-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(policies): Support wildcard and dynamic_tag (#15)
- Loading branch information
Showing
17 changed files
with
287 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,3 @@ description: |- | |
### Read-Only | ||
|
||
- `id` (String) The id and api key of the cluster integration | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ variable "komodor_api_key" { | |
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
||
## Schema | ||
|
||
### Optional | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,3 @@ description: |- | |
- `created_at` (String) | ||
- `id` (String) The ID of this resource. | ||
- `updated_at` (String) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,3 @@ description: |- | |
### Read-Only | ||
|
||
- `id` (String) The id and api key of the cluster integration | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,3 @@ description: |- | |
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,3 @@ description: |- | |
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,3 @@ description: |- | |
- `id` (String) The ID of this resource. | ||
- `is_default` (Boolean) | ||
- `updated_at` (String) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This example shows how to create a policy with dynamic tags. | ||
# Dynamic tags feature is not available by default. | ||
# When the feature is disabled, applying this policy will fail with error: `400 Bad Request` | ||
|
||
resource "komodor_policy" "komo-example-dynamic-tags-policy" { | ||
name = "komo-example-dynamic-tags-policy" | ||
type = "dynamic_tag" | ||
tags = { | ||
"team": "super-heroes" | ||
} | ||
statements = <<EOF | ||
[{ | ||
"actions": [ | ||
"view:all" | ||
], | ||
"resources": [] | ||
}] | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This example shows how to create a policy with a wildcard namespace pattern. | ||
# wildcard policy type is not available by default. | ||
# When the feature is disabled, applying this policy will fail with error: `400 Bad Request` | ||
|
||
resource "komodor_policy" "komo-example-wildcard-policy" { | ||
name = "komo-example-wildcard-policy" | ||
type = "wildcard" | ||
statements = <<EOF | ||
[{ | ||
"actions": [ | ||
"view:all" | ||
], | ||
"resources": [{ | ||
"cluster": "komo-example-cluster", | ||
"namespacePattern": "prod-*" | ||
}] | ||
}] | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,83 @@ | ||
module github.com/komodorio/terraform-provider-komodor | ||
|
||
go 1.19 | ||
go 1.23.3 | ||
|
||
require ( | ||
github.com/hashicorp/terraform-plugin-docs v0.13.0 | ||
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 | ||
github.com/hashicorp/terraform-plugin-docs v0.20.0 | ||
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 | ||
) | ||
|
||
require ( | ||
github.com/BurntSushi/toml v1.2.1 // indirect | ||
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect | ||
github.com/Masterminds/goutils v1.1.1 // indirect | ||
github.com/Masterminds/semver/v3 v3.1.1 // indirect | ||
github.com/Masterminds/sprig/v3 v3.2.2 // indirect | ||
github.com/Masterminds/semver/v3 v3.2.0 // indirect | ||
github.com/Masterminds/sprig/v3 v3.2.3 // indirect | ||
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect | ||
github.com/agext/levenshtein v1.2.2 // indirect | ||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect | ||
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect | ||
github.com/armon/go-radix v1.0.0 // indirect | ||
github.com/bgentry/speakeasy v0.1.0 // indirect | ||
github.com/fatih/color v1.13.0 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/go-cmp v0.5.9 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect | ||
github.com/cloudflare/circl v1.3.7 // indirect | ||
github.com/fatih/color v1.16.0 // indirect | ||
github.com/golang/protobuf v1.5.4 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/hashicorp/cli v1.1.6 // indirect | ||
github.com/hashicorp/errwrap v1.1.0 // indirect | ||
github.com/hashicorp/go-checkpoint v0.5.0 // indirect | ||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect | ||
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect | ||
github.com/hashicorp/go-hclog v1.2.1 // indirect | ||
github.com/hashicorp/go-hclog v1.6.3 // indirect | ||
github.com/hashicorp/go-multierror v1.1.1 // indirect | ||
github.com/hashicorp/go-plugin v1.4.6 // indirect | ||
github.com/hashicorp/go-plugin v1.6.2 // indirect | ||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect | ||
github.com/hashicorp/go-uuid v1.0.3 // indirect | ||
github.com/hashicorp/go-version v1.6.0 // indirect | ||
github.com/hashicorp/hc-install v0.4.0 // indirect | ||
github.com/hashicorp/hcl/v2 v2.15.0 // indirect | ||
github.com/hashicorp/go-version v1.7.0 // indirect | ||
github.com/hashicorp/hc-install v0.9.0 // indirect | ||
github.com/hashicorp/hcl/v2 v2.22.0 // indirect | ||
github.com/hashicorp/logutils v1.0.0 // indirect | ||
github.com/hashicorp/terraform-exec v0.17.3 // indirect | ||
github.com/hashicorp/terraform-json v0.14.0 // indirect | ||
github.com/hashicorp/terraform-plugin-go v0.14.1 // indirect | ||
github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect | ||
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect | ||
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect | ||
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect | ||
github.com/huandu/xstrings v1.3.2 // indirect | ||
github.com/imdario/mergo v0.3.13 // indirect | ||
github.com/hashicorp/terraform-exec v0.21.0 // indirect | ||
github.com/hashicorp/terraform-json v0.23.0 // indirect | ||
github.com/hashicorp/terraform-plugin-go v0.25.0 // indirect | ||
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect | ||
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect | ||
github.com/hashicorp/terraform-svchost v0.1.1 // indirect | ||
github.com/hashicorp/yamux v0.1.1 // indirect | ||
github.com/huandu/xstrings v1.3.3 // indirect | ||
github.com/imdario/mergo v0.3.15 // indirect | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.17 // indirect | ||
github.com/mitchellh/cli v1.1.4 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/mattn/go-runewidth v0.0.9 // indirect | ||
github.com/mitchellh/copystructure v1.2.0 // indirect | ||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect | ||
github.com/mitchellh/go-wordwrap v1.0.0 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||
github.com/oklog/run v1.0.0 // indirect | ||
github.com/posener/complete v1.2.3 // indirect | ||
github.com/russross/blackfriday v1.6.0 // indirect | ||
github.com/shopspring/decimal v1.3.1 // indirect | ||
github.com/spf13/cast v1.5.0 // indirect | ||
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect | ||
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect | ||
github.com/vmihailenco/tagparser v0.1.1 // indirect | ||
github.com/zclconf/go-cty v1.12.1 // indirect | ||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect | ||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect | ||
golang.org/x/sys v0.3.0 // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
google.golang.org/appengine v1.6.6 // indirect | ||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect | ||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect | ||
github.com/yuin/goldmark v1.7.7 // indirect | ||
github.com/yuin/goldmark-meta v1.1.0 // indirect | ||
github.com/zclconf/go-cty v1.15.0 // indirect | ||
go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect | ||
golang.org/x/crypto v0.28.0 // indirect | ||
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect | ||
golang.org/x/mod v0.21.0 // indirect | ||
golang.org/x/net v0.28.0 // indirect | ||
golang.org/x/sync v0.8.0 // indirect | ||
golang.org/x/sys v0.26.0 // indirect | ||
golang.org/x/text v0.19.0 // indirect | ||
golang.org/x/tools v0.22.0 // indirect | ||
google.golang.org/appengine v1.6.8 // indirect | ||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect | ||
google.golang.org/grpc v1.50.1 // indirect | ||
google.golang.org/protobuf v1.28.1 // indirect | ||
google.golang.org/grpc v1.67.1 // indirect | ||
google.golang.org/protobuf v1.35.1 // indirect | ||
gopkg.in/yaml.v2 v2.3.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.