diff --git a/docs/data-sources/account.md b/docs/data-sources/account.md index 488c866..b1636b1 100644 --- a/docs/data-sources/account.md +++ b/docs/data-sources/account.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_account" "current" { metadata { - name = "test2" + name = "test2" namespace = "default" } } diff --git a/docs/data-sources/accounts.md b/docs/data-sources/accounts.md index 22d21dc..c54f284 100644 --- a/docs/data-sources/accounts.md +++ b/docs/data-sources/accounts.md @@ -41,7 +41,7 @@ data "bluechip_accounts" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/cidr.md b/docs/data-sources/cidr.md index 72d01c4..86ce9ac 100644 --- a/docs/data-sources/cidr.md +++ b/docs/data-sources/cidr.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_cidr" "current" { metadata { - name = "my-test" + name = "my-test" namespace = "default" } } diff --git a/docs/data-sources/cidrs.md b/docs/data-sources/cidrs.md index 21a70e2..c121404 100644 --- a/docs/data-sources/cidrs.md +++ b/docs/data-sources/cidrs.md @@ -17,7 +17,7 @@ resource "bluechip_cidr" "c1" { metadata { name = "cidr1" namespace = "default" - labels = { + labels = { "foo" = "bar" } annotations = { @@ -34,11 +34,11 @@ resource "bluechip_cidr" "c2" { metadata { name = "cidr2" namespace = "default" - labels = { + labels = { "foo" = "bar" } annotations = { - "office" = "true" + "office" = "true" "bluechip.example.com/location" = "tokyo" } } @@ -90,7 +90,7 @@ data "bluechip_cidrs" "seoul" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index f8c5252..7b7bcf7 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_cluster" "current" { metadata { - name = "test" + name = "test" namespace = "default" } } diff --git a/docs/data-sources/clusterrolebindings.md b/docs/data-sources/clusterrolebindings.md index cc0d39b..f5d5bd7 100644 --- a/docs/data-sources/clusterrolebindings.md +++ b/docs/data-sources/clusterrolebindings.md @@ -36,7 +36,7 @@ data "bluechip_clusterrolebindings" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/clusters.md b/docs/data-sources/clusters.md index 5458efc..029d80f 100644 --- a/docs/data-sources/clusters.md +++ b/docs/data-sources/clusters.md @@ -41,7 +41,7 @@ data "bluechip_clusters" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/image.md b/docs/data-sources/image.md index de38d17..e132209 100644 --- a/docs/data-sources/image.md +++ b/docs/data-sources/image.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_image" "current" { metadata { - name = "my-test" + name = "my-test" namespace = "default" } } diff --git a/docs/data-sources/images.md b/docs/data-sources/images.md index 1795615..af5a4c1 100644 --- a/docs/data-sources/images.md +++ b/docs/data-sources/images.md @@ -16,8 +16,8 @@ description: |- data "bluechip_images" "current" { filter { operator = "equals" - field = "spec.commitHash" - value = "6874ece755439b5b3473b5b910fb4938751d6689" + field = "spec.commitHash" + value = "6874ece755439b5b3473b5b910fb4938751d6689" } namespace = "pubg" } @@ -46,7 +46,7 @@ data "bluechip_images" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/namespaces.md b/docs/data-sources/namespaces.md index dad259a..690d156 100644 --- a/docs/data-sources/namespaces.md +++ b/docs/data-sources/namespaces.md @@ -36,7 +36,7 @@ data "bluechip_namespaces" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/oidcauth.md b/docs/data-sources/oidcauth.md index 3fbe09c..1a7a684 100644 --- a/docs/data-sources/oidcauth.md +++ b/docs/data-sources/oidcauth.md @@ -80,4 +80,5 @@ Read-Only: Read-Only: - `from` (String) +- `from_path_resolver` (String) - `to` (String) diff --git a/docs/data-sources/oidcauths.md b/docs/data-sources/oidcauths.md index 33dac74..cb18752 100644 --- a/docs/data-sources/oidcauths.md +++ b/docs/data-sources/oidcauths.md @@ -36,7 +36,7 @@ data "bluechip_oidcauths" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. @@ -88,4 +88,5 @@ Read-Only: Read-Only: - `from` (String) +- `from_path_resolver` (String) - `to` (String) diff --git a/docs/data-sources/rolebinding.md b/docs/data-sources/rolebinding.md index 2e149a3..694b828 100644 --- a/docs/data-sources/rolebinding.md +++ b/docs/data-sources/rolebinding.md @@ -15,7 +15,7 @@ description: |- ```terraform data "bluechip_rolebinding" "current" { metadata { - name = "my-test" + name = "my-test" namespace = "default" } } diff --git a/docs/data-sources/rolebindings.md b/docs/data-sources/rolebindings.md index c86a4fd..9efa9a3 100644 --- a/docs/data-sources/rolebindings.md +++ b/docs/data-sources/rolebindings.md @@ -17,7 +17,7 @@ data "bluechip_rolebindings" "current" { filter { operator = "equals" key = "metadata.name" - value = "" + value = "" } namespace = "pubg" } @@ -46,7 +46,7 @@ data "bluechip_rolebindings" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/users.md b/docs/data-sources/users.md index bab0152..cece8eb 100644 --- a/docs/data-sources/users.md +++ b/docs/data-sources/users.md @@ -36,7 +36,7 @@ data "bluechip_users" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/data-sources/vendors.md b/docs/data-sources/vendors.md index 3485b34..a4d747c 100644 --- a/docs/data-sources/vendors.md +++ b/docs/data-sources/vendors.md @@ -36,7 +36,7 @@ data "bluechip_vendors" "current" { Required: - `field` (String) Field to use for the query term. -- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase']. +- `operator` (String) Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix']. - `value` (String) Value to use for the query term. diff --git a/docs/resources/account.md b/docs/resources/account.md index 2535ccc..0a3faae 100644 --- a/docs/resources/account.md +++ b/docs/resources/account.md @@ -15,16 +15,16 @@ description: |- ```terraform resource "bluechip_account" "current" { metadata { - name = "test2" + name = "test2" namespace = "default" } spec { - account_id = "12398213" + account_id = "12398213" display_name = "test" - description = "test" - alias = "test" - vendor = "AWS" - regions = ["test"] + description = "test" + alias = "test" + vendor = "AWS" + regions = ["test"] } } ``` diff --git a/docs/resources/cidr.md b/docs/resources/cidr.md index 8117dea..5342451 100644 --- a/docs/resources/cidr.md +++ b/docs/resources/cidr.md @@ -15,7 +15,7 @@ description: |- ```terraform resource "bluechip_cidr" "current" { metadata { - name = "my-test" + name = "my-test" namespace = "default" } spec { diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index d8c9437..b123cd7 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -15,29 +15,29 @@ description: |- ```terraform resource "bluechip_cluster" "current" { metadata { - name = "test" + name = "test" namespace = "default" } spec { - project = "pubg" - environment = "dev" + project = "pubg" + environment = "dev" organization_unit = "devops" - platform = "pc" + platform = "pc" pubg { infra = "common" - site = "devops" + site = "devops" } vendor { - name = "AWS" + name = "AWS" account_id = "12398213" - engine = "EKS" - region = "ap-northeast-2" + engine = "EKS" + region = "ap-northeast-2" } kubernetes { - endpoint = "https://api.devops.dev.pubg.com" - ca_cert = "-----BEGIN CERTIFI" + endpoint = "https://api.devops.dev.pubg.com" + ca_cert = "-----BEGIN CERTIFI" sa_issuer = "https://login.microsoftonline.com/1a27bdbf-e6cc-4e33-85d2-e1c81bad930a/v2.0" - version = "1.28" + version = "1.28" } } } diff --git a/docs/resources/image.md b/docs/resources/image.md index 0d7a023..ca838d2 100644 --- a/docs/resources/image.md +++ b/docs/resources/image.md @@ -15,16 +15,16 @@ description: |- ```terraform resource "bluechip_image" "current" { metadata { - name = "my-test" + name = "my-test" namespace = "default" } spec { - app = "my-test" - timestamp = 1398329823 + app = "my-test" + timestamp = 1398329823 commit_hash = "1234567890" - repository = "test" - tag = "test" - branch = "test" + repository = "test" + tag = "test" + branch = "test" } } ``` diff --git a/docs/resources/oidcauth.md b/docs/resources/oidcauth.md index ea2a189..a07ee4f 100644 --- a/docs/resources/oidcauth.md +++ b/docs/resources/oidcauth.md @@ -18,13 +18,33 @@ resource "bluechip_oidcauth" "current" { name = "my-test" } spec { - username_claim= "sub" - username_prefix= "string" - issuer = "https://accounts.google.com/" - client_id = "string" + username_claim = "sub" + username_prefix = "string" + issuer = "https://accounts.google.com/" + client_id = "string" required_claims = ["string"] - groups_claim = "string" - groups_prefix = "string" + groups_claim = "string" + groups_prefix = "string" + attribute_mapping { + from = "namespace_path" + from_path_resolver = "bare" + to = "namespace_path" + } + attribute_mapping { + from = "project_path" + from_path_resolver = "bare" + to = "project_path" + } + attribute_mapping { + from = "pipeline_source" + from_path_resolver = "bare" + to = "pipeline_source" + } + attribute_mapping { + from = "ref_path" + from_path_resolver = "bare" + to = "ref_path" + } } } ``` @@ -88,6 +108,10 @@ Required: - `from` (String) - `to` (String) +Optional: + +- `from_path_resolver` (String) + diff --git a/docs/resources/rolebinding.md b/docs/resources/rolebinding.md index 986f166..e21b09a 100644 --- a/docs/resources/rolebinding.md +++ b/docs/resources/rolebinding.md @@ -15,7 +15,7 @@ description: |- ```terraform resource "bluechip_rolebinding" "current" { metadata { - name = "my-test" + name = "my-test" namespace = "default" } spec { diff --git a/docs/resources/user.md b/docs/resources/user.md index fa411c3..8005ee8 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -19,7 +19,7 @@ resource "bluechip_user" "current" { } spec { password = "tetete" - groups = ["asdf"] + groups = ["asdf"] } } ``` diff --git a/docs/resources/vendor.md b/docs/resources/vendor.md index 9d478c7..f1aa583 100644 --- a/docs/resources/vendor.md +++ b/docs/resources/vendor.md @@ -19,9 +19,9 @@ resource "bluechip_vendor" "current" { } spec { display_name = "asdf" - code_name = "AWS" - short_name = "aws" - regions = ["asdf"] + code_name = "AWS" + short_name = "aws" + regions = ["asdf"] } } ``` diff --git a/pkg/bluechip_client/bluechip_models/lists.go b/pkg/bluechip_client/bluechip_models/lists.go index af0dd6f..46d00cb 100644 --- a/pkg/bluechip_client/bluechip_models/lists.go +++ b/pkg/bluechip_client/bluechip_models/lists.go @@ -29,6 +29,7 @@ const OperatorNotEquals = "notEquals" const OperatorWildcard = "wildcard" const OperatorRegex = "regex" const OperatorMatchPhrase = "matchPhrase" +const OperatorPrefix = "prefix" type QueryTerm struct { Operator string `json:"operator"` diff --git a/pkg/framework/fwtype/filter.go b/pkg/framework/fwtype/filter.go index 0ee0ff1..864e77d 100644 --- a/pkg/framework/fwtype/filter.go +++ b/pkg/framework/fwtype/filter.go @@ -30,7 +30,7 @@ func (FilterType) Schema() *schema.Schema { }, "operator": { Type: schema.TypeString, - Description: "Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase'].", + Description: "Operator to use for the query term. One of ['equals', 'notEquals', 'fuzzy', 'wildcard', 'regex', 'matchPhrase', 'prefix'].", Required: true, ValidateFunc: validation.StringInSlice([]string{ bluechip_models.OperatorEquals, @@ -39,6 +39,7 @@ func (FilterType) Schema() *schema.Schema { bluechip_models.OperatorWildcard, bluechip_models.OperatorRegex, bluechip_models.OperatorMatchPhrase, + bluechip_models.OperatorPrefix, }, false), }, "value": {