From 74704edd9a1243d414e2823f25b2375ef454a1ff Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 13:47:59 -0500 Subject: [PATCH 01/19] Run 'go get github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go@15be89965483c55f182ad4236ce4d725f6c8f764'. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6bcaf2416e..26db1adfa4 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/smithy-go v1.10.0 github.com/evanphx/json-patch v0.5.2 // indirect github.com/google/go-cmp v0.5.7 - github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0 + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483 github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 github.com/hashicorp/go-hclog v1.0.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index bb159f0d31..e4d04ffb2f 100644 --- a/go.sum +++ b/go.sum @@ -201,6 +201,8 @@ github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0 h1:n/ICe8cTnmPQfvn2bupsrubnwIEXcHLrE18RUAdVcgY= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483 h1:d1aOm82tPbx4gJezcutU6otdtR1/gL1E0kDQb7Zn80M= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 h1:fw9FTvekjXAQrHwkYwEBnesZS/lb/XZsV/5hqA1lxqA= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3/go.mod h1:mt5V7NshmBoY+q96yicADdPd/Eu2AyNXVdzlO4LqFM8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= From 1e0691a1bb53d6b0fb3cda5b8d024c029086d411 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 13:50:20 -0500 Subject: [PATCH 02/19] 'cfschema.Sanitize' return an error. --- internal/provider/generators/schema/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/provider/generators/schema/main.go b/internal/provider/generators/schema/main.go index c500bc00f7..825b803b7b 100644 --- a/internal/provider/generators/schema/main.go +++ b/internal/provider/generators/schema/main.go @@ -331,7 +331,11 @@ func (d *Downloader) ResourceSchema(schema ResourceSchema) (string, string, erro return "", "", fmt.Errorf("describing CloudFormation type: %w", err) } - schema := cfschema.Sanitize(aws.ToString(output.Schema)) + schema, err := cfschema.Sanitize(aws.ToString(output.Schema)) + + if err != nil { + return "", "", fmt.Errorf("sanitizing schema: %w", err) + } err = ioutil.WriteFile(dst, []byte(schema), 0644) //nolint:gomnd From 171b797f751d2e8063a785e8fcccad8193e79ebb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 15:18:39 -0500 Subject: [PATCH 03/19] Run 'go get github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go@42afe5eba878fb0a8a3cc7e7aba3b729b3978e6c'. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 26db1adfa4..63be1bca59 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/smithy-go v1.10.0 github.com/evanphx/json-patch v0.5.2 // indirect github.com/google/go-cmp v0.5.7 - github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483 + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878 github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 github.com/hashicorp/go-hclog v1.0.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index e4d04ffb2f..57cb8a252d 100644 --- a/go.sum +++ b/go.sum @@ -203,6 +203,8 @@ github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0 h1:n/ICe8 github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483 h1:d1aOm82tPbx4gJezcutU6otdtR1/gL1E0kDQb7Zn80M= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878 h1:87EM8r5q4/zJI6jajr+afNIp/xhwqclFbST4RxlbPlQ= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878/go.mod h1:Vh1zhjMM0j3Dr+dFkR5BC+ZTvvruJrSY1PMRkMkMNYg= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 h1:fw9FTvekjXAQrHwkYwEBnesZS/lb/XZsV/5hqA1lxqA= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3/go.mod h1:mt5V7NshmBoY+q96yicADdPd/Eu2AyNXVdzlO4LqFM8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= From 3636350572fed1a5b30551d307141722c2f907a9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 15:19:38 -0500 Subject: [PATCH 04/19] Run 'go mod edit -replace github.com/xeipuuv/gojsonschema=github.com/ewbankkit/gojsonschema@f-pattern-validation-error && go mod tidy'. --- go.mod | 2 ++ go.sum | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 63be1bca59..6592b51d7c 100644 --- a/go.mod +++ b/go.mod @@ -24,3 +24,5 @@ require ( github.com/mattn/go-colorable v0.1.8 // indirect github.com/mitchellh/cli v1.1.2 ) + +replace github.com/xeipuuv/gojsonschema => github.com/ewbankkit/gojsonschema v1.2.1-0.20220218201251-4d7168031961 diff --git a/go.sum b/go.sum index 57cb8a252d..f491818ef6 100644 --- a/go.sum +++ b/go.sum @@ -128,6 +128,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= +github.com/ewbankkit/gojsonschema v1.2.1-0.20220218201251-4d7168031961 h1:8ZInweCgYHIJP9JEAwI3cULI5cBikJmysfeUGFhaNB0= +github.com/ewbankkit/gojsonschema v1.2.1-0.20220218201251-4d7168031961/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -199,10 +201,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0 h1:n/ICe8cTnmPQfvn2bupsrubnwIEXcHLrE18RUAdVcgY= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483 h1:d1aOm82tPbx4gJezcutU6otdtR1/gL1E0kDQb7Zn80M= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878 h1:87EM8r5q4/zJI6jajr+afNIp/xhwqclFbST4RxlbPlQ= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878/go.mod h1:Vh1zhjMM0j3Dr+dFkR5BC+ZTvvruJrSY1PMRkMkMNYg= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 h1:fw9FTvekjXAQrHwkYwEBnesZS/lb/XZsV/5hqA1lxqA= @@ -383,8 +381,6 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From a4e1c4ca03e66135e83ea63ccfe0f45f6c3eafa0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 15:59:46 -0500 Subject: [PATCH 05/19] Revert "Run 'go mod edit -replace github.com/xeipuuv/gojsonschema=github.com/ewbankkit/gojsonschema@f-pattern-validation-error && go mod tidy'." This reverts commit 3636350572fed1a5b30551d307141722c2f907a9. --- go.mod | 2 -- go.sum | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 6592b51d7c..63be1bca59 100644 --- a/go.mod +++ b/go.mod @@ -24,5 +24,3 @@ require ( github.com/mattn/go-colorable v0.1.8 // indirect github.com/mitchellh/cli v1.1.2 ) - -replace github.com/xeipuuv/gojsonschema => github.com/ewbankkit/gojsonschema v1.2.1-0.20220218201251-4d7168031961 diff --git a/go.sum b/go.sum index f491818ef6..57cb8a252d 100644 --- a/go.sum +++ b/go.sum @@ -128,8 +128,6 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/ewbankkit/gojsonschema v1.2.1-0.20220218201251-4d7168031961 h1:8ZInweCgYHIJP9JEAwI3cULI5cBikJmysfeUGFhaNB0= -github.com/ewbankkit/gojsonschema v1.2.1-0.20220218201251-4d7168031961/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -201,6 +199,10 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0 h1:n/ICe8cTnmPQfvn2bupsrubnwIEXcHLrE18RUAdVcgY= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483 h1:d1aOm82tPbx4gJezcutU6otdtR1/gL1E0kDQb7Zn80M= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878 h1:87EM8r5q4/zJI6jajr+afNIp/xhwqclFbST4RxlbPlQ= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878/go.mod h1:Vh1zhjMM0j3Dr+dFkR5BC+ZTvvruJrSY1PMRkMkMNYg= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 h1:fw9FTvekjXAQrHwkYwEBnesZS/lb/XZsV/5hqA1lxqA= @@ -381,6 +383,8 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 06f52299958d08f42c064df7b87ff8e4856dd7eb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 16:01:06 -0500 Subject: [PATCH 06/19] Run 'go get github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go@286a497ed6503bf79e2b860bccdcca426ee6cfd7'. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 63be1bca59..8255a5c0dc 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/smithy-go v1.10.0 github.com/evanphx/json-patch v0.5.2 // indirect github.com/google/go-cmp v0.5.7 - github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878 + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218205657-286a497ed650 github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 github.com/hashicorp/go-hclog v1.0.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index 57cb8a252d..e3d3f2e129 100644 --- a/go.sum +++ b/go.sum @@ -205,6 +205,8 @@ github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.2022021 github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218184328-15be89965483/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878 h1:87EM8r5q4/zJI6jajr+afNIp/xhwqclFbST4RxlbPlQ= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878/go.mod h1:Vh1zhjMM0j3Dr+dFkR5BC+ZTvvruJrSY1PMRkMkMNYg= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218205657-286a497ed650 h1:hdNk4xkrnQjpU4zR8p1zdsfycays6yvYruUs+2+WezI= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218205657-286a497ed650/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 h1:fw9FTvekjXAQrHwkYwEBnesZS/lb/XZsV/5hqA1lxqA= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3/go.mod h1:mt5V7NshmBoY+q96yicADdPd/Eu2AyNXVdzlO4LqFM8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= From 76e9f763172bfd1bb6b803ee43294f1eb83d9d3e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 16:10:43 -0500 Subject: [PATCH 07/19] Emit call to 'validate.StringMatch' for property pattern. --- internal/provider/generators/shared/codegen/emitter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/provider/generators/shared/codegen/emitter.go b/internal/provider/generators/shared/codegen/emitter.go index ac3fe0f110..b91f908d1f 100644 --- a/internal/provider/generators/shared/codegen/emitter.go +++ b/internal/provider/generators/shared/codegen/emitter.go @@ -980,6 +980,10 @@ func stringValidators(path []string, property *cfschema.Property) ([]string, err validators = append(validators, fmt.Sprintf("validate.StringLenBetween(%d,%d)", *property.MinLength, *property.MaxLength)) } + if property.Pattern != nil { + validators = append(validators, fmt.Sprintf("validate.StringMatch(`%s`, \"\")", *property.Pattern)) + } + if property.Format != nil { switch format := *property.Format; format { case "date-time": From b3ef3c22a44c60fb3b3509add237a2f0f0a87655 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 16:41:28 -0500 Subject: [PATCH 08/19] Add 'validate.StringMatch'. --- internal/validate/string.go | 47 +++++++++++++++++++++++ internal/validate/string_test.go | 65 ++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) diff --git a/internal/validate/string.go b/internal/validate/string.go index f49e9b9597..5268e400c2 100644 --- a/internal/validate/string.go +++ b/internal/validate/string.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "regexp" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -196,6 +197,52 @@ func StringInSlice(valid []string) tfsdk.AttributeValidator { } } +// stringMatchValidator validates that a string Attribute's value matches the specified regular expression. +type stringMatchValidator struct { + tfsdk.AttributeValidator + + re *regexp.Regexp + message string +} + +// Description describes the validation in plain text formatting. +func (validator stringMatchValidator) Description(_ context.Context) string { + return fmt.Sprintf("value must match regular expression '%s'", validator.re) +} + +// MarkdownDescription describes the validation in Markdown formatting. +func (validator stringMatchValidator) MarkdownDescription(ctx context.Context) string { + return validator.Description(ctx) +} + +// Validate performs the validation. +func (validator stringMatchValidator) Validate(ctx context.Context, request tfsdk.ValidateAttributeRequest, response *tfsdk.ValidateAttributeResponse) { + s, ok := validateString(request, response) + if !ok { + return + } + + if ok := validator.re.MatchString(s); ok { + return + } + + if v := validator.message; v != "" { + response.Diagnostics.Append(ccdiag.NewInvalidValueAttributeError(request.AttributePath, v)) + } + + response.Diagnostics.Append(ccdiag.NewInvalidValueAttributeError( + request.AttributePath, + fmt.Sprintf("expected value of %s to match regular expression '%s'", s, validator.re))) +} + +// StringMatch returns a new string match validator. +func StringMatch(re *regexp.Regexp, message string) tfsdk.AttributeValidator { + return stringMatchValidator{ + re: re, + message: message, + } +} + // stringIsJsonObjectValidator validates that a string Attribute's value is a valid JSON object. type stringIsJsonObjectValidator struct { tfsdk.AttributeValidator diff --git a/internal/validate/string_test.go b/internal/validate/string_test.go index 12aca6e5d3..35a4fc4c79 100644 --- a/internal/validate/string_test.go +++ b/internal/validate/string_test.go @@ -2,6 +2,7 @@ package validate import ( "context" + "regexp" "testing" "github.com/hashicorp/terraform-plugin-framework/attr" @@ -285,6 +286,70 @@ func TestStringInSliceValidator(t *testing.T) { } } +func TestStringMatchValidator(t *testing.T) { + t.Parallel() + + type testCase struct { + val tftypes.Value + f func(context.Context, tftypes.Value) (attr.Value, error) + re *regexp.Regexp + expectError bool + } + tests := map[string]testCase{ + "not a string": { + val: tftypes.NewValue(tftypes.Bool, true), + f: types.BoolType.ValueFromTerraform, + expectError: true, + }, + "unknown string": { + val: tftypes.NewValue(tftypes.String, tftypes.UnknownValue), + f: types.StringType.ValueFromTerraform, + }, + "null string": { + val: tftypes.NewValue(tftypes.String, nil), + f: types.StringType.ValueFromTerraform, + }, + "valid string": { + val: tftypes.NewValue(tftypes.String, "ok"), + f: types.StringType.ValueFromTerraform, + re: regexp.MustCompile(`^o[j-l]?$`), + }, + "invalid string": { + val: tftypes.NewValue(tftypes.String, "not ok"), + f: types.StringType.ValueFromTerraform, + re: regexp.MustCompile(`\d+`), + expectError: true, + }, + } + + for name, test := range tests { + name, test := name, test + t.Run(name, func(t *testing.T) { + ctx := context.TODO() + val, err := test.f(ctx, test.val) + + if err != nil { + t.Fatalf("got unexpected error: %s", err) + } + + request := tfsdk.ValidateAttributeRequest{ + AttributePath: tftypes.NewAttributePath().WithAttributeName("test"), + AttributeConfig: val, + } + response := tfsdk.ValidateAttributeResponse{} + StringMatch(test.re, "").Validate(ctx, request, &response) + + if !response.Diagnostics.HasError() && test.expectError { + t.Fatal("expected error, got no error") + } + + if response.Diagnostics.HasError() && !test.expectError { + t.Fatalf("got unexpected error: %s", tfresource.DiagsError(response.Diagnostics)) + } + }) + } +} + func TestStringIsJsonValidator(t *testing.T) { t.Parallel() From 865b52246fee088bebf00c7744498db714989784 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 16:56:56 -0500 Subject: [PATCH 09/19] Import regexp in generated code if necessary. --- internal/provider/generators/resource/main.go | 1 + .../generators/shared/codegen/emitter.go | 53 ++++++++++++------- .../provider/generators/shared/generator.go | 4 ++ 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/internal/provider/generators/resource/main.go b/internal/provider/generators/resource/main.go index 6ca3ca038d..2d81e09d8e 100644 --- a/internal/provider/generators/resource/main.go +++ b/internal/provider/generators/resource/main.go @@ -114,6 +114,7 @@ package {{ .PackageName }} import ( "context" + {{if .ImportRegexp }}"regexp"{{- end}} {{if .ImportFrameworkAttr }}"github.com/hashicorp/terraform-plugin-framework/attr"{{- end}} "github.com/hashicorp/terraform-plugin-framework/tfsdk" diff --git a/internal/provider/generators/shared/codegen/emitter.go b/internal/provider/generators/shared/codegen/emitter.go index b91f908d1f..3b50e62728 100644 --- a/internal/provider/generators/shared/codegen/emitter.go +++ b/internal/provider/generators/shared/codegen/emitter.go @@ -19,6 +19,7 @@ const ( HasUpdatableProperty Features = 1 << iota // At least one property can be updated. HasRequiredRootProperty // At least one root property is required. UsesFrameworkAttr // Uses a type from the terraform-plugin-framework/attr package. + UsesRegexp // Uses a type from the Go standard regexp package. UsesValidation // Uses a type from the internal/validate package. HasIDRootProperty // Has a root property named "id" ) @@ -133,27 +134,30 @@ func (e Emitter) emitAttribute(attributeNameMap map[string]string, path []string case cfschema.PropertyTypeInteger: e.printf("Type:types.Int64Type,\n") - if v, err := integerValidators(path, property); err != nil { + if f, v, err := integerValidators(path, property); err != nil { return 0, err } else if len(v) > 0 { + features |= f validators = append(validators, v...) } case cfschema.PropertyTypeNumber: e.printf("Type:types.Float64Type,\n") - if v, err := numberValidators(path, property); err != nil { + if f, v, err := numberValidators(path, property); err != nil { return 0, err } else if len(v) > 0 { + features |= f validators = append(validators, v...) } case cfschema.PropertyTypeString: e.printf("Type:types.StringType,\n") - if v, err := stringValidators(path, property); err != nil { + if f, v, err := stringValidators(path, property); err != nil { return 0, err } else if len(v) > 0 { + features |= f validators = append(validators, v...) } @@ -243,9 +247,10 @@ func (e Emitter) emitAttribute(attributeNameMap map[string]string, path []string } if validatorsGenerator != nil { - if v, err := validatorsGenerator(path, property.Items); err != nil { + if f, v, err := validatorsGenerator(path, property.Items); err != nil { return 0, err } else if len(v) > 0 { + features |= f for _, v := range v { validators = append(validators, fmt.Sprintf("validate.ArrayForEach(%s)", v)) } @@ -346,9 +351,10 @@ func (e Emitter) emitAttribute(attributeNameMap map[string]string, path []string } if validatorsGenerator != nil { - if v, err := validatorsGenerator(path, property.Items); err != nil { + if f, v, err := validatorsGenerator(path, property.Items); err != nil { return 0, err } else if len(v) > 0 { + features |= f for _, v := range v { validators = append(validators, fmt.Sprintf("validate.ArrayForEach(%s)", v)) } @@ -897,12 +903,14 @@ func defaultValueAttributePlanModifier(path []string, property *cfschema.Propert } } -type primitiveValidatorsGenerator func([]string, *cfschema.Property) ([]string, error) +type primitiveValidatorsGenerator func([]string, *cfschema.Property) (Features, []string, error) // integerValidators returns any validators for the specified integer Property. -func integerValidators(path []string, property *cfschema.Property) ([]string, error) { +func integerValidators(path []string, property *cfschema.Property) (Features, []string, error) { + var features Features + if propertyType := property.Type.String(); propertyType != cfschema.PropertyTypeInteger { - return nil, fmt.Errorf("invalid property type: %s", propertyType) + return features, nil, fmt.Errorf("invalid property type: %s", propertyType) } var validators []string @@ -917,7 +925,7 @@ func integerValidators(path []string, property *cfschema.Property) ([]string, er if property.Format != nil { if format := *property.Format; format != "int64" { - return nil, fmt.Errorf("%s has unsupported format: %s", strings.Join(path, "/"), format) + return features, nil, fmt.Errorf("%s has unsupported format: %s", strings.Join(path, "/"), format) } } @@ -932,13 +940,15 @@ func integerValidators(path []string, property *cfschema.Property) ([]string, er validators = append(validators, w.String()) } - return validators, nil + return features, validators, nil } // numberValidators returns any validators for the specified number Property. -func numberValidators(path []string, property *cfschema.Property) ([]string, error) { +func numberValidators(path []string, property *cfschema.Property) (Features, []string, error) { + var features Features + if propertyType := property.Type.String(); propertyType != cfschema.PropertyTypeNumber { - return nil, fmt.Errorf("invalid property type: %s", propertyType) + return features, nil, fmt.Errorf("invalid property type: %s", propertyType) } var validators []string @@ -953,21 +963,23 @@ func numberValidators(path []string, property *cfschema.Property) ([]string, err if property.Format != nil { if format := *property.Format; format != "double" { - return nil, fmt.Errorf("%s has unsupported format: %s", strings.Join(path, "/"), format) + return features, nil, fmt.Errorf("%s has unsupported format: %s", strings.Join(path, "/"), format) } } if len(property.Enum) > 0 { - return nil, fmt.Errorf("%s has enumerated values", strings.Join(path, "/")) + return features, nil, fmt.Errorf("%s has enumerated values", strings.Join(path, "/")) } - return validators, nil + return features, validators, nil } // stringValidators returns any validators for the specified string Property. -func stringValidators(path []string, property *cfschema.Property) ([]string, error) { +func stringValidators(path []string, property *cfschema.Property) (Features, []string, error) { + var features Features + if propertyType := property.Type.String(); propertyType != cfschema.PropertyTypeString { - return nil, fmt.Errorf("invalid property type: %s", propertyType) + return features, nil, fmt.Errorf("invalid property type: %s", propertyType) } var validators []string @@ -980,8 +992,9 @@ func stringValidators(path []string, property *cfschema.Property) ([]string, err validators = append(validators, fmt.Sprintf("validate.StringLenBetween(%d,%d)", *property.MinLength, *property.MaxLength)) } - if property.Pattern != nil { - validators = append(validators, fmt.Sprintf("validate.StringMatch(`%s`, \"\")", *property.Pattern)) + if property.Pattern != nil && *property.Pattern != "" { + features |= UsesRegexp + validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(`%s`), \"\")", *property.Pattern)) } if property.Format != nil { @@ -1009,7 +1022,7 @@ func stringValidators(path []string, property *cfschema.Property) ([]string, err validators = append(validators, w.String()) } - return validators, nil + return features, validators, nil } func addPropertyRequiredAttributes(writer io.Writer, p *cfschema.PropertySubschema) int { diff --git a/internal/provider/generators/shared/generator.go b/internal/provider/generators/shared/generator.go index 6bb4211263..1747b926d2 100644 --- a/internal/provider/generators/shared/generator.go +++ b/internal/provider/generators/shared/generator.go @@ -147,6 +147,9 @@ func (g *Generator) GenerateTemplateData(cfTypeSchemaFile, resType, tfResourceTy if codeFeatures&codegen.HasUpdatableProperty == 0 { templateData.HasUpdateMethod = false } + if codeFeatures&codegen.UsesRegexp > 0 { + templateData.ImportRegexp = true + } if codeFeatures&codegen.UsesValidation > 0 || requiredAttributesValidator != "" { templateData.ImportValidate = true } @@ -189,6 +192,7 @@ type TemplateData struct { HasRequiredAttribute bool HasUpdateMethod bool ImportFrameworkAttr bool + ImportRegexp bool ImportValidate bool PackageName string RequiredAttributesValidator string From 3de9d77b223ba816479b0ad4873c7cd8a8f5f42d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 18 Feb 2022 17:04:46 -0500 Subject: [PATCH 10/19] Support valid property patterns in downloaded CloudFormation resource schemas. --- .../schemas/AWS_APS_RuleGroupsNamespace.json | 4 +- .../schemas/AWS_APS_Workspace.json | 2 +- .../schemas/AWS_Amplify_App.json | 34 ++++----- .../schemas/AWS_Amplify_Branch.json | 18 ++--- .../schemas/AWS_Amplify_Domain.json | 12 ++-- .../AWS_ApiGateway_BasePathMapping.json | 2 +- .../schemas/AWS_ApiGateway_Resource.json | 2 +- .../schemas/AWS_ApiGateway_UsagePlanKey.json | 2 +- .../schemas/AWS_AppFlow_ConnectorProfile.json | 70 +++++++++---------- .../schemas/AWS_AppFlow_Flow.json | 22 +++--- .../AWS_AppIntegrations_DataIntegration.json | 14 ++-- .../AWS_AppIntegrations_EventIntegration.json | 14 ++-- .../schemas/AWS_AppRunner_Service.json | 14 ++-- .../schemas/AWS_AppRunner_VpcConnector.json | 4 +- .../schemas/AWS_AppSync_DomainName.json | 4 +- .../AWS_AppSync_DomainNameApiAssociation.json | 2 +- .../AWS_ApplicationInsights_Application.json | 34 ++++----- .../schemas/AWS_Athena_WorkGroup.json | 2 +- .../schemas/AWS_AuditManager_Assessment.json | 20 +++--- .../schemas/AWS_Backup_BackupVault.json | 2 +- .../schemas/AWS_Backup_Framework.json | 2 +- .../schemas/AWS_Backup_ReportPlan.json | 4 +- .../schemas/AWS_CE_AnomalyMonitor.json | 10 +-- .../schemas/AWS_CE_AnomalySubscription.json | 6 +- .../schemas/AWS_CE_CostCategory.json | 4 +- .../schemas/AWS_CUR_ReportDefinition.json | 8 +-- .../schemas/AWS_Cassandra_Keyspace.json | 2 +- .../schemas/AWS_Cassandra_Table.json | 6 +- ...AWS_Chatbot_SlackChannelConfiguration.json | 8 +-- ...AWS_CloudFormation_HookDefaultVersion.json | 8 +-- .../AWS_CloudFormation_HookTypeConfig.json | 10 +-- .../AWS_CloudFormation_HookVersion.json | 12 ++-- ...S_CloudFormation_ModuleDefaultVersion.json | 6 +- .../AWS_CloudFormation_ModuleVersion.json | 6 +- .../AWS_CloudFormation_PublicTypeVersion.json | 10 +-- .../schemas/AWS_CloudFormation_Publisher.json | 6 +- ...CloudFormation_ResourceDefaultVersion.json | 8 +-- .../AWS_CloudFormation_ResourceVersion.json | 10 +-- .../schemas/AWS_CloudFormation_StackSet.json | 8 +-- .../AWS_CloudFormation_TypeActivation.json | 12 ++-- .../schemas/AWS_CloudFront_CachePolicy.json | 6 +- .../AWS_CloudFront_OriginRequestPolicy.json | 6 +- .../AWS_CloudFront_ResponseHeadersPolicy.json | 4 +- .../schemas/AWS_CloudTrail_Trail.json | 2 +- .../schemas/AWS_CodeArtifact_Domain.json | 6 +- .../schemas/AWS_CodeArtifact_Repository.json | 8 +-- .../AWS_CodeGuruProfiler_ProfilingGroup.json | 10 +-- ...odeGuruReviewer_RepositoryAssociation.json | 10 +-- .../AWS_CodeStarConnections_Connection.json | 6 +- ...odeStarNotifications_NotificationRule.json | 6 +- .../AWS_Config_AggregationAuthorization.json | 4 +- .../AWS_Config_ConfigurationAggregator.json | 2 +- .../schemas/AWS_Config_ConformancePack.json | 4 +- ...WS_Config_OrganizationConformancePack.json | 4 +- .../schemas/AWS_Config_StoredQuery.json | 8 +-- .../schemas/AWS_Connect_ContactFlow.json | 6 +- .../AWS_Connect_ContactFlowModule.json | 8 +-- .../schemas/AWS_Connect_HoursOfOperation.json | 4 +- .../schemas/AWS_Connect_QuickConnect.json | 12 ++-- .../schemas/AWS_Connect_User.json | 12 ++-- .../AWS_Connect_UserHierarchyGroup.json | 4 +- .../schemas/AWS_CustomerProfiles_Domain.json | 2 +- .../AWS_CustomerProfiles_Integration.json | 30 ++++---- .../AWS_CustomerProfiles_ObjectType.json | 12 ++-- .../schemas/AWS_DataBrew_Dataset.json | 8 +-- .../schemas/AWS_DataBrew_Job.json | 4 +- .../schemas/AWS_DataBrew_Ruleset.json | 4 +- .../schemas/AWS_DataSync_Agent.json | 16 ++--- .../schemas/AWS_DataSync_LocationEFS.json | 16 ++--- .../AWS_DataSync_LocationFSxWindows.json | 20 +++--- .../schemas/AWS_DataSync_LocationHDFS.json | 18 ++--- .../schemas/AWS_DataSync_LocationNFS.json | 14 ++-- .../AWS_DataSync_LocationObjectStorage.json | 20 +++--- .../schemas/AWS_DataSync_LocationS3.json | 14 ++-- .../schemas/AWS_DataSync_LocationSMB.json | 20 +++--- .../schemas/AWS_DataSync_Task.json | 24 +++---- .../AWS_Detective_MemberInvitation.json | 6 +- .../AWS_DevOpsGuru_NotificationChannel.json | 4 +- .../AWS_DevOpsGuru_ResourceCollection.json | 2 +- .../AWS_EC2_CapacityReservationFleet.json | 2 +- .../schemas/AWS_EC2_CarrierGateway.json | 2 +- .../schemas/AWS_EC2_EC2Fleet.json | 4 +- ..._EnclaveCertificateIamRoleAssociation.json | 4 +- .../schemas/AWS_EC2_SpotFleet.json | 4 +- ...S_EC2_TransitGatewayPeeringAttachment.json | 2 +- .../schemas/AWS_EC2_VPCEndpoint.json | 2 +- .../schemas/AWS_ECR_PublicRepository.json | 2 +- .../schemas/AWS_ECR_PullThroughCacheRule.json | 6 +- .../schemas/AWS_ECR_RegistryPolicy.json | 2 +- .../AWS_ECR_ReplicationConfiguration.json | 6 +- .../schemas/AWS_ECR_Repository.json | 2 +- .../schemas/AWS_EFS_AccessPoint.json | 2 +- .../schemas/AWS_EFS_FileSystem.json | 2 +- .../schemas/AWS_EKS_Cluster.json | 4 +- .../schemas/AWS_EKS_Nodegroup.json | 2 +- .../AWS_EMRContainers_VirtualCluster.json | 6 +- .../schemas/AWS_EMR_Studio.json | 20 +++--- .../schemas/AWS_EMR_StudioSessionMapping.json | 4 +- .../schemas/AWS_ElastiCache_User.json | 2 +- .../schemas/AWS_ElastiCache_UserGroup.json | 2 +- .../schemas/AWS_Events_ApiDestination.json | 2 +- .../schemas/AWS_Events_Connection.json | 2 +- .../schemas/AWS_Evidently_Experiment.json | 22 +++--- .../schemas/AWS_Evidently_Feature.json | 12 ++-- .../schemas/AWS_Evidently_Launch.json | 16 ++--- .../schemas/AWS_Evidently_Project.json | 10 +-- .../schemas/AWS_FMS_NotificationChannel.json | 2 +- .../schemas/AWS_FMS_Policy.json | 16 ++--- .../schemas/AWS_FinSpace_Environment.json | 32 ++++----- .../schemas/AWS_Forecast_Dataset.json | 12 ++-- .../schemas/AWS_Forecast_DatasetGroup.json | 6 +- .../schemas/AWS_FraudDetector_Detector.json | 4 +- .../schemas/AWS_FraudDetector_EntityType.json | 2 +- .../schemas/AWS_FraudDetector_EventType.json | 2 +- .../schemas/AWS_FraudDetector_Label.json | 2 +- .../schemas/AWS_FraudDetector_Outcome.json | 2 +- .../schemas/AWS_FraudDetector_Variable.json | 2 +- .../schemas/AWS_GameLift_Alias.json | 4 +- .../schemas/AWS_GameLift_Fleet.json | 20 +++--- .../schemas/AWS_GameLift_GameServerGroup.json | 10 +-- .../AWS_GlobalAccelerator_Accelerator.json | 4 +- .../schemas/AWS_Glue_Registry.json | 2 +- .../schemas/AWS_Glue_Schema.json | 6 +- .../schemas/AWS_Glue_SchemaVersion.json | 4 +- .../AWS_Glue_SchemaVersionMetadata.json | 2 +- .../AWS_GreengrassV2_ComponentVersion.json | 2 +- .../schemas/AWS_GroundStation_Config.json | 8 +-- ...S_GroundStation_DataflowEndpointGroup.json | 6 +- .../AWS_GroundStation_MissionProfile.json | 8 +-- .../schemas/AWS_HealthLake_FHIRDatastore.json | 4 +- .../schemas/AWS_IAM_OIDCProvider.json | 2 +- .../schemas/AWS_IAM_SAMLProvider.json | 2 +- .../schemas/AWS_IAM_ServerCertificate.json | 2 +- .../schemas/AWS_IAM_VirtualMFADevice.json | 4 +- .../schemas/AWS_IVS_Channel.json | 6 +- .../schemas/AWS_IVS_PlaybackKeyPair.json | 4 +- .../AWS_IVS_RecordingConfiguration.json | 6 +- .../schemas/AWS_IVS_StreamKey.json | 4 +- .../schemas/AWS_IoTAnalytics_Channel.json | 6 +- .../schemas/AWS_IoTAnalytics_Dataset.json | 12 ++-- .../schemas/AWS_IoTAnalytics_Datastore.json | 16 ++--- .../schemas/AWS_IoTAnalytics_Pipeline.json | 10 +-- .../schemas/AWS_IoTEvents_DetectorModel.json | 12 ++-- .../schemas/AWS_IoTEvents_Input.json | 4 +- .../schemas/AWS_IoTFleetHub_Application.json | 10 +-- .../schemas/AWS_IoTWireless_Destination.json | 2 +- .../AWS_IoTWireless_PartnerAccount.json | 10 +-- .../AWS_IoTWireless_TaskDefinition.json | 2 +- .../AWS_IoTWireless_WirelessDevice.json | 28 ++++---- .../AWS_IoTWireless_WirelessGateway.json | 2 +- .../schemas/AWS_IoT_Authorizer.json | 2 +- .../schemas/AWS_IoT_CustomMetric.json | 2 +- .../schemas/AWS_IoT_Dimension.json | 2 +- .../schemas/AWS_IoT_DomainConfiguration.json | 10 +-- .../schemas/AWS_IoT_JobTemplate.json | 2 +- .../schemas/AWS_IoT_Logging.json | 2 +- .../schemas/AWS_IoT_MitigationAction.json | 2 +- .../schemas/AWS_IoT_ProvisioningTemplate.json | 2 +- .../AWS_IoT_ResourceSpecificLogging.json | 4 +- .../schemas/AWS_IoT_ScheduledAudit.json | 4 +- .../schemas/AWS_IoT_SecurityProfile.json | 10 +-- .../cloudformation/schemas/AWS_KMS_Alias.json | 2 +- .../schemas/AWS_KafkaConnect_Connector.json | 8 +-- .../schemas/AWS_Kendra_DataSource.json | 22 +++--- .../schemas/AWS_Kendra_Faq.json | 2 +- .../schemas/AWS_Kendra_Index.json | 4 +- .../AWS_KinesisFirehose_DeliveryStream.json | 38 +++++----- .../AWS_KinesisVideo_SignalingChannel.json | 2 +- .../schemas/AWS_KinesisVideo_Stream.json | 10 +-- .../schemas/AWS_Kinesis_Stream.json | 4 +- .../schemas/AWS_Lambda_CodeSigningConfig.json | 6 +- .../AWS_Lambda_EventSourceMapping.json | 20 +++--- .../schemas/AWS_Lambda_Function.json | 14 ++-- .../cloudformation/schemas/AWS_Lex_Bot.json | 16 ++--- .../schemas/AWS_Lex_BotAlias.json | 10 +-- .../schemas/AWS_Lex_BotVersion.json | 4 +- .../schemas/AWS_Lex_ResourcePolicy.json | 2 +- .../schemas/AWS_Lightsail_Alarm.json | 2 +- .../schemas/AWS_Lightsail_Bucket.json | 2 +- .../schemas/AWS_Lightsail_Container.json | 2 +- .../schemas/AWS_Lightsail_Database.json | 2 +- .../schemas/AWS_Lightsail_Disk.json | 4 +- .../schemas/AWS_Lightsail_Distribution.json | 2 +- .../schemas/AWS_Lightsail_Instance.json | 6 +- .../schemas/AWS_Lightsail_LoadBalancer.json | 2 +- ..._Lightsail_LoadBalancerTlsCertificate.json | 2 +- .../AWS_Location_GeofenceCollection.json | 8 +-- .../schemas/AWS_Location_Map.json | 10 +-- .../schemas/AWS_Location_PlaceIndex.json | 8 +-- .../schemas/AWS_Location_RouteCalculator.json | 8 +-- .../schemas/AWS_Location_Tracker.json | 8 +-- .../schemas/AWS_Location_TrackerConsumer.json | 4 +- .../schemas/AWS_Logs_QueryDefinition.json | 4 +- .../schemas/AWS_Logs_ResourcePolicy.json | 2 +- ...S_LookoutEquipment_InferenceScheduler.json | 18 ++--- .../schemas/AWS_LookoutMetrics_Alert.json | 8 +-- .../AWS_LookoutMetrics_AnomalyDetector.json | 46 ++++++------ .../schemas/AWS_LookoutVision_Project.json | 2 +- .../schemas/AWS_MWAA_Environment.json | 34 ++++----- .../schemas/AWS_MemoryDB_ACL.json | 2 +- .../schemas/AWS_MemoryDB_Cluster.json | 4 +- .../schemas/AWS_MemoryDB_SubnetGroup.json | 2 +- .../schemas/AWS_MemoryDB_User.json | 2 +- .../schemas/AWS_NetworkFirewall_Firewall.json | 10 +-- .../AWS_NetworkFirewall_FirewallPolicy.json | 16 ++--- ..._NetworkFirewall_LoggingConfiguration.json | 4 +- .../AWS_NetworkFirewall_RuleGroup.json | 30 ++++---- .../AWS_NimbleStudio_LaunchProfile.json | 8 +-- .../AWS_NimbleStudio_StreamingImage.json | 6 +- .../schemas/AWS_NimbleStudio_Studio.json | 6 +- .../AWS_NimbleStudio_StudioComponent.json | 8 +-- .../schemas/AWS_OpsWorksCM_Server.json | 26 +++---- .../AWS_Panorama_ApplicationInstance.json | 22 +++--- .../schemas/AWS_Panorama_Package.json | 10 +-- .../schemas/AWS_Panorama_PackageVersion.json | 10 +-- .../schemas/AWS_QLDB_Stream.json | 2 +- .../schemas/AWS_QuickSight_Analysis.json | 20 +++--- .../schemas/AWS_QuickSight_Dashboard.json | 20 +++--- .../schemas/AWS_QuickSight_DataSet.json | 10 +-- .../schemas/AWS_QuickSight_DataSource.json | 4 +- .../schemas/AWS_QuickSight_Template.json | 12 ++-- .../schemas/AWS_QuickSight_Theme.json | 48 ++++++------- .../schemas/AWS_RDS_DBProxy.json | 6 +- .../schemas/AWS_RDS_DBProxyEndpoint.json | 10 +-- .../schemas/AWS_RDS_DBProxyTargetGroup.json | 2 +- .../schemas/AWS_RDS_GlobalCluster.json | 4 +- .../schemas/AWS_RUM_AppMonitor.json | 8 +-- .../schemas/AWS_Redshift_EndpointAccess.json | 2 +- .../AWS_Redshift_EndpointAuthorization.json | 4 +- .../AWS_RefactorSpaces_Environment.json | 10 +-- .../schemas/AWS_RefactorSpaces_Route.json | 12 ++-- .../schemas/AWS_RefactorSpaces_Service.json | 20 +++--- .../schemas/AWS_Rekognition_Collection.json | 6 +- .../schemas/AWS_Rekognition_Project.json | 4 +- .../schemas/AWS_ResilienceHub_App.json | 14 ++-- .../AWS_ResilienceHub_ResiliencyPolicy.json | 2 +- .../schemas/AWS_RoboMaker_Fleet.json | 6 +- .../schemas/AWS_RoboMaker_Robot.json | 2 +- .../AWS_RoboMaker_RobotApplication.json | 2 +- ...AWS_RoboMaker_RobotApplicationVersion.json | 4 +- .../AWS_RoboMaker_SimulationApplication.json | 8 +-- ...oboMaker_SimulationApplicationVersion.json | 4 +- .../AWS_Route53RecoveryControl_Cluster.json | 2 +- ...S_Route53RecoveryControl_ControlPanel.json | 2 +- ...Route53RecoveryControl_RoutingControl.json | 2 +- ...AWS_Route53RecoveryControl_SafetyRule.json | 2 +- .../AWS_Route53RecoveryReadiness_Cell.json | 4 +- ...ute53RecoveryReadiness_ReadinessCheck.json | 6 +- ...oute53RecoveryReadiness_RecoveryGroup.json | 4 +- ..._Route53RecoveryReadiness_ResourceSet.json | 2 +- .../AWS_Route53Resolver_ResolverConfig.json | 2 +- ...ute53Resolver_ResolverRuleAssociation.json | 2 +- .../schemas/AWS_Route53_DNSSEC.json | 2 +- .../schemas/AWS_Route53_HealthCheck.json | 2 +- .../schemas/AWS_Route53_KeySigningKey.json | 4 +- .../AWS_S3ObjectLambda_AccessPoint.json | 4 +- .../AWS_S3ObjectLambda_AccessPointPolicy.json | 2 +- .../schemas/AWS_S3Outposts_AccessPoint.json | 6 +- .../schemas/AWS_S3Outposts_Bucket.json | 12 ++-- .../schemas/AWS_S3Outposts_BucketPolicy.json | 2 +- .../schemas/AWS_S3Outposts_Endpoint.json | 14 ++-- .../schemas/AWS_S3_AccessPoint.json | 4 +- .../cloudformation/schemas/AWS_S3_Bucket.json | 8 +-- .../AWS_S3_MultiRegionAccessPoint.json | 4 +- .../AWS_S3_MultiRegionAccessPointPolicy.json | 4 +- .../schemas/AWS_S3_StorageLens.json | 2 +- .../schemas/AWS_SES_ConfigurationSet.json | 2 +- ..._SES_ConfigurationSetEventDestination.json | 8 +-- .../schemas/AWS_SES_ContactList.json | 4 +- .../schemas/AWS_SES_Template.json | 2 +- .../schemas/AWS_SSMContacts_Contact.json | 4 +- .../AWS_SSMContacts_ContactChannel.json | 2 +- .../AWS_SSMIncidents_ReplicationSet.json | 2 +- .../AWS_SSMIncidents_ResponsePlan.json | 10 +-- .../schemas/AWS_SSM_Association.json | 16 ++--- .../schemas/AWS_SSM_Document.json | 16 ++--- .../schemas/AWS_SSO_Assignment.json | 8 +-- ...ceAccessControlAttributeConfiguration.json | 6 +- .../schemas/AWS_SSO_PermissionSet.json | 14 ++-- .../schemas/AWS_SageMaker_App.json | 12 ++-- .../schemas/AWS_SageMaker_AppImageConfig.json | 6 +- ...WS_SageMaker_DataQualityJobDefinition.json | 30 ++++---- .../schemas/AWS_SageMaker_Device.json | 10 +-- .../schemas/AWS_SageMaker_DeviceFleet.json | 12 ++-- .../schemas/AWS_SageMaker_Domain.json | 30 ++++---- .../schemas/AWS_SageMaker_FeatureGroup.json | 14 ++-- .../schemas/AWS_SageMaker_Image.json | 10 +-- .../schemas/AWS_SageMaker_ImageVersion.json | 12 ++-- .../AWS_SageMaker_ModelBiasJobDefinition.json | 34 ++++----- ...aker_ModelExplainabilityJobDefinition.json | 32 ++++----- .../AWS_SageMaker_ModelPackageGroup.json | 10 +-- ...S_SageMaker_ModelQualityJobDefinition.json | 34 ++++----- .../AWS_SageMaker_MonitoringSchedule.json | 32 ++++----- .../schemas/AWS_SageMaker_Pipeline.json | 8 +-- .../schemas/AWS_SageMaker_Project.json | 22 +++--- .../schemas/AWS_SageMaker_UserProfile.json | 20 +++--- ...ServiceCatalogAppRegistry_Application.json | 6 +- ...viceCatalogAppRegistry_AttributeGroup.json | 6 +- ...AppRegistry_AttributeGroupAssociation.json | 8 +-- ...atalogAppRegistry_ResourceAssociation.json | 8 +-- ...alog_CloudFormationProvisionedProduct.json | 8 +-- .../schemas/AWS_Signer_ProfilePermission.json | 2 +- .../schemas/AWS_Signer_SigningProfile.json | 4 +- .../schemas/AWS_Synthetics_Canary.json | 4 +- .../schemas/AWS_Timestream_Database.json | 4 +- .../AWS_Timestream_ScheduledQuery.json | 6 +- .../schemas/AWS_Timestream_Table.json | 4 +- .../schemas/AWS_Transfer_Workflow.json | 20 +++--- .../schemas/AWS_WAFv2_IPSet.json | 6 +- .../AWS_WAFv2_LoggingConfiguration.json | 2 +- .../schemas/AWS_WAFv2_RegexPatternSet.json | 6 +- .../schemas/AWS_WAFv2_RuleGroup.json | 8 +-- .../schemas/AWS_WAFv2_WebACL.json | 14 ++-- .../schemas/AWS_Wisdom_Assistant.json | 6 +- .../AWS_Wisdom_AssistantAssociation.json | 10 +-- .../schemas/AWS_Wisdom_KnowledgeBase.json | 6 +- .../AWS_WorkSpaces_ConnectionAlias.json | 8 +-- 317 files changed, 1355 insertions(+), 1355 deletions(-) diff --git a/internal/service/cloudformation/schemas/AWS_APS_RuleGroupsNamespace.json b/internal/service/cloudformation/schemas/AWS_APS_RuleGroupsNamespace.json index 1ae791ab1d..f8986d9de9 100644 --- a/internal/service/cloudformation/schemas/AWS_APS_RuleGroupsNamespace.json +++ b/internal/service/cloudformation/schemas/AWS_APS_RuleGroupsNamespace.json @@ -31,7 +31,7 @@ "Workspace": { "description": "Required to identify a specific APS Workspace associated with this RuleGroupsNamespace.", "type": "string", - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn):aps:[a-z0-9-]+:[0-9]+:workspace/[a-zA-Z0-9-]+$" }, "Name": { "description": "The RuleGroupsNamespace name.", @@ -46,7 +46,7 @@ "Arn": { "description": "The RuleGroupsNamespace ARN.", "type": "string", - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn):aps:[a-z0-9-]+:[0-9]+:rulegroupsnamespace/[a-zA-Z0-9-]+/[0-9A-Za-z][-.0-9A-Z_a-z]*$" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", diff --git a/internal/service/cloudformation/schemas/AWS_APS_Workspace.json b/internal/service/cloudformation/schemas/AWS_APS_Workspace.json index 3d1210a153..63c6b523f2 100644 --- a/internal/service/cloudformation/schemas/AWS_APS_Workspace.json +++ b/internal/service/cloudformation/schemas/AWS_APS_Workspace.json @@ -44,7 +44,7 @@ "Arn": { "description": "Workspace arn.", "type": "string", - "pattern": "", + "pattern": "^arn:\b(aws|aws-us-gov|aws-cn)\b:aps:[a-z0-9-]+:[0-9]+:workspace/[a-zA-Z0-9-]+$", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_Amplify_App.json b/internal/service/cloudformation/schemas/AWS_Amplify_App.json index 4379af3684..664a55c12c 100644 --- a/internal/service/cloudformation/schemas/AWS_Amplify_App.json +++ b/internal/service/cloudformation/schemas/AWS_Amplify_App.json @@ -12,18 +12,18 @@ "type": "string", "minLength": 1, "maxLength": 20, - "pattern": "" + "pattern": "d[a-z0-9]+" }, "AppName": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "(?s).+" }, "Arn": { "type": "string", "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "AutoBranchCreationConfig": { "$ref": "#/definitions/AutoBranchCreationConfig" @@ -35,13 +35,13 @@ "type": "string", "minLength": 1, "maxLength": 25000, - "pattern": "" + "pattern": "(?s).+" }, "CustomHeaders": { "type": "string", "minLength": 0, "maxLength": 25000, - "pattern": "" + "pattern": "(?s).*" }, "CustomRules": { "type": "array", @@ -58,7 +58,7 @@ "Description": { "type": "string", "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "EnableBranchAutoDeletion": { "type": "boolean" @@ -74,22 +74,22 @@ "type": "string", "minLength": 1, "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "Name": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "(?s).+" }, "OauthToken": { "type": "string", "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "Repository": { "type": "string", - "pattern": "" + "pattern": "(?s).*" }, "Tags": { "type": "array", @@ -143,7 +143,7 @@ "PullRequestEnvironmentName": { "type": "string", "maxLength": 20, - "pattern": "" + "pattern": "(?s).*" }, "Stage": { "type": "string", @@ -184,25 +184,25 @@ "type": "string", "minLength": 0, "maxLength": 2048, - "pattern": "" + "pattern": "(?s).*" }, "Status": { "type": "string", "minLength": 3, "maxLength": 7, - "pattern": "" + "pattern": ".{3,7}" }, "Target": { "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "(?s).+" }, "Source": { "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "(?s).+" } }, "required": [ @@ -217,12 +217,12 @@ "Name": { "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "(?s).*" }, "Value": { "type": "string", "maxLength": 5500, - "pattern": "" + "pattern": "(?s).*" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_Amplify_Branch.json b/internal/service/cloudformation/schemas/AWS_Amplify_Branch.json index d8c4442ae5..af67d350f2 100644 --- a/internal/service/cloudformation/schemas/AWS_Amplify_Branch.json +++ b/internal/service/cloudformation/schemas/AWS_Amplify_Branch.json @@ -7,12 +7,12 @@ "type": "string", "minLength": 1, "maxLength": 20, - "pattern": "" + "pattern": "d[a-z0-9]+" }, "Arn": { "type": "string", "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "BasicAuthConfig": { "$ref": "#/definitions/BasicAuthConfig" @@ -21,18 +21,18 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "(?s).+" }, "BuildSpec": { "type": "string", "minLength": 1, "maxLength": 25000, - "pattern": "" + "pattern": "(?s).+" }, "Description": { "type": "string", "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "EnableAutoBuild": { "type": "boolean" @@ -53,7 +53,7 @@ "PullRequestEnvironmentName": { "type": "string", "maxLength": 20, - "pattern": "" + "pattern": "(?s).*" }, "Stage": { "type": "string", @@ -81,12 +81,12 @@ "Name": { "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "(?s).*" }, "Value": { "type": "string", "maxLength": 5500, - "pattern": "" + "pattern": "(?s).*" } }, "required": [ @@ -109,7 +109,7 @@ "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_Amplify_Domain.json b/internal/service/cloudformation/schemas/AWS_Amplify_Domain.json index a3e4c004b4..a74306e76a 100644 --- a/internal/service/cloudformation/schemas/AWS_Amplify_Domain.json +++ b/internal/service/cloudformation/schemas/AWS_Amplify_Domain.json @@ -7,12 +7,12 @@ "type": "string", "minLength": 1, "maxLength": 20, - "pattern": "" + "pattern": "d[a-z0-9]+" }, "Arn": { "type": "string", "maxLength": 1000, - "pattern": "" + "pattern": "(?s).*" }, "AutoSubDomainCreationPatterns": { "type": "array", @@ -21,12 +21,12 @@ "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "(?s).+" } }, "AutoSubDomainIAMRole": { "type": "string", - "pattern": "", + "pattern": "^$|^arn:.+:iam::\\d{12}:role.+", "maxLength": 1000 }, "CertificateRecord": { @@ -65,13 +65,13 @@ "Prefix": { "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "(?s).*" }, "BranchName": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "(?s).+" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_ApiGateway_BasePathMapping.json b/internal/service/cloudformation/schemas/AWS_ApiGateway_BasePathMapping.json index 6ff9786920..e23bc11322 100644 --- a/internal/service/cloudformation/schemas/AWS_ApiGateway_BasePathMapping.json +++ b/internal/service/cloudformation/schemas/AWS_ApiGateway_BasePathMapping.json @@ -58,4 +58,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_ApiGateway_Resource.json b/internal/service/cloudformation/schemas/AWS_ApiGateway_Resource.json index ff24bd2f50..77c7606750 100644 --- a/internal/service/cloudformation/schemas/AWS_ApiGateway_Resource.json +++ b/internal/service/cloudformation/schemas/AWS_ApiGateway_Resource.json @@ -48,4 +48,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_ApiGateway_UsagePlanKey.json b/internal/service/cloudformation/schemas/AWS_ApiGateway_UsagePlanKey.json index 66b435c9a1..125546d221 100644 --- a/internal/service/cloudformation/schemas/AWS_ApiGateway_UsagePlanKey.json +++ b/internal/service/cloudformation/schemas/AWS_ApiGateway_UsagePlanKey.json @@ -61,4 +61,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_AppFlow_ConnectorProfile.json b/internal/service/cloudformation/schemas/AWS_AppFlow_ConnectorProfile.json index 69d0146e65..39e83dd968 100644 --- a/internal/service/cloudformation/schemas/AWS_AppFlow_ConnectorProfile.json +++ b/internal/service/cloudformation/schemas/AWS_AppFlow_ConnectorProfile.json @@ -6,19 +6,19 @@ "ConnectorProfileArn": { "description": "Unique identifier for connector profile resources", "type": "string", - "pattern": "", + "pattern": "arn:aws:appflow:.*:[0-9]+:.*", "maxLength": 512 }, "ConnectorProfileName": { "description": "The maximum number of items to retrieve in a single batch.", "type": "string", - "pattern": "", + "pattern": "[\\w/!@#+=.-]+", "maxLength": 256 }, "KMSArn": { "description": "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", "type": "string", - "pattern": "", + "pattern": "arn:aws:kms:.*:[0-9]+:.*", "maxLength": 2048, "minLength": 20 }, @@ -41,7 +41,7 @@ "CredentialsArn": { "description": "A unique Arn for Connector-Profile resource", "type": "string", - "pattern": "", + "pattern": "arn:aws:.*:.*:[0-9]+:.*", "maxLength": 512 } }, @@ -705,52 +705,52 @@ }, "ClientId": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "ClientSecret": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "InstanceUrl": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 256 }, "AccessToken": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "ApiKey": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 256 }, "ApiSecretKey": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 256 }, "ApiToken": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 256 }, "ApplicationKey": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "AuthCode": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "BucketName": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 63, "minLength": 3 }, @@ -760,67 +760,67 @@ }, "Key": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "DatabaseUrl": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "RoleArn": { "type": "string", - "pattern": "", + "pattern": "arn:aws:iam:.*:[0-9]+:.*", "maxLength": 512 }, "Warehouse": { "type": "string", - "pattern": "", + "pattern": "[\\s\\w/!@#+=.-]*", "maxLength": 512 }, "Stage": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 16 }, "PrivateLinkServiceName": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "AccountName": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "RefreshToken": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "Region": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 64 }, "SecretKey": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 256 }, "AccessKeyId": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 256 }, "Username": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "Password": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "ConnectorOAuthRequest": { @@ -838,28 +838,28 @@ }, "ClientCredentialsArn": { "type": "string", - "pattern": "", + "pattern": "arn:aws:secretsmanager:.*:[0-9]+:.*", "maxLength": 2048 }, "ApplicationHostUrl": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" }, "ApplicationServicePath": { "type": "string", - "pattern": "", + "pattern": "\\S+", "maxLength": 512 }, "ClientNumber": { "type": "string", - "pattern": "", + "pattern": "^\\d{3}$", "minLength": 3, "maxLength": 3 }, "LogonLanguage": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_]*$", "maxLength": 2 }, "PortNumber": { @@ -873,12 +873,12 @@ "AuthCodeUrl": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" }, "TokenUrl": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" }, "OAuthScopes": { "type": "array", @@ -886,7 +886,7 @@ "items": { "type":"string", "maxLength": 128, - "pattern": "" + "pattern": "[/\\w]*" } } } diff --git a/internal/service/cloudformation/schemas/AWS_AppFlow_Flow.json b/internal/service/cloudformation/schemas/AWS_AppFlow_Flow.json index d3d754925d..124af5c713 100644 --- a/internal/service/cloudformation/schemas/AWS_AppFlow_Flow.json +++ b/internal/service/cloudformation/schemas/AWS_AppFlow_Flow.json @@ -7,26 +7,26 @@ "FlowArn": { "description": "ARN identifier of the flow.", "type": "string", - "pattern": "", + "pattern": "arn:aws:appflow:.*:[0-9]+:.*", "maxLength": 512 }, "FlowName": { "description": "Name of the flow.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9][\\w!@#.-]+", "maxLength": 256, "minLength": 1 }, "Description": { "description": "Description of the flow.", "type": "string", - "pattern": "", + "pattern": "[\\w!@#\\-.?,\\s]*", "maxLength": 2048 }, "KMSArn": { "description": "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", "type": "string", - "pattern": "", + "pattern": "arn:aws:kms:.*:[0-9]+:.*", "maxLength": 2048, "minLength": 20 }, @@ -379,7 +379,7 @@ "Object": { "type": "string", "maxLength": 512, - "pattern": "" + "pattern": "\\S+" }, "EnableDynamicFieldUpdate": { "type": "boolean" @@ -399,19 +399,19 @@ "DocumentType": { "type": "string", "maxLength": 512, - "pattern": "" + "pattern": "[\\s\\w_-]+" }, "BucketName": { "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "\\S+" }, "UpsolverBucketName": { "type": "string", "minLength": 16, "maxLength": 63, - "pattern": "" + "pattern": "^(upsolver-appflow)\\S*" }, "BucketPrefix": { "type": "string", @@ -447,7 +447,7 @@ "Name": { "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "\\S+" }, "WriteOperationType": { "type": "string", @@ -571,7 +571,7 @@ "ConnectorProfileName": { "description": "Name of connector profile", "type": "string", - "pattern": "", + "pattern": "[\\w/!@#+=.-]+", "maxLength": 256 }, "AmplitudeSourceProperties": { @@ -982,7 +982,7 @@ "Value": { "type": "string", "maxLength": 2048, - "pattern": "" + "pattern": ".+" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_AppIntegrations_DataIntegration.json b/internal/service/cloudformation/schemas/AWS_AppIntegrations_DataIntegration.json index f2b814aa60..d4873403b7 100644 --- a/internal/service/cloudformation/schemas/AWS_AppIntegrations_DataIntegration.json +++ b/internal/service/cloudformation/schemas/AWS_AppIntegrations_DataIntegration.json @@ -9,21 +9,21 @@ "FirstExecutionFrom": { "description": "The start date for objects to import in the first flow run. Epoch or ISO timestamp format is supported.", "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 255 }, "Object": { "description": "The name of the object to pull from the data source.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9/\\._\\-]+$", "minLength": 1, "maxLength": 255 }, "ScheduleExpression": { "description": "How often the data should be pulled from data source.", "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 255 } @@ -70,7 +70,7 @@ "Id": { "description": "The unique identifer of the data integration.", "type": "string", - "pattern": "", + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", "minLength": 1, "maxLength": 255 }, @@ -84,14 +84,14 @@ "Name": { "description": "The name of the data integration.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9/\\._\\-]+$", "minLength": 1, "maxLength": 255 }, "KmsKey": { "description": "The KMS key of the data integration.", "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 255 }, @@ -103,7 +103,7 @@ "SourceURI": { "description": "The URI of the data source.", "type": "string", - "pattern": "", + "pattern": "^\\w+\\:\\/\\/\\w+\\/[\\w/!@#+=.-]+$", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_AppIntegrations_EventIntegration.json b/internal/service/cloudformation/schemas/AWS_AppIntegrations_EventIntegration.json index 1814a4cfd0..ab29a35fdf 100644 --- a/internal/service/cloudformation/schemas/AWS_AppIntegrations_EventIntegration.json +++ b/internal/service/cloudformation/schemas/AWS_AppIntegrations_EventIntegration.json @@ -9,7 +9,7 @@ "Source": { "description": "The source of the events.", "type": "string", - "pattern": "", + "pattern": "^aws\\.partner\\/.*$", "minLength": 1, "maxLength": 256 } @@ -48,14 +48,14 @@ "Key": { "description": "A key to identify the metadata.", "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 255 }, "Value": { "description": "Corresponding metadata value for the key.", "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 255 } @@ -85,7 +85,7 @@ "EventBridgeRuleName": { "description": "The name of the Eventbridge rule.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9/\\._\\-]+$", "minLength": 1, "maxLength": 2048 }, @@ -99,7 +99,7 @@ "EventIntegrationAssociationId": { "description": "The identifier for the event integration association.", "type": "string", - "pattern": "" + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" } }, "additionalProperties": false, @@ -123,14 +123,14 @@ "Name": { "description": "The name of the event integration.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9/\\._\\-]+$", "minLength": 1, "maxLength": 255 }, "EventBridgeBus": { "description": "The Amazon Eventbridge bus for the event integration.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9/\\._\\-]+$", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_AppRunner_Service.json b/internal/service/cloudformation/schemas/AWS_AppRunner_Service.json index ab01e9836b..a3f4ac480b 100644 --- a/internal/service/cloudformation/schemas/AWS_AppRunner_Service.json +++ b/internal/service/cloudformation/schemas/AWS_AppRunner_Service.json @@ -132,7 +132,7 @@ "description": "Image Identifier", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "([0-9]{12}.dkr.ecr.[a-z\\-]+-[0-9]{1}.amazonaws.com\\/.*)|(^public\\.ecr\\.aws\\/.+\\/.+)" }, "ImageConfiguration": { "$ref": "#/definitions/ImageConfiguration" @@ -200,14 +200,14 @@ "description": "CPU", "minLength": 4, "maxLength": 6, - "pattern": "" + "pattern": "1024|2048|(1|2) vCPU" }, "Memory": { "type": "string", "description": "Memory", "minLength": 4, "maxLength": 4, - "pattern": "" + "pattern": "2048|3072|4096|(2|3|4) GB" }, "InstanceRoleArn": { "description": "Instance Role Arn", @@ -220,7 +220,7 @@ "type": "string", "minLength": 29, "maxLength": 102, - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):iam::[0-9]{12}:role/[\\w+=,.@-]{1,64}" }, "EncryptionConfiguration": { "description": "Encryption configuration (KMS key)", @@ -231,7 +231,7 @@ "description": "The KMS Key", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws(-[\\w]+)*:kms:[a-z\\-]+-[0-9]{1}:[0-9]{12}:key\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" } }, "required": [ @@ -349,7 +349,7 @@ "type": "string", "minLength": 4, "maxLength": 40, - "pattern": "" + "pattern": "[A-Za-z0-9][A-Za-z0-9-_]{3,39}" }, "ServiceId": { "description": "The AppRunner Service Id", @@ -469,4 +469,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_AppRunner_VpcConnector.json b/internal/service/cloudformation/schemas/AWS_AppRunner_VpcConnector.json index 54e786ed18..0c776cb38c 100644 --- a/internal/service/cloudformation/schemas/AWS_AppRunner_VpcConnector.json +++ b/internal/service/cloudformation/schemas/AWS_AppRunner_VpcConnector.json @@ -22,7 +22,7 @@ "type": "string", "minLength": 4, "maxLength": 40, - "pattern": "" + "pattern": "^[A-Za-z0-9][A-Za-z0-9-\\\\_]{3,39}$" }, "VpcConnectorArn":{ "description": "The Amazon Resource Name (ARN) of this VPC connector.", @@ -115,4 +115,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_AppSync_DomainName.json b/internal/service/cloudformation/schemas/AWS_AppSync_DomainName.json index 9e3808670e..04550fd7de 100644 --- a/internal/service/cloudformation/schemas/AWS_AppSync_DomainName.json +++ b/internal/service/cloudformation/schemas/AWS_AppSync_DomainName.json @@ -7,7 +7,7 @@ "type": "string", "minLength": 1, "maxLength": 253, - "pattern": "" + "pattern": "^(\\*[a-z\\d-]*\\.)?([a-z\\d-]+\\.)+[a-z\\d-]+$" }, "Description": { "type": "string", @@ -18,7 +18,7 @@ "type": "string", "minLength": 3, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:[a-z-]*:acm:[a-z0-9-]*:\\d{12}:certificate/[0-9A-Za-z_/-]*$" }, "AppSyncDomainName": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_AppSync_DomainNameApiAssociation.json b/internal/service/cloudformation/schemas/AWS_AppSync_DomainNameApiAssociation.json index c62146103a..03e50d94f2 100644 --- a/internal/service/cloudformation/schemas/AWS_AppSync_DomainNameApiAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_AppSync_DomainNameApiAssociation.json @@ -7,7 +7,7 @@ "type": "string", "minLength": 1, "maxLength": 253, - "pattern": "" + "pattern": "^(\\*[a-z\\d-]*\\.)?([a-z\\d-]+\\.)+[a-z\\d-]+$" }, "ApiId": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_ApplicationInsights_Application.json b/internal/service/cloudformation/schemas/AWS_ApplicationInsights_Application.json index 3946778228..7a1f1e11f0 100644 --- a/internal/service/cloudformation/schemas/AWS_ApplicationInsights_Application.json +++ b/internal/service/cloudformation/schemas/AWS_ApplicationInsights_Application.json @@ -8,7 +8,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z0-9.-_]*" }, "ApplicationARN": { "description": "The ARN of the ApplicationInsights application.", @@ -27,7 +27,7 @@ "type": "string", "minLength": 20, "maxLength": 300, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$" }, "Tags": { "description": "The tags of Application Insights application.", @@ -103,7 +103,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[\\d\\w\\-_.+]*$" }, "ResourceList": { "description": "The list of resource ARNs that belong to the component.", @@ -112,7 +112,7 @@ "type": "string", "minLength": 20, "maxLength": 300, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$" }, "minItems": 1, "insertionOrder": true @@ -133,7 +133,7 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "" + "pattern": "[a-zA-Z0-9.-_]*" }, "LogPatterns": { "description": "The log patterns of a set.", @@ -160,7 +160,7 @@ "type": "string", "minLength": 1, "maxLength": 50, - "pattern": "" + "pattern": "[a-zA-Z0-9.-_]*" }, "Pattern": { "description": "The log pattern.", @@ -189,19 +189,19 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[\\d\\w\\-_.+]*$" }, "ComponentARN": { "description": "The ARN of the compnonent.", "type": "string", "minLength": 20, "maxLength": 300, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$" }, "Tier": { "description": "The tier of the application component.", "type": "string", - "pattern": "" + "pattern": "^[A-Z][[A-Z]_]*$" }, "ComponentConfigurationMode": { "description": "The component monitoring configuration mode.", @@ -427,19 +427,19 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "[\\.\\-_/#A-Za-z0-9]+" }, "LogPath": { "description": "The path of the logs to be monitored.", "type": "string", "minLength": 1, "maxLength": 260, - "pattern": "" + "pattern": "^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$" }, "LogType": { "description": "The log type decides the log patterns against which Application Insights analyzes the log.", "type": "string", - "pattern": "" + "pattern": "^[A-Z][[A-Z]_]*$" }, "Encoding": { "description": "The type of encoding of the logs to be monitored.", @@ -455,7 +455,7 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "" + "pattern": "[a-zA-Z0-9.-_]*" } }, "required": [ @@ -472,14 +472,14 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "[\\.\\-_/#A-Za-z0-9]+" }, "EventName": { "description": "The type of Windows Events to log.", "type": "string", "minLength": 1, "maxLength": 260, - "pattern": "" + "pattern": "^[a-zA-Z0-9_ \\\\/-]$" }, "EventLevels": { "description": "The levels of event to log. ", @@ -495,7 +495,7 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "" + "pattern": "[a-zA-Z0-9.-_]*" } }, "required": [ @@ -646,4 +646,4 @@ } }, "taggable": true -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Athena_WorkGroup.json b/internal/service/cloudformation/schemas/AWS_Athena_WorkGroup.json index af4374b6e3..16f4f978f1 100644 --- a/internal/service/cloudformation/schemas/AWS_Athena_WorkGroup.json +++ b/internal/service/cloudformation/schemas/AWS_Athena_WorkGroup.json @@ -201,7 +201,7 @@ "properties": { "Name": { "description": "The workGroup name.", - "pattern": "", + "pattern": "[a-zA-Z0-9._-]{1,128}", "type": "string" }, "Description": { diff --git a/internal/service/cloudformation/schemas/AWS_AuditManager_Assessment.json b/internal/service/cloudformation/schemas/AWS_AuditManager_Assessment.json index 8bd00c98ae..ea78bde03d 100644 --- a/internal/service/cloudformation/schemas/AWS_AuditManager_Assessment.json +++ b/internal/service/cloudformation/schemas/AWS_AuditManager_Assessment.json @@ -8,27 +8,27 @@ "type":"string", "maxLength":36, "minLength":32, - "pattern":"" + "pattern":"^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|.*\\S.*)$" }, "UUID": { "type":"string", "maxLength":36, "minLength":36, - "pattern":"" + "pattern":"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" }, "AccountId": { "description": "The identifier for the specified AWS account.", "type":"string", "maxLength":12, "minLength":12, - "pattern":"" + "pattern":"^[0-9]{12}$" }, "EmailAddress": { "description": "The unique identifier for the email account.", "type":"string", "maxLength":320, "minLength":1, - "pattern":"" + "pattern":"^.*@.*$" }, "AccountName": { "description": "The name of the specified AWS account.", @@ -58,7 +58,7 @@ "type":"string", "maxLength":2048, "minLength":20, - "pattern":"" + "pattern":"^arn:.*:auditmanager:.*" }, "Timestamp": { "description": "The sequence of characters that identifies when the event occurred.", @@ -69,34 +69,34 @@ "type":"string", "maxLength":300, "minLength":1, - "pattern":"" + "pattern":"^[\\w\\W\\s\\S]*$" }, "CreatedBy": { "description": "The IAM user or role that performed the action.", "type":"string", "maxLength":100, "minLength":1, - "pattern":"" + "pattern":"^[a-zA-Z0-9-_()\\[\\]\\s]+$" }, "IamArn": { "description": "The Amazon Resource Name (ARN) of the IAM user or role.", "type":"string", "maxLength":2048, "minLength":20, - "pattern":"" + "pattern":"^arn:.*:iam:.*" }, "AssessmentName": { "description": "The name of the related assessment.", "type":"string", "maxLength":127, "minLength":1, - "pattern":"" + "pattern":"^[a-zA-Z0-9-_\\.]+$" }, "DelegationComment": { "description": "The comment related to the delegation.", "type":"string", "maxLength":350, - "pattern":"" + "pattern":"^[\\w\\W\\s\\S]*$" }, "RoleType": { "description": " The IAM role type.", diff --git a/internal/service/cloudformation/schemas/AWS_Backup_BackupVault.json b/internal/service/cloudformation/schemas/AWS_Backup_BackupVault.json index 469f31cd8f..e79e4fbf82 100644 --- a/internal/service/cloudformation/schemas/AWS_Backup_BackupVault.json +++ b/internal/service/cloudformation/schemas/AWS_Backup_BackupVault.json @@ -44,7 +44,7 @@ }, "BackupVaultNamePattern": { "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]{2,50}$" } }, "properties": { diff --git a/internal/service/cloudformation/schemas/AWS_Backup_Framework.json b/internal/service/cloudformation/schemas/AWS_Backup_Framework.json index 5efcd314b4..449c01afaf 100644 --- a/internal/service/cloudformation/schemas/AWS_Backup_Framework.json +++ b/internal/service/cloudformation/schemas/AWS_Backup_Framework.json @@ -6,7 +6,7 @@ "FrameworkName": { "description": "The unique name of a framework. This name is between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z][_a-zA-Z0-9]*", "minLength": 1, "maxLength": 256 }, diff --git a/internal/service/cloudformation/schemas/AWS_Backup_ReportPlan.json b/internal/service/cloudformation/schemas/AWS_Backup_ReportPlan.json index dc191b0d5f..096a6f72e6 100644 --- a/internal/service/cloudformation/schemas/AWS_Backup_ReportPlan.json +++ b/internal/service/cloudformation/schemas/AWS_Backup_ReportPlan.json @@ -8,7 +8,7 @@ "description": "The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z][_a-zA-Z0-9]*" }, "ReportPlanArn": { "type": "string", @@ -19,7 +19,7 @@ "description": "An optional description of the report plan with a maximum of 1,024 characters.", "minLength": 0, "maxLength": 1024, - "pattern": "" + "pattern": ".*\\S.*" }, "ReportPlanTags": { "description": "Metadata that you can assign to help organize the report plans that you create. Each tag is a key-value pair.", diff --git a/internal/service/cloudformation/schemas/AWS_CE_AnomalyMonitor.json b/internal/service/cloudformation/schemas/AWS_CE_AnomalyMonitor.json index bf6e5c209f..eedd1fedfb 100644 --- a/internal/service/cloudformation/schemas/AWS_CE_AnomalyMonitor.json +++ b/internal/service/cloudformation/schemas/AWS_CE_AnomalyMonitor.json @@ -6,7 +6,7 @@ "Arn": { "description": "Monitor ARN", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$" } }, "properties": { @@ -23,7 +23,7 @@ "MonitorName": { "description": "The name of the monitor.", "type": "string", - "pattern": "", + "pattern": "[\\S\\s]*", "minLength": 0, "maxLength": 1024 }, @@ -32,21 +32,21 @@ "type": "string", "minLength": 0, "maxLength": 40, - "pattern": "" + "pattern": "(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}Z)?" }, "LastEvaluatedDate": { "description": "The date when the monitor last evaluated for anomalies.", "type": "string", "minLength": 0, "maxLength": 40, - "pattern": "" + "pattern": "(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}Z)?" }, "LastUpdatedDate": { "description": "The date when the monitor was last updated.", "type": "string", "minLength": 0, "maxLength": 40, - "pattern": "" + "pattern": "(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}Z)?" }, "MonitorDimension": { "description": "The dimensions to evaluate", diff --git a/internal/service/cloudformation/schemas/AWS_CE_AnomalySubscription.json b/internal/service/cloudformation/schemas/AWS_CE_AnomalySubscription.json index 1a3d0f1c20..9de50774b1 100644 --- a/internal/service/cloudformation/schemas/AWS_CE_AnomalySubscription.json +++ b/internal/service/cloudformation/schemas/AWS_CE_AnomalySubscription.json @@ -6,14 +6,14 @@ "Arn": { "description": "Subscription ARN", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$" }, "Subscriber": { "type": "object", "properties": { "Address": { "type": "string", - "pattern": "" + "pattern": "(^[a-zA-Z0-9.!#$%&'*+=?^_\u2018{|}~-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$)|(^arn:(aws[a-zA-Z-]*):sns:[a-zA-Z0-9-]+:[0-9]{12}:[a-zA-Z0-9_-]+$)" }, "Status": { "type": "string", @@ -44,7 +44,7 @@ "SubscriptionName": { "description": "The name of the subscription.", "type": "string", - "pattern": "", + "pattern": "[\\S\\s]*", "minLength": 0, "maxLength": 1024 }, diff --git a/internal/service/cloudformation/schemas/AWS_CE_CostCategory.json b/internal/service/cloudformation/schemas/AWS_CE_CostCategory.json index 77f63a4674..d6cc16d753 100644 --- a/internal/service/cloudformation/schemas/AWS_CE_CostCategory.json +++ b/internal/service/cloudformation/schemas/AWS_CE_CostCategory.json @@ -6,7 +6,7 @@ "ZonedDateTime": { "description": "ISO 8601 date time with offset format", "type": "string", - "pattern": "", + "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(([+-]\\d\\d:\\d\\d)|Z)$", "minLength": 20, "maxLength": 25 } @@ -15,7 +15,7 @@ "Arn": { "description": "Cost category ARN", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$" }, "EffectiveStart": { "$ref": "#/definitions/ZonedDateTime" diff --git a/internal/service/cloudformation/schemas/AWS_CUR_ReportDefinition.json b/internal/service/cloudformation/schemas/AWS_CUR_ReportDefinition.json index 99e7a2fce2..61d126ee98 100644 --- a/internal/service/cloudformation/schemas/AWS_CUR_ReportDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_CUR_ReportDefinition.json @@ -8,7 +8,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[0-9A-Za-z!\\-_.*\\'()]+" }, "TimeUnit": { "description": "The granularity of the line items in the report.", @@ -53,14 +53,14 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[A-Za-z0-9_\\.\\-]+" }, "S3Prefix": { "description": "The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.", "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[0-9A-Za-z!\\-_.*\\'()/]*" }, "S3Region": { "description": "The region of the S3 bucket that AWS delivers the report into.", @@ -96,7 +96,7 @@ "description": "The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs.", "type": "string", "default": null, - "pattern": "", + "pattern": "(arn:aws(-cn)?:billing::[0-9]{12}:billingview/)?[a-zA-Z0-9_\\+=\\.\\-@].{1,30}", "minLength": 1, "maxLength": 128 } diff --git a/internal/service/cloudformation/schemas/AWS_Cassandra_Keyspace.json b/internal/service/cloudformation/schemas/AWS_Cassandra_Keyspace.json index d2757036e1..4fc7b0f297 100644 --- a/internal/service/cloudformation/schemas/AWS_Cassandra_Keyspace.json +++ b/internal/service/cloudformation/schemas/AWS_Cassandra_Keyspace.json @@ -5,7 +5,7 @@ "KeyspaceName": { "description": "Name for Cassandra keyspace", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$" }, "Tags": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_Cassandra_Table.json b/internal/service/cloudformation/schemas/AWS_Cassandra_Table.json index 34c09ad23c..bf350be7d3 100644 --- a/internal/service/cloudformation/schemas/AWS_Cassandra_Table.json +++ b/internal/service/cloudformation/schemas/AWS_Cassandra_Table.json @@ -7,7 +7,7 @@ "properties": { "ColumnName": { "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$" }, "ColumnType": { "type": "string" @@ -132,12 +132,12 @@ "KeyspaceName": { "description": "Name for Cassandra keyspace", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$" }, "TableName": { "description": "Name for Cassandra table", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$" }, "RegularColumns": { "description": "Non-key columns of the table", diff --git a/internal/service/cloudformation/schemas/AWS_Chatbot_SlackChannelConfiguration.json b/internal/service/cloudformation/schemas/AWS_Chatbot_SlackChannelConfiguration.json index 4e4d6521a6..d4031b93b7 100644 --- a/internal/service/cloudformation/schemas/AWS_Chatbot_SlackChannelConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_Chatbot_SlackChannelConfiguration.json @@ -12,14 +12,14 @@ "SlackChannelId": { "description": "The id of the Slack channel", "type": "string", - "pattern": "", + "pattern": "^[A-Za-z0-9]+$", "minLength": 1, "maxLength": 256 }, "ConfigurationName": { "description": "The name of the configuration", "type": "string", - "pattern": "", + "pattern": "^[A-Za-z0-9-_]+$", "minLength": 1, "maxLength":128 }, @@ -40,7 +40,7 @@ "LoggingLevel": { "description": "Specifies the logging level for this configuration:ERROR,INFO or NONE. This property affects the log entries pushed to Amazon CloudWatch logs", "type": "string", - "pattern": "", + "pattern": "^(ERROR|INFO|NONE)$", "default": "NONE" }, "Arn": { @@ -110,4 +110,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_HookDefaultVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_HookDefaultVersion.json index e12f72bf99..a256c1e1d6 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_HookDefaultVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_HookDefaultVersion.json @@ -5,22 +5,22 @@ "properties": { "TypeVersionArn": { "description": "The Amazon Resource Name (ARN) of the type version.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", "type": "string" }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", "type": "string" }, "Arn": { "description": "The Amazon Resource Name (ARN) of the type. This is used to uniquely identify a HookDefaultVersion", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", "type": "string" }, "VersionId": { "description": "The ID of an existing version of the hook to set as the default.", - "pattern": "", + "pattern": "^[A-Za-z0-9-]{1,128}$", "type": "string" } }, diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_HookTypeConfig.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_HookTypeConfig.json index 7eedd02c70..0eb2c9bcfd 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_HookTypeConfig.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_HookTypeConfig.json @@ -5,27 +5,27 @@ "properties": { "TypeArn": { "description": "The Amazon Resource Name (ARN) of the type version.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", "type": "string" }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", "type": "string" }, "ConfigurationArn": { "description": "The Amazon Resource Name (ARN) for the configuration data, in this account and region.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type-configuration/hook/.+$", "type": "string" }, "Configuration": { "description": "The configuration data for the extension, in this account and region.", - "pattern": "", + "pattern": "[\\s\\S]+", "type": "string" }, "ConfigurationAlias": { "description": "An alias by which to refer to this extension configuration data.", - "pattern": "", + "pattern": "^[a-zA-Z0-9]{1,256}$", "default": "default", "enum": [ "default" diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_HookVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_HookVersion.json index af43d196fe..cc4596b9c2 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_HookVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_HookVersion.json @@ -9,7 +9,7 @@ "LogGroupName": { "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", "type": "string", - "pattern": "", + "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", "minLength": 1, "maxLength": 512 }, @@ -26,17 +26,17 @@ "properties": { "Arn": { "description": "The Amazon Resource Name (ARN) of the type, here the HookVersion. This is used to uniquely identify a HookVersion resource", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", "type": "string" }, "TypeArn": { "description": "The Amazon Resource Name (ARN) of the type without the versionID.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", "type": "string" }, "ExecutionRoleArn": { "description": "The Amazon Resource Name (ARN) of the IAM execution role to use to register the type. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. CloudFormation then assumes that execution role to provide your resource type with the appropriate credentials.", - "pattern": "", + "pattern": "arn:.+:iam::[0-9]{12}:role/.+", "maxLength": 256, "type": "string" }, @@ -55,12 +55,12 @@ }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", "type": "string" }, "VersionId": { "description": "The ID of the version of the type represented by this hook instance.", - "pattern": "", + "pattern": "^[A-Za-z0-9-]{1,128}$", "type": "string" }, "Visibility": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleDefaultVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleDefaultVersion.json index c0ffc215d3..6fd83df1dd 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleDefaultVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleDefaultVersion.json @@ -5,17 +5,17 @@ "properties": { "Arn": { "description": "The Amazon Resource Name (ARN) of the module version to set as the default version.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/module/.+/[0-9]{8}$", "type": "string" }, "ModuleName": { "description": "The name of a module existing in the registry.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::MODULE", "type": "string" }, "VersionId": { "description": "The ID of an existing version of the named module to set as the default.", - "pattern": "", + "pattern": "^[0-9]{8}$", "type": "string" } }, diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleVersion.json index 20966b9baa..7888483340 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_ModuleVersion.json @@ -5,7 +5,7 @@ "properties": { "Arn": { "description": "The Amazon Resource Name (ARN) of the module.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/module/.+$", "type": "string" }, "Description": { @@ -21,7 +21,7 @@ }, "ModuleName": { "description": "The name of the module being registered.\n\nRecommended module naming pattern: company_or_organization::service::type::MODULE.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::MODULE", "type": "string" }, "ModulePackage": { @@ -44,7 +44,7 @@ }, "VersionId": { "description": "The version ID of the module represented by this module instance.", - "pattern": "", + "pattern": "^[0-9]{8}$", "type": "string" }, "Visibility": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_PublicTypeVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_PublicTypeVersion.json index 68ca777d55..fd20d0bae2 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_PublicTypeVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_PublicTypeVersion.json @@ -5,12 +5,12 @@ "properties": { "Arn": { "description": "The Amazon Resource Number (ARN) of the extension.", - "pattern": "", + "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:[0-9]{12}:type/.+", "type": "string" }, "TypeVersionArn": { "description": "The Amazon Resource Number (ARN) of the extension with the versionId.", - "pattern": "", + "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:[0-9]{12}:type/.+", "type": "string" }, "PublicVersionNumber": { @@ -21,20 +21,20 @@ }, "PublisherId": { "description": "The publisher id assigned by CloudFormation for publishing in this region.", - "pattern": "", + "pattern": "[0-9a-zA-Z]{40}", "type": "string", "minLength": 1, "maxLength": 40 }, "PublicTypeArn": { "description": "The Amazon Resource Number (ARN) assigned to the public extension upon publication", - "pattern": "", + "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+", "type": "string", "maxLength": 1024 }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}", "type": "string" }, "LogDeliveryBucket": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_Publisher.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_Publisher.json index 012684a728..8e635a839d 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_Publisher.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_Publisher.json @@ -9,7 +9,7 @@ }, "PublisherId": { "description": "The publisher id assigned by CloudFormation for publishing in this region.", - "pattern": "", + "pattern": "[0-9a-zA-Z]{40}", "type": "string", "minLength": 1, "maxLength": 40 @@ -17,7 +17,7 @@ "ConnectionArn": { "description": "If you are using a Bitbucket or GitHub account for identity verification, the Amazon Resource Name (ARN) for your connection to that account.", "type": "string", - "pattern": "" + "pattern": "arn:aws(-[w]+)*:.+:.+:[0-9]{12}:.+" }, "PublisherStatus": { "description": "Whether the publisher is verified.", @@ -26,7 +26,7 @@ }, "PublisherProfile": { "description": "The URL to the publisher's profile with the identity provider.", - "pattern": "", + "pattern": "(http:|https:)+[^s]+[w]", "type": "string", "maxLength": 1024 }, diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceDefaultVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceDefaultVersion.json index d9e2424020..a05b117751 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceDefaultVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceDefaultVersion.json @@ -5,22 +5,22 @@ "properties": { "TypeVersionArn": { "description": "The Amazon Resource Name (ARN) of the type version.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", "type": "string" }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", "type": "string" }, "Arn": { "description": "The Amazon Resource Name (ARN) of the type. This is used to uniquely identify a ResourceDefaultVersion", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", "type": "string" }, "VersionId": { "description": "The ID of an existing version of the resource to set as the default.", - "pattern": "", + "pattern": "^[A-Za-z0-9-]{1,128}$", "type": "string" } }, diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceVersion.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceVersion.json index 588024275f..c97b757ed9 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceVersion.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_ResourceVersion.json @@ -9,7 +9,7 @@ "LogGroupName": { "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", "type": "string", - "pattern": "", + "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", "minLength": 1, "maxLength": 512 }, @@ -26,12 +26,12 @@ "properties": { "Arn": { "description": "The Amazon Resource Name (ARN) of the type, here the ResourceVersion. This is used to uniquely identify a ResourceVersion resource", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", "type": "string" }, "TypeArn": { "description": "The Amazon Resource Name (ARN) of the type without the versionID.", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", "type": "string" }, "ExecutionRoleArn": { @@ -61,12 +61,12 @@ }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", "type": "string" }, "VersionId": { "description": "The ID of the version of the type represented by this resource instance.", - "pattern": "", + "pattern": "^[A-Za-z0-9-]{1,128}$", "type": "string" }, "Visibility": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_StackSet.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_StackSet.json index f370fe382b..0382a94358 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_StackSet.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_StackSet.json @@ -50,15 +50,15 @@ "Account": { "description": "AWS account that you want to create stack instances in the specified Region(s) for.", "type": "string", - "pattern": "" + "pattern": "^[0-9]{12}$" }, "Region": { "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9-]{1,128}$" }, "OrganizationalUnitId": { "type": "string", - "pattern": "" + "pattern": "^(ou-[a-z0-9]{4,32}-[a-z0-9]{8,32}|r-[a-z0-9]{4,32})$" }, "Capability": { "type": "string", @@ -197,7 +197,7 @@ "StackSetName": { "description": "The name to associate with the stack set. The name must be unique in the Region where you create your stack set.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z][a-zA-Z0-9\\-]{0,127}$", "maxLength": 128 }, "StackSetId": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFormation_TypeActivation.json b/internal/service/cloudformation/schemas/AWS_CloudFormation_TypeActivation.json index b7e2be8b40..05a43c6d21 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFormation_TypeActivation.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFormation_TypeActivation.json @@ -9,7 +9,7 @@ "LogGroupName": { "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", "type": "string", - "pattern": "", + "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", "minLength": 1, "maxLength": 512 }, @@ -26,7 +26,7 @@ "properties": { "Arn": { "description": "The Amazon Resource Name (ARN) of the extension.", - "pattern": "", + "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+", "type": "string" }, "ExecutionRoleArn": { @@ -35,7 +35,7 @@ }, "PublisherId": { "description": "The publisher id assigned by CloudFormation for publishing in this region.", - "pattern": "", + "pattern": "[0-9a-zA-Z]{40}", "type": "string", "minLength": 1, "maxLength": 40 @@ -46,7 +46,7 @@ }, "PublicTypeArn": { "description": "The Amazon Resource Number (ARN) assigned to the public extension upon publication", - "pattern": "", + "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+", "type": "string", "maxLength": 1024 }, @@ -56,7 +56,7 @@ }, "TypeNameAlias": { "description": "An alias to assign to the public extension in this account and region. If you specify an alias for the extension, you must then use the alias to refer to the extension in your templates.", - "pattern": "", + "pattern": "[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}", "type": "string", "minLength": 10, "maxLength": 204 @@ -74,7 +74,7 @@ }, "TypeName": { "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - "pattern": "", + "pattern": "[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}", "type": "string" }, "Type": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFront_CachePolicy.json b/internal/service/cloudformation/schemas/AWS_CloudFront_CachePolicy.json index c48f565317..aaf07ce6d9 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFront_CachePolicy.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFront_CachePolicy.json @@ -42,7 +42,7 @@ "additionalProperties": false, "properties": { "CookieBehavior": { - "pattern": "", + "pattern": "^(none|whitelist|allExcept|all)$", "type": "string" }, "Cookies": { @@ -62,7 +62,7 @@ "additionalProperties": false, "properties": { "HeaderBehavior": { - "pattern": "", + "pattern": "^(none|whitelist)$", "type": "string" }, "Headers": { @@ -109,7 +109,7 @@ "additionalProperties": false, "properties": { "QueryStringBehavior": { - "pattern": "", + "pattern": "^(none|whitelist|allExcept|all)$", "type": "string" }, "QueryStrings": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFront_OriginRequestPolicy.json b/internal/service/cloudformation/schemas/AWS_CloudFront_OriginRequestPolicy.json index 7651c6364f..c9021040c5 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFront_OriginRequestPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFront_OriginRequestPolicy.json @@ -5,7 +5,7 @@ "additionalProperties": false, "properties": { "CookieBehavior": { - "pattern": "", + "pattern": "^(none|whitelist|all)$", "type": "string" }, "Cookies": { @@ -25,7 +25,7 @@ "additionalProperties": false, "properties": { "HeaderBehavior": { - "pattern": "", + "pattern": "^(none|whitelist|allViewer|allViewerAndWhitelistCloudFront)$", "type": "string" }, "Headers": { @@ -72,7 +72,7 @@ "additionalProperties": false, "properties": { "QueryStringBehavior": { - "pattern": "", + "pattern": "^(none|whitelist|all)$", "type": "string" }, "QueryStrings": { diff --git a/internal/service/cloudformation/schemas/AWS_CloudFront_ResponseHeadersPolicy.json b/internal/service/cloudformation/schemas/AWS_CloudFront_ResponseHeadersPolicy.json index 5868eb226b..e24cb39818 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudFront_ResponseHeadersPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_CloudFront_ResponseHeadersPolicy.json @@ -168,7 +168,7 @@ "additionalProperties": false, "properties": { "FrameOption": { - "pattern": "", + "pattern": "^(DENY|SAMEORIGIN)$", "type": "string" }, "Override": { @@ -188,7 +188,7 @@ "type": "boolean" }, "ReferrerPolicy": { - "pattern": "", + "pattern": "^(no-referrer|no-referrer-when-downgrade|origin|origin-when-cross-origin|same-origin|strict-origin|strict-origin-when-cross-origin|unsafe-url)$", "type": "string" } }, diff --git a/internal/service/cloudformation/schemas/AWS_CloudTrail_Trail.json b/internal/service/cloudformation/schemas/AWS_CloudTrail_Trail.json index 724b54853a..4538ec9c08 100644 --- a/internal/service/cloudformation/schemas/AWS_CloudTrail_Trail.json +++ b/internal/service/cloudformation/schemas/AWS_CloudTrail_Trail.json @@ -161,7 +161,7 @@ }, "TrailName": { "type": "string", - "pattern": "", + "pattern": "(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9]([a-zA-Z0-9\\._-])*[a-zA-Z0-9]$)", "minLength": 3, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_CodeArtifact_Domain.json b/internal/service/cloudformation/schemas/AWS_CodeArtifact_Domain.json index 691b0afd1c..adabd705c2 100644 --- a/internal/service/cloudformation/schemas/AWS_CodeArtifact_Domain.json +++ b/internal/service/cloudformation/schemas/AWS_CodeArtifact_Domain.json @@ -31,20 +31,20 @@ "DomainName": { "description": "The name of the domain.", "type": "string", - "pattern": "", + "pattern": "^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$", "minLength": 2, "maxLength": 50 }, "Name": { "description": "The name of the domain. This field is used for GetAtt", "type": "string", - "pattern": "", + "pattern": "^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$", "minLength": 2, "maxLength": 50 }, "Owner": { "description": "The 12-digit account ID of the AWS account that owns the domain. This field is used for GetAtt", - "pattern": "", + "pattern": "[0-9]{12}", "type": "string" }, "EncryptionKey": { diff --git a/internal/service/cloudformation/schemas/AWS_CodeArtifact_Repository.json b/internal/service/cloudformation/schemas/AWS_CodeArtifact_Repository.json index e83c369714..4da2199105 100644 --- a/internal/service/cloudformation/schemas/AWS_CodeArtifact_Repository.json +++ b/internal/service/cloudformation/schemas/AWS_CodeArtifact_Repository.json @@ -31,27 +31,27 @@ "RepositoryName": { "description": "The name of the repository.", "type": "string", - "pattern": "", + "pattern": "^([A-Za-z0-9][A-Za-z0-9._\\-]{1,99})$", "minLength": 2, "maxLength": 100 }, "Name": { "description": "The name of the repository. This is used for GetAtt", "type": "string", - "pattern": "", + "pattern": "^([A-Za-z0-9][A-Za-z0-9._\\-]{1,99})$", "minLength": 2, "maxLength": 100 }, "DomainName": { "description": "The name of the domain that contains the repository.", "type": "string", - "pattern": "", + "pattern": "^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$", "minLength": 2, "maxLength": 50 }, "DomainOwner": { "description": "The 12-digit account ID of the AWS account that owns the domain.", - "pattern": "", + "pattern": "[0-9]{12}", "type": "string" }, "Description": { diff --git a/internal/service/cloudformation/schemas/AWS_CodeGuruProfiler_ProfilingGroup.json b/internal/service/cloudformation/schemas/AWS_CodeGuruProfiler_ProfilingGroup.json index f45a399f0d..71bdfdd801 100644 --- a/internal/service/cloudformation/schemas/AWS_CodeGuruProfiler_ProfilingGroup.json +++ b/internal/service/cloudformation/schemas/AWS_CodeGuruProfiler_ProfilingGroup.json @@ -5,11 +5,11 @@ "definitions": { "ProfilingGroupArn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws([-\\w]*):codeguru-profiler:(([a-z]+-)+[0-9]+):([0-9]{12}):profilingGroup/[^.]+$" }, "IamArn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws([-\\w]*):iam::([0-9]{12}):[\\S]+$" }, "Tag": { "description": "A key-value pair to associate with a resource.", @@ -37,12 +37,12 @@ "ChannelId": { "description": "Unique identifier for each Channel in the notification configuration of a Profiling Group", "type": "string", - "pattern": "" + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" }, "ChannelUri": { "description": "Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.", "type": "string", - "pattern": "" + "pattern": "^arn:aws([-\\w]*):[a-z-]+:(([a-z]+-)+[0-9]+)?:([0-9]{12}):[^.]+$" }, "Channel": { "description": "Notification medium for users to get alerted for events that occur in application profile. We support SNS topic as a notification channel.", @@ -66,7 +66,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[\\w-]+$" }, "ComputePlatform": { "description": "The compute platform of the profiling group.", diff --git a/internal/service/cloudformation/schemas/AWS_CodeGuruReviewer_RepositoryAssociation.json b/internal/service/cloudformation/schemas/AWS_CodeGuruReviewer_RepositoryAssociation.json index 45219d895f..f077a5a11c 100644 --- a/internal/service/cloudformation/schemas/AWS_CodeGuruReviewer_RepositoryAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_CodeGuruReviewer_RepositoryAssociation.json @@ -33,7 +33,7 @@ "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "^\\S[\\w.-]*$" }, "Type": { "description": "The type of repository to be associated.", @@ -50,28 +50,28 @@ "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "^\\S(.*\\S)?$" }, "BucketName": { "description": "The name of the S3 bucket associated with an associated S3 repository. It must start with `codeguru-reviewer-`.", "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "^\\S(.*\\S)?$" }, "ConnectionArn": { "description": "The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.", "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+" }, "AssociationArn": { "description": "The Amazon Resource Name (ARN) of the repository association.", "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+" }, "Tags": { "description": "The tags associated with a repository association.", diff --git a/internal/service/cloudformation/schemas/AWS_CodeStarConnections_Connection.json b/internal/service/cloudformation/schemas/AWS_CodeStarConnections_Connection.json index 99f2782284..1672dba677 100644 --- a/internal/service/cloudformation/schemas/AWS_CodeStarConnections_Connection.json +++ b/internal/service/cloudformation/schemas/AWS_CodeStarConnections_Connection.json @@ -32,7 +32,7 @@ "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+" }, "ConnectionName": { "description": "The name of the connection. Connection names must be unique in an AWS user account.", @@ -49,7 +49,7 @@ "type": "string", "minLength": 12, "maxLength": 12, - "pattern": "" + "pattern": "[0-9]{12}" }, "ProviderType": { "description": "The name of the external provider where your third-party code repository is configured. You must specify either a ProviderType or a HostArn.", @@ -60,7 +60,7 @@ "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+" }, "Tags": { "description": "Specifies the tags applied to a connection.", diff --git a/internal/service/cloudformation/schemas/AWS_CodeStarNotifications_NotificationRule.json b/internal/service/cloudformation/schemas/AWS_CodeStarNotifications_NotificationRule.json index a737d23346..6bef2a98c9 100644 --- a/internal/service/cloudformation/schemas/AWS_CodeStarNotifications_NotificationRule.json +++ b/internal/service/cloudformation/schemas/AWS_CodeStarNotifications_NotificationRule.json @@ -43,7 +43,7 @@ }, "Resource": { "type": "string", - "pattern": "" + "pattern": "^arn:aws[^:\\s]*:[^:\\s]*:[^:\\s]*:[0-9]{12}:[^\\s]+$" }, "Targets": { "type": "array", @@ -58,13 +58,13 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": "[A-Za-z0-9\\-_ ]+$", "minLength": 1, "maxLength": 64 }, "Arn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws[^:\\s]*:codestar-notifications:[^:\\s]+:\\d{12}:notificationrule\\/(.*\\S)?$" } }, "definitions": { diff --git a/internal/service/cloudformation/schemas/AWS_Config_AggregationAuthorization.json b/internal/service/cloudformation/schemas/AWS_Config_AggregationAuthorization.json index 24480f7574..ead18a3ca7 100644 --- a/internal/service/cloudformation/schemas/AWS_Config_AggregationAuthorization.json +++ b/internal/service/cloudformation/schemas/AWS_Config_AggregationAuthorization.json @@ -7,7 +7,7 @@ "AuthorizedAccountId": { "description": "The 12-digit account ID of the account authorized to aggregate data.", "type": "string", - "pattern": "" + "pattern": "^\\d{12}$" }, "AuthorizedAwsRegion": { "description": "The region authorized to collect aggregated data.", @@ -103,4 +103,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Config_ConfigurationAggregator.json b/internal/service/cloudformation/schemas/AWS_Config_ConfigurationAggregator.json index 3c966cd2ab..19c12baaa9 100644 --- a/internal/service/cloudformation/schemas/AWS_Config_ConfigurationAggregator.json +++ b/internal/service/cloudformation/schemas/AWS_Config_ConfigurationAggregator.json @@ -14,7 +14,7 @@ "ConfigurationAggregatorName": { "description": "The name of the aggregator.", "type": "string", - "pattern": "", + "pattern": "[\\w\\-]+", "minLength": 1, "maxLength": 256 }, diff --git a/internal/service/cloudformation/schemas/AWS_Config_ConformancePack.json b/internal/service/cloudformation/schemas/AWS_Config_ConformancePack.json index 909aaa34c4..d201b3ae55 100644 --- a/internal/service/cloudformation/schemas/AWS_Config_ConformancePack.json +++ b/internal/service/cloudformation/schemas/AWS_Config_ConformancePack.json @@ -37,7 +37,7 @@ "ConformancePackName": { "description": "Name of the conformance pack which will be assigned as the unique identifier.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z][-a-zA-Z0-9]*", "minLength": 1, "maxLength": 256 }, @@ -62,7 +62,7 @@ "TemplateS3Uri": { "description": "Location of file containing the template body which points to the conformance pack template that is located in an Amazon S3 bucket. You can only specify one of the template body or template S3Uri fields.", "type": "string", - "pattern": "", + "pattern": "s3://.*", "minLength": 1, "maxLength": 1024 }, diff --git a/internal/service/cloudformation/schemas/AWS_Config_OrganizationConformancePack.json b/internal/service/cloudformation/schemas/AWS_Config_OrganizationConformancePack.json index ce2c9b3fad..35d36533d4 100644 --- a/internal/service/cloudformation/schemas/AWS_Config_OrganizationConformancePack.json +++ b/internal/service/cloudformation/schemas/AWS_Config_OrganizationConformancePack.json @@ -38,14 +38,14 @@ "OrganizationConformancePackName": { "description": "The name of the organization conformance pack.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z][-a-zA-Z0-9]*", "minLength": 1, "maxLength": 128 }, "TemplateS3Uri": { "description": "Location of file containing the template body.", "type": "string", - "pattern": "", + "pattern": "s3://.*", "minLength": 1, "maxLength": 1024 }, diff --git a/internal/service/cloudformation/schemas/AWS_Config_StoredQuery.json b/internal/service/cloudformation/schemas/AWS_Config_StoredQuery.json index 4364180ef3..dfa9c62378 100644 --- a/internal/service/cloudformation/schemas/AWS_Config_StoredQuery.json +++ b/internal/service/cloudformation/schemas/AWS_Config_StoredQuery.json @@ -13,25 +13,25 @@ "type": "string", "minLength": 1, "maxLength": 36, - "pattern": "" + "pattern": "^\\S+$" }, "QueryName": { "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_]+$" }, "QueryDescription": { "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "[\\s\\S]*" }, "QueryExpression": { "type": "string", "minLength": 1, "maxLength": 4096, - "pattern": "" + "pattern": "[\\s\\S]*" }, "Tags": { "description": "The tags for the stored query.", diff --git a/internal/service/cloudformation/schemas/AWS_Connect_ContactFlow.json b/internal/service/cloudformation/schemas/AWS_Connect_ContactFlow.json index 321b666cc0..d5ef1fcfd3 100644 --- a/internal/service/cloudformation/schemas/AWS_Connect_ContactFlow.json +++ b/internal/service/cloudformation/schemas/AWS_Connect_ContactFlow.json @@ -31,14 +31,14 @@ "InstanceArn": { "description": "The identifier of the Amazon Connect instance (ARN).", "type": "string", - "pattern": "", + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", "minLength": 1, "maxLength": 256 }, "ContactFlowArn": { "description": "The identifier of the contact flow (ARN).", "type": "string", - "pattern": "", + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$", "minLength": 1, "maxLength": 500 }, @@ -136,4 +136,4 @@ "createOnlyProperties": [ "/properties/Type" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Connect_ContactFlowModule.json b/internal/service/cloudformation/schemas/AWS_Connect_ContactFlowModule.json index ce28a47865..4742bd326c 100644 --- a/internal/service/cloudformation/schemas/AWS_Connect_ContactFlowModule.json +++ b/internal/service/cloudformation/schemas/AWS_Connect_ContactFlowModule.json @@ -31,14 +31,14 @@ "InstanceArn": { "description": "The identifier of the Amazon Connect instance (ARN).", "type": "string", - "pattern": "", + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", "minLength": 1, "maxLength": 256 }, "ContactFlowModuleArn": { "description": "The identifier of the contact flow module (ARN).", "type": "string", - "pattern": "", + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/flow-module/[-a-zA-Z0-9]*$", "minLength": 1, "maxLength": 256 }, @@ -47,7 +47,7 @@ "type": "string", "minLength": 1, "maxLength": 127, - "pattern": "" + "pattern": ".*\\S.*" }, "Content": { "description": "The content of the contact flow module in JSON format.", @@ -59,7 +59,7 @@ "description": "The description of the contact flow module.", "type": "string", "maxLength": 500, - "pattern": "" + "pattern": ".*\\S.*" }, "State": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_Connect_HoursOfOperation.json b/internal/service/cloudformation/schemas/AWS_Connect_HoursOfOperation.json index d238570715..0ae862301d 100644 --- a/internal/service/cloudformation/schemas/AWS_Connect_HoursOfOperation.json +++ b/internal/service/cloudformation/schemas/AWS_Connect_HoursOfOperation.json @@ -87,7 +87,7 @@ "InstanceArn": { "description": "The identifier of the Amazon Connect instance.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$" }, "Name": { "description": "The name of the hours of operation.", @@ -118,7 +118,7 @@ "HoursOfOperationArn": { "description": "The Amazon Resource Name (ARN) for the hours of operation.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/operating-hours/[-a-zA-Z0-9]*$" }, "Tags": { "description": "One or more tags.", diff --git a/internal/service/cloudformation/schemas/AWS_Connect_QuickConnect.json b/internal/service/cloudformation/schemas/AWS_Connect_QuickConnect.json index d15cf0ebe6..4791efb465 100644 --- a/internal/service/cloudformation/schemas/AWS_Connect_QuickConnect.json +++ b/internal/service/cloudformation/schemas/AWS_Connect_QuickConnect.json @@ -15,22 +15,22 @@ "PhoneNumber": { "description": "The phone number in E.164 format.", "type": "string", - "pattern": "" + "pattern": "^\\+[1-9]\\d{1,14}$" }, "ContactFlowArn": { "description": "The identifier of the contact flow.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$" }, "QueueArn": { "description": "The identifier for the queue.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/queue/[-a-zA-Z0-9]*$" }, "UserArn": { "description": "The identifier of the user.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$" }, "PhoneNumberQuickConnectConfig": { "description": "The phone configuration. This is required only if QuickConnectType is PHONE_NUMBER.", @@ -129,7 +129,7 @@ "InstanceArn": { "description": "The identifier of the Amazon Connect instance.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$" }, "Name": { "description": "The name of the quick connect.", @@ -150,7 +150,7 @@ "QuickConnectArn": { "description": "The Amazon Resource Name (ARN) for the quick connect.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/transfer-destination/[-a-zA-Z0-9]*$" }, "Tags": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_Connect_User.json b/internal/service/cloudformation/schemas/AWS_Connect_User.json index 96ede732d6..153567a788 100644 --- a/internal/service/cloudformation/schemas/AWS_Connect_User.json +++ b/internal/service/cloudformation/schemas/AWS_Connect_User.json @@ -18,7 +18,7 @@ "SecurityProfileArn": { "description": "The identifier of the security profile for the user.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/security-profile/[-a-zA-Z0-9]*$" }, "AfterContactWorkTimeLimit": { "description": "The After Call Work (ACW) timeout setting, in seconds.", @@ -107,7 +107,7 @@ "InstanceArn": { "description": "The identifier of the Amazon Connect instance.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$" }, "DirectoryUserId": { "description": "The identifier of the user account in the directory used for identity management.", @@ -116,14 +116,14 @@ "HierarchyGroupArn": { "description": "The identifier of the hierarchy group for the user.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$" }, "Username": { "description": "The user name for the account.", "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "[a-zA-Z0-9\\_\\-\\.\\@]+" }, "Password": { "description": "The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.", @@ -133,7 +133,7 @@ "RoutingProfileArn": { "description": "The identifier of the routing profile for the user.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/routing-profile/[-a-zA-Z0-9]*$" }, "IdentityInfo": { "description": "The information about the identity of the user.", @@ -157,7 +157,7 @@ "UserArn": { "description": "The Amazon Resource Name (ARN) for the user.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$" }, "Tags": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_Connect_UserHierarchyGroup.json b/internal/service/cloudformation/schemas/AWS_Connect_UserHierarchyGroup.json index f3a0f93f44..c2dafe8d43 100644 --- a/internal/service/cloudformation/schemas/AWS_Connect_UserHierarchyGroup.json +++ b/internal/service/cloudformation/schemas/AWS_Connect_UserHierarchyGroup.json @@ -6,14 +6,14 @@ "UserHierarchyGroupArn": { "description": "The Amazon Resource Name (ARN) for the user hierarchy group.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$" } }, "properties": { "InstanceArn": { "description": "The identifier of the Amazon Connect instance.", "type": "string", - "pattern": "" + "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$" }, "UserHierarchyGroupArn": { "description": "The Amazon Resource Name (ARN) for the user hierarchy group.", diff --git a/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Domain.json b/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Domain.json index 321b78cd3d..9fb0cfcb15 100644 --- a/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Domain.json +++ b/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Domain.json @@ -29,7 +29,7 @@ "DomainName": { "description": "The unique name of the domain.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Integration.json b/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Integration.json index 61d026d135..38af18c63a 100644 --- a/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Integration.json +++ b/internal/service/cloudformation/schemas/AWS_CustomerProfiles_Integration.json @@ -27,7 +27,7 @@ "Object": { "type": "string", "maxLength": 512, - "pattern": "", + "pattern": "\\S+", "additionalProperties": false }, "MarketoSourceProperties": { @@ -49,12 +49,12 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "\\S+" }, "BucketPrefix": { "type": "string", "maxLength": 512, - "pattern": "" + "pattern": ".*" } }, "required": [ @@ -154,7 +154,7 @@ "ConnectorProfileName": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "[\\w/!@#+=.-]+" }, "IncrementalPullConfig": { "$ref": "#/definitions/IncrementalPullConfig" @@ -355,7 +355,7 @@ "DestinationField": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": ".*" }, "TaskType": { "type": "string", @@ -378,7 +378,7 @@ "Property": { "type": "string", "maxLength": 2048, - "pattern": "" + "pattern": ".+" } }, "required": [ @@ -398,7 +398,7 @@ "items": { "type": "string", "maxLength": 2048, - "pattern": "" + "pattern": ".*" } }, "DestinationField": { @@ -437,7 +437,7 @@ "ScheduleExpression": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": ".*" }, "DataPullMode": { "type": "string", @@ -455,7 +455,7 @@ "Timezone": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": ".*" }, "ScheduleOffset": { "type": "integer", @@ -500,17 +500,17 @@ "properties": { "FlowName": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9][\\w!@#.-]+", "maxLength": 256 }, "Description": { "type": "string", - "pattern": "", + "pattern": "[\\w!@#\\-.?,\\s]*", "maxLength": 2048 }, "KmsArn": { "type": "string", - "pattern": "", + "pattern": "arn:aws:kms:.*:[0-9]+:.*", "minLength": 20, "maxLength": 2048 }, @@ -546,7 +546,7 @@ }, "Value": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", "minLength": 1, "maxLength": 255 } @@ -562,7 +562,7 @@ "DomainName": { "description": "The unique name of the domain.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 }, @@ -578,7 +578,7 @@ "ObjectTypeName": { "description": "The name of the ObjectType defined for the 3rd party data in Profile Service", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_CustomerProfiles_ObjectType.json b/internal/service/cloudformation/schemas/AWS_CustomerProfiles_ObjectType.json index 4e23e5305f..cb380c130e 100644 --- a/internal/service/cloudformation/schemas/AWS_CustomerProfiles_ObjectType.json +++ b/internal/service/cloudformation/schemas/AWS_CustomerProfiles_ObjectType.json @@ -29,7 +29,7 @@ "properties": { "Name": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 }, @@ -74,7 +74,7 @@ "properties": { "Name": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 }, @@ -97,7 +97,7 @@ "type": "array", "items": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 } @@ -124,14 +124,14 @@ "DomainName": { "description": "The unique name of the domain.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 }, "ObjectTypeName": { "description": "The name of the profile object type.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", "minLength": 1, "maxLength": 255 }, @@ -193,7 +193,7 @@ "TemplateId": { "description": "A unique identifier for the object template.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 64 } diff --git a/internal/service/cloudformation/schemas/AWS_DataBrew_Dataset.json b/internal/service/cloudformation/schemas/AWS_DataBrew_Dataset.json index 5a999cafee..cde2a78b0e 100644 --- a/internal/service/cloudformation/schemas/AWS_DataBrew_Dataset.json +++ b/internal/service/cloudformation/schemas/AWS_DataBrew_Dataset.json @@ -299,14 +299,14 @@ "type": "string", "minLength": 1, "maxLength": 6, - "pattern": "" + "pattern": "^(Z|[-+](\\d|\\d{2}|\\d{2}:?\\d{2}))$" }, "LocaleCode": { "description": "Locale code for a date parameter", "type": "string", "minLength": 2, "maxLength": 100, - "pattern": "" + "pattern": "^[A-Za-z0-9_\\.#@\\-]+$" } }, "additionalProperties": false, @@ -320,7 +320,7 @@ "type": "string", "minLength": 4, "maxLength": 1024, - "pattern": "" + "pattern": "^[><0-9A-Za-z_.,:)(!= ]+$" }, "ValuesMap": { "type": "array", @@ -342,7 +342,7 @@ "type": "string", "minLength": 2, "maxLength": 128, - "pattern": "" + "pattern": "^:[A-Za-z0-9_]+$" }, "Value": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_DataBrew_Job.json b/internal/service/cloudformation/schemas/AWS_DataBrew_Job.json index 150d2c938b..1586db615b 100644 --- a/internal/service/cloudformation/schemas/AWS_DataBrew_Job.json +++ b/internal/service/cloudformation/schemas/AWS_DataBrew_Job.json @@ -397,7 +397,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[A-Z_][A-Z\\\\d_]*$" } }, "AllowedStatistics": { @@ -480,7 +480,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[A-Z\\_]+$" }, "StatisticOverride": { "type": "object", diff --git a/internal/service/cloudformation/schemas/AWS_DataBrew_Ruleset.json b/internal/service/cloudformation/schemas/AWS_DataBrew_Ruleset.json index 47a5da040f..4d6337a66c 100644 --- a/internal/service/cloudformation/schemas/AWS_DataBrew_Ruleset.json +++ b/internal/service/cloudformation/schemas/AWS_DataBrew_Ruleset.json @@ -9,7 +9,7 @@ "type": "string", "minLength": 4, "maxLength": 1024, - "pattern": "" + "pattern": "^[><0-9A-Za-z_.,:)(!= ]+$" }, "SubstitutionValue": { "description": "A key-value pair to associate expression's substitution variable names with their values", @@ -20,7 +20,7 @@ "type": "string", "minLength": 2, "maxLength": 128, - "pattern": "" + "pattern": "^:[A-Za-z0-9_]+$" }, "Value": { "description": "Value or column name", diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_Agent.json b/internal/service/cloudformation/schemas/AWS_DataSync_Agent.json index c2175d66a2..770cf93b0c 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_Agent.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_Agent.json @@ -11,14 +11,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -33,14 +33,14 @@ "AgentName": { "description": "The name configured for the agent. Text reference used to identify the agent in the console.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 }, "ActivationKey": { "description": "Activation key of the Agent.", "type": "string", - "pattern": "", + "pattern": "[A-Z0-9]{5}(-[A-Z0-9]{5}){4}", "maxLength": 29 }, "SecurityGroupArns": { @@ -49,7 +49,7 @@ "insertionOrder": false, "items": { "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$", "maxLength": 128 } }, @@ -59,14 +59,14 @@ "insertionOrder": false, "items": { "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$", "maxLength": 128 } }, "VpcEndpointId": { "description": "The ID of the VPC endpoint that the agent has access to.", "type": "string", - "pattern": "" + "pattern": "^vpce-[0-9a-f]{17}$" }, "EndpointType": { "description": "The service endpoints that the agent will connect to.", @@ -90,7 +90,7 @@ "AgentArn": { "description": "The DataSync Agent ARN.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", "maxLength": 128 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationEFS.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationEFS.json index 70c18b7b88..1bdf7622ca 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationEFS.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationEFS.json @@ -13,7 +13,7 @@ "type": "array", "items": { "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$", "maxLength": 128 }, "minItems": 1, @@ -23,7 +23,7 @@ "SubnetArn": { "description": "The ARN of the subnet that DataSync uses to access the target EFS file system.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$", "maxLength": 128 } }, @@ -40,14 +40,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -65,14 +65,14 @@ "EfsFilesystemArn": { "description": "The Amazon Resource Name (ARN) for the Amazon EFS file system.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):elasticfilesystem:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$", "maxLength": 128 }, "Subdirectory": { "description": "A subdirectory in the location's path. This subdirectory in the EFS file system is used to read data from the EFS source location or write data to the EFS destination.", "type": "string", "maxLength": 4096, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", @@ -87,13 +87,13 @@ "LocationArn": { "description": "The Amazon Resource Name (ARN) of the Amazon EFS file system location that is created.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the EFS location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9.\\-/]+$", "maxLength": 4356 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationFSxWindows.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationFSxWindows.json index a347e9afe7..fc7dc3bb13 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationFSxWindows.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationFSxWindows.json @@ -11,14 +11,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -34,19 +34,19 @@ "description": "The name of the Windows domain that the FSx for Windows server belongs to.", "type": "string", "maxLength": 253, - "pattern": "" + "pattern": "^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$" }, "FsxFilesystemArn": { "description": "The Amazon Resource Name (ARN) for the FSx for Windows file system.", "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):fsx:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$" }, "Password": { "description": "The password of the user who has the permissions to access files and folders in the FSx for Windows file system.", "type": "string", "maxLength": 104, - "pattern": "" + "pattern": "^.{0,104}$" }, "SecurityGroupArns": { "description": "The ARNs of the security groups that are to use to configure the FSx for Windows file system.", @@ -54,7 +54,7 @@ "items": { "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$" }, "insertionOrder": false }, @@ -62,13 +62,13 @@ "description": "A subdirectory in the location's path.", "type": "string", "maxLength": 4096, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$" }, "User": { "description": "The user who has the permissions to access files and folders in the FSx for Windows file system.", "type": "string", "maxLength": 104, - "pattern": "" + "pattern": "^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", @@ -83,13 +83,13 @@ "LocationArn": { "description": "The Amazon Resource Name (ARN) of the Amazon FSx for Windows file system location that is created.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the FSx for Windows location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$", "maxLength": 4356 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationHDFS.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationHDFS.json index e8f4dc46cf..242a340f98 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationHDFS.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationHDFS.json @@ -11,7 +11,7 @@ "Hostname": { "description": "The DNS name or IP address of the Name Node in the customer's on premises HDFS cluster.", "type": "string", - "pattern": "", + "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", "maxLength": 255 }, "Port": { @@ -109,7 +109,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^kms:\\/\\/http[s]?@(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])(;(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9]))*:[0-9]{1,5}\\/kms$" }, "QopConfiguration": { "$ref": "#/definitions/QopConfiguration" @@ -125,14 +125,14 @@ "SimpleUser": { "description": "The user name that has read and write permissions on the specified HDFS cluster.", "type": "string", - "pattern": "", + "pattern": "^[_.A-Za-z0-9][-_.A-Za-z0-9]*$", "minLength": 1, "maxLength": 256 }, "KerberosPrincipal": { "description": "The unique identity, or principal, to which Kerberos can assign tickets.", "type": "string", - "pattern": "", + "pattern": "^.+$", "minLength": 1, "maxLength": 256 }, @@ -159,7 +159,7 @@ "type": "array", "items": { "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", "maxLength": 128 }, "minItems": 1, @@ -170,18 +170,18 @@ "description": "The subdirectory in HDFS that is used to read data from the HDFS source location or write data to the HDFS destination.", "type": "string", "maxLength": 4096, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$" }, "LocationArn": { "description": "The Amazon Resource Name (ARN) of the HDFS location.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the HDFS location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw|hdfs)://[a-zA-Z0-9.:/\\-]+$", "maxLength": 4356 } }, @@ -244,4 +244,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationNFS.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationNFS.json index c1e81abd76..f147966fdb 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationNFS.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationNFS.json @@ -30,7 +30,7 @@ "type": "array", "items": { "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", "maxLength": 128 }, "minItems": 1, @@ -50,14 +50,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -81,14 +81,14 @@ "ServerHostname": { "description": "The name of the NFS server. This value is the IP address or DNS name of the NFS server.", "type": "string", - "pattern": "", + "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", "maxLength": 255 }, "Subdirectory": { "description": "The subdirectory in the NFS file system that is used to read data from the NFS source location or write data to the NFS destination.", "type": "string", "maxLength": 4096, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", @@ -103,13 +103,13 @@ "LocationArn": { "description": "The Amazon Resource Name (ARN) of the NFS location.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the NFS location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$", "maxLength": 4356 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationObjectStorage.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationObjectStorage.json index b652b84366..941d87b36c 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationObjectStorage.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationObjectStorage.json @@ -11,14 +11,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -35,7 +35,7 @@ "type": "string", "minLength": 8, "maxLength": 200, - "pattern": "" + "pattern": "^.+$" }, "AgentArns": { "description": "The Amazon Resource Name (ARN) of the agents associated with the self-managed object storage server location.", @@ -43,7 +43,7 @@ "items": { "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$" }, "minItems": 1, "maxItems": 4, @@ -54,20 +54,20 @@ "type": "string", "maxLength": 63, "minLength": 3, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$" }, "SecretKey": { "description": "Optional. The secret key is used if credentials are required to access the self-managed object storage server.", "type": "string", "minLength": 8, "maxLength": 200, - "pattern": "" + "pattern": "^.+$" }, "ServerHostname": { "description": "The name of the self-managed object storage server. This value is the IP address or Domain Name Service (DNS) name of the object storage server.", "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$" }, "ServerPort": { "description": "The port that your self-managed server accepts inbound network traffic on.", @@ -87,7 +87,7 @@ "description": "The subdirectory in the self-managed object storage server that is used to read data from.", "type": "string", "maxLength": 4096, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\p{Zs}]*$" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", @@ -102,13 +102,13 @@ "LocationArn": { "description": "The Amazon Resource Name (ARN) of the location that is created.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the object storage location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw|object-storage)://[a-zA-Z0-9./\\-]+$", "maxLength": 4356 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationS3.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationS3.json index 7c8e1d3027..36a1e82314 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationS3.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationS3.json @@ -11,7 +11,7 @@ "BucketAccessRoleArn": { "description": "The ARN of the IAM role of the Amazon S3 bucket.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):iam::[0-9]{12}:role/.*$", "maxLength": 2048 } }, @@ -27,14 +27,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -53,13 +53,13 @@ "description": "The Amazon Resource Name (ARN) of the Amazon S3 bucket.", "type": "string", "maxLength": 156, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):s3:[a-z\\-0-9]*:[0-9]*:.*$" }, "Subdirectory": { "description": "A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is used to read data from the S3 source location or write data to the S3 destination.", "type": "string", "maxLength": 1024, - "pattern": "" + "pattern": "^[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}\\p{C}]*$" }, "S3StorageClass": { "description": "The Amazon S3 storage class you want to store your files in when this location is used as a task destination.", @@ -87,13 +87,13 @@ "LocationArn": { "description": "The Amazon Resource Name (ARN) of the Amazon S3 bucket location.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the S3 location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9.\\-/]+$", "maxLength": 4356 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_LocationSMB.json b/internal/service/cloudformation/schemas/AWS_DataSync_LocationSMB.json index 56f357ac4d..76933b255f 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_LocationSMB.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_LocationSMB.json @@ -27,14 +27,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -51,7 +51,7 @@ "type": "array", "items": { "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", "maxLength": 128 }, "minItems": 1, @@ -62,7 +62,7 @@ "description": "The name of the Windows domain that the SMB server belongs to.", "type": "string", "maxLength": 253, - "pattern": "" + "pattern": "^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$" }, "MountOptions": { "$ref": "#/definitions/MountOptions", @@ -74,25 +74,25 @@ "description": "The password of the user who can mount the share and has the permissions to access files and folders in the SMB share.", "type": "string", "maxLength": 104, - "pattern": "" + "pattern": "^.{0,104}$" }, "ServerHostname": { "description": "The name of the SMB server. This value is the IP address or Domain Name Service (DNS) name of the SMB server.", "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$" }, "Subdirectory": { "description": "The subdirectory in the SMB file system that is used to read data from the SMB source location or write data to the SMB destination", "type": "string", "maxLength": 4096, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$" }, "User": { "description": "The user who can mount the share, has the permissions to access files and folders in the SMB share.", "type": "string", "maxLength": 104, - "pattern": "" + "pattern": "^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", @@ -107,13 +107,13 @@ "LocationArn": { "description": "The Amazon Resource Name (ARN) of the SMB location that is created.", "type": "string", - "pattern": "", + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", "maxLength": 128 }, "LocationUri": { "description": "The URL of the SMB location that was described.", "type": "string", - "pattern": "", + "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$", "maxLength": 4356 } }, diff --git a/internal/service/cloudformation/schemas/AWS_DataSync_Task.json b/internal/service/cloudformation/schemas/AWS_DataSync_Task.json index 1c61cc451c..6fc9d1901f 100644 --- a/internal/service/cloudformation/schemas/AWS_DataSync_Task.json +++ b/internal/service/cloudformation/schemas/AWS_DataSync_Task.json @@ -14,13 +14,13 @@ "enum": [ "SIMPLE_PATTERN" ], - "pattern": "", + "pattern": "^[A-Z0-9_]+$", "maxLength": 128 }, "Value": { "description": "A single filter string that consists of the patterns to include or exclude. The patterns are delimited by \"|\".", "type": "string", - "pattern": "", + "pattern": "^[^\\x00]+$", "maxLength": 409600 } } @@ -33,14 +33,14 @@ "Key": { "type": "string", "description": "The key for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", "maxLength": 256, "minLength": 1 }, "Value": { "type": "string", "description": "The value for an AWS resource tag.", - "pattern": "", + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", "maxLength": 256, "minLength": 1 } @@ -59,7 +59,7 @@ "description": "A cron expression that specifies when AWS DataSync initiates a scheduled transfer from a source to a destination location", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\ \\_\\*\\?\\,\\|\\^\\-\\/\\#\\s\\(\\)\\+]*$" } }, "required": [ @@ -195,7 +195,7 @@ "type": "array", "items": { "type": "string", - "pattern": "" + "pattern": "^arn:aws[\\-a-z]{0,}:ec2:[a-z\\-0-9]*:[0-9]{12}:network-interface/eni-[0-9a-f]+$" }, "maxItems": 128, "insertionOrder": false @@ -205,7 +205,7 @@ "type": "array", "items": { "type": "string", - "pattern": "" + "pattern": "^arn:aws[\\-a-z]{0,}:ec2:[a-z\\-0-9]*:[0-9]{12}:network-interface/eni-[0-9a-f]+$" }, "maxItems": 128, "insertionOrder": false @@ -244,20 +244,20 @@ "description": "The ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task.", "type": "string", "maxLength": 562, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\\-0-9]*:[0-9]{12}:log-group:([^:\\*]*)(:\\*)?$" }, "DestinationLocationArn": { "description": "The ARN of an AWS storage resource's location.", "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$" }, "Name": { "description": "The name of a task. This value is a text reference that is used to identify the task in the console.", "type": "string", "maxLength": 256, "minLength": 1, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$" }, "Options": { "$ref": "#/definitions/Options" @@ -269,13 +269,13 @@ "description": "The ARN of the source location for the task.", "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$" }, "TaskArn": { "description": "The ARN of the task.", "type": "string", "maxLength": 128, - "pattern": "" + "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]*:[0-9]{12}:task/task-[0-9a-f]{17}$" }, "ErrorCode": { "description": "Errors that AWS DataSync encountered during execution of the task. You can use this error code to help troubleshoot issues.", diff --git a/internal/service/cloudformation/schemas/AWS_Detective_MemberInvitation.json b/internal/service/cloudformation/schemas/AWS_Detective_MemberInvitation.json index 35fe3a74aa..04b813f12f 100644 --- a/internal/service/cloudformation/schemas/AWS_Detective_MemberInvitation.json +++ b/internal/service/cloudformation/schemas/AWS_Detective_MemberInvitation.json @@ -6,17 +6,17 @@ "GraphArn": { "description": "The ARN of the graph to which the member account will be invited", "type": "string", - "pattern": "" + "pattern": "arn:aws(-[\\w]+)*:detective:(([a-z]+-)+[0-9]+):[0-9]{12}:graph:[0-9a-f]{32}" }, "MemberId": { "description": "The AWS account ID to be invited to join the graph as a member", "type": "string", - "pattern": "" + "pattern": "[0-9]{12}" }, "MemberEmailAddress": { "description": "The root email address for the account to be invited, for validation. Updating this field has no effect.", "type": "string", - "pattern": "" + "pattern": ".*@.*" }, "DisableEmailNotification": { "description": "When set to true, invitation emails are not sent to the member accounts. Member accounts must still accept the invitation before they are added to the behavior graph. Updating this field has no effect.", diff --git a/internal/service/cloudformation/schemas/AWS_DevOpsGuru_NotificationChannel.json b/internal/service/cloudformation/schemas/AWS_DevOpsGuru_NotificationChannel.json index f81c4baff1..4a80fd68c3 100644 --- a/internal/service/cloudformation/schemas/AWS_DevOpsGuru_NotificationChannel.json +++ b/internal/service/cloudformation/schemas/AWS_DevOpsGuru_NotificationChannel.json @@ -21,7 +21,7 @@ "type": "string", "minLength": 36, "maxLength": 1024, - "pattern": "" + "pattern": "^arn:aws[a-z0-9-]*:sns:[a-z0-9-]+:\\d{12}:[^:]+$" } }, "additionalProperties": false @@ -36,7 +36,7 @@ "type": "string", "minLength": 36, "maxLength": 36, - "pattern": "" + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_DevOpsGuru_ResourceCollection.json b/internal/service/cloudformation/schemas/AWS_DevOpsGuru_ResourceCollection.json index c346ba92f5..076211297c 100644 --- a/internal/service/cloudformation/schemas/AWS_DevOpsGuru_ResourceCollection.json +++ b/internal/service/cloudformation/schemas/AWS_DevOpsGuru_ResourceCollection.json @@ -24,7 +24,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z*]+[a-zA-Z0-9-]*$" }, "minItems": 1, "maxItems": 200 diff --git a/internal/service/cloudformation/schemas/AWS_EC2_CapacityReservationFleet.json b/internal/service/cloudformation/schemas/AWS_EC2_CapacityReservationFleet.json index 8c6b0d6ded..6b0a92cc80 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_CapacityReservationFleet.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_CapacityReservationFleet.json @@ -162,4 +162,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_EC2_CarrierGateway.json b/internal/service/cloudformation/schemas/AWS_EC2_CarrierGateway.json index d41e50c5ae..2ae724da8d 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_CarrierGateway.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_CarrierGateway.json @@ -99,4 +99,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_EC2_EC2Fleet.json b/internal/service/cloudformation/schemas/AWS_EC2_EC2Fleet.json index 94fac3c4b0..f421b711f7 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_EC2Fleet.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_EC2Fleet.json @@ -168,7 +168,7 @@ "type": "string", "minLength": 3, "maxLength": 128, - "pattern": "" + "pattern": "[a-zA-Z0-9\\(\\)\\.\\-/_]+" }, "LaunchTemplateId": { "type": "string" @@ -379,7 +379,7 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "" + "pattern": "[a-zA-Z0-9\\.\\*]+" } }, "InstanceGenerations": { diff --git a/internal/service/cloudformation/schemas/AWS_EC2_EnclaveCertificateIamRoleAssociation.json b/internal/service/cloudformation/schemas/AWS_EC2_EnclaveCertificateIamRoleAssociation.json index 0f9a4150f0..65397083b5 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_EnclaveCertificateIamRoleAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_EnclaveCertificateIamRoleAssociation.json @@ -6,14 +6,14 @@ "CertificateArn": { "description": "The Amazon Resource Name (ARN) of the ACM certificate with which to associate the IAM role.", "type": "string", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:acm:[A-Za-z0-9-]{1,64}:([0-9]{12})?:certificate/.+$", "minLength": 1, "maxLength": 1283 }, "RoleArn": { "description": "The Amazon Resource Name (ARN) of the IAM role to associate with the ACM certificate. You can associate up to 16 IAM roles with an ACM certificate.", "type": "string", - "pattern": "", + "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:iam:.*:([0-9]{12})?:role/.+$", "minLength": 1, "maxLength": 1283 }, diff --git a/internal/service/cloudformation/schemas/AWS_EC2_SpotFleet.json b/internal/service/cloudformation/schemas/AWS_EC2_SpotFleet.json index d9b21c5791..cde5e03c96 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_SpotFleet.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_SpotFleet.json @@ -330,7 +330,7 @@ "type": "string", "minLength": 3, "maxLength": 128, - "pattern": "" + "pattern": "[a-zA-Z0-9\\(\\)\\.\\-/_]+" }, "Version": { "type": "string" @@ -654,7 +654,7 @@ "type": "string", "minLength": 1, "maxLength": 30, - "pattern": "" + "pattern": "[a-zA-Z0-9\\.\\*]+" } }, "InstanceGenerations": { diff --git a/internal/service/cloudformation/schemas/AWS_EC2_TransitGatewayPeeringAttachment.json b/internal/service/cloudformation/schemas/AWS_EC2_TransitGatewayPeeringAttachment.json index 54af01f03f..f7e91e1c41 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_TransitGatewayPeeringAttachment.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_TransitGatewayPeeringAttachment.json @@ -1 +1 @@ -{"typeName":"AWS::EC2::TransitGatewayPeeringAttachment","readOnlyProperties":["/properties/TransitGatewayAttachmentId","/properties/Status","/properties/State","/properties/CreationTime"],"description":"The AWS::EC2::TransitGatewayPeeringAttachment type","createOnlyProperties":["/properties/TransitGatewayId","/properties/PeerTransitGatewayId","/properties/PeerRegion","/properties/PeerAccountId"],"primaryIdentifier":["/properties/TransitGatewayAttachmentId"],"required":["TransitGatewayId","PeerTransitGatewayId","PeerAccountId","PeerRegion"],"sourceUrl":"https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-myservice","handlers":{"read":{"permissions":["ec2:DescribeTransitGatewayPeeringAttachments"]},"create":{"permissions":["ec2:CreateTransitGatewayPeeringAttachment","ec2:DescribeTransitGatewayPeeringAttachments"]},"update":{"permissions":["ec2:DescribeTransitGatewayPeeringAttachments"]},"list":{"permissions":["ec2:DescribeTransitGatewayPeeringAttachments"]},"delete":{"permissions":["ec2:DeleteTransitGatewayPeeringAttachment","ec2:DescribeTransitGatewayPeeringAttachments"]}},"writeOnlyProperties":["/properties/Options"],"additionalProperties":false,"definitions":{"TransitGatewayPeeringAttachmentOptions":{"additionalProperties":false,"type":"object","properties":{"DynamicRouting":{"description":"Whether to enable dynamic routing. (enable/disable)","type":"string"}}},"Tag":{"additionalProperties":false,"type":"object","properties":{"Value":{"description":"The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.","type":"string"},"Key":{"description":"The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.","type":"string"}}},"PeeringAttachmentStatus":{"additionalProperties":false,"type":"object","properties":{"Message":{"description":"The status message, if applicable.","type":"string"},"Code":{"description":"The status code.","type":"string"}}}},"properties":{"Status":{"description":"The status of the transit gateway peering attachment.","$ref":"#/definitions/PeeringAttachmentStatus"},"Options":{"description":"Options for transit gateway peering attachment","$ref":"#/definitions/TransitGatewayPeeringAttachmentOptions"},"TransitGatewayId":{"description":"The ID of the transit gateway.","type":"string"},"PeerTransitGatewayId":{"description":"The ID of the peer transit gateway.","type":"string"},"PeerAccountId":{"description":"The ID of the peer account","type":"string"},"State":{"description":"The state of the transit gateway peering attachment. Note that the initiating state has been deprecated.","type":"string"},"CreationTime":{"format":"date-time","description":"The time the transit gateway peering attachment was created.","type":"string"},"PeerRegion":{"description":"Peer Region","type":"string"},"Tags":{"description":"The tags for the transit gateway peering attachment.","type":"array","items":{"$ref":"#/definitions/Tag"}},"TransitGatewayAttachmentId":{"description":"The ID of the transit gateway peering attachment.","type":"string"}}} \ No newline at end of file +{"typeName":"AWS::EC2::TransitGatewayPeeringAttachment","readOnlyProperties":["/properties/TransitGatewayAttachmentId","/properties/Status","/properties/State","/properties/CreationTime"],"description":"The AWS::EC2::TransitGatewayPeeringAttachment type","createOnlyProperties":["/properties/TransitGatewayId","/properties/PeerTransitGatewayId","/properties/PeerRegion","/properties/PeerAccountId"],"primaryIdentifier":["/properties/TransitGatewayAttachmentId"],"required":["TransitGatewayId","PeerTransitGatewayId","PeerAccountId","PeerRegion"],"sourceUrl":"https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-myservice","handlers":{"read":{"permissions":["ec2:DescribeTransitGatewayPeeringAttachments"]},"create":{"permissions":["ec2:CreateTransitGatewayPeeringAttachment","ec2:DescribeTransitGatewayPeeringAttachments"]},"update":{"permissions":["ec2:DescribeTransitGatewayPeeringAttachments"]},"list":{"permissions":["ec2:DescribeTransitGatewayPeeringAttachments"]},"delete":{"permissions":["ec2:DeleteTransitGatewayPeeringAttachment","ec2:DescribeTransitGatewayPeeringAttachments"]}},"writeOnlyProperties":["/properties/Options"],"additionalProperties":false,"definitions":{"TransitGatewayPeeringAttachmentOptions":{"additionalProperties":false,"type":"object","properties":{"DynamicRouting":{"description":"Whether to enable dynamic routing. (enable/disable)","type":"string"}}},"Tag":{"additionalProperties":false,"type":"object","properties":{"Value":{"description":"The value of the tag. Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.","type":"string"},"Key":{"description":"The key of the tag. Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.","type":"string"}}},"PeeringAttachmentStatus":{"additionalProperties":false,"type":"object","properties":{"Message":{"description":"The status message, if applicable.","type":"string"},"Code":{"description":"The status code.","type":"string"}}}},"properties":{"Status":{"description":"The status of the transit gateway peering attachment.","$ref":"#/definitions/PeeringAttachmentStatus"},"Options":{"description":"Options for transit gateway peering attachment","$ref":"#/definitions/TransitGatewayPeeringAttachmentOptions"},"TransitGatewayId":{"description":"The ID of the transit gateway.","type":"string"},"PeerTransitGatewayId":{"description":"The ID of the peer transit gateway.","type":"string"},"PeerAccountId":{"description":"The ID of the peer account","type":"string"},"State":{"description":"The state of the transit gateway peering attachment. Note that the initiating state has been deprecated.","type":"string"},"CreationTime":{"format":"date-time","description":"The time the transit gateway peering attachment was created.","type":"string"},"PeerRegion":{"description":"Peer Region","type":"string"},"Tags":{"description":"The tags for the transit gateway peering attachment.","type":"array","items":{"$ref":"#/definitions/Tag"}},"TransitGatewayAttachmentId":{"description":"The ID of the transit gateway peering attachment.","type":"string"}}} diff --git a/internal/service/cloudformation/schemas/AWS_EC2_VPCEndpoint.json b/internal/service/cloudformation/schemas/AWS_EC2_VPCEndpoint.json index dc4fa72c36..13a2f818d3 100644 --- a/internal/service/cloudformation/schemas/AWS_EC2_VPCEndpoint.json +++ b/internal/service/cloudformation/schemas/AWS_EC2_VPCEndpoint.json @@ -64,4 +64,4 @@ "readOnlyProperties" : [ "/properties/NetworkInterfaceIds", "/properties/CreationTimestamp", "/properties/DnsEntries", "/properties/Id" ], "createOnlyProperties" : [ "/properties/ServiceName", "/properties/VpcEndpointType", "/properties/VpcId" ], "primaryIdentifier" : [ "/properties/Id" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_ECR_PublicRepository.json b/internal/service/cloudformation/schemas/AWS_ECR_PublicRepository.json index beca154907..90d39043cc 100644 --- a/internal/service/cloudformation/schemas/AWS_ECR_PublicRepository.json +++ b/internal/service/cloudformation/schemas/AWS_ECR_PublicRepository.json @@ -8,7 +8,7 @@ "description": "The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. ", "minLength": 12, "maxLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "RepositoryDescription": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_ECR_PullThroughCacheRule.json b/internal/service/cloudformation/schemas/AWS_ECR_PullThroughCacheRule.json index dbaf1d80b8..978c4977ad 100644 --- a/internal/service/cloudformation/schemas/AWS_ECR_PullThroughCacheRule.json +++ b/internal/service/cloudformation/schemas/AWS_ECR_PullThroughCacheRule.json @@ -27,14 +27,14 @@ "RegistryId": { "type": "string", "description": "The account ID of the registry pull-through cache repository will be created in.", - "pattern": "" + "pattern": "^[0-9]{12}$" }, "EcrRepositoryPrefix": { "type": "string", "minLength": 2, "maxLength": 20, "description": "The ECRRepositoryPrefix is a custom alias for upstream registry url.", - "pattern": "" + "pattern": "^([a-z0-9]+(?:[._-][a-z0-9]+)*)$" }, "UpstreamRegistryUrl": { "type": "string", @@ -47,7 +47,7 @@ "description": "The ECRRepositoryPrefix is a custom alias for upstream registry url.", "minLength": 2, "maxLength": 20, - "pattern": "" + "pattern": "^([a-z0-9]+(?:[._-][a-z0-9]+)*)$" }, "UpstreamRegistryUrl": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_ECR_RegistryPolicy.json b/internal/service/cloudformation/schemas/AWS_ECR_RegistryPolicy.json index 4dbee0aa3d..33d74db5dc 100644 --- a/internal/service/cloudformation/schemas/AWS_ECR_RegistryPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_ECR_RegistryPolicy.json @@ -8,7 +8,7 @@ "description": "The registry id.", "minLength": 12, "maxLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" } }, "properties": { diff --git a/internal/service/cloudformation/schemas/AWS_ECR_ReplicationConfiguration.json b/internal/service/cloudformation/schemas/AWS_ECR_ReplicationConfiguration.json index 3c4e0843f5..35cb753cb3 100644 --- a/internal/service/cloudformation/schemas/AWS_ECR_ReplicationConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_ECR_ReplicationConfiguration.json @@ -70,7 +70,7 @@ "Filter": { "type": "string", "description": "The repository filter to be applied for replication.", - "pattern": "" + "pattern": "^(?:[a-z0-9]+(?:[._-][a-z0-9]*)*/)*[a-z0-9]*(?:[._-][a-z0-9]*)*$" }, "FilterType": { "description": "Type of repository filter", @@ -97,12 +97,12 @@ "RegistryId": { "type": "string", "description": "The account ID of the destination registry to replicate to.", - "pattern": "" + "pattern": "^[0-9]{12}$" }, "Region": { "description": "A Region to replicate to.", "type": "string", - "pattern": "" + "pattern": "[0-9a-z-]{2,25}" } }, "properties": { diff --git a/internal/service/cloudformation/schemas/AWS_ECR_Repository.json b/internal/service/cloudformation/schemas/AWS_ECR_Repository.json index b87792abfe..281f9bc585 100644 --- a/internal/service/cloudformation/schemas/AWS_ECR_Repository.json +++ b/internal/service/cloudformation/schemas/AWS_ECR_Repository.json @@ -27,7 +27,7 @@ "description": "The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. ", "minLength": 12, "maxLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "Tag": { "description": "A key-value pair to associate with a resource.", diff --git a/internal/service/cloudformation/schemas/AWS_EFS_AccessPoint.json b/internal/service/cloudformation/schemas/AWS_EFS_AccessPoint.json index 16b46bbcac..b4b31a2c42 100644 --- a/internal/service/cloudformation/schemas/AWS_EFS_AccessPoint.json +++ b/internal/service/cloudformation/schemas/AWS_EFS_AccessPoint.json @@ -33,7 +33,7 @@ "Permissions":{ "type":"string", "description":"Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing the file's mode bits.", - "pattern":"" + "pattern":"^[0-7]{3,4}$" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_EFS_FileSystem.json b/internal/service/cloudformation/schemas/AWS_EFS_FileSystem.json index 1f3fd8c3e8..0c1b6c9964 100644 --- a/internal/service/cloudformation/schemas/AWS_EFS_FileSystem.json +++ b/internal/service/cloudformation/schemas/AWS_EFS_FileSystem.json @@ -156,4 +156,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_EKS_Cluster.json b/internal/service/cloudformation/schemas/AWS_EKS_Cluster.json index e09208f546..cda1bb502b 100644 --- a/internal/service/cloudformation/schemas/AWS_EKS_Cluster.json +++ b/internal/service/cloudformation/schemas/AWS_EKS_Cluster.json @@ -186,7 +186,7 @@ "Name": { "description": "The unique name to give to your cluster.", "type": "string", - "pattern": "", + "pattern": "^[0-9A-Za-z][A-Za-z0-9\\-_]*", "minLength": 1, "maxLength": 100 }, @@ -200,7 +200,7 @@ "Version": { "description": "The desired Kubernetes version for your cluster. If you don't specify a value here, the latest version available in Amazon EKS is used.", "type": "string", - "pattern": "" + "pattern": "1\\.\\d\\d" }, "Tags": { "description": "An array of key-value pairs to apply to this resource.", diff --git a/internal/service/cloudformation/schemas/AWS_EKS_Nodegroup.json b/internal/service/cloudformation/schemas/AWS_EKS_Nodegroup.json index c30a8a34bf..cf51201ed8 100644 --- a/internal/service/cloudformation/schemas/AWS_EKS_Nodegroup.json +++ b/internal/service/cloudformation/schemas/AWS_EKS_Nodegroup.json @@ -277,4 +277,4 @@ "timeoutInMinutes": 2160 } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_EMRContainers_VirtualCluster.json b/internal/service/cloudformation/schemas/AWS_EMRContainers_VirtualCluster.json index 23e8924658..d1195618cf 100644 --- a/internal/service/cloudformation/schemas/AWS_EMRContainers_VirtualCluster.json +++ b/internal/service/cloudformation/schemas/AWS_EMRContainers_VirtualCluster.json @@ -16,7 +16,7 @@ "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "^[0-9A-Za-z][A-Za-z0-9\\-_]*" }, "Info": { "$ref": "#/definitions/ContainerInfo" @@ -48,7 +48,7 @@ "type": "string", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?" } }, "required": [ @@ -94,7 +94,7 @@ "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "[\\.\\-_/#A-Za-z0-9]+" }, "Tags": { "description": "An array of key-value pairs to apply to this virtual cluster.", diff --git a/internal/service/cloudformation/schemas/AWS_EMR_Studio.json b/internal/service/cloudformation/schemas/AWS_EMR_Studio.json index 898be61525..3925989369 100644 --- a/internal/service/cloudformation/schemas/AWS_EMR_Studio.json +++ b/internal/service/cloudformation/schemas/AWS_EMR_Studio.json @@ -10,7 +10,7 @@ }, "Arn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$" }, "Tags": { "type": "array", @@ -37,7 +37,7 @@ "description": "The value for the tag. You can specify a value that is 0 to 255 Unicode characters in length. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z+-=._:/]+$" } }, "required": [ @@ -64,7 +64,7 @@ "type": "string", "minLength": 6, "maxLength": 10280, - "pattern": "" + "pattern": "^s3://.*" }, "Description": { "description": "A detailed description of the Studio.", @@ -77,14 +77,14 @@ "type": "string", "minLength": 4, "maxLength": 256, - "pattern": "" + "pattern": "^sg-[a-zA-Z0-9\\-._]+$" }, "Name": { "description": "A descriptive name for the Amazon EMR Studio.", "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z0-9_-]+" }, "ServiceRole": { "description": "The IAM role that will be assumed by the Amazon EMR Studio. The service role provides a way for Amazon EMR Studio to interoperate with other AWS services.", @@ -93,7 +93,7 @@ "StudioId": { "description": "The ID of the EMR Studio.", "type": "string", - "pattern": "", + "pattern": "^es-[0-9A-Z]+", "minLength": 4, "maxLength": 256 }, @@ -112,7 +112,7 @@ "Url": { "description": "The unique Studio access URL.", "type": "string", - "pattern": "", + "pattern": "^https://[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])(:[0-9]*)*([?/#].*)?$", "maxLength": 4096 }, "UserRole": { @@ -122,17 +122,17 @@ "VpcId": { "description": "The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.", "type": "string", - "pattern": "" + "pattern": "^(vpc-[0-9a-f]{8}|vpc-[0-9a-f]{17})$" }, "WorkspaceSecurityGroupId": { "description": "The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by VpcId.", "type": "string", - "pattern": "" + "pattern": "^sg-[a-zA-Z0-9\\-._]+$" }, "IdpAuthUrl": { "description": "Your identity provider's authentication endpoint. Amazon EMR Studio redirects federated users to this endpoint for authentication when logging in to a Studio with the Studio URL.", "type": "string", - "pattern": "", + "pattern": "^https://[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])(:[0-9]*)*([?/#].*)?$", "maxLength": 4096 }, "IdpRelayStateParameterName": { diff --git a/internal/service/cloudformation/schemas/AWS_EMR_StudioSessionMapping.json b/internal/service/cloudformation/schemas/AWS_EMR_StudioSessionMapping.json index fcdec96f7b..8e010cabec 100644 --- a/internal/service/cloudformation/schemas/AWS_EMR_StudioSessionMapping.json +++ b/internal/service/cloudformation/schemas/AWS_EMR_StudioSessionMapping.json @@ -6,7 +6,7 @@ "definitions": { "IamPolicyArn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws(-(cn|us-gov))?:iam::([0-9]{12})?:policy\\/[^.]+$" } }, "properties": { @@ -29,7 +29,7 @@ "StudioId": { "description": "The ID of the Amazon EMR Studio to which the user or group will be mapped.", "type": "string", - "pattern": "", + "pattern": "^es-[0-9A-Z]+", "minLength": 4, "maxLength": 256 } diff --git a/internal/service/cloudformation/schemas/AWS_ElastiCache_User.json b/internal/service/cloudformation/schemas/AWS_ElastiCache_User.json index 8254714e9e..c6db482e01 100644 --- a/internal/service/cloudformation/schemas/AWS_ElastiCache_User.json +++ b/internal/service/cloudformation/schemas/AWS_ElastiCache_User.json @@ -9,7 +9,7 @@ }, "UserId": { "description": "The ID of the user.", - "pattern": "", + "pattern": "[a-z][a-z0-9\\\\-]*", "type": "string" }, "UserName": { diff --git a/internal/service/cloudformation/schemas/AWS_ElastiCache_UserGroup.json b/internal/service/cloudformation/schemas/AWS_ElastiCache_UserGroup.json index dcaf2b3820..d16463bb8c 100644 --- a/internal/service/cloudformation/schemas/AWS_ElastiCache_UserGroup.json +++ b/internal/service/cloudformation/schemas/AWS_ElastiCache_UserGroup.json @@ -9,7 +9,7 @@ }, "UserGroupId": { "description": "The ID of the user group.", - "pattern": "", + "pattern": "[a-z][a-z0-9\\\\-]*", "type": "string" }, "Engine": { diff --git a/internal/service/cloudformation/schemas/AWS_Events_ApiDestination.json b/internal/service/cloudformation/schemas/AWS_Events_ApiDestination.json index f7b09023b5..612c87594b 100644 --- a/internal/service/cloudformation/schemas/AWS_Events_ApiDestination.json +++ b/internal/service/cloudformation/schemas/AWS_Events_ApiDestination.json @@ -86,4 +86,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Events_Connection.json b/internal/service/cloudformation/schemas/AWS_Events_Connection.json index c4620aab35..6cadae3366 100644 --- a/internal/service/cloudformation/schemas/AWS_Events_Connection.json +++ b/internal/service/cloudformation/schemas/AWS_Events_Connection.json @@ -261,4 +261,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Evidently_Experiment.json b/internal/service/cloudformation/schemas/AWS_Evidently_Experiment.json index c95c1d3acd..63c68ecf81 100644 --- a/internal/service/cloudformation/schemas/AWS_Evidently_Experiment.json +++ b/internal/service/cloudformation/schemas/AWS_Evidently_Experiment.json @@ -5,17 +5,17 @@ "properties": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/experiment/[-a-zA-Z0-9._]*" }, "Name": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, "Project": { "type": "string", - "pattern": "", + "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)", "minLength": 0, "maxLength": 2048 }, @@ -28,7 +28,7 @@ "type": "string", "minLength": 0, "maxLength": 127, - "pattern": "" + "pattern": ".*" }, "Treatments": { "type": "array", @@ -74,7 +74,7 @@ "properties": { "TreatmentName": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -83,11 +83,11 @@ }, "Feature": { "type": "string", - "pattern": "" + "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:.*)" }, "Variation": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 255 } @@ -106,7 +106,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[\\S]+$" }, "EntityIdKey": { "description": "The JSON path to reference the entity id in the event.", @@ -124,7 +124,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": ".*" }, "DesiredChange": { "type": "string", @@ -148,7 +148,7 @@ "properties": { "ControlTreatmentName": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -168,7 +168,7 @@ "properties": { "Treatment": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, diff --git a/internal/service/cloudformation/schemas/AWS_Evidently_Feature.json b/internal/service/cloudformation/schemas/AWS_Evidently_Feature.json index c8f633dd80..57a7374b8c 100644 --- a/internal/service/cloudformation/schemas/AWS_Evidently_Feature.json +++ b/internal/service/cloudformation/schemas/AWS_Evidently_Feature.json @@ -5,19 +5,19 @@ "properties": { "Arn": { "type": "string", - "pattern": "", + "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/feature/[-a-zA-Z0-9._]*", "minLength": 0, "maxLength": 2048 }, "Project": { "type": "string", - "pattern": "", + "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)", "minLength": 0, "maxLength": 2048 }, "Name": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -45,7 +45,7 @@ }, "DefaultVariation": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -75,7 +75,7 @@ "properties": { "VariationName": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -130,7 +130,7 @@ }, "Variation": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 } diff --git a/internal/service/cloudformation/schemas/AWS_Evidently_Launch.json b/internal/service/cloudformation/schemas/AWS_Evidently_Launch.json index 84808ae0bb..2babb6305c 100644 --- a/internal/service/cloudformation/schemas/AWS_Evidently_Launch.json +++ b/internal/service/cloudformation/schemas/AWS_Evidently_Launch.json @@ -5,17 +5,17 @@ "properties": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/launch/[-a-zA-Z0-9._]*" }, "Name": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, "Project": { "type": "string", - "pattern": "", + "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)", "minLength": 0, "maxLength": 2048 }, @@ -28,7 +28,7 @@ "type": "string", "minLength": 0, "maxLength": 127, - "pattern": "" + "pattern": ".*" }, "ScheduledSplitsConfig": { "type": "array", @@ -76,7 +76,7 @@ "properties": { "GroupName": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -104,7 +104,7 @@ "properties": { "GroupName": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -146,7 +146,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[\\S]+$" }, "EntityIdKey": { "description": "The JSON path to reference the entity id in the event.", @@ -164,7 +164,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": ".*" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_Evidently_Project.json b/internal/service/cloudformation/schemas/AWS_Evidently_Project.json index 3fd1672654..3e74ae08d7 100644 --- a/internal/service/cloudformation/schemas/AWS_Evidently_Project.json +++ b/internal/service/cloudformation/schemas/AWS_Evidently_Project.json @@ -5,13 +5,13 @@ "properties": { "Arn": { "type": "string", - "pattern": "", + "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*", "minLength": 0, "maxLength": 2048 }, "Name": { "type": "string", - "pattern": "", + "pattern": "[-a-zA-Z0-9._]*", "minLength": 1, "maxLength": 127 }, @@ -43,7 +43,7 @@ }, "LogGroup": { "type": "string", - "pattern": "", + "pattern": "^[-a-zA-Z0-9._/]+$", "minLength": 1, "maxLength": 512 } @@ -67,13 +67,13 @@ "properties": { "BucketName": { "type": "string", - "pattern": "", + "pattern": "^[a-z0-9][-a-z0-9]*[a-z0-9]$", "minLength": 3, "maxLength": 63 }, "Prefix": { "type": "string", - "pattern": "", + "pattern": "^[-a-zA-Z0-9!_.*'()/]*$", "minLength": 1, "maxLength": 1024 } diff --git a/internal/service/cloudformation/schemas/AWS_FMS_NotificationChannel.json b/internal/service/cloudformation/schemas/AWS_FMS_NotificationChannel.json index 7e8c7b7241..3ad24367e1 100644 --- a/internal/service/cloudformation/schemas/AWS_FMS_NotificationChannel.json +++ b/internal/service/cloudformation/schemas/AWS_FMS_NotificationChannel.json @@ -6,7 +6,7 @@ "ResourceArn": { "description": "A resource ARN.", "type": "string", - "pattern": "", + "pattern": "^([^\\s]+)$", "minLength": 1, "maxLength": 1024 } diff --git a/internal/service/cloudformation/schemas/AWS_FMS_Policy.json b/internal/service/cloudformation/schemas/AWS_FMS_Policy.json index 96247d19a2..fcbfd7e279 100644 --- a/internal/service/cloudformation/schemas/AWS_FMS_Policy.json +++ b/internal/service/cloudformation/schemas/AWS_FMS_Policy.json @@ -6,14 +6,14 @@ "AccountId": { "description": "An AWS account ID.", "type": "string", - "pattern": "", + "pattern": "^([0-9]*)$", "minLength": 12, "maxLength": 12 }, "OrganizationalUnitId": { "description": "An Organizational Unit ID.", "type": "string", - "pattern": "", + "pattern": "^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$", "minLength": 16, "maxLength": 68 }, @@ -44,13 +44,13 @@ "properties": { "Key": { "type": "string", - "pattern": "", + "pattern": "^([^\\s]*)$", "minLength": 1, "maxLength": 128 }, "Value": { "type": "string", - "pattern": "", + "pattern": "^([^\\s]*)$", "maxLength": 256 } }, @@ -82,14 +82,14 @@ "ResourceType": { "description": "An AWS resource type", "type": "string", - "pattern": "", + "pattern": "^([^\\s]*)$", "minLength": 1, "maxLength": 128 }, "ResourceArn": { "description": "A resource ARN.", "type": "string", - "pattern": "", + "pattern": "^([^\\s]*)$", "minLength": 1, "maxLength": 1024 } @@ -106,13 +106,13 @@ }, "Id": { "type": "string", - "pattern": "", + "pattern": "^[a-z0-9A-Z-]{36}$", "minLength": 36, "maxLength": 36 }, "PolicyName": { "type": "string", - "pattern": "", + "pattern": "^([a-zA-Z0-9_.:/=+\\-@]+)$", "minLength": 1, "maxLength": 1024 }, diff --git a/internal/service/cloudformation/schemas/AWS_FinSpace_Environment.json b/internal/service/cloudformation/schemas/AWS_FinSpace_Environment.json index c9410c298d..0f175ea89b 100644 --- a/internal/service/cloudformation/schemas/AWS_FinSpace_Environment.json +++ b/internal/service/cloudformation/schemas/AWS_FinSpace_Environment.json @@ -10,26 +10,26 @@ "SamlMetadataURL": { "description": "SAML metadata URL to link with the Environment", "type": "string", - "pattern": "" + "pattern": "^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]{1,1000}" }, "FederationProviderName": { "description": "Federation provider name to link with the Environment", "type": "string", - "pattern": "", + "pattern": "[^_\\p{Z}][\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}][^_\\p{Z}]+", "minLength": 1, "maxLength": 32 }, "SamlMetadataDocument": { "description": "SAML metadata document to link the federation provider to the Environment", "type": "string", - "pattern": "", + "pattern": ".*", "minLength": 1000, "maxLength": 10000000 }, "ApplicationCallBackURL": { "description": "SAML metadata URL to link with the Environment", "type": "string", - "pattern": "" + "pattern": "^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]{1,1000}" }, "FederationURN": { "description": "SAML metadata URL to link with the Environment", @@ -49,21 +49,21 @@ "FirstName": { "description": "First name", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9]{1,50}$", "minLength": 1, "maxLength": 50 }, "LastName": { "description": "Last name", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9]{1,50}$", "minLength": 1, "maxLength": 50 }, "EmailAddress": { "description": "Email address", "type": "string", - "pattern": "", + "pattern": "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+[.]+[A-Za-z]+", "minLength": 1, "maxLength": 128 } @@ -71,29 +71,29 @@ }, "DataBundleArn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\\d*:data-bundle/[0-9A-Za-z_-]{1,128}$" } }, "properties": { "EnvironmentId": { "description": "Unique identifier for representing FinSpace Environment", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9]{1,26}$" }, "Name": { "description": "Name of the Environment", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]{1,255}$" }, "AwsAccountId": { "description": "AWS account ID associated with the Environment", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9]{1,26}$" }, "Description": { "description": "Description of the Environment", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9. ]{1,1000}$" }, "Status": { "description": "State of the Environment", @@ -114,12 +114,12 @@ "EnvironmentUrl": { "description": "URL used to login to the Environment", "type": "string", - "pattern": "" + "pattern": "^[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]{1,1000}" }, "EnvironmentArn": { "description": "ARN of the Environment", "type": "string", - "pattern": "" + "pattern": "^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\\d+:environment/[0-9A-Za-z_-]{1,128}$" }, "SageMakerStudioDomainUrl": { "description": "SageMaker Studio Domain URL associated with the Environment", @@ -134,7 +134,7 @@ "DedicatedServiceAccountId": { "description": "ID for FinSpace created account used to store Environment artifacts", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9]{1,26}$" }, "FederationMode": { "description": "Federation mode used with the Environment", @@ -211,4 +211,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Forecast_Dataset.json b/internal/service/cloudformation/schemas/AWS_Forecast_Dataset.json index 307614e5e9..081a158a29 100644 --- a/internal/service/cloudformation/schemas/AWS_Forecast_Dataset.json +++ b/internal/service/cloudformation/schemas/AWS_Forecast_Dataset.json @@ -14,7 +14,7 @@ "AttributeName": { "description": "Name of the dataset field", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*" }, "AttributeType": { "description": "Data type of the field", @@ -36,13 +36,13 @@ "description": "KMS key used to encrypt the Dataset data", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "arn:aws[-a-z]*:kms:.*:key/.*" }, "RoleArn": { "description": "The ARN of the IAM role that Amazon Forecast can assume to access the AWS KMS key.", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$" }, "Key": { "type": "string", @@ -61,14 +61,14 @@ "Arn": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$" }, "DatasetName": { "description": "A name for the dataset", "type": "string", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*" }, "DatasetType": { "description": "The dataset type", @@ -82,7 +82,7 @@ "DataFrequency": { "description": "Frequency of data collection. This parameter is required for RELATED_TIME_SERIES", "type": "string", - "pattern": "" + "pattern": "^Y|M|W|D|H|30min|15min|10min|5min|1min$" }, "Domain": { "description": "The domain associated with the dataset", diff --git a/internal/service/cloudformation/schemas/AWS_Forecast_DatasetGroup.json b/internal/service/cloudformation/schemas/AWS_Forecast_DatasetGroup.json index 7d6e7b241c..8fbdb1a172 100644 --- a/internal/service/cloudformation/schemas/AWS_Forecast_DatasetGroup.json +++ b/internal/service/cloudformation/schemas/AWS_Forecast_DatasetGroup.json @@ -29,7 +29,7 @@ "Arn": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$" }, "MaxResults": { "description": "The number of items to return in the response.", @@ -56,7 +56,7 @@ "DatasetGroupName": { "description": "A name for the dataset group.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*", "minLength": 1, "maxLength": 63 }, @@ -87,7 +87,7 @@ "description": "The Amazon Resource Name (ARN) of the dataset group to delete.", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_FraudDetector_Detector.json b/internal/service/cloudformation/schemas/AWS_FraudDetector_Detector.json index 0467c7dc44..ba3309f844 100644 --- a/internal/service/cloudformation/schemas/AWS_FraudDetector_Detector.json +++ b/internal/service/cloudformation/schemas/AWS_FraudDetector_Detector.json @@ -301,7 +301,7 @@ "Name": { "description": "The name for the event type", "type": "string", - "pattern": "", + "pattern": "^[0-9a-z_-]+$", "minLength": 1, "maxLength": 64 }, @@ -381,7 +381,7 @@ "DetectorId": { "description": "The ID of the detector", "type": "string", - "pattern": "", + "pattern": "^[0-9a-z_-]+$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_FraudDetector_EntityType.json b/internal/service/cloudformation/schemas/AWS_FraudDetector_EntityType.json index 52f93f5030..8ae036166c 100644 --- a/internal/service/cloudformation/schemas/AWS_FraudDetector_EntityType.json +++ b/internal/service/cloudformation/schemas/AWS_FraudDetector_EntityType.json @@ -28,7 +28,7 @@ "Name": { "description": "The name of the entity type.", "type": "string", - "pattern": "", + "pattern": "^[0-9a-z_-]+$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_FraudDetector_EventType.json b/internal/service/cloudformation/schemas/AWS_FraudDetector_EventType.json index 848e18ee7f..071d96a57d 100644 --- a/internal/service/cloudformation/schemas/AWS_FraudDetector_EventType.json +++ b/internal/service/cloudformation/schemas/AWS_FraudDetector_EventType.json @@ -201,7 +201,7 @@ "Name": { "description": "The name for the event type", "type": "string", - "pattern": "", + "pattern": "^[0-9a-z_-]+$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_FraudDetector_Label.json b/internal/service/cloudformation/schemas/AWS_FraudDetector_Label.json index 94f8e13d94..1271ea48d6 100644 --- a/internal/service/cloudformation/schemas/AWS_FraudDetector_Label.json +++ b/internal/service/cloudformation/schemas/AWS_FraudDetector_Label.json @@ -28,7 +28,7 @@ "Name": { "description": "The name of the label.", "type": "string", - "pattern": "", + "pattern": "^[0-9a-z_-]+$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_FraudDetector_Outcome.json b/internal/service/cloudformation/schemas/AWS_FraudDetector_Outcome.json index d3440544d2..8b3d7d87e8 100644 --- a/internal/service/cloudformation/schemas/AWS_FraudDetector_Outcome.json +++ b/internal/service/cloudformation/schemas/AWS_FraudDetector_Outcome.json @@ -28,7 +28,7 @@ "Name": { "description": "The name of the outcome.", "type": "string", - "pattern": "", + "pattern": "^[0-9a-z_-]+$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_FraudDetector_Variable.json b/internal/service/cloudformation/schemas/AWS_FraudDetector_Variable.json index 22592ad526..159e1d7c9c 100644 --- a/internal/service/cloudformation/schemas/AWS_FraudDetector_Variable.json +++ b/internal/service/cloudformation/schemas/AWS_FraudDetector_Variable.json @@ -28,7 +28,7 @@ "Name": { "description": "The name of the variable.", "type": "string", - "pattern": "" + "pattern": "^[a-z_][a-z0-9_]{0,99}?$" }, "DataSource": { "description": "The source of the data.", diff --git a/internal/service/cloudformation/schemas/AWS_GameLift_Alias.json b/internal/service/cloudformation/schemas/AWS_GameLift_Alias.json index 4694c4d1be..14c23a52bf 100644 --- a/internal/service/cloudformation/schemas/AWS_GameLift_Alias.json +++ b/internal/service/cloudformation/schemas/AWS_GameLift_Alias.json @@ -13,7 +13,7 @@ "FleetId": { "description": "A unique identifier for a fleet that the alias points to. If you specify SIMPLE for the Type property, you must specify this property.", "type": "string", - "pattern": "" + "pattern": "^fleet-\\S+" }, "Type": { "description": "Simple routing strategy. The alias resolves to one specific fleet. Use this type when routing to active fleets.", @@ -54,7 +54,7 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": ".*\\S.*" }, "RoutingStrategy": { "description": "A routing configuration that specifies where traffic is directed for this alias, such as to a fleet or to a message.", diff --git a/internal/service/cloudformation/schemas/AWS_GameLift_Fleet.json b/internal/service/cloudformation/schemas/AWS_GameLift_Fleet.json index adc9ea9665..0cb898006c 100644 --- a/internal/service/cloudformation/schemas/AWS_GameLift_Fleet.json +++ b/internal/service/cloudformation/schemas/AWS_GameLift_Fleet.json @@ -60,7 +60,7 @@ "IpRange": { "description": "A range of allowed IP addresses. This value must be expressed in CIDR notation. Example: \"000.000.000.000/[subnet mask]\" or optionally the shortened version \"0.0.0.0/[subnet mask]\".", "type": "string", - "pattern": "" + "pattern": "(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$)" }, "Protocol": { "description": "The network communication protocol used by the fleet.", @@ -89,7 +89,7 @@ "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-z]+(-([a-z]+|\\d))*" }, "LocationConfiguration": { "description": "A remote location where a multi-location fleet can deploy EC2 instances for game hosting.", @@ -166,7 +166,7 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^([Cc]:\\\\game\\S+|/local/game/\\S+)" }, "Parameters": { "description": "An optional list of parameters to pass to the server executable or Realtime script on launch.", @@ -210,7 +210,7 @@ "EC2InstanceType": { "description": "The name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions.", "type": "string", - "pattern": "" + "pattern": "^.*..*$" }, "FleetType": { "description": "Indicates whether to use On-Demand instances or Spot instances for this fleet. If empty, the default is ON_DEMAND. Both categories of instances use identical hardware and configurations based on the instance type selected for this fleet.", @@ -224,7 +224,7 @@ "description": "A unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN from the IAM dashboard in the AWS Management Console.", "type": "string", "minLength": 1, - "pattern": "" + "pattern": "^arn:aws(-.*)?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$" }, "Locations": { "type": "array", @@ -281,14 +281,14 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "PeerVpcId": { "description": "A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the AWS Management Console.", "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^vpc-\\S+" }, "ResourceCreationLimitPolicy": { "description": "A policy that limits the number of game sessions an individual player can create over a span of time for this fleet.", @@ -297,17 +297,17 @@ "FleetId": { "description": "Unique fleet ID", "type": "string", - "pattern": "" + "pattern": "^fleet-\\S+" }, "BuildId": { "description": "A unique identifier for a build to be deployed on the new fleet. If you are deploying the fleet with a custom game build, you must specify this property. The build must have been successfully uploaded to Amazon GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.", "type": "string", - "pattern": "" + "pattern": "^build-\\S+|^arn:.*:build\\/build-\\S+" }, "ScriptId": { "description": "A unique identifier for a Realtime script to be deployed on a new Realtime Servers fleet. The script must have been successfully uploaded to Amazon GameLift. This fleet setting cannot be changed once the fleet is created.\n\nNote: It is not currently possible to use the !Ref command to reference a script created with a CloudFormation template for the fleet property ScriptId. Instead, use Fn::GetAtt Script.Arn or Fn::GetAtt Script.Id to retrieve either of these properties as input for ScriptId. Alternatively, enter a ScriptId string manually.", "type": "string", - "pattern": "" + "pattern": "^script-\\S+|^arn:.*:script\\/script-\\S+" }, "RuntimeConfiguration": { "description": "Instructions for launching server processes on each instance in the fleet. Server processes run either a custom game build executable or a Realtime script. The runtime configuration defines the server executables or launch script file, launch parameters, and the number of processes to run concurrently on each instance. When creating a fleet, the runtime configuration must have at least one server process configuration; otherwise the request fails with an invalid request exception.\n\nThis parameter is required unless the parameters ServerLaunchPath and ServerLaunchParameters are defined. Runtime configuration has replaced these parameters, but fleets that use them will continue to work.", diff --git a/internal/service/cloudformation/schemas/AWS_GameLift_GameServerGroup.json b/internal/service/cloudformation/schemas/AWS_GameLift_GameServerGroup.json index 05783be157..ec8a1a720c 100644 --- a/internal/service/cloudformation/schemas/AWS_GameLift_GameServerGroup.json +++ b/internal/service/cloudformation/schemas/AWS_GameLift_GameServerGroup.json @@ -61,7 +61,7 @@ "GameServerGroupName": { "type": "string", "description": "An identifier for the new game server group.", - "pattern": "", + "pattern": "[a-zA-Z0-9-\\.]+", "minLength": 1, "maxLength": 128 }, @@ -76,7 +76,7 @@ "GameServerGroupArn": { "description": "A generated unique ID for the game server group.", "type": "string", - "pattern": "", + "pattern": "^arn:.*:gameservergroup\\/[a-zA-Z0-9-\\.]*", "minLength": 1, "maxLength": 256 }, @@ -156,7 +156,7 @@ "RoleArn": { "type": "string", "description": "The Amazon Resource Name (ARN) for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups.", - "pattern": "", + "pattern": "^arn:.*:role\\/[\\w+=,.@-]+", "minLength": 1, "maxLength": 256 }, @@ -189,7 +189,7 @@ "description": "A list of virtual private cloud (VPC) subnets to use with instances in the game server group.", "items": { "type": "string", - "pattern": "", + "pattern": "^subnet-[0-9a-z]+$", "minLength": 15, "maxLength": 24 }, @@ -245,7 +245,7 @@ "description": "A generated unique ID for the EC2 Auto Scaling group that is associated with this game server group.", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "[ -\ud7ff\ue000-\ufffd\ud800\udc00-\udbff\udfff\r\n\t]*" }, "CreationTime": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_GlobalAccelerator_Accelerator.json b/internal/service/cloudformation/schemas/AWS_GlobalAccelerator_Accelerator.json index 51fc7ea03b..17fc45525e 100644 --- a/internal/service/cloudformation/schemas/AWS_GlobalAccelerator_Accelerator.json +++ b/internal/service/cloudformation/schemas/AWS_GlobalAccelerator_Accelerator.json @@ -27,7 +27,7 @@ "additionalProperties": false }, "IpAddress": { - "pattern": "", + "pattern": "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$", "description": "The IP addresses from BYOIP Prefix pool.", "type": "string" } @@ -36,7 +36,7 @@ "Name": { "description": "Name of accelerator.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]{0,64}$", "minLength": 1, "maxLength": 64 }, diff --git a/internal/service/cloudformation/schemas/AWS_Glue_Registry.json b/internal/service/cloudformation/schemas/AWS_Glue_Registry.json index a649a693cc..1ba2246cf8 100644 --- a/internal/service/cloudformation/schemas/AWS_Glue_Registry.json +++ b/internal/service/cloudformation/schemas/AWS_Glue_Registry.json @@ -30,7 +30,7 @@ "Arn": { "description": "Amazon Resource Name for the created Registry.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*" }, "Name": { "description": "Name of the registry to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.", diff --git a/internal/service/cloudformation/schemas/AWS_Glue_Schema.json b/internal/service/cloudformation/schemas/AWS_Glue_Schema.json index 8d0edf1ddb..024911fe4d 100644 --- a/internal/service/cloudformation/schemas/AWS_Glue_Schema.json +++ b/internal/service/cloudformation/schemas/AWS_Glue_Schema.json @@ -16,7 +16,7 @@ "Arn": { "description": "Amazon Resource Name for the Registry.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*" } }, "additionalProperties": false @@ -65,7 +65,7 @@ "Arn": { "description": "Amazon Resource Name for the Schema.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*" }, "Registry": { "$ref": "#/definitions/Registry" @@ -113,7 +113,7 @@ "InitialSchemaVersionId": { "type": "string", "description": "Represents the version ID associated with the initial schema version.", - "pattern": "" + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersion.json b/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersion.json index 8b9558ad9c..8f061546ea 100644 --- a/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersion.json +++ b/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersion.json @@ -10,7 +10,7 @@ "SchemaArn": { "description": "Amazon Resource Name for the Schema. This attribute can be used to uniquely represent the Schema.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*" }, "SchemaName": { "description": "Name of the schema. This parameter requires RegistryName to be provided.", @@ -41,7 +41,7 @@ "VersionId": { "type": "string", "description": "Represents the version ID associated with the schema version.", - "pattern": "" + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersionMetadata.json b/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersionMetadata.json index a980e772f2..9940d3aaf6 100644 --- a/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersionMetadata.json +++ b/internal/service/cloudformation/schemas/AWS_Glue_SchemaVersionMetadata.json @@ -6,7 +6,7 @@ "SchemaVersionId": { "type": "string", "description": "Represents the version ID associated with the schema version.", - "pattern": "" + "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" }, "Key": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_GreengrassV2_ComponentVersion.json b/internal/service/cloudformation/schemas/AWS_GreengrassV2_ComponentVersion.json index c5ab4edafc..55c16fd30d 100644 --- a/internal/service/cloudformation/schemas/AWS_GreengrassV2_ComponentVersion.json +++ b/internal/service/cloudformation/schemas/AWS_GreengrassV2_ComponentVersion.json @@ -7,7 +7,7 @@ "properties": { "LambdaArn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws(-(cn|us-gov))?:lambda:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$" }, "ComponentName": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_GroundStation_Config.json b/internal/service/cloudformation/schemas/AWS_GroundStation_Config.json index 50d3df424b..e3ca31af83 100644 --- a/internal/service/cloudformation/schemas/AWS_GroundStation_Config.json +++ b/internal/service/cloudformation/schemas/AWS_GroundStation_Config.json @@ -104,7 +104,7 @@ }, "S3KeyPrefix": { "type": "string", - "pattern": "" + "pattern": "^([a-zA-Z0-9_\\-=/]|\\{satellite_id\\}|\\{config\\-name}|\\{s3\\-config-id}|\\{year\\}|\\{month\\}|\\{day\\}){1,900}$" }, "BucketArn": { "type": "string" @@ -254,11 +254,11 @@ "properties": { "Key": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$" }, "Value": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$" } }, "additionalProperties": false @@ -267,7 +267,7 @@ "properties": { "Name": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9_:-]{1,256}$" }, "Tags": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_GroundStation_DataflowEndpointGroup.json b/internal/service/cloudformation/schemas/AWS_GroundStation_DataflowEndpointGroup.json index f84622963b..a5450a4679 100644 --- a/internal/service/cloudformation/schemas/AWS_GroundStation_DataflowEndpointGroup.json +++ b/internal/service/cloudformation/schemas/AWS_GroundStation_DataflowEndpointGroup.json @@ -20,7 +20,7 @@ "properties": { "Name": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9_:-]{1,256}$" }, "Address": { "$ref": "#/definitions/SocketAddress" @@ -69,11 +69,11 @@ "properties": { "Key": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$" }, "Value": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$" } }, "additionalProperties": false diff --git a/internal/service/cloudformation/schemas/AWS_GroundStation_MissionProfile.json b/internal/service/cloudformation/schemas/AWS_GroundStation_MissionProfile.json index ef2ffeac1c..f2f8580713 100644 --- a/internal/service/cloudformation/schemas/AWS_GroundStation_MissionProfile.json +++ b/internal/service/cloudformation/schemas/AWS_GroundStation_MissionProfile.json @@ -20,11 +20,11 @@ "properties": { "Key": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$" }, "Value": { "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$" } }, "additionalProperties": false @@ -34,7 +34,7 @@ "Name": { "description": "A name used to identify a mission profile.", "type": "string", - "pattern": "" + "pattern": "^[ a-zA-Z0-9_:-]{1,256}$" }, "ContactPrePassDurationSeconds": { "description": "Pre-pass time needed before the contact.", @@ -126,4 +126,4 @@ } }, "additionalProperties": false -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_HealthLake_FHIRDatastore.json b/internal/service/cloudformation/schemas/AWS_HealthLake_FHIRDatastore.json index a9d695f718..d16f1f195d 100644 --- a/internal/service/cloudformation/schemas/AWS_HealthLake_FHIRDatastore.json +++ b/internal/service/cloudformation/schemas/AWS_HealthLake_FHIRDatastore.json @@ -25,7 +25,7 @@ "DatastoreArn": { "description": "The Amazon Resource Name used in the creation of the Data Store.", "type": "string", - "pattern": "" + "pattern": "^arn:aws((-us-gov)|(-iso)|(-iso-b)|(-cn))?:healthlake:[a-zA-Z0-9-]+:[0-9]{12}:datastore/.+?" }, "DatastoreEndpoint": { "description": "The AWS endpoint for the Data Store. Each Data Store will have it's own endpoint with Data Store ID in the endpoint URL.", @@ -108,7 +108,7 @@ "type": "string", "minLength": 1, "maxLength": 400, - "pattern": "" + "pattern": "(arn:aws((-us-gov)|(-iso)|(-iso-b)|(-cn))?:kms:)?([a-z]{2}-[a-z]+(-[a-z]+)?-\\d:)?(\\d{12}:)?(((key/)?[a-zA-Z0-9-_]+)|(alias/[a-zA-Z0-9:/_-]+))" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_IAM_OIDCProvider.json b/internal/service/cloudformation/schemas/AWS_IAM_OIDCProvider.json index 0f370ff678..ebe21d5af6 100644 --- a/internal/service/cloudformation/schemas/AWS_IAM_OIDCProvider.json +++ b/internal/service/cloudformation/schemas/AWS_IAM_OIDCProvider.json @@ -21,7 +21,7 @@ "items": { "minLength": 40, "maxLength": 40, - "pattern": "", + "pattern": "[0-9A-Fa-f]{40}", "type": "string" }, "maxItems": 5 diff --git a/internal/service/cloudformation/schemas/AWS_IAM_SAMLProvider.json b/internal/service/cloudformation/schemas/AWS_IAM_SAMLProvider.json index 2fd6fa3ae1..e4168bcbb6 100644 --- a/internal/service/cloudformation/schemas/AWS_IAM_SAMLProvider.json +++ b/internal/service/cloudformation/schemas/AWS_IAM_SAMLProvider.json @@ -6,7 +6,7 @@ "Name": { "minLength": 1, "maxLength": 128, - "pattern": "", + "pattern": "[\\w._-]+", "type": "string" }, "SamlMetadataDocument": { diff --git a/internal/service/cloudformation/schemas/AWS_IAM_ServerCertificate.json b/internal/service/cloudformation/schemas/AWS_IAM_ServerCertificate.json index 07a44b3c77..3c2726202f 100644 --- a/internal/service/cloudformation/schemas/AWS_IAM_ServerCertificate.json +++ b/internal/service/cloudformation/schemas/AWS_IAM_ServerCertificate.json @@ -18,7 +18,7 @@ "ServerCertificateName": { "minLength": 1, "maxLength": 128, - "pattern": "", + "pattern": "[\\w+=,.@-]+", "type": "string" }, "Path": { diff --git a/internal/service/cloudformation/schemas/AWS_IAM_VirtualMFADevice.json b/internal/service/cloudformation/schemas/AWS_IAM_VirtualMFADevice.json index 044694be0d..25b1707784 100644 --- a/internal/service/cloudformation/schemas/AWS_IAM_VirtualMFADevice.json +++ b/internal/service/cloudformation/schemas/AWS_IAM_VirtualMFADevice.json @@ -6,7 +6,7 @@ "VirtualMfaDeviceName": { "minLength": 1, "maxLength": 226, - "pattern": "", + "pattern": "[\\w+=,.@-]+", "type": "string" }, "Path": { @@ -18,7 +18,7 @@ "SerialNumber": { "minLength": 9, "maxLength": 256, - "pattern": "", + "pattern": "[\\w+=/:,.@-]+", "type": "string" }, "Users": { diff --git a/internal/service/cloudformation/schemas/AWS_IVS_Channel.json b/internal/service/cloudformation/schemas/AWS_IVS_Channel.json index 2c558458b9..a91af83d60 100644 --- a/internal/service/cloudformation/schemas/AWS_IVS_Channel.json +++ b/internal/service/cloudformation/schemas/AWS_IVS_Channel.json @@ -28,7 +28,7 @@ "Arn": { "description": "Channel ARN is automatically generated on creation and assigned as the unique identifier.", "type": "string", - "pattern": "", + "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$", "minLength": 1, "maxLength": 128 }, @@ -37,7 +37,7 @@ "type": "string", "minLength": 0, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_]*$" }, "Authorized": { "description": "Whether the channel is authorized.", @@ -81,7 +81,7 @@ "description": "Recording Configuration ARN. A value other than an empty string indicates that recording is enabled. Default: ?? (recording is disabled).", "type": "string", "default": "", - "pattern": "", + "pattern": "^$|arn:aws:ivs:[a-z0-9-]+:[0-9]+:recording-configuration/[a-zA-Z0-9-]+$", "minLength": 0, "maxLength": 128 } diff --git a/internal/service/cloudformation/schemas/AWS_IVS_PlaybackKeyPair.json b/internal/service/cloudformation/schemas/AWS_IVS_PlaybackKeyPair.json index bc7732cbbc..98b7172c45 100644 --- a/internal/service/cloudformation/schemas/AWS_IVS_PlaybackKeyPair.json +++ b/internal/service/cloudformation/schemas/AWS_IVS_PlaybackKeyPair.json @@ -28,7 +28,7 @@ "Name": { "description": "An arbitrary string (a nickname) assigned to a playback key pair that helps the customer identify that resource. The value does not need to be unique.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9-_]*$", "minLength": 0, "maxLength": 128 }, @@ -43,7 +43,7 @@ "Arn": { "description": "Key-pair identifier.", "type": "string", - "pattern": "", + "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:playback-key/[a-zA-Z0-9-]+$", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_IVS_RecordingConfiguration.json b/internal/service/cloudformation/schemas/AWS_IVS_RecordingConfiguration.json index a2de62e561..2adbfc095a 100644 --- a/internal/service/cloudformation/schemas/AWS_IVS_RecordingConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_IVS_RecordingConfiguration.json @@ -43,7 +43,7 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "^[a-z0-9-.]+$" } }, "required": ["BucketName"] @@ -75,7 +75,7 @@ "Arn": { "description": "Recording Configuration ARN is automatically generated on creation and assigned as the unique identifier.", "type": "string", - "pattern": "", + "pattern": "^arn:aws[-a-z]*:ivs:[a-z0-9-]+:[0-9]+:recording-configuration/[a-zA-Z0-9-]+$", "minLength": 1, "maxLength": 128 }, @@ -84,7 +84,7 @@ "type": "string", "minLength": 0, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_]*$" }, "State": { "description": "Recording Configuration State.", diff --git a/internal/service/cloudformation/schemas/AWS_IVS_StreamKey.json b/internal/service/cloudformation/schemas/AWS_IVS_StreamKey.json index 94766a614e..e146026668 100644 --- a/internal/service/cloudformation/schemas/AWS_IVS_StreamKey.json +++ b/internal/service/cloudformation/schemas/AWS_IVS_StreamKey.json @@ -28,14 +28,14 @@ "Arn": { "description": "Stream Key ARN is automatically generated on creation and assigned as the unique identifier.", "type": "string", - "pattern": "", + "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:stream-key/[a-zA-Z0-9-]+$", "minLength": 1, "maxLength": 128 }, "ChannelArn": { "description": "Channel ARN for the stream.", "type": "string", - "pattern": "" + "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$" }, "Tags": { "description": "A list of key-value pairs that contain metadata for the asset model.", diff --git a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Channel.json b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Channel.json index 28d4286357..fb6d8b71c5 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Channel.json +++ b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Channel.json @@ -37,7 +37,7 @@ "properties": { "Bucket": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9.\\-_]*$", "minLength": 3, "maxLength": 255 }, @@ -48,7 +48,7 @@ }, "KeyPrefix": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9!_.*'()/{}:-]*/$", "minLength": 1, "maxLength": 255 } @@ -148,4 +148,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Dataset.json b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Dataset.json index 5399009435..9deb7288bd 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Dataset.json +++ b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Dataset.json @@ -112,7 +112,7 @@ "properties": { "ActionName": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_]+$", "minLength": 1, "maxLength": 128 }, @@ -161,7 +161,7 @@ "properties": { "InputName": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", "minLength": 1, "maxLength": 128 }, @@ -185,7 +185,7 @@ }, "RuleName": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_]+$", "minLength": 1, "maxLength": 128 } @@ -371,7 +371,7 @@ "properties": { "FileName": { "type": "string", - "pattern": "" + "pattern": "^[\\w\\.-]{1,255}$" } }, "required": [ @@ -399,13 +399,13 @@ }, "Bucket": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9.\\-_]*$", "minLength": 3, "maxLength": 255 }, "Key": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9!_.*'()/{}:-]*$", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Datastore.json b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Datastore.json index b3d947853e..36d90fb737 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Datastore.json +++ b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Datastore.json @@ -9,7 +9,7 @@ }, "DatastoreName": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 128 }, @@ -115,7 +115,7 @@ "properties": { "Bucket": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9.\\-_]*", "minLength": 3, "maxLength": 255 }, @@ -126,7 +126,7 @@ }, "KeyPrefix": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9!_.*'()/{}:-]*/", "minLength": 1, "maxLength": 255 } @@ -151,13 +151,13 @@ "properties": { "Bucket": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9.\\-_]*", "minLength": 3, "maxLength": 255 }, "KeyPrefix": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9!_.*'()/{}:-]*/", "minLength": 1, "maxLength": 255 } @@ -238,7 +238,7 @@ "properties": { "AttributeName": { "type": "string", - "pattern": "" + "pattern": "[a-zA-Z0-9_]+" } }, "required": [ @@ -251,11 +251,11 @@ "properties": { "AttributeName": { "type": "string", - "pattern": "" + "pattern": "[a-zA-Z0-9_]+" }, "TimestampFormat": { "type": "string", - "pattern": "" + "pattern": "[a-zA-Z0-9\\s\\[\\]_,.'/:-]*" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Pipeline.json b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Pipeline.json index c07a2e4141..d1c8bfca2d 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Pipeline.json +++ b/internal/service/cloudformation/schemas/AWS_IoTAnalytics_Pipeline.json @@ -9,7 +9,7 @@ }, "PipelineName" : { "type" : "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 128 }, @@ -183,7 +183,7 @@ "properties" : { "DatastoreName" : { "type" : "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 128 }, @@ -203,7 +203,7 @@ "properties" : { "ChannelName" : { "type" : "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 128 }, @@ -269,7 +269,7 @@ }, "LambdaName" : { "type" : "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_-]+", "minLength": 1, "maxLength": 64 }, @@ -419,4 +419,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_IoTEvents_DetectorModel.json b/internal/service/cloudformation/schemas/AWS_IoTEvents_DetectorModel.json index 886ea289fc..1a817fb93a 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTEvents_DetectorModel.json +++ b/internal/service/cloudformation/schemas/AWS_IoTEvents_DetectorModel.json @@ -323,7 +323,7 @@ "Separator": { "type": "string", "description": "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", - "pattern": "" + "pattern": "([\\n\\t])|(\\r\\n)|(,)" } }, "required": [ @@ -340,7 +340,7 @@ "description": "The name of the AWS IoT Events input where the data is sent.", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" }, "Payload": { "$ref": "#/definitions/Payload" @@ -476,7 +476,7 @@ "description": "The name of the variable.", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" } }, "required": [ @@ -638,7 +638,7 @@ "description": "The name of the detector model.", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9_-]+$" }, "EvaluationMethod": { "type": "string", @@ -653,7 +653,7 @@ "description": "The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.\n\nThis parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^((`[\\w\\- ]+`)|([\\w\\-]+))(\\.((`[\\w\\- ]+`)|([\\w\\-]+)))*$" }, "RoleArn": { "type": "string", @@ -724,4 +724,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_IoTEvents_Input.json b/internal/service/cloudformation/schemas/AWS_IoTEvents_Input.json index 55bb9c5476..139f003ca1 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTEvents_Input.json +++ b/internal/service/cloudformation/schemas/AWS_IoTEvents_Input.json @@ -33,7 +33,7 @@ "description": "An expression that specifies an attribute-value pair in a JSON structure. Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to AWS IoT Events (`BatchPutMessage`). Each such message contains a JSON payload. The attribute (and its paired value) specified here are available for use in the `condition` expressions used by detectors.\n\n_Syntax_: `....`", "minLength": 1, "maxLength": 128, - "pattern": "", + "pattern": "^((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+))(\\.((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+)))*$", "type": "string" } }, @@ -75,7 +75,7 @@ "description": "The name of the input.", "minLength": 1, "maxLength": 128, - "pattern": "", + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", "type": "string" }, "Tags": { diff --git a/internal/service/cloudformation/schemas/AWS_IoTFleetHub_Application.json b/internal/service/cloudformation/schemas/AWS_IoTFleetHub_Application.json index 4cc7faa6fe..45122496b1 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTFleetHub_Application.json +++ b/internal/service/cloudformation/schemas/AWS_IoTFleetHub_Application.json @@ -31,28 +31,28 @@ "ApplicationId": { "description": "The ID of the application.", "type": "string", - "pattern": "", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "minLength": 36, "maxLength": 36 }, "ApplicationArn": { "description": "The ARN of the application.", "type": "string", - "pattern": "", + "pattern": "^arn:[!-~]+$", "minLength": 1, "maxLength": 1600 }, "ApplicationName": { "description": "Application Name, should be between 1 and 256 characters.", "type": "string", - "pattern": "", + "pattern": "^[ -~]*$", "minLength": 1, "maxLength": 256 }, "ApplicationDescription": { "description": "Application Description, should be between 1 and 2048 characters.", "type": "string", - "pattern": "", + "pattern": "^[ -~]*$", "minLength": 1, "maxLength": 2048 }, @@ -75,7 +75,7 @@ "RoleArn": { "description": "The ARN of the role that the web application assumes when it interacts with AWS IoT Core. For more info on configuring this attribute, see https://docs.aws.amazon.com/iot/latest/apireference/API_iotfleethub_CreateApplication.html#API_iotfleethub_CreateApplication_RequestSyntax", "type": "string", - "pattern": "", + "pattern": "^arn:[!-~]+$", "minLength": 1, "maxLength": 1600 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoTWireless_Destination.json b/internal/service/cloudformation/schemas/AWS_IoTWireless_Destination.json index c2045136c8..82757a593b 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTWireless_Destination.json +++ b/internal/service/cloudformation/schemas/AWS_IoTWireless_Destination.json @@ -24,7 +24,7 @@ "Name": { "description": "Unique name of destination", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "maxLength": 128 }, "Expression": { diff --git a/internal/service/cloudformation/schemas/AWS_IoTWireless_PartnerAccount.json b/internal/service/cloudformation/schemas/AWS_IoTWireless_PartnerAccount.json index a86c6d6d9c..d5c45c82eb 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTWireless_PartnerAccount.json +++ b/internal/service/cloudformation/schemas/AWS_IoTWireless_PartnerAccount.json @@ -9,7 +9,7 @@ "properties": { "AppServerPrivateKey": { "type": "string", - "pattern": "", + "pattern": "[a-fA-F0-9]{64}", "minLength": 1, "maxLength": 4096 } @@ -28,7 +28,7 @@ }, "Fingerprint": { "type": "string", - "pattern": "", + "pattern": "[a-fA-F0-9]{64}", "minLength": 64, "maxLength": 64 }, @@ -43,7 +43,7 @@ "properties": { "AppServerPrivateKey": { "type": "string", - "pattern": "", + "pattern": "[a-fA-F0-9]{64}", "minLength": 1, "maxLength": 4096 } @@ -98,7 +98,7 @@ "Fingerprint": { "description": "The fingerprint of the Sidewalk application server private key.", "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{64}" }, "Arn": { "description": "PartnerAccount arn. Returned after successful create.", @@ -160,4 +160,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_IoTWireless_TaskDefinition.json b/internal/service/cloudformation/schemas/AWS_IoTWireless_TaskDefinition.json index 5e49641861..18fda4c2e1 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTWireless_TaskDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_IoTWireless_TaskDefinition.json @@ -115,7 +115,7 @@ "Id": { "description": "The ID of the new wireless gateway task definition", "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" }, "TaskDefinitionType": { "description": "A filter to list only the wireless gateway task definitions that use this task definition type", diff --git a/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessDevice.json b/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessDevice.json index 3fe922273f..269650f3f0 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessDevice.json +++ b/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessDevice.json @@ -9,11 +9,11 @@ "properties": { "AppKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "AppEui": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{16}" } }, "required": [ @@ -27,15 +27,15 @@ "properties": { "AppKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "NwkKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "JoinEui": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{16}" } }, "required": [ @@ -50,19 +50,19 @@ "properties": { "FNwkSIntKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "SNwkSIntKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "NwkSEncKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "AppSKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" } }, "required": [ @@ -78,7 +78,7 @@ "properties": { "DevAddr": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{8}" }, "SessionKeys": { "$ref": "#/definitions/SessionKeysAbpV11" @@ -95,11 +95,11 @@ "properties": { "NwkSKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" }, "AppSKey": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{32}" } }, "required": [ @@ -113,7 +113,7 @@ "properties": { "DevAddr": { "type": "string", - "pattern": "" + "pattern": "[a-fA-F0-9]{8}" }, "SessionKeys": { "$ref": "#/definitions/SessionKeysAbpV10x" @@ -130,7 +130,7 @@ "properties": { "DevEui": { "type": "string", - "pattern": "" + "pattern": "[a-f0-9]{16}" }, "DeviceProfileId": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessGateway.json b/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessGateway.json index 0c3e4a0954..be4713cbf8 100644 --- a/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessGateway.json +++ b/internal/service/cloudformation/schemas/AWS_IoTWireless_WirelessGateway.json @@ -9,7 +9,7 @@ "properties": { "GatewayEui": { "type": "string", - "pattern": "" + "pattern": "^(([0-9A-Fa-f]{2}-){7}|([0-9A-Fa-f]{2}:){7}|([0-9A-Fa-f]{2}\\s){7}|([0-9A-Fa-f]{2}){7})([0-9A-Fa-f]{2})$" }, "RfRegion": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_IoT_Authorizer.json b/internal/service/cloudformation/schemas/AWS_IoT_Authorizer.json index 95233e76b1..6e3e609515 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_Authorizer.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_Authorizer.json @@ -29,7 +29,7 @@ }, "AuthorizerName": { "type": "string", - "pattern": "", + "pattern": "[\\w=,@-]+", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoT_CustomMetric.json b/internal/service/cloudformation/schemas/AWS_IoT_CustomMetric.json index 693e73e251..73689cb800 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_CustomMetric.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_CustomMetric.json @@ -31,7 +31,7 @@ "MetricName": { "description": "The name of the custom metric. This will be used in the metric report submitted from the device/thing. Shouldn't begin with aws: . Cannot be updated once defined.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoT_Dimension.json b/internal/service/cloudformation/schemas/AWS_IoT_Dimension.json index f7db88434b..fe5691ff6f 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_Dimension.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_Dimension.json @@ -31,7 +31,7 @@ "Name": { "description": "A unique identifier for the dimension.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoT_DomainConfiguration.json b/internal/service/cloudformation/schemas/AWS_IoT_DomainConfiguration.json index 078f245be2..8d50c0bf3f 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_DomainConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_DomainConfiguration.json @@ -13,7 +13,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[\\w=,@-]+$" } }, "additionalProperties": false @@ -23,7 +23,7 @@ "properties": { "ServerCertificateArn": { "type": "string", - "pattern": "", + "pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$", "minLength": 1, "maxLength": 2048 }, @@ -62,7 +62,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[\\w.-]+$" }, "AuthorizerConfig": { "$ref": "#/definitions/AuthorizerConfig" @@ -78,7 +78,7 @@ "maxItems": 1, "items": { "type": "string", - "pattern": "", + "pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$", "minLength": 1, "maxLength": 2048 } @@ -93,7 +93,7 @@ }, "ValidationCertificateArn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$" }, "Arn": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_IoT_JobTemplate.json b/internal/service/cloudformation/schemas/AWS_IoT_JobTemplate.json index a1a61b9621..81fbc0e0ea 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_JobTemplate.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_JobTemplate.json @@ -1 +1 @@ -{"documentationUrl":"https://docs.aws.amazon.com/iot/latest/developerguide/job-templates.html","taggable":true,"typeName":"AWS::IoT::JobTemplate","readOnlyProperties":["/properties/Arn"],"description":"Job templates enable you to preconfigure jobs so that you can deploy them to multiple sets of target devices.","createOnlyProperties":["/properties/JobTemplateId","/properties/JobArn","/properties/Description","/properties/Document","/properties/DocumentSource","/properties/TimeoutConfig","/properties/JobExecutionsRolloutConfig","/properties/AbortConfig","/properties/PresignedUrlConfig","/properties/Tags"],"primaryIdentifier":["/properties/JobTemplateId"],"required":["JobTemplateId","Description"],"sourceUrl":"https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-iot.git","handlers":{"read":{"permissions":["iot:DescribeJobTemplate"]},"create":{"permissions":["iot:CreateJobTemplate","iam:PassRole","s3:GetObject"]},"list":{"permissions":["iot:ListJobTemplates"]},"delete":{"permissions":["iot:DeleteJobTemplate"]}},"writeOnlyProperties":["/properties/JobArn","/properties/Tags"],"additionalProperties":false,"definitions":{"ExpiresInSec":{"description":"How number (in seconds) pre-signed URLs are valid.","maximum":3600,"type":"integer","minimum":60},"Action":{"type":"string","enum":["CANCEL"]},"FailureType":{"type":"string","enum":["FAILED","REJECTED","TIMED_OUT","ALL"]},"BaseRatePerMinute":{"type":"integer","minimum":1},"NumberOfNotifiedThings":{"type":"integer","minimum":1},"RoleArn":{"minLength":20,"description":"The ARN of an IAM role that grants grants permission to download files from the S3 bucket where the job data/updates are stored. The role must also grant permission for IoT to download the files.","type":"string","maxLength":2048},"ExponentialRolloutRate":{"description":"Allows you to create an exponential rate of rollout for a job.","additionalProperties":false,"type":"object","properties":{"RateIncreaseCriteria":{"description":"The criteria to initiate the increase in rate of rollout for a job.","type":"object","$ref":"#/definitions/RateIncreaseCriteria"},"BaseRatePerMinute":{"description":"The minimum number of things that will be notified of a pending job, per minute at the start of job rollout. This parameter allows you to define the initial rate of rollout.","$ref":"#/definitions/BaseRatePerMinute"},"IncrementFactor":{"description":"The exponential factor to increase the rate of rollout for a job.","$ref":"#/definitions/IncrementFactor"}},"required":["BaseRatePerMinute","IncrementFactor","RateIncreaseCriteria"]},"IncrementFactor":{"maximum":5,"type":"number","minimum":1},"InProgressTimeoutInMinutes":{"description":"Specifies the amount of time, in minutes, this device has to finish execution of this job.","maximum":10080,"type":"integer","minimum":1},"RateIncreaseCriteria":{"additionalProperties":false,"type":"object","properties":{"NumberOfSucceededThings":{"$ref":"#/definitions/NumberOfSucceededThings"},"NumberOfNotifiedThings":{"$ref":"#/definitions/NumberOfNotifiedThings"}}},"MaximumPerMinute":{"type":"integer","minimum":1},"AbortCriteria":{"description":"The criteria that determine when and how a job abort takes place.","additionalProperties":false,"type":"object","properties":{"Action":{"description":"The type of job action to take to initiate the job abort.","$ref":"#/definitions/Action"},"FailureType":{"description":"The type of job execution failures that can initiate a job abort.","$ref":"#/definitions/FailureType"},"ThresholdPercentage":{"description":"The minimum percentage of job execution failures that must occur to initiate the job abort.","$ref":"#/definitions/ThresholdPercentage"},"MinNumberOfExecutedThings":{"description":"The minimum number of things which must receive job execution notifications before the job can be aborted.","$ref":"#/definitions/MinNumberOfExecutedThings"}},"required":["Action","FailureType","MinNumberOfExecutedThings","ThresholdPercentage"]},"RetryCriteria":{"description":"Specifies how many times a failure type should be retried.","additionalProperties":false,"type":"object","properties":{"FailureType":{"$ref":"#/definitions/JobRetryFailureType"},"NumberOfRetries":{"maximum":10,"type":"integer","minimum":0}}},"NumberOfSucceededThings":{"type":"integer","minimum":1},"ThresholdPercentage":{"maximum":100,"type":"number"},"Tag":{"description":"A key-value pair to associate with a resource.","additionalProperties":false,"type":"object","properties":{"Value":{"minLength":1,"description":"The tag's value.","type":"string","maxLength":256},"Key":{"minLength":1,"description":"The tag's key.","type":"string","maxLength":128}},"required":["Value","Key"]},"MinNumberOfExecutedThings":{"type":"integer","minimum":1},"JobRetryFailureType":{"type":"string","enum":["FAILED","TIMED_OUT","ALL"]}},"properties":{"JobArn":{"description":"Optional for copying a JobTemplate from a pre-existing Job configuration.","type":"string"},"TimeoutConfig":{"description":"Specifies the amount of time each device has to finish its execution of the job.","additionalProperties":false,"type":"object","properties":{"InProgressTimeoutInMinutes":{"$ref":"#/definitions/InProgressTimeoutInMinutes"}},"required":["InProgressTimeoutInMinutes"]},"JobExecutionsRolloutConfig":{"description":"Allows you to create a staged rollout of a job.","additionalProperties":false,"type":"object","properties":{"MaximumPerMinute":{"description":"The maximum number of things that will be notified of a pending job, per minute. This parameter allows you to create a staged rollout.","$ref":"#/definitions/MaximumPerMinute"},"ExponentialRolloutRate":{"description":"The rate of increase for a job rollout. This parameter allows you to define an exponential rate for a job rollout.","$ref":"#/definitions/ExponentialRolloutRate"}}},"Description":{"pattern":"[^\\p{C}]+","description":"A description of the Job Template.","type":"string","maxLength":2028},"JobExecutionsRetryConfig":{"additionalProperties":false,"type":"object","properties":{"RetryCriteriaList":{"minItems":1,"maxItems":2,"insertionOrder":false,"type":"array","items":{"$ref":"#/definitions/RetryCriteria"}}}},"DocumentSource":{"minLength":1,"description":"An S3 link to the job document to use in the template. Required if you don't specify a value for document.","type":"string","maxLength":1350},"AbortConfig":{"description":"The criteria that determine when and how a job abort takes place.","additionalProperties":false,"type":"object","properties":{"CriteriaList":{"minItems":1,"insertionOrder":false,"type":"array","items":{"$ref":"#/definitions/AbortCriteria"}}},"required":["CriteriaList"]},"Arn":{"type":"string"},"JobTemplateId":{"minLength":1,"pattern":"[a-zA-Z0-9_-]+","type":"string","maxLength":64},"Document":{"description":"The job document. Required if you don't specify a value for documentSource.","type":"string","maxLength":32768},"PresignedUrlConfig":{"description":"Configuration for pre-signed S3 URLs.","additionalProperties":false,"type":"object","properties":{"ExpiresInSec":{"$ref":"#/definitions/ExpiresInSec"},"RoleArn":{"$ref":"#/definitions/RoleArn"}},"required":["RoleArn"]},"Tags":{"maxItems":50,"uniqueItems":true,"description":"Metadata that can be used to manage the JobTemplate.","insertionOrder":false,"type":"array","items":{"$ref":"#/definitions/Tag"}}}} \ No newline at end of file +{"documentationUrl":"https://docs.aws.amazon.com/iot/latest/developerguide/job-templates.html","taggable":true,"typeName":"AWS::IoT::JobTemplate","readOnlyProperties":["/properties/Arn"],"description":"Job templates enable you to preconfigure jobs so that you can deploy them to multiple sets of target devices.","createOnlyProperties":["/properties/JobTemplateId","/properties/JobArn","/properties/Description","/properties/Document","/properties/DocumentSource","/properties/TimeoutConfig","/properties/JobExecutionsRolloutConfig","/properties/AbortConfig","/properties/PresignedUrlConfig","/properties/Tags"],"primaryIdentifier":["/properties/JobTemplateId"],"required":["JobTemplateId","Description"],"sourceUrl":"https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-iot.git","handlers":{"read":{"permissions":["iot:DescribeJobTemplate"]},"create":{"permissions":["iot:CreateJobTemplate","iam:PassRole","s3:GetObject"]},"list":{"permissions":["iot:ListJobTemplates"]},"delete":{"permissions":["iot:DeleteJobTemplate"]}},"writeOnlyProperties":["/properties/JobArn","/properties/Tags"],"additionalProperties":false,"definitions":{"ExpiresInSec":{"description":"How number (in seconds) pre-signed URLs are valid.","maximum":3600,"type":"integer","minimum":60},"Action":{"type":"string","enum":["CANCEL"]},"FailureType":{"type":"string","enum":["FAILED","REJECTED","TIMED_OUT","ALL"]},"BaseRatePerMinute":{"type":"integer","minimum":1},"NumberOfNotifiedThings":{"type":"integer","minimum":1},"RoleArn":{"minLength":20,"description":"The ARN of an IAM role that grants grants permission to download files from the S3 bucket where the job data/updates are stored. The role must also grant permission for IoT to download the files.","type":"string","maxLength":2048},"ExponentialRolloutRate":{"description":"Allows you to create an exponential rate of rollout for a job.","additionalProperties":false,"type":"object","properties":{"RateIncreaseCriteria":{"description":"The criteria to initiate the increase in rate of rollout for a job.","type":"object","$ref":"#/definitions/RateIncreaseCriteria"},"BaseRatePerMinute":{"description":"The minimum number of things that will be notified of a pending job, per minute at the start of job rollout. This parameter allows you to define the initial rate of rollout.","$ref":"#/definitions/BaseRatePerMinute"},"IncrementFactor":{"description":"The exponential factor to increase the rate of rollout for a job.","$ref":"#/definitions/IncrementFactor"}},"required":["BaseRatePerMinute","IncrementFactor","RateIncreaseCriteria"]},"IncrementFactor":{"maximum":5,"type":"number","minimum":1},"InProgressTimeoutInMinutes":{"description":"Specifies the amount of time, in minutes, this device has to finish execution of this job.","maximum":10080,"type":"integer","minimum":1},"RateIncreaseCriteria":{"additionalProperties":false,"type":"object","properties":{"NumberOfSucceededThings":{"$ref":"#/definitions/NumberOfSucceededThings"},"NumberOfNotifiedThings":{"$ref":"#/definitions/NumberOfNotifiedThings"}}},"MaximumPerMinute":{"type":"integer","minimum":1},"AbortCriteria":{"description":"The criteria that determine when and how a job abort takes place.","additionalProperties":false,"type":"object","properties":{"Action":{"description":"The type of job action to take to initiate the job abort.","$ref":"#/definitions/Action"},"FailureType":{"description":"The type of job execution failures that can initiate a job abort.","$ref":"#/definitions/FailureType"},"ThresholdPercentage":{"description":"The minimum percentage of job execution failures that must occur to initiate the job abort.","$ref":"#/definitions/ThresholdPercentage"},"MinNumberOfExecutedThings":{"description":"The minimum number of things which must receive job execution notifications before the job can be aborted.","$ref":"#/definitions/MinNumberOfExecutedThings"}},"required":["Action","FailureType","MinNumberOfExecutedThings","ThresholdPercentage"]},"RetryCriteria":{"description":"Specifies how many times a failure type should be retried.","additionalProperties":false,"type":"object","properties":{"FailureType":{"$ref":"#/definitions/JobRetryFailureType"},"NumberOfRetries":{"maximum":10,"type":"integer","minimum":0}}},"NumberOfSucceededThings":{"type":"integer","minimum":1},"ThresholdPercentage":{"maximum":100,"type":"number"},"Tag":{"description":"A key-value pair to associate with a resource.","additionalProperties":false,"type":"object","properties":{"Value":{"minLength":1,"description":"The tag's value.","type":"string","maxLength":256},"Key":{"minLength":1,"description":"The tag's key.","type":"string","maxLength":128}},"required":["Value","Key"]},"MinNumberOfExecutedThings":{"type":"integer","minimum":1},"JobRetryFailureType":{"type":"string","enum":["FAILED","TIMED_OUT","ALL"]}},"properties":{"JobArn":{"description":"Optional for copying a JobTemplate from a pre-existing Job configuration.","type":"string"},"TimeoutConfig":{"description":"Specifies the amount of time each device has to finish its execution of the job.","additionalProperties":false,"type":"object","properties":{"InProgressTimeoutInMinutes":{"$ref":"#/definitions/InProgressTimeoutInMinutes"}},"required":["InProgressTimeoutInMinutes"]},"JobExecutionsRolloutConfig":{"description":"Allows you to create a staged rollout of a job.","additionalProperties":false,"type":"object","properties":{"MaximumPerMinute":{"description":"The maximum number of things that will be notified of a pending job, per minute. This parameter allows you to create a staged rollout.","$ref":"#/definitions/MaximumPerMinute"},"ExponentialRolloutRate":{"description":"The rate of increase for a job rollout. This parameter allows you to define an exponential rate for a job rollout.","$ref":"#/definitions/ExponentialRolloutRate"}}},"Description":{"pattern":"[^\\p{C}]+","description":"A description of the Job Template.","type":"string","maxLength":2028},"JobExecutionsRetryConfig":{"additionalProperties":false,"type":"object","properties":{"RetryCriteriaList":{"minItems":1,"maxItems":2,"insertionOrder":false,"type":"array","items":{"$ref":"#/definitions/RetryCriteria"}}}},"DocumentSource":{"minLength":1,"description":"An S3 link to the job document to use in the template. Required if you don't specify a value for document.","type":"string","maxLength":1350},"AbortConfig":{"description":"The criteria that determine when and how a job abort takes place.","additionalProperties":false,"type":"object","properties":{"CriteriaList":{"minItems":1,"insertionOrder":false,"type":"array","items":{"$ref":"#/definitions/AbortCriteria"}}},"required":["CriteriaList"]},"Arn":{"type":"string"},"JobTemplateId":{"minLength":1,"pattern":"[a-zA-Z0-9_-]+","type":"string","maxLength":64},"Document":{"description":"The job document. Required if you don't specify a value for documentSource.","type":"string","maxLength":32768},"PresignedUrlConfig":{"description":"Configuration for pre-signed S3 URLs.","additionalProperties":false,"type":"object","properties":{"ExpiresInSec":{"$ref":"#/definitions/ExpiresInSec"},"RoleArn":{"$ref":"#/definitions/RoleArn"}},"required":["RoleArn"]},"Tags":{"maxItems":50,"uniqueItems":true,"description":"Metadata that can be used to manage the JobTemplate.","insertionOrder":false,"type":"array","items":{"$ref":"#/definitions/Tag"}}}} diff --git a/internal/service/cloudformation/schemas/AWS_IoT_Logging.json b/internal/service/cloudformation/schemas/AWS_IoT_Logging.json index 6c06614c23..7c9ddc4145 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_Logging.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_Logging.json @@ -10,7 +10,7 @@ "type": "string", "minLength": 12, "maxLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "RoleArn": { "description": "The ARN of the role that allows IoT to write to Cloudwatch logs.", diff --git a/internal/service/cloudformation/schemas/AWS_IoT_MitigationAction.json b/internal/service/cloudformation/schemas/AWS_IoT_MitigationAction.json index c0fce2d604..71a78e3403 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_MitigationAction.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_MitigationAction.json @@ -174,7 +174,7 @@ "ActionName": { "description": "A unique identifier for the mitigation action.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoT_ProvisioningTemplate.json b/internal/service/cloudformation/schemas/AWS_IoT_ProvisioningTemplate.json index 4287ac70d7..03f28fde39 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_ProvisioningTemplate.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_ProvisioningTemplate.json @@ -37,7 +37,7 @@ }, "TemplateName": { "type": "string", - "pattern": "", + "pattern": "^[0-9A-Za-z_-]+$", "minLength": 1, "maxLength": 36 }, diff --git a/internal/service/cloudformation/schemas/AWS_IoT_ResourceSpecificLogging.json b/internal/service/cloudformation/schemas/AWS_IoT_ResourceSpecificLogging.json index ca38a2c342..099276ad82 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_ResourceSpecificLogging.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_ResourceSpecificLogging.json @@ -17,7 +17,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "[a-zA-Z0-9:_-]+" }, "LogLevel": { "description": "The log level for a specific target. Valid values are: ERROR, WARN, INFO, DEBUG, or DISABLED.", @@ -35,7 +35,7 @@ "type": "string", "minLength": 13, "maxLength": 140, - "pattern": "" + "pattern": "[a-zA-Z0-9:_-]+" } }, "createOnlyProperties": [ diff --git a/internal/service/cloudformation/schemas/AWS_IoT_ScheduledAudit.json b/internal/service/cloudformation/schemas/AWS_IoT_ScheduledAudit.json index d7620e2431..67267f3050 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_ScheduledAudit.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_ScheduledAudit.json @@ -31,7 +31,7 @@ "ScheduledAuditName": { "description": "The name you want to give to the scheduled audit.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, @@ -48,7 +48,7 @@ "DayOfMonth": { "description": "The day of the month on which the scheduled audit takes place. Can be 1 through 31 or LAST. This field is required if the frequency parameter is set to MONTHLY.", "type": "string", - "pattern": "" + "pattern": "^([1-9]|[12][0-9]|3[01])$|^LAST$" }, "DayOfWeek": { "description": "The day of the week on which the scheduled audit takes place. Can be one of SUN, MON, TUE,WED, THU, FRI, or SAT. This field is required if the frequency parameter is set to WEEKLY or BIWEEKLY.", diff --git a/internal/service/cloudformation/schemas/AWS_IoT_SecurityProfile.json b/internal/service/cloudformation/schemas/AWS_IoT_SecurityProfile.json index c83082b31b..eed79083d7 100644 --- a/internal/service/cloudformation/schemas/AWS_IoT_SecurityProfile.json +++ b/internal/service/cloudformation/schemas/AWS_IoT_SecurityProfile.json @@ -10,14 +10,14 @@ "Name": { "description": "The name for the behavior.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, "Metric": { "description": "What is measured by the behavior.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, @@ -44,7 +44,7 @@ "DimensionName": { "description": "A unique identifier for the dimension.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, @@ -234,7 +234,7 @@ "Metric": { "description": "What is measured by the behavior.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, @@ -275,7 +275,7 @@ "SecurityProfileName": { "description": "A unique identifier for the security profile.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 128 }, diff --git a/internal/service/cloudformation/schemas/AWS_KMS_Alias.json b/internal/service/cloudformation/schemas/AWS_KMS_Alias.json index a830c07bf9..f3cc3065ae 100644 --- a/internal/service/cloudformation/schemas/AWS_KMS_Alias.json +++ b/internal/service/cloudformation/schemas/AWS_KMS_Alias.json @@ -6,7 +6,7 @@ "AliasName": { "description": "Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. The alias/aws/ prefix is reserved for AWS managed CMKs.", "type": "string", - "pattern": "", + "pattern": "^(alias/)[a-zA-Z0-9:/_-]+$", "minLength": 1, "maxLength": 256 }, diff --git a/internal/service/cloudformation/schemas/AWS_KafkaConnect_Connector.json b/internal/service/cloudformation/schemas/AWS_KafkaConnect_Connector.json index 0d1f297d1a..4942d520d6 100644 --- a/internal/service/cloudformation/schemas/AWS_KafkaConnect_Connector.json +++ b/internal/service/cloudformation/schemas/AWS_KafkaConnect_Connector.json @@ -11,7 +11,7 @@ "ConnectorArn": { "description": "Amazon Resource Name for the created Connector.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*" }, "ConnectorConfiguration": { "description": "The configuration for the connector.", @@ -63,7 +63,7 @@ "ServiceExecutionRoleArn": { "description": "The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon S3 objects and other external resources.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):iam:.*" }, "WorkerConfiguration": { "$ref": "#/definitions/WorkerConfiguration" @@ -162,7 +162,7 @@ "CustomPluginArn": { "description": "The Amazon Resource Name (ARN) of the custom plugin to use.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*" }, "Revision": { "description": "The revision of the custom plugin to use.", @@ -363,7 +363,7 @@ "WorkerConfigurationArn": { "description": "The Amazon Resource Name (ARN) of the worker configuration to use.", "type": "string", - "pattern": "" + "pattern": "arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*" } }, "required": [ "Revision", "WorkerConfigurationArn" ] diff --git a/internal/service/cloudformation/schemas/AWS_Kendra_DataSource.json b/internal/service/cloudformation/schemas/AWS_Kendra_DataSource.json index 8e6a01aeb0..8d16856344 100644 --- a/internal/service/cloudformation/schemas/AWS_Kendra_DataSource.json +++ b/internal/service/cloudformation/schemas/AWS_Kendra_DataSource.json @@ -69,7 +69,7 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]" }, "S3ObjectKey": { "type": "string", @@ -126,7 +126,7 @@ "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "^(https?|ftp|file)://([^\\s]*)" }, "SecretArn": { "type": "string", @@ -144,7 +144,7 @@ "type": "string", "minLength": 1, "maxLength": 200, - "pattern": "" + "pattern": "[\\-0-9a-zA-Z]+" } }, "SecurityGroupIds": { @@ -154,7 +154,7 @@ "type": "string", "minLength": 1, "maxLength": 200, - "pattern": "" + "pattern": "[\\-0-9a-zA-Z]+" } } }, @@ -678,7 +678,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\\.)+[a-z]{2,}$" }, "OneDriveUsers": { "type": "object", @@ -1175,7 +1175,7 @@ }, "WebCrawlerSiteMap": { "type": "string", - "pattern": "", + "pattern": "^(https?):\\/\\/([^\\s]*)", "minLength": 1, "maxLength": 2048 }, @@ -1201,7 +1201,7 @@ }, "WebCrawlerSeedUrl": { "type": "string", - "pattern": "", + "pattern": "^(https?):\/\/([^\\s]*)", "minLength": 1, "maxLength": 2048 }, @@ -1250,7 +1250,7 @@ "properties": { "Host": { "type": "string", - "pattern": "", + "pattern": "([^\\s]*)", "minLength": 1, "maxLength": 253 }, @@ -1274,7 +1274,7 @@ "properties": { "Host": { "type": "string", - "pattern": "", + "pattern": "([^\\s]*)", "minLength": 1, "maxLength": 253 }, @@ -1361,7 +1361,7 @@ "type": "string", "minLength": 12, "maxLength": 12, - "pattern": "" + "pattern": "d-[0-9a-fA-F]{10}" }, "CrawlComments": { "type": "boolean" @@ -1620,7 +1620,7 @@ "type": "string", "minLength": 1, "maxLength": 200, - "pattern": "" + "pattern": "[a-zA-Z0-9_][a-zA-Z0-9_-]*" }, "DocumentAttributeValue": { "type": "object", diff --git a/internal/service/cloudformation/schemas/AWS_Kendra_Faq.json b/internal/service/cloudformation/schemas/AWS_Kendra_Faq.json index 2c4115d583..ba4ff7d22d 100644 --- a/internal/service/cloudformation/schemas/AWS_Kendra_Faq.json +++ b/internal/service/cloudformation/schemas/AWS_Kendra_Faq.json @@ -75,7 +75,7 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]" }, "S3ObjectKey": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_Kendra_Index.json b/internal/service/cloudformation/schemas/AWS_Kendra_Index.json index 88193be625..822e48c212 100644 --- a/internal/service/cloudformation/schemas/AWS_Kendra_Index.json +++ b/internal/service/cloudformation/schemas/AWS_Kendra_Index.json @@ -64,7 +64,7 @@ "type": "string", "minLength": 1, "maxLength": 10, - "pattern": "" + "pattern": "[0-9]+[s]" }, "Order": { "type": "string", @@ -271,7 +271,7 @@ "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "^(https?|ftp|file):\\/\\/([^\\s]*)" }, "JsonTokenTypeConfiguration": { "type": "object", diff --git a/internal/service/cloudformation/schemas/AWS_KinesisFirehose_DeliveryStream.json b/internal/service/cloudformation/schemas/AWS_KinesisFirehose_DeliveryStream.json index 2b49abb67e..a86e131ec5 100644 --- a/internal/service/cloudformation/schemas/AWS_KinesisFirehose_DeliveryStream.json +++ b/internal/service/cloudformation/schemas/AWS_KinesisFirehose_DeliveryStream.json @@ -13,7 +13,7 @@ "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "[a-zA-Z0-9._-]+" }, "DeliveryStreamType": { "type": "string", @@ -64,7 +64,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "KeyType": { "type": "string", @@ -135,7 +135,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "EndpointConfiguration": { "$ref": "#/definitions/HttpEndpointConfiguration" @@ -175,13 +175,13 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "RoleARN": { "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" } }, "required": [ @@ -197,7 +197,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "SubnetIds": { "type": "array", @@ -236,7 +236,7 @@ "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "arn:.*" }, "BufferingHints": { "$ref": "#/definitions/BufferingHints" @@ -280,7 +280,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "S3BackupConfiguration": { "$ref": "#/definitions/S3DestinationConfiguration" @@ -306,7 +306,7 @@ "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "arn:.*" }, "BufferingHints": { "$ref": "#/definitions/BufferingHints" @@ -341,7 +341,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" } }, "required": [ @@ -379,7 +379,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "S3BackupConfiguration": { "$ref": "#/definitions/S3DestinationConfiguration" @@ -423,7 +423,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "IndexName": { "type": "string", @@ -450,7 +450,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "S3BackupMode": { "type": "string", @@ -466,7 +466,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "https:.*" }, "TypeName": { "type": "string", @@ -497,7 +497,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "IndexName": { "type": "string", @@ -524,7 +524,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "S3BackupMode": { "type": "string", @@ -540,7 +540,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "https:.*" }, "TypeName": { "type": "string", @@ -810,7 +810,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "arn:.*" }, "TableName": { "type": "string" @@ -1034,7 +1034,7 @@ }, "Value": { "type": "string", - "pattern": "", + "pattern": "^[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@%]*$", "minLength": 0, "maxLength": 256 } diff --git a/internal/service/cloudformation/schemas/AWS_KinesisVideo_SignalingChannel.json b/internal/service/cloudformation/schemas/AWS_KinesisVideo_SignalingChannel.json index 2603ad2760..f3670cbe11 100644 --- a/internal/service/cloudformation/schemas/AWS_KinesisVideo_SignalingChannel.json +++ b/internal/service/cloudformation/schemas/AWS_KinesisVideo_SignalingChannel.json @@ -37,7 +37,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z0-9_.-]+" }, "Type": { "description": "The type of the Kinesis Video Signaling Channel to create. Currently, SINGLE_MASTER is the only supported channel type.", diff --git a/internal/service/cloudformation/schemas/AWS_KinesisVideo_Stream.json b/internal/service/cloudformation/schemas/AWS_KinesisVideo_Stream.json index c1713f1815..177379bded 100644 --- a/internal/service/cloudformation/schemas/AWS_KinesisVideo_Stream.json +++ b/internal/service/cloudformation/schemas/AWS_KinesisVideo_Stream.json @@ -37,7 +37,7 @@ "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z0-9_.-]+" }, "DataRetentionInHours": { "description": "The number of hours till which Kinesis Video will retain the data in the stream", @@ -50,21 +50,21 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "[a-zA-Z0-9_.-]+" }, "KmsKeyId": { "description": "AWS KMS key ID that Kinesis Video Streams uses to encrypt stream data.", "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": ".+" }, "MediaType": { "description": "The media type of the stream. Consumers of the stream can use this information when processing the stream.", "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "[\\w\\-\\.\\+]+/[\\w\\-\\.\\+]+(,[\\w\\-\\.\\+]+/[\\w\\-\\.\\+]+)*" }, "Tags": { "description": "An array of key-value pairs associated with the Kinesis Video Stream.", @@ -116,4 +116,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Kinesis_Stream.json b/internal/service/cloudformation/schemas/AWS_Kinesis_Stream.json index 9f88f31d81..1f649eda13 100644 --- a/internal/service/cloudformation/schemas/AWS_Kinesis_Stream.json +++ b/internal/service/cloudformation/schemas/AWS_Kinesis_Stream.json @@ -79,7 +79,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9_.-]+$" }, "RetentionPeriodHours": { "description": "The number of hours for the data records that are stored in shards to remain accessible.", @@ -164,4 +164,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Lambda_CodeSigningConfig.json b/internal/service/cloudformation/schemas/AWS_Lambda_CodeSigningConfig.json index aee5c540bc..b965e12888 100644 --- a/internal/service/cloudformation/schemas/AWS_Lambda_CodeSigningConfig.json +++ b/internal/service/cloudformation/schemas/AWS_Lambda_CodeSigningConfig.json @@ -20,12 +20,12 @@ "CodeSigningConfigId": { "description": "A unique identifier for CodeSigningConfig resource", "type": "string", - "pattern": "" + "pattern": "csc-[a-zA-Z0-9-_\\.]{17}" }, "CodeSigningConfigArn": { "description": "A unique Arn for CodeSigningConfig resource", "type": "string", - "pattern": "" + "pattern": "arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:code-signing-config:csc-[a-z0-9]{17}" } }, @@ -42,7 +42,7 @@ "maxItems": 20, "items": { "type": "string", - "pattern": "", + "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)", "minLength": 12, "maxLength": 1024 } diff --git a/internal/service/cloudformation/schemas/AWS_Lambda_EventSourceMapping.json b/internal/service/cloudformation/schemas/AWS_Lambda_EventSourceMapping.json index 1823dd7119..85c792837d 100644 --- a/internal/service/cloudformation/schemas/AWS_Lambda_EventSourceMapping.json +++ b/internal/service/cloudformation/schemas/AWS_Lambda_EventSourceMapping.json @@ -6,7 +6,7 @@ "Id": { "description": "Event Source Mapping Identifier UUID.", "type": "string", - "pattern": "", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", "minLength": 36, "maxLength": 36 }, @@ -31,7 +31,7 @@ "EventSourceArn": { "description": "The Amazon Resource Name (ARN) of the event source.", "type": "string", - "pattern": "", + "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)", "minLength": 12, "maxLength": 1024 }, @@ -42,7 +42,7 @@ "FunctionName": { "description": "The name of the Lambda function.", "type": "string", - "pattern": "", + "pattern": "(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?", "minLength": 1, "maxLength": 140 }, @@ -73,7 +73,7 @@ "StartingPosition": { "description": "The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Streams sources.", "type": "string", - "pattern": "", + "pattern": "(LATEST|TRIM_HORIZON|AT_TIMESTAMP)+", "minLength": 6, "maxLength": 12 }, @@ -87,7 +87,7 @@ "uniqueItems": true, "items": { "type": "string", - "pattern": "", + "pattern": "^[^.]([a-zA-Z0-9\\-_.]+)", "minLength": 1, "maxLength": 249 }, @@ -100,7 +100,7 @@ "uniqueItems": true, "items": { "type": "string", - "pattern": "", + "pattern": "[\\s\\S]*", "minLength": 1, "maxLength": 1000 }, @@ -178,7 +178,7 @@ "Pattern": { "type": "string", "description": "The filter pattern that defines which events should be passed for invocations.", - "pattern": "", + "pattern": ".*", "minLength": 0, "maxLength": 4096 } @@ -192,7 +192,7 @@ "Destination": { "description": "The Amazon Resource Name (ARN) of the destination resource.", "type": "string", - "pattern": "", + "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)", "minLength": 12, "maxLength": 1024 } @@ -220,7 +220,7 @@ "URI" : { "description": "The URI for the source access configuration resource.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*", "minLength": 1, "maxLength": 200 } @@ -249,7 +249,7 @@ "items": { "type": "string", "description": "The URL of a Kafka server.", - "pattern": "", + "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]):[0-9]{1,5}", "minLength": 1, "maxLength": 300 }, diff --git a/internal/service/cloudformation/schemas/AWS_Lambda_Function.json b/internal/service/cloudformation/schemas/AWS_Lambda_Function.json index 68df64f87c..00828bfc92 100644 --- a/internal/service/cloudformation/schemas/AWS_Lambda_Function.json +++ b/internal/service/cloudformation/schemas/AWS_Lambda_Function.json @@ -41,7 +41,7 @@ "description" : "The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime", "type" : "string", "maxLength" : 128, - "pattern" : "" + "pattern" : "^[^\\s]+$" }, "Architectures" : { "type" : "array", @@ -59,7 +59,7 @@ "KmsKeyArn" : { "description" : "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", "type" : "string", - "pattern" : "" + "pattern" : "^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$" }, "Layers" : { "description" : "A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.", @@ -81,7 +81,7 @@ "Role" : { "description" : "The Amazon Resource Name (ARN) of the function's execution role.", "type" : "string", - "pattern" : "" + "pattern" : "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "Runtime" : { "description" : "The identifier of the function's runtime.", @@ -112,7 +112,7 @@ "CodeSigningConfigArn": { "description": "A unique Arn for CodeSigningConfig resource", "type": "string", - "pattern": "" + "pattern": "arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:code-signing-config:csc-[a-z0-9]{17}" }, "ImageConfig" : { "description" : "ImageConfig", @@ -169,7 +169,7 @@ "TargetArn" : { "type" : "string", "description" : "The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.", - "pattern" : "" + "pattern" : "^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$" } } }, @@ -196,14 +196,14 @@ "properties" : { "Arn" : { "type" : "string", - "pattern": "", + "pattern": "^arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:access-point/fsap-[a-f0-9]{17}$", "description" : "The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.", "maxLength" : 200 }, "LocalMountPath" : { "type" : "string", "description" : "The path where the function can access the file system, starting with /mnt/.", - "pattern": "", + "pattern": "^/mnt/[a-zA-Z0-9-_.]+$", "maxLength" : 160 } }, diff --git a/internal/service/cloudformation/schemas/AWS_Lex_Bot.json b/internal/service/cloudformation/schemas/AWS_Lex_Bot.json index 4460e535d0..c16001eed9 100644 --- a/internal/service/cloudformation/schemas/AWS_Lex_Bot.json +++ b/internal/service/cloudformation/schemas/AWS_Lex_Bot.json @@ -8,27 +8,27 @@ "type": "string", "minLength": 32, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:aws[a-zA-Z-]*:iam::[0-9]{12}:role/.*$" }, "Id": { "description": "Unique ID of resource", "type": "string", "minLength": 10, "maxLength": 10, - "pattern": "" + "pattern": "^[0-9a-zA-Z]+$" }, "BotArn": { "type": "string", "minLength": 1, "maxLength": 1011, - "pattern": "" + "pattern": "^arn:aws[a-zA-Z-]*:lex:[a-z]+-[a-z]+-[0-9]:[0-9]{12}:bot/[0-9a-zA-Z]+$" }, "Name": { "description": "Unique name for a resource.", "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "^([0-9a-zA-Z][_-]?)+$" }, "Description": { "description": "A description of the resource", @@ -605,7 +605,7 @@ "type": "string", "minLength": 32, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:aws[a-zA-Z-]*:kendra:[a-z]+-[a-z]+-[0-9]:[0-9]{12}:index/[a-zA-Z0-9][a-zA-Z0-9_-]*$" }, "QueryFilterString": { "description": "A query filter that Amazon Lex sends to Amazon Kendra to filter the response from a query.", @@ -822,13 +822,13 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$" }, "S3ObjectKey": { "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$" }, "GrammarSlotTypeSource": { "description": "Describes the Amazon S3 bucket name and location for the grammar that is the source for the slot type.", @@ -847,7 +847,7 @@ "type": "string", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:[\\w\\-]+:kms:[\\w\\-]+:[\\d]{12}:(?:key\\/[\\w\\-]+|alias\\/[a-zA-Z0-9:\\/_\\-]{1,256})$" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_Lex_BotAlias.json b/internal/service/cloudformation/schemas/AWS_Lex_BotAlias.json index 016deaa4e5..34d0ee871d 100644 --- a/internal/service/cloudformation/schemas/AWS_Lex_BotAlias.json +++ b/internal/service/cloudformation/schemas/AWS_Lex_BotAlias.json @@ -215,7 +215,7 @@ "description" : "The Amazon Resource Name (ARN) of an Amazon S3 bucket where audio log files are stored.", "minLength" : 1, "maxLength" : 2048, - "pattern" : "" + "pattern" : "^arn:[\\w\\-]+:s3:::[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$" }, "LogPrefix" : { "type" : "string", @@ -228,7 +228,7 @@ "description" : "The Amazon Resource Name (ARN) of an AWS Key Management Service (KMS) key for encrypting audio log files stored in an S3 bucket.", "minLength" : 20, "maxLength" : 2048, - "pattern": "" + "pattern": "^arn:[\\w\\-]+:kms:[\\w\\-]+:[\\d]{12}:(?:key\\/[\\w\\-]+|alias\\/[a-zA-Z0-9:\\/_\\-]{1,256})$" } }, "required": [ @@ -242,21 +242,21 @@ "type": "string", "minLength": 10, "maxLength": 10, - "pattern": "" + "pattern": "^[0-9a-zA-Z]+$" }, "Name": { "description": "A unique identifier for a resource.", "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "^([0-9a-zA-Z][_-]?)+$" }, "BotVersion": { "description": "The version of a bot.", "type": "string", "minLength": 1, "maxLength": 5, - "pattern": "" + "pattern": "^(DRAFT|[0-9]+)$" }, "Description": { "description": "A description of the bot alias. Use the description to help identify the bot alias in lists.", diff --git a/internal/service/cloudformation/schemas/AWS_Lex_BotVersion.json b/internal/service/cloudformation/schemas/AWS_Lex_BotVersion.json index 1ad8ac07d1..6004850b57 100644 --- a/internal/service/cloudformation/schemas/AWS_Lex_BotVersion.json +++ b/internal/service/cloudformation/schemas/AWS_Lex_BotVersion.json @@ -8,7 +8,7 @@ "type": "string", "minLength": 10, "maxLength": 10, - "pattern": "" + "pattern": "^[0-9a-zA-Z]+$" }, "Description": { "description": "A description of the version. Use the description to help identify the version in lists.", @@ -24,7 +24,7 @@ "type": "string", "minLength": 1, "maxLength": 5, - "pattern": "" + "pattern": "^(DRAFT|[0-9]+)$" }, "BotVersionLocaleDetails": { "description": "The version of a bot used for a bot locale.", diff --git a/internal/service/cloudformation/schemas/AWS_Lex_ResourcePolicy.json b/internal/service/cloudformation/schemas/AWS_Lex_ResourcePolicy.json index dddb63d9c9..65502b9a0f 100644 --- a/internal/service/cloudformation/schemas/AWS_Lex_ResourcePolicy.json +++ b/internal/service/cloudformation/schemas/AWS_Lex_ResourcePolicy.json @@ -18,7 +18,7 @@ "type": "string", "minLength": 1, "maxLength": 5, - "pattern": "" + "pattern": "^[0-9]+$" }, "PhysicalId": { "description": "The Physical ID of the resource policy.", diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Alarm.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Alarm.json index 118a38ff6b..2d897049d9 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Alarm.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Alarm.json @@ -6,7 +6,7 @@ "AlarmName": { "description": "The name for the alarm. Specify the name of an existing alarm to update, and overwrite the previous configuration of the alarm.", "type": "string", - "pattern": "" + "pattern": "\\w[\\w\\-]*\\w" }, "MonitoredResourceName": { "description": "The validation status of the SSL/TLS certificate.", diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Bucket.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Bucket.json index 0a4b3f7cab..bb66c37deb 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Bucket.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Bucket.json @@ -45,7 +45,7 @@ "BucketName": { "description": "The name for the bucket.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9][a-z0-9-]{1,52}[a-z0-9]$", "minLength": 3, "maxLength": 54 }, diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Container.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Container.json index 3e7f3700a8..f532115de7 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Container.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Container.json @@ -185,7 +185,7 @@ "ServiceName": { "description": "The name for the container service.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9]{1,2}|[a-z0-9][a-z0-9-]+[a-z0-9]$", "minLength": 1, "maxLength": 63 }, diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Database.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Database.json index 82639fd951..cfb2aa57b6 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Database.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Database.json @@ -69,7 +69,7 @@ "RelationalDatabaseName": { "description": "The name to use for your new Lightsail database resource.", "type": "string", - "pattern": "", + "pattern": "\\w[\\w\\-]*\\w", "minLength": 2, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Disk.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Disk.json index 4a80698c06..e897294c88 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Disk.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Disk.json @@ -32,7 +32,7 @@ "SnapshotTimeOfDay": { "type": "string", "description": "The daily time when an automatic snapshot will be created.", - "pattern": "" + "pattern": "^[0-9]{2}:00$" } }, "additionalProperties": false @@ -89,7 +89,7 @@ "DiskName": { "description": "The names to use for your new Lightsail disk.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", "minLength": 1, "maxLength": 254 }, diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Distribution.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Distribution.json index 7e9fde5db7..d7f28e65f1 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Distribution.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Distribution.json @@ -177,7 +177,7 @@ "DistributionName": { "description": "The name for the distribution.", "type": "string", - "pattern": "" + "pattern": "\\w[\\w\\-]*\\w" }, "DistributionArn": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_Instance.json b/internal/service/cloudformation/schemas/AWS_Lightsail_Instance.json index 5c496b4ca4..d468d6fb80 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_Instance.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_Instance.json @@ -56,7 +56,7 @@ "SnapshotTimeOfDay": { "type": "string", "description": "The daily time when an automatic snapshot will be created.", - "pattern": "" + "pattern": "^[0-9]{2}:00$" } }, "additionalProperties": false @@ -115,7 +115,7 @@ "DiskName": { "description": "The names to use for your new Lightsail disk.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", "minLength": 1, "maxLength": 254 }, @@ -311,7 +311,7 @@ "InstanceName": { "description": "The names to use for your new Lightsail instance.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", "minLength": 1, "maxLength": 254 }, diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancer.json b/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancer.json index d7e17cce02..7b38cc5365 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancer.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancer.json @@ -30,7 +30,7 @@ "LoadBalancerName": { "description": "The name of your load balancer.", "type": "string", - "pattern": "" + "pattern": "\\w[\\w\\-]*\\w" }, "LoadBalancerArn": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancerTlsCertificate.json b/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancerTlsCertificate.json index 8718098404..ebc2549861 100644 --- a/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancerTlsCertificate.json +++ b/internal/service/cloudformation/schemas/AWS_Lightsail_LoadBalancerTlsCertificate.json @@ -6,7 +6,7 @@ "LoadBalancerName": { "description": "The name of your load balancer.", "type": "string", - "pattern": "" + "pattern": "\\w[\\w\\-]*\\w" }, "CertificateName": { "description": "The SSL/TLS certificate name.", diff --git a/internal/service/cloudformation/schemas/AWS_Location_GeofenceCollection.json b/internal/service/cloudformation/schemas/AWS_Location_GeofenceCollection.json index 4b9c78f721..1fcdc18739 100644 --- a/internal/service/cloudformation/schemas/AWS_Location_GeofenceCollection.json +++ b/internal/service/cloudformation/schemas/AWS_Location_GeofenceCollection.json @@ -11,25 +11,25 @@ "iso8601UTC": { "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" } }, "properties": { "CollectionArn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "Arn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "CollectionName": { "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" }, "CreateTime": { "$ref": "#/definitions/iso8601UTC" diff --git a/internal/service/cloudformation/schemas/AWS_Location_Map.json b/internal/service/cloudformation/schemas/AWS_Location_Map.json index 37299e7112..9fe45b39fe 100644 --- a/internal/service/cloudformation/schemas/AWS_Location_Map.json +++ b/internal/service/cloudformation/schemas/AWS_Location_Map.json @@ -9,7 +9,7 @@ "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" } }, "additionalProperties": false, @@ -26,7 +26,7 @@ "iso8601UTC": { "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" } }, "properties": { @@ -47,18 +47,18 @@ "MapArn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "Arn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "MapName": { "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" }, "PricingPlan": { "$ref": "#/definitions/PricingPlan" diff --git a/internal/service/cloudformation/schemas/AWS_Location_PlaceIndex.json b/internal/service/cloudformation/schemas/AWS_Location_PlaceIndex.json index d10a230fdd..04cfc7f98e 100644 --- a/internal/service/cloudformation/schemas/AWS_Location_PlaceIndex.json +++ b/internal/service/cloudformation/schemas/AWS_Location_PlaceIndex.json @@ -27,7 +27,7 @@ "iso8601UTC": { "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" } }, "properties": { @@ -48,18 +48,18 @@ "IndexArn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "Arn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "IndexName": { "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" }, "PricingPlan": { "$ref": "#/definitions/PricingPlan" diff --git a/internal/service/cloudformation/schemas/AWS_Location_RouteCalculator.json b/internal/service/cloudformation/schemas/AWS_Location_RouteCalculator.json index e784fec9e6..28c7855314 100644 --- a/internal/service/cloudformation/schemas/AWS_Location_RouteCalculator.json +++ b/internal/service/cloudformation/schemas/AWS_Location_RouteCalculator.json @@ -11,25 +11,25 @@ "iso8601UTC": { "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" } }, "properties": { "CalculatorArn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "Arn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "CalculatorName": { "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" }, "CreateTime": { "$ref": "#/definitions/iso8601UTC" diff --git a/internal/service/cloudformation/schemas/AWS_Location_Tracker.json b/internal/service/cloudformation/schemas/AWS_Location_Tracker.json index d5c457dbfb..f844e4c075 100644 --- a/internal/service/cloudformation/schemas/AWS_Location_Tracker.json +++ b/internal/service/cloudformation/schemas/AWS_Location_Tracker.json @@ -11,7 +11,7 @@ "iso8601UTC": { "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" }, "PositionFiltering": { "type": "string", @@ -48,18 +48,18 @@ "TrackerArn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "Arn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "TrackerName": { "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" }, "UpdateTime": { "$ref": "#/definitions/iso8601UTC" diff --git a/internal/service/cloudformation/schemas/AWS_Location_TrackerConsumer.json b/internal/service/cloudformation/schemas/AWS_Location_TrackerConsumer.json index b93f774f6a..b8bfd6ebe2 100644 --- a/internal/service/cloudformation/schemas/AWS_Location_TrackerConsumer.json +++ b/internal/service/cloudformation/schemas/AWS_Location_TrackerConsumer.json @@ -5,13 +5,13 @@ "ConsumerArn": { "type": "string", "maxLength": 1600, - "pattern": "" + "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$" }, "TrackerName": { "type": "string", "maxLength": 100, "minLength": 1, - "pattern": "" + "pattern": "^[-._\\w]+$" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_Logs_QueryDefinition.json b/internal/service/cloudformation/schemas/AWS_Logs_QueryDefinition.json index e2fde8e9b1..cf4dc036e3 100644 --- a/internal/service/cloudformation/schemas/AWS_Logs_QueryDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_Logs_QueryDefinition.json @@ -5,7 +5,7 @@ "definitions": { "LogGroup": { "type": "string", - "pattern": "", + "pattern": "[\\.\\-_/#A-Za-z0-9]+", "minLength": 1, "maxLength": 512 } @@ -14,7 +14,7 @@ "Name": { "description": "A name for the saved query definition", "type": "string", - "pattern": "", + "pattern": "^([^:*\\/]+\\/?)*[^:*\\/]+$", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_Logs_ResourcePolicy.json b/internal/service/cloudformation/schemas/AWS_Logs_ResourcePolicy.json index d110d99683..49deb598cd 100644 --- a/internal/service/cloudformation/schemas/AWS_Logs_ResourcePolicy.json +++ b/internal/service/cloudformation/schemas/AWS_Logs_ResourcePolicy.json @@ -6,7 +6,7 @@ "PolicyName": { "description": "A name for resource policy", "type": "string", - "pattern": "", + "pattern": "^([^:*\\/]+\\/?)*[^:*\\/]+$", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_LookoutEquipment_InferenceScheduler.json b/internal/service/cloudformation/schemas/AWS_LookoutEquipment_InferenceScheduler.json index ecb1739fdb..a2945f6ee1 100644 --- a/internal/service/cloudformation/schemas/AWS_LookoutEquipment_InferenceScheduler.json +++ b/internal/service/cloudformation/schemas/AWS_LookoutEquipment_InferenceScheduler.json @@ -5,7 +5,7 @@ "definitions": { "Bucket": { "type": "string", - "pattern": "", + "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", "minLength": 3, "maxLength": 63 }, @@ -53,14 +53,14 @@ "ComponentTimestampDelimiter": { "description": "Indicates the delimiter character used between items in the data.", "type": "string", - "pattern": "", + "pattern": "^(\\-|\\_|\\s)?$", "minLength": 0, "maxLength": 1 }, "TimestampFormat": { "description": "The format of the timestamp, whether Epoch time, or standard, with or without hyphens (-).", "type": "string", - "pattern": "" + "pattern": "^EPOCH|yyyy-MM-dd-HH-mm-ss|yyyyMMddHHmmss$" } }, "additionalProperties": false @@ -79,7 +79,7 @@ "Value": { "description": "The value for the specified tag.", "type": "string", - "pattern": "", + "pattern": "[\\s\\w+-=\\.:/@]*", "minLength": 0, "maxLength": 256 } @@ -105,7 +105,7 @@ "InputTimeZoneOffset": { "description": "Indicates the difference between your time zone and Greenwich Mean Time (GMT).", "type": "string", - "pattern": "" + "pattern": "^(\\+|\\-)[0-9]{2}\\:[0-9]{2}$" }, "InferenceInputNameConfiguration": { "$ref": "#/definitions/InputNameConfiguration" @@ -153,21 +153,21 @@ "InferenceSchedulerName": { "description": "The name of the inference scheduler being created.", "type": "string", - "pattern": "", + "pattern": "^[0-9a-zA-Z_-]{1,200}$", "minLength": 1, "maxLength": 200 }, "ModelName": { "description": "The name of the previously trained ML model being used to create the inference scheduler.", "type": "string", - "pattern": "", + "pattern": "^[0-9a-zA-Z_-]{1,200}$", "minLength": 1, "maxLength": 200 }, "RoleArn": { "description": "The Amazon Resource Name (ARN) of a role with permission to access the data source being used for the inference.", "type": "string", - "pattern": "", + "pattern": "arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+", "minLength": 20, "maxLength": 2048 }, @@ -191,7 +191,7 @@ "InferenceSchedulerArn": { "description": "The Amazon Resource Name (ARN) of the inference scheduler being created.", "type": "string", - "pattern": "", + "pattern": "arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9\\-]*:[0-9]{12}:inference-scheduler\\/.+", "minLength": 1, "maxLength": 200 } diff --git a/internal/service/cloudformation/schemas/AWS_LookoutMetrics_Alert.json b/internal/service/cloudformation/schemas/AWS_LookoutMetrics_Alert.json index c45ab445ba..aae1ee3ced 100644 --- a/internal/service/cloudformation/schemas/AWS_LookoutMetrics_Alert.json +++ b/internal/service/cloudformation/schemas/AWS_LookoutMetrics_Alert.json @@ -6,7 +6,7 @@ "Arn": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+" }, "Action": { "type": "object", @@ -65,7 +65,7 @@ "type": "string", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*" }, "Arn": { "description": "ARN assigned to the alert.", @@ -75,13 +75,13 @@ "description": "A description for the alert.", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": ".*\\S.*" }, "AnomalyDetectorArn": { "description": "The Amazon resource name (ARN) of the Anomaly Detector to alert.", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+" }, "AlertSensitivityThreshold": { "description": "A number between 0 and 100 (inclusive) that tunes the sensitivity of the alert.", diff --git a/internal/service/cloudformation/schemas/AWS_LookoutMetrics_AnomalyDetector.json b/internal/service/cloudformation/schemas/AWS_LookoutMetrics_AnomalyDetector.json index 5be5652dd1..ac278e694e 100644 --- a/internal/service/cloudformation/schemas/AWS_LookoutMetrics_AnomalyDetector.json +++ b/internal/service/cloudformation/schemas/AWS_LookoutMetrics_AnomalyDetector.json @@ -6,19 +6,19 @@ "Arn": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+" }, "ColumnName": { "description": "Name of a column in the data.", "type": "string", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*" }, "Charset": { "type": "string", "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*" }, "CsvFormatDescriptor": { "type": "object", @@ -36,7 +36,7 @@ "Delimiter": { "type": "string", "maxLength": 1, - "pattern": "" + "pattern": "[^\\r\\n]" }, "HeaderList": { "type": "array", @@ -47,7 +47,7 @@ "QuoteSymbol": { "type": "string", "maxLength": 1, - "pattern": "" + "pattern": "[^\\r\\n]|^$" }, "ContainsHeader": { "type": "boolean" @@ -96,7 +96,7 @@ "items": { "type": "string", "maxLength": 1024, - "pattern": "" + "pattern": "^s3://[a-zA-Z0-9_\\-\\/ {}=]+$" } }, "HistoricalDataPathList": { @@ -106,7 +106,7 @@ "items": { "type": "string", "maxLength": 1024, - "pattern": "" + "pattern": "^s3://[a-z0-9].+$" } }, "FileFormatDescriptor": { @@ -128,7 +128,7 @@ "FlowName": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "[a-zA-Z0-9][\\w!@#.-]+" } }, "required": [ @@ -153,7 +153,7 @@ "type": "string", "minLength": 1, "maxLength": 253, - "pattern": "" + "pattern": ".*\\S.*" }, "DatabasePort": { "type": "integer", @@ -164,14 +164,14 @@ "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" }, "SubnetIdList": { "type": "array", "items": { "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "[\\-0-9a-zA-Z]+" } }, "SecurityGroupIdList": { @@ -180,7 +180,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "VpcConfiguration": { @@ -202,7 +202,7 @@ "SecretManagerArn": { "type": "string", "maxLength": 256, - "pattern": "" + "pattern": "arn:([a-z\\d-]+):.*:.*:secret:AmazonLookoutMetrics-.+" }, "RDSSourceConfig": { "type": "object", @@ -226,7 +226,7 @@ "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "[a-zA-Z0-9_]+" }, "TableName": { "$ref": "#/definitions/TableName" @@ -272,7 +272,7 @@ "type": "string", "minLength": 1, "maxLength": 100, - "pattern": "" + "pattern": "[a-z0-9]+" }, "TableName": { "$ref": "#/definitions/TableName" @@ -328,7 +328,7 @@ "description": "A timestamp format for the timestamps in the dataset", "type": "string", "maxLength": 63, - "pattern": "" + "pattern": ".*\\S.*" } } }, @@ -351,7 +351,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "[^:].*" } }, "required": [ @@ -367,13 +367,13 @@ "type": "string", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*" }, "MetricSetDescription": { "description": "A description for the MetricSet.", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": ".*\\S.*" }, "MetricSource": { "$ref": "#/definitions/MetricSource" @@ -418,7 +418,7 @@ "Timezone": { "type": "string", "maxLength": 60, - "pattern": "" + "pattern": ".*\\S.*" } }, "required": [ @@ -461,13 +461,13 @@ "type": "string", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*" }, "AnomalyDetectorDescription": { "description": "A description for the AnomalyDetector.", "type": "string", "maxLength": 256, - "pattern": "" + "pattern": ".*\\S.*" }, "AnomalyDetectorConfig": { "description": "Configuration options for the AnomalyDetector", @@ -487,7 +487,7 @@ "type": "string", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "arn:aws.*:kms:.*:[0-9]{12}:key/.*" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_LookoutVision_Project.json b/internal/service/cloudformation/schemas/AWS_LookoutVision_Project.json index f3f2796040..0ccfae4b2f 100644 --- a/internal/service/cloudformation/schemas/AWS_LookoutVision_Project.json +++ b/internal/service/cloudformation/schemas/AWS_LookoutVision_Project.json @@ -12,7 +12,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "[a-zA-Z0-9][a-zA-Z0-9_\\-]*" } }, "properties": { diff --git a/internal/service/cloudformation/schemas/AWS_MWAA_Environment.json b/internal/service/cloudformation/schemas/AWS_MWAA_Environment.json index 262fd27e99..490f118b44 100644 --- a/internal/service/cloudformation/schemas/AWS_MWAA_Environment.json +++ b/internal/service/cloudformation/schemas/AWS_MWAA_Environment.json @@ -8,7 +8,7 @@ "description": "Customer-defined identifier for the environment, unique per customer region.", "minLength": 1, "maxLength": 80, - "pattern": "" + "pattern": "^[a-zA-Z][0-9a-zA-Z\\-_]*$" }, "EnvironmentStatus": { "type": "string", @@ -51,21 +51,21 @@ "description": "", "minLength": 1, "maxLength": 1224, - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:airflow:[a-z0-9\\-]+:\\d{12}:environment/\\w+" }, "EnvironmentArn": { "type": "string", "description": "ARN for the MWAA environment.", "minLength": 1, "maxLength": 1224, - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:airflow:[a-z0-9\\-]+:\\d{12}:environment/\\w+" }, "S3BucketArn": { "type": "string", "description": "ARN for the AWS S3 bucket to use as the source of DAGs and plugins for the environment.", "minLength": 1, "maxLength": 1224, - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:s3:::[a-z0-9.\\-]+$" }, "CreatedAt": { "type": "string", @@ -80,68 +80,68 @@ "description": "Url endpoint for the environment's Airflow UI.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^https://.+$" }, "ExecutionRoleArn": { "type": "string", "description": "IAM role to be used by tasks.", "maxLength": 1224, - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "ServiceRoleArn": { "type": "string", "description": "IAM role to be used by MWAA to perform AWS API calls on behalf of the customer.", "maxLength": 1224, - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "KmsKey": { "type": "string", "description": "The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for MWAA data encryption.\n\n You can specify the CMK using any of the following:\n\n Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab.\n\n Key alias. For example, alias/ExampleAlias.\n\n Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.\n\n Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.\n\n AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.", "maxLength": 1224, - "pattern": "" + "pattern": "^(((arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:kms:[a-z]{2}-[a-z]+-\\d:\\d+:)?key\\/)?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|(arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):kms:[a-z]{2}-[a-z]+-\\d:\\d+:)?alias/.+)$" }, "AirflowVersion": { "type": "string", "description": "Version of airflow to deploy to the environment.", "maxLength": 32, - "pattern": "" + "pattern": "^[0-9a-z.]+$" }, "RelativePath": { "type": "string", "description": "Represents an S3 prefix relative to the root of an S3 bucket.", "maxLength": 1024, - "pattern": "" + "pattern": ".*" }, "ConfigKey": { "type": "string", "description": "", "maxLength": 64, - "pattern": "" + "pattern": "^[a-z]+([a-z._]*[a-z]+)?$" }, "ConfigValue": { "type": "string", "description": "", "maxLength": 256, - "pattern": "" + "pattern": ".*" }, "SecurityGroupId": { "type": "string", "description": "", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^sg-[a-zA-Z0-9\\-._]+$" }, "SubnetId": { "type": "string", "description": "", "maxLength": 1024, - "pattern": "" + "pattern": "^subnet-[a-zA-Z0-9\\-._]+$" }, "CloudWatchLogGroupArn": { "type": "string", "description": "", "maxLength": 1224, - "pattern": "" + "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:logs:[a-z0-9\\-]+:\\d{12}:log-group:\\w+" }, "LoggingEnabled": { "type": "boolean", @@ -304,7 +304,7 @@ "description": "Error message describing a failed operation.", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^.+$" }, "S3ObjectVersion": { "type": "string", @@ -315,7 +315,7 @@ "type": "string", "description": "Start time for the weekly maintenance window.", "maxLength": 9, - "pattern": "" + "pattern": "(MON|TUE|WED|THU|FRI|SAT|SUN):([01]\\d|2[0-3]):(00|30)" }, "WebserverAccessMode": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_MemoryDB_ACL.json b/internal/service/cloudformation/schemas/AWS_MemoryDB_ACL.json index 446cb69cb2..e47c27fde1 100644 --- a/internal/service/cloudformation/schemas/AWS_MemoryDB_ACL.json +++ b/internal/service/cloudformation/schemas/AWS_MemoryDB_ACL.json @@ -37,7 +37,7 @@ }, "ACLName": { "description": "The name of the acl.", - "pattern": "", + "pattern": "[a-z][a-z0-9\\\\-]*", "type": "string" }, "UserNames": { diff --git a/internal/service/cloudformation/schemas/AWS_MemoryDB_Cluster.json b/internal/service/cloudformation/schemas/AWS_MemoryDB_Cluster.json index 3a8f929d58..7e5517ee4f 100644 --- a/internal/service/cloudformation/schemas/AWS_MemoryDB_Cluster.json +++ b/internal/service/cloudformation/schemas/AWS_MemoryDB_Cluster.json @@ -47,7 +47,7 @@ "properties": { "ClusterName": { "description": "The name of the cluster. This value must be unique as it also serves as the cluster identifier.", - "pattern": "", + "pattern": "[a-z][a-z0-9\\-]*", "type": "string" }, "Description": { @@ -110,7 +110,7 @@ "ACLName": { "description": "The name of the Access Control List to associate with the cluster.", "type": "string", - "pattern": "" + "pattern": "[a-zA-Z][a-zA-Z0-9\\-]*" }, "SnsTopicArn": { "description": "The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications are sent.", diff --git a/internal/service/cloudformation/schemas/AWS_MemoryDB_SubnetGroup.json b/internal/service/cloudformation/schemas/AWS_MemoryDB_SubnetGroup.json index 170ad1a714..9cd5c63654 100644 --- a/internal/service/cloudformation/schemas/AWS_MemoryDB_SubnetGroup.json +++ b/internal/service/cloudformation/schemas/AWS_MemoryDB_SubnetGroup.json @@ -33,7 +33,7 @@ "properties": { "SubnetGroupName": { "description": "The name of the subnet group. This value must be unique as it also serves as the subnet group identifier.", - "pattern": "", + "pattern": "[a-z][a-z0-9\\-]*", "type": "string" }, "Description": { diff --git a/internal/service/cloudformation/schemas/AWS_MemoryDB_User.json b/internal/service/cloudformation/schemas/AWS_MemoryDB_User.json index d16971a9c7..2466252bd9 100644 --- a/internal/service/cloudformation/schemas/AWS_MemoryDB_User.json +++ b/internal/service/cloudformation/schemas/AWS_MemoryDB_User.json @@ -37,7 +37,7 @@ }, "UserName": { "description": "The name of the user.", - "pattern": "", + "pattern": "[a-z][a-z0-9\\\\-]*", "type": "string" }, "AccessString": { diff --git a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_Firewall.json b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_Firewall.json index 0f655354b8..eca73d1dd9 100644 --- a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_Firewall.json +++ b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_Firewall.json @@ -7,7 +7,7 @@ "ResourceArn": { "description": "A resource ARN.", "type": "string", - "pattern": "", + "pattern": "^arn:aws.*$", "minLength": 1, "maxLength": 256 }, @@ -54,7 +54,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-]+$" }, "FirewallArn": { "$ref": "#/definitions/ResourceArn" @@ -63,7 +63,7 @@ "type": "string", "minLength": 36, "maxLength": 36, - "pattern": "" + "pattern": "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$" }, "FirewallPolicyArn": { "$ref": "#/definitions/ResourceArn" @@ -72,7 +72,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^vpc-[0-9a-f]+$" }, "SubnetMappings": { "type": "array", @@ -95,7 +95,7 @@ "Description": { "type": "string", "maxLength": 512, - "pattern": "" + "pattern": "^.*$" }, "EndpointIds": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_FirewallPolicy.json b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_FirewallPolicy.json index 02f9e31c6d..2bc2680611 100644 --- a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_FirewallPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_FirewallPolicy.json @@ -7,7 +7,7 @@ "ResourceArn": { "description": "A resource ARN.", "type": "string", - "pattern": "", + "pattern": "^(arn:aws.*)$", "minLength": 1, "maxLength": 256 }, @@ -18,13 +18,13 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^.*$" }, "Value": { "type": "string", "minLength": 0, "maxLength": 255, - "pattern": "" + "pattern": "^.*$" } }, "required": [ @@ -101,7 +101,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9]+$" }, "ActionDefinition": { "$ref": "#/definitions/ActionDefinition" @@ -146,7 +146,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_ ]+$" } }, "required": [ @@ -212,7 +212,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-]+$" }, "FirewallPolicyArn": { "$ref": "#/definitions/ResourceArn" @@ -224,13 +224,13 @@ "type": "string", "minLength": 36, "maxLength": 36, - "pattern": "" + "pattern": "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$" }, "Description": { "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "^.*$" }, "Tags": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_LoggingConfiguration.json b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_LoggingConfiguration.json index 5a7a0bc742..dae3623ef6 100644 --- a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_LoggingConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_LoggingConfiguration.json @@ -7,7 +7,7 @@ "ResourceArn": { "description": "A resource ARN.", "type": "string", - "pattern": "", + "pattern": "^arn:aws.*$", "minLength": 1, "maxLength": 256 }, @@ -73,7 +73,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-]+$" }, "FirewallArn": { "$ref": "#/definitions/ResourceArn" diff --git a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_RuleGroup.json b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_RuleGroup.json index 309b762ff6..6df45c53b1 100644 --- a/internal/service/cloudformation/schemas/AWS_NetworkFirewall_RuleGroup.json +++ b/internal/service/cloudformation/schemas/AWS_NetworkFirewall_RuleGroup.json @@ -7,7 +7,7 @@ "ResourceArn": { "description": "A resource ARN.", "type": "string", - "pattern": "", + "pattern": "^(arn:aws.*)$", "minLength": 1, "maxLength": 256 }, @@ -18,13 +18,13 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^.*$" }, "Value": { "type": "string", "minLength": 0, "maxLength": 255, - "pattern": "" + "pattern": "^.*$" } }, "required": [ @@ -111,7 +111,7 @@ "VariableDefinition": { "type": "string", "minLength": 1, - "pattern": "" + "pattern": "^.*$" }, "RulesSource": { "type": "object", @@ -241,7 +241,7 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^.*$" }, "SourcePort": { "$ref": "#/definitions/Port" @@ -257,7 +257,7 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^.*$" }, "DestinationPort": { "$ref": "#/definitions/Port" @@ -280,7 +280,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^.*$" }, "Settings": { "type": "array", @@ -300,13 +300,13 @@ "type": "string", "minLength": 1, "maxLength": 8192, - "pattern": "" + "pattern": "^.*$" }, "Port": { "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^.*$" }, "StatelessRulesAndCustomActions": { "type": "object", @@ -433,7 +433,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^([a-fA-F\\d:\\.]+/\\d{1,3})$" } }, "required": [ @@ -512,7 +512,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9]+$" }, "ActionDefinition": { "$ref": "#/definitions/ActionDefinition" @@ -557,7 +557,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_ ]+$" } }, "required": [ @@ -587,7 +587,7 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9-]+$" }, "RuleGroupArn": { "$ref": "#/definitions/ResourceArn" @@ -596,7 +596,7 @@ "type": "string", "minLength": 36, "maxLength": 36, - "pattern": "" + "pattern": "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$" }, "RuleGroup": { "$ref": "#/definitions/RuleGroup" @@ -615,7 +615,7 @@ "type": "string", "minLength": 1, "maxLength": 512, - "pattern": "" + "pattern": "^.*$" }, "Tags": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_NimbleStudio_LaunchProfile.json b/internal/service/cloudformation/schemas/AWS_NimbleStudio_LaunchProfile.json index 271d93d803..5bd211d581 100644 --- a/internal/service/cloudformation/schemas/AWS_NimbleStudio_LaunchProfile.json +++ b/internal/service/cloudformation/schemas/AWS_NimbleStudio_LaunchProfile.json @@ -31,7 +31,7 @@ "type": "string", "maxLength": 22, "minLength": 0, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_]*$" }, "maxItems": 20, "minItems": 1, @@ -104,14 +104,14 @@ "type": "string", "maxLength": 128, "minLength": 1, - "pattern": "", + "pattern": "^(/?|(\\$HOME)?(/[^\\$/\\n\\s\\\\]+)*)$", "description": "

The folder path in Linux workstations where files are uploaded.

" }, "Windows": { "type": "string", "maxLength": 128, "minLength": 1, - "pattern": "", + "pattern": "^((\\%HOMEPATH\\%)|[a-zA-Z]:)[\\\\/](?:[a-zA-Z0-9_-]+[\\\\/])*[a-zA-Z0-9_-]+$", "description": "

The folder path in Windows workstations where files are uploaded.

" } }, @@ -152,7 +152,7 @@ "type": "string", "maxLength": 10, "minLength": 0, - "pattern": "", + "pattern": "^2021\\-03\\-31$", "description": "

The version number of the protocol that is used by the launch profile. The only valid\n version is \"2021-03-31\".

" }, "description": "

The version number of the protocol that is used by the launch profile. The only valid\n version is \"2021-03-31\".

" diff --git a/internal/service/cloudformation/schemas/AWS_NimbleStudio_StreamingImage.json b/internal/service/cloudformation/schemas/AWS_NimbleStudio_StreamingImage.json index 9ab8ae902b..16d3cd858c 100644 --- a/internal/service/cloudformation/schemas/AWS_NimbleStudio_StreamingImage.json +++ b/internal/service/cloudformation/schemas/AWS_NimbleStudio_StreamingImage.json @@ -13,7 +13,7 @@ "KeyArn": { "type": "string", "minLength": 4, - "pattern": "", + "pattern": "^arn:.*", "description": "

The ARN for a KMS key that is used to encrypt studio data.

" } }, @@ -49,7 +49,7 @@ }, "Ec2ImageId": { "type": "string", - "pattern": "", + "pattern": "^ami-[0-9A-z]+$", "description": "

The ID of an EC2 machine image with which to create this streaming image.

" }, "EncryptionConfiguration": { @@ -74,7 +74,7 @@ }, "Platform": { "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z]*$", "description": "

The platform of the streaming image, either WINDOWS or LINUX.

" }, "StreamingImageId": { diff --git a/internal/service/cloudformation/schemas/AWS_NimbleStudio_Studio.json b/internal/service/cloudformation/schemas/AWS_NimbleStudio_Studio.json index cece708636..72e7207859 100644 --- a/internal/service/cloudformation/schemas/AWS_NimbleStudio_Studio.json +++ b/internal/service/cloudformation/schemas/AWS_NimbleStudio_Studio.json @@ -13,7 +13,7 @@ "KeyArn": { "type": "string", "minLength": 4, - "pattern": "", + "pattern": "^arn:.*", "description": "

The ARN for a KMS key that is used to encrypt studio data.

" } }, @@ -56,7 +56,7 @@ "type": "string", "maxLength": 50, "minLength": 0, - "pattern": "", + "pattern": "[a-z]{2}-?(iso|gov)?-{1}[a-z]*-{1}[0-9]", "description": "

The Amazon Web Services Region where the studio resource is located.

" }, "SsoClientId": { @@ -73,7 +73,7 @@ "type": "string", "maxLength": 64, "minLength": 3, - "pattern": "", + "pattern": "^[a-z0-9]*$", "description": "

The studio name that is used in the URL of the Nimble Studio portal when accessed by Nimble Studio users.

" }, "StudioUrl": { diff --git a/internal/service/cloudformation/schemas/AWS_NimbleStudio_StudioComponent.json b/internal/service/cloudformation/schemas/AWS_NimbleStudio_StudioComponent.json index 0c068d4240..0856f02ebd 100644 --- a/internal/service/cloudformation/schemas/AWS_NimbleStudio_StudioComponent.json +++ b/internal/service/cloudformation/schemas/AWS_NimbleStudio_StudioComponent.json @@ -96,7 +96,7 @@ "type": "string", "maxLength": 64, "minLength": 1, - "pattern": "", + "pattern": "^[a-zA-Z_][a-zA-Z0-9_]+$", "description": "

A script parameter key.

" } }, @@ -120,14 +120,14 @@ }, "WindowsMountDrive": { "type": "string", - "pattern": "", + "pattern": "^[A-Z]$", "description": "

The mount location for a shared file system on a Windows virtual workstation.

" }, "LinuxMountPoint": { "type": "string", "maxLength": 128, "minLength": 0, - "pattern": "", + "pattern": "^(/?|(\\$HOME)?(/[^/\\n\\s\\\\]+)*)$", "description": "

The mount location for a shared file system on a Linux virtual workstation.

" } }, @@ -166,7 +166,7 @@ "type": "string", "maxLength": 10, "minLength": 0, - "pattern": "", + "pattern": "^2021\\-03\\-31$", "description": "

The version number of the protocol that is used by the launch profile. The only valid version is \"2021-03-31\".

" }, "Platform": { diff --git a/internal/service/cloudformation/schemas/AWS_OpsWorksCM_Server.json b/internal/service/cloudformation/schemas/AWS_OpsWorksCM_Server.json index 918781408a..e30f96bf5e 100644 --- a/internal/service/cloudformation/schemas/AWS_OpsWorksCM_Server.json +++ b/internal/service/cloudformation/schemas/AWS_OpsWorksCM_Server.json @@ -5,7 +5,7 @@ "properties": { "KeyPair": { "type": "string", - "pattern": "", + "pattern": ".*", "maxLength": 10000 }, "EngineVersion": { @@ -14,7 +14,7 @@ }, "ServiceRoleArn": { "type": "string", - "pattern": "", + "pattern": "arn:aws:iam::[0-9]{12}:role/.*", "maxLength": 10000 }, "DisableAutomatedBackup": { @@ -22,7 +22,7 @@ }, "BackupId": { "type": "string", - "pattern": "", + "pattern": "[a-zA-Z][a-zA-Z0-9\\-\\.\\:]*", "maxLength": 79 }, "EngineModel": { @@ -31,7 +31,7 @@ }, "PreferredMaintenanceWindow": { "type": "string", - "pattern": "", + "pattern": "^((Mon|Tue|Wed|Thu|Fri|Sat|Sun):)?([0-1][0-9]|2[0-3]):[0-5][0-9]$", "maxLength": 10000 }, "AssociatePublicIpAddress": { @@ -39,17 +39,17 @@ }, "InstanceProfileArn": { "type": "string", - "pattern": "", + "pattern": "arn:aws:iam::[0-9]{12}:instance-profile/.*", "maxLength": 10000 }, "CustomCertificate": { "type": "string", - "pattern": "", + "pattern": "(?s)\\s*-----BEGIN CERTIFICATE-----.+-----END CERTIFICATE-----\\s*", "maxLength": 2097152 }, "PreferredBackupWindow": { "type": "string", - "pattern": "", + "pattern": "^((Mon|Tue|Wed|Thu|Fri|Sat|Sun):)?([0-1][0-9]|2[0-3]):[0-5][0-9]$", "maxLength": 10000 }, "SecurityGroupIds": { @@ -79,14 +79,14 @@ }, "CustomPrivateKey": { "type": "string", - "pattern": "", + "pattern": "(?ms)\\s*^-----BEGIN (?-s:.*)PRIVATE KEY-----$.*?^-----END (?-s:.*)PRIVATE KEY-----$\\s*", "maxLength": 4096 }, "ServerName": { "type": "string", "minLength": 1, "maxLength": 40, - "pattern": "" + "pattern": "[a-zA-Z][a-zA-Z0-9\\-]*" }, "EngineAttributes": { "type": "array", @@ -130,12 +130,12 @@ "properties": { "Value": { "type": "string", - "pattern": "", + "pattern": "(?s).*", "maxLength": 10000 }, "Name": { "type": "string", - "pattern": "", + "pattern": "(?s).*", "maxLength": 10000 } } @@ -146,13 +146,13 @@ "properties": { "Value": { "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 0, "maxLength": 256 }, "Key": { "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 1, "maxLength": 128 } diff --git a/internal/service/cloudformation/schemas/AWS_Panorama_ApplicationInstance.json b/internal/service/cloudformation/schemas/AWS_Panorama_ApplicationInstance.json index 9d43f0346a..86032f6ba8 100644 --- a/internal/service/cloudformation/schemas/AWS_Panorama_ApplicationInstance.json +++ b/internal/service/cloudformation/schemas/AWS_Panorama_ApplicationInstance.json @@ -7,19 +7,19 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "Description": { "type": "string", "minLength": 0, "maxLength": 255, - "pattern": "" + "pattern": "^.*$" }, "ManifestPayloadData": { "type": "string", "minLength": 1, "maxLength": 51200, - "pattern": "" + "pattern": "^.+$" }, "ManifestPayload": { "type": "object", @@ -34,7 +34,7 @@ "type": "string", "minLength": 0, "maxLength": 51200, - "pattern": "" + "pattern": "^.+$" }, "ManifestOverridesPayload": { "type": "object", @@ -49,25 +49,25 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^arn:[a-z0-9][-.a-z0-9]{0,62}:iam::[0-9]{12}:role/.+$" }, "DefaultRuntimeContextDevice": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "DeviceName": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "ApplicationInstanceId": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "ApplicationInstanceArn": { "type": "string", @@ -86,7 +86,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "ApplicationInstanceStatus": { "type": "string", @@ -130,14 +130,14 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^.+$" }, "Value": { "description": "A string containing the value for the tag", "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "^.+$" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_Panorama_Package.json b/internal/service/cloudformation/schemas/AWS_Panorama_Package.json index 77315b04de..21f25ee06b 100644 --- a/internal/service/cloudformation/schemas/AWS_Panorama_Package.json +++ b/internal/service/cloudformation/schemas/AWS_Panorama_Package.json @@ -7,13 +7,13 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "NodePackageId": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_\\/]+$" }, "NodePackageArn": { "type": "string", @@ -51,13 +51,13 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^.+$" }, "Value": { "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "^.+$" } }, "required": [ @@ -150,4 +150,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Panorama_PackageVersion.json b/internal/service/cloudformation/schemas/AWS_Panorama_PackageVersion.json index a6e2f994b5..bfdfb24eb0 100644 --- a/internal/service/cloudformation/schemas/AWS_Panorama_PackageVersion.json +++ b/internal/service/cloudformation/schemas/AWS_Panorama_PackageVersion.json @@ -7,13 +7,13 @@ "type": "string", "minLength": 1, "maxLength": 12, - "pattern": "" + "pattern": "^[0-9a-z\\_]+$" }, "NodePackageId": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_\\/]+$" }, "NodePackageArn": { "type": "string", @@ -24,19 +24,19 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-\\_]+$" }, "NodePackageVersion": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^([0-9]+)\\.([0-9]+)$" }, "NodePackagePatchVersion": { "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-z0-9]+$" }, "PackageVersionStatus": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_QLDB_Stream.json b/internal/service/cloudformation/schemas/AWS_QLDB_Stream.json index 8669e77cfb..0d6ec85bd5 100644 --- a/internal/service/cloudformation/schemas/AWS_QLDB_Stream.json +++ b/internal/service/cloudformation/schemas/AWS_QLDB_Stream.json @@ -5,7 +5,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" }, "KinesisConfiguration": { "type": "object", diff --git a/internal/service/cloudformation/schemas/AWS_QuickSight_Analysis.json b/internal/service/cloudformation/schemas/AWS_QuickSight_Analysis.json index 789892a250..c6358a3d01 100644 --- a/internal/service/cloudformation/schemas/AWS_QuickSight_Analysis.json +++ b/internal/service/cloudformation/schemas/AWS_QuickSight_Analysis.json @@ -11,7 +11,7 @@ }, "Message": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The message associated with the analysis error.

" } }, @@ -75,7 +75,7 @@ }, "DataSetPlaceholder": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

Dataset placeholder.

" } }, @@ -98,7 +98,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

A display name for the date-time parameter.

" } }, @@ -121,7 +121,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

A display name for the decimal parameter.

" } }, @@ -144,7 +144,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The name of the integer parameter.

" } }, @@ -243,12 +243,12 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "", + "pattern": "[\\w\\-]+", "description": "

The unique identifier associated with a sheet.

" }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.

" } }, @@ -267,7 +267,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

A display name for a string parameter.

" } }, @@ -306,7 +306,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "[\\w\\-]+" }, "Arn": { "type": "string", @@ -316,7 +316,7 @@ "type": "string", "maxLength": 12, "minLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "CreatedTime": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_QuickSight_Dashboard.json b/internal/service/cloudformation/schemas/AWS_QuickSight_Dashboard.json index 3ebbd0c05d..0022e6d172 100644 --- a/internal/service/cloudformation/schemas/AWS_QuickSight_Dashboard.json +++ b/internal/service/cloudformation/schemas/AWS_QuickSight_Dashboard.json @@ -28,7 +28,7 @@ }, "Message": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

Message.

" } }, @@ -179,7 +179,7 @@ }, "DataSetPlaceholder": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

Dataset placeholder.

" } }, @@ -202,7 +202,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

A display name for the date-time parameter.

" } }, @@ -225,7 +225,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

A display name for the decimal parameter.

" } }, @@ -258,7 +258,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The name of the integer parameter.

" } }, @@ -357,12 +357,12 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "", + "pattern": "[\\w\\-]+", "description": "

The unique identifier associated with a sheet.

" }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.

" } }, @@ -391,7 +391,7 @@ }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

A display name for a string parameter.

" } }, @@ -434,7 +434,7 @@ "type": "string", "maxLength": 12, "minLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "CreatedTime": { "type": "string", @@ -445,7 +445,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "[\\w\\-]+" }, "DashboardPublishOptions": { "$ref": "#/definitions/DashboardPublishOptions" diff --git a/internal/service/cloudformation/schemas/AWS_QuickSight_DataSet.json b/internal/service/cloudformation/schemas/AWS_QuickSight_DataSet.json index bb163da06c..b373d83d02 100644 --- a/internal/service/cloudformation/schemas/AWS_QuickSight_DataSet.json +++ b/internal/service/cloudformation/schemas/AWS_QuickSight_DataSet.json @@ -332,14 +332,14 @@ "type": "string", "maxLength": 64, "minLength": 1, - "pattern": "", + "pattern": "[0-9a-zA-Z-]*", "description": "

Left operand.

" }, "RightOperand": { "type": "string", "maxLength": 64, "minLength": 1, - "pattern": "", + "pattern": "[0-9a-zA-Z-]*", "description": "

Right operand.

" }, "RightJoinKeyProperties": { @@ -416,7 +416,7 @@ "type": "string", "maxLength": 64, "minLength": 1, - "pattern": "", + "pattern": "[0-9a-zA-Z-]*", "description": "

Physical table ID.

" }, "JoinInstruction": { @@ -589,7 +589,7 @@ "type": "string", "maxLength": 64, "minLength": 0, - "pattern": "", + "pattern": "^[a-zA-Z0-9._-]*$", "description": "

The namespace associated with the row-level permissions dataset.

" }, "PermissionPolicy": { @@ -777,7 +777,7 @@ "type": "string", "maxLength": 12, "minLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "ColumnGroups": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_QuickSight_DataSource.json b/internal/service/cloudformation/schemas/AWS_QuickSight_DataSource.json index 3f0717bfea..6bcbf87a18 100644 --- a/internal/service/cloudformation/schemas/AWS_QuickSight_DataSource.json +++ b/internal/service/cloudformation/schemas/AWS_QuickSight_DataSource.json @@ -154,7 +154,7 @@ "properties": { "CopySourceArn": { "type": "string", - "pattern": "", + "pattern": "^arn:[-a-z0-9]*:quicksight:[-a-z0-9]*:[0-9]{12}:datasource/.+", "description": "

The Amazon Resource Name (ARN) of a data source that has the credential pair that you\n want to use. When CopySourceArn is not null, the credential pair from the\n data source in the ARN is used as the credentials for the\n DataSourceCredentials structure.

" }, "CredentialPair": { @@ -714,7 +714,7 @@ "type": "string", "maxLength": 12, "minLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "CreatedTime": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_QuickSight_Template.json b/internal/service/cloudformation/schemas/AWS_QuickSight_Template.json index 0d8d2b9c77..f9f7a88ca4 100644 --- a/internal/service/cloudformation/schemas/AWS_QuickSight_Template.json +++ b/internal/service/cloudformation/schemas/AWS_QuickSight_Template.json @@ -85,7 +85,7 @@ }, "DataSetPlaceholder": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

Dataset placeholder.

" } }, @@ -157,12 +157,12 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "", + "pattern": "[\\w\\-]+", "description": "

The unique identifier associated with a sheet.

" }, "Name": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.

" } }, @@ -200,7 +200,7 @@ }, "Message": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

Description of the error type.

" } }, @@ -335,7 +335,7 @@ "type": "string", "maxLength": 12, "minLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "CreatedTime": { "type": "string", @@ -379,7 +379,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "[\\w\\-]+" }, "Version": { "$ref": "#/definitions/TemplateVersion" diff --git a/internal/service/cloudformation/schemas/AWS_QuickSight_Theme.json b/internal/service/cloudformation/schemas/AWS_QuickSight_Theme.json index e8625ce49e..27aeb01993 100644 --- a/internal/service/cloudformation/schemas/AWS_QuickSight_Theme.json +++ b/internal/service/cloudformation/schemas/AWS_QuickSight_Theme.json @@ -19,14 +19,14 @@ "properties": { "EmptyFillColor": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The hexadecimal code of a color that applies to charts where a lack of data is\n highlighted.

" }, "Colors": { "type": "array", "items": { "type": "string", - "pattern": "" + "pattern": "^#[A-F0-9]{6}$" }, "maxItems": 100, "minItems": 0, @@ -36,7 +36,7 @@ "type": "array", "items": { "type": "string", - "pattern": "" + "pattern": "^#[A-F0-9]{6}$" }, "maxItems": 100, "minItems": 0, @@ -178,7 +178,7 @@ }, "Message": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "description": "

The error message.

" } }, @@ -231,7 +231,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "", + "pattern": "[\\w\\-]+", "description": "

The Amazon QuickSight-defined ID of the theme that a custom theme inherits from. All\n themes initially inherit from a default QuickSight theme.

" }, "Arn": { @@ -290,82 +290,82 @@ "properties": { "Warning": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

This color that applies to warning and informational messages.

" }, "Accent": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

This color is that applies to selected states and buttons.

" }, "AccentForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any text or other elements that appear over the\n accent color.

" }, "SecondaryBackground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The background color that applies to the sheet background and sheet controls.

" }, "DangerForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any text or other elements that appear over the\n error color.

" }, "PrimaryBackground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The background color that applies to visuals and other high emphasis UI.

" }, "Dimension": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The color that applies to the names of fields that are identified as\n dimensions.

" }, "SecondaryForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any sheet title, sheet control text, or UI that\n appears over the secondary background.

" }, "WarningForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any text or other elements that appear over the\n warning color.

" }, "DimensionForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any text or other elements that appear over the\n dimension color.

" }, "PrimaryForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The color of text and other foreground elements that appear over the primary\n background regions, such as grid lines, borders, table banding, icons, and so on.

" }, "Success": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The color that applies to success messages, for example the check mark for a\n successful download.

" }, "Danger": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The color that applies to error messages.

" }, "SuccessForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any text or other elements that appear over the\n success color.

" }, "Measure": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The color that applies to the names of fields that are identified as measures.

" }, "MeasureForeground": { "type": "string", - "pattern": "", + "pattern": "^#[A-F0-9]{6}$", "description": "

The foreground color that applies to any text or other elements that appear over the\n measure color.

" } }, @@ -381,13 +381,13 @@ "type": "string", "maxLength": 12, "minLength": 12, - "pattern": "" + "pattern": "^[0-9]{12}$" }, "BaseThemeId": { "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "", + "pattern": "[\\w\\-]+", "description": "

The ID of the theme that a custom theme will inherit from. All themes inherit from one of\n\t\t\tthe starting themes defined by Amazon QuickSight. For a list of the starting themes, use\n\t\t\t\tListThemes or choose Themes from\n\t\t\twithin a QuickSight analysis.

" }, "Configuration": { @@ -431,7 +431,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "[\\w\\-]+" }, "Type": { "$ref": "#/definitions/ThemeType" diff --git a/internal/service/cloudformation/schemas/AWS_RDS_DBProxy.json b/internal/service/cloudformation/schemas/AWS_RDS_DBProxy.json index 8922717829..eedf416b27 100644 --- a/internal/service/cloudformation/schemas/AWS_RDS_DBProxy.json +++ b/internal/service/cloudformation/schemas/AWS_RDS_DBProxy.json @@ -40,12 +40,12 @@ "properties": { "Key": { "type": "string", - "pattern": "", + "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", "maxLength": 128 }, "Value": { "type": "string", - "pattern": "", + "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", "maxLength": 128 } } @@ -67,7 +67,7 @@ "DBProxyName": { "description": "The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.", "type": "string", - "pattern": "", + "pattern": "[0-z]*", "maxLength": 64 }, "DebugLogging": { diff --git a/internal/service/cloudformation/schemas/AWS_RDS_DBProxyEndpoint.json b/internal/service/cloudformation/schemas/AWS_RDS_DBProxyEndpoint.json index f88e6553b3..ef8b6e393f 100644 --- a/internal/service/cloudformation/schemas/AWS_RDS_DBProxyEndpoint.json +++ b/internal/service/cloudformation/schemas/AWS_RDS_DBProxyEndpoint.json @@ -8,12 +8,12 @@ "properties": { "Key": { "type": "string", - "pattern": "", + "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", "maxLength": 128 }, "Value": { "type": "string", - "pattern": "", + "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", "maxLength": 128 } }, @@ -24,18 +24,18 @@ "DBProxyEndpointName": { "description": "The identifier for the DB proxy endpoint. This name must be unique for all DB proxy endpoints owned by your AWS account in the specified AWS Region.", "type": "string", - "pattern": "", + "pattern": "[0-z]*", "maxLength": 64 }, "DBProxyEndpointArn": { "description": "The Amazon Resource Name (ARN) for the DB proxy endpoint.", "type": "string", - "pattern": "" + "pattern": "arn:aws[A-Za-z0-9-]{0,64}:rds:[A-Za-z0-9-]{1,64}:[0-9]{12}:.*" }, "DBProxyName": { "description": "The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.", "type": "string", - "pattern": "", + "pattern": "[0-z]*", "maxLength": 64 }, "VpcId": { diff --git a/internal/service/cloudformation/schemas/AWS_RDS_DBProxyTargetGroup.json b/internal/service/cloudformation/schemas/AWS_RDS_DBProxyTargetGroup.json index a1d2eab23e..279e80bc1e 100644 --- a/internal/service/cloudformation/schemas/AWS_RDS_DBProxyTargetGroup.json +++ b/internal/service/cloudformation/schemas/AWS_RDS_DBProxyTargetGroup.json @@ -40,7 +40,7 @@ "DBProxyName": { "description": "The identifier for the proxy.", "type": "string", - "pattern": "", + "pattern": "[A-z][0-z]*", "maxLength": 64 }, "TargetGroupArn": { diff --git a/internal/service/cloudformation/schemas/AWS_RDS_GlobalCluster.json b/internal/service/cloudformation/schemas/AWS_RDS_GlobalCluster.json index 2b65ba1f8c..9e825b60d8 100644 --- a/internal/service/cloudformation/schemas/AWS_RDS_GlobalCluster.json +++ b/internal/service/cloudformation/schemas/AWS_RDS_GlobalCluster.json @@ -23,14 +23,14 @@ "GlobalClusterIdentifier": { "description": "The cluster identifier of the new global database cluster. This parameter is stored as a lowercase string.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z]{1}(?:-?[a-zA-Z0-9]){0,62}$" }, "SourceDBClusterIdentifier": { "description": "The Amazon Resource Name (ARN) to use as the primary cluster of the global database. This parameter is optional. This parameter is stored as a lowercase string.", "type": "string", "oneOf": [ { - "pattern": "" + "pattern": "^[a-zA-Z]{1}(?:-?[a-zA-Z0-9]){0,62}$" }, { "pattern": "" diff --git a/internal/service/cloudformation/schemas/AWS_RUM_AppMonitor.json b/internal/service/cloudformation/schemas/AWS_RUM_AppMonitor.json index 0523f940da..d7bfe3edd6 100644 --- a/internal/service/cloudformation/schemas/AWS_RUM_AppMonitor.json +++ b/internal/service/cloudformation/schemas/AWS_RUM_AppMonitor.json @@ -12,7 +12,7 @@ "description": "The ID of the identity pool that is used to authorize the sending of data to RUM.", "minLength": 1, "maxLength": 55, - "pattern": "", + "pattern": "[\\w-]+:[0-9a-f-]+", "type": "string" }, "ExcludedPages": { @@ -111,14 +111,14 @@ "Url": { "description": "Page Url", "type": "string", - "pattern": "", + "pattern": "https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)", "minLength": 1, "maxLength": 1260 }, "Arn": { "description": "Resource ARN", "type": "string", - "pattern": "" + "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:.*" }, "Telemetry": { "type": "string", @@ -133,7 +133,7 @@ "Name": { "description": "A name for the app monitor", "type": "string", - "pattern": "", + "pattern": "[\\.\\-_/#A-Za-z0-9]+", "minLength": 1, "maxLength": 255 }, diff --git a/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAccess.json b/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAccess.json index 9195a1edf3..915e88608a 100644 --- a/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAccess.json +++ b/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAccess.json @@ -62,7 +62,7 @@ "ResourceOwner": { "description": "The AWS account ID of the owner of the cluster.", "type": "string", - "pattern": "" + "pattern": "^\\d{12}$" }, "EndpointStatus": { "description": "The status of the endpoint.", diff --git a/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAuthorization.json b/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAuthorization.json index 879eb4d618..40c3816091 100644 --- a/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAuthorization.json +++ b/internal/service/cloudformation/schemas/AWS_Redshift_EndpointAuthorization.json @@ -5,11 +5,11 @@ "definitions": { "AwsAccount": { "type": "string", - "pattern": "" + "pattern": "^\\d{12}$" }, "VpcId": { "type": "string", - "pattern": "" + "pattern": "^vpc-\\d{1,17}$" } }, "properties": { diff --git a/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Environment.json b/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Environment.json index 0f2c3bef46..6942bb34ec 100644 --- a/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Environment.json +++ b/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Environment.json @@ -38,13 +38,13 @@ "type": "string", "maxLength": 256, "minLength": 1, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_\\s\\.\\!\\*\\#\\@\\']+$" }, "EnvironmentIdentifier": { "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^env-([0-9A-Za-z]{10}$)" }, "Name": { "type": "string", @@ -59,13 +59,13 @@ "type": "string", "maxLength": 2048, "minLength": 20, - "pattern": "" + "pattern": "^arn:(aws[a-zA-Z-]*)?:refactor-spaces:[a-zA-Z0-9\\-]+:\\w{12}:[a-zA-Z_0-9+=,.@\\-_\/]+$" }, "TransitGatewayId": { "type": "string", "maxLength": 21, "minLength": 21, - "pattern": "" + "pattern": "^tgw-[-a-f0-9]{17}$" }, "Tags": { "type": "array", @@ -122,4 +122,4 @@ } }, "taggable": true -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Route.json b/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Route.json index a8e3deb0d5..43420e2050 100644 --- a/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Route.json +++ b/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Route.json @@ -34,7 +34,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "^(/[a-zA-Z0-9._-]+)+$" }, "ActivationState": { "$ref": "#/definitions/RouteActivationState" @@ -88,25 +88,25 @@ "type": "string", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:(aws[a-zA-Z-]*)?:refactor-spaces:[a-zA-Z0-9\\-]+:\\w{12}:[a-zA-Z_0-9+=,.@\\-_\/]+$" }, "ApplicationIdentifier": { "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^app-([0-9A-Za-z]{10}$)" }, "EnvironmentIdentifier": { "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^env-([0-9A-Za-z]{10}$)" }, "RouteIdentifier": { "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^rte-([0-9A-Za-z]{10}$)" }, "RouteType": { "$ref": "#/definitions/RouteType" @@ -115,7 +115,7 @@ "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^svc-([0-9A-Za-z]{10}$)" }, "UriPathRoute": { "$ref": "#/definitions/UriPathRouteInput" diff --git a/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Service.json b/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Service.json index c317096e84..4f0e3e26d5 100644 --- a/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Service.json +++ b/internal/service/cloudformation/schemas/AWS_RefactorSpaces_Service.json @@ -9,7 +9,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_]+(:\n(\\$LATEST|[a-zA-Z0-9-_]+))?$" } }, "required": [ @@ -31,13 +31,13 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "^https?://[-a-zA-Z0-9+\\x38@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\\x38@#/%=~_|]$" }, "Url": { "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "^https?://[-a-zA-Z0-9+\\x38@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\\x38@#/%=~_|]$" } }, "required": [ @@ -75,19 +75,19 @@ "type": "string", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:(aws[a-zA-Z-]*)?:refactor-spaces:[a-zA-Z0-9\\-]+:\\w{12}:[a-zA-Z_0-9+=,.@\\-_\/]+$" }, "ApplicationIdentifier": { "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^app-([0-9A-Za-z]{10}$)" }, "Description": { "type": "string", "maxLength": 256, "minLength": 1, - "pattern": "" + "pattern": "^[a-zA-Z0-9-_\\s\\.\\!\\*\\#\\@\\']+$" }, "EndpointType": { "$ref": "#/definitions/ServiceEndpointType" @@ -96,7 +96,7 @@ "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^env-([0-9A-Za-z]{10}$)" }, "LambdaEndpoint": { "$ref": "#/definitions/LambdaEndpointInput" @@ -111,7 +111,7 @@ "type": "string", "maxLength": 14, "minLength": 14, - "pattern": "" + "pattern": "^svc-([0-9A-Za-z]{10}$)" }, "UrlEndpoint": { "$ref": "#/definitions/UrlEndpointInput" @@ -120,7 +120,7 @@ "type": "string", "maxLength": 21, "minLength": 12, - "pattern": "" + "pattern": "^vpc-[-a-f0-9]{8}([-a-f0-9]{9})?$" }, "Tags": { "type": "array", @@ -190,4 +190,4 @@ } }, "taggable": true -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Rekognition_Collection.json b/internal/service/cloudformation/schemas/AWS_Rekognition_Collection.json index 6ce5be9fea..6fdeecede3 100644 --- a/internal/service/cloudformation/schemas/AWS_Rekognition_Collection.json +++ b/internal/service/cloudformation/schemas/AWS_Rekognition_Collection.json @@ -13,7 +13,7 @@ "description": "The name of the collection", "type": "string", "maxLength": 255, - "pattern": "" + "pattern": "\\A[a-zA-Z0-9_\\.\\-]+$" }, "Tag": { "description": "A key-value pair to associate with a resource.", @@ -29,7 +29,7 @@ "type": "string", "description": "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", "maxLength": 256, - "pattern": "" + "pattern": "\\A[a-zA-Z0-9+\\-=\\._\\:\\/@]+$" } }, "required": [ @@ -105,4 +105,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Rekognition_Project.json b/internal/service/cloudformation/schemas/AWS_Rekognition_Project.json index 207d46ad7e..4431d1cc9c 100644 --- a/internal/service/cloudformation/schemas/AWS_Rekognition_Project.json +++ b/internal/service/cloudformation/schemas/AWS_Rekognition_Project.json @@ -6,14 +6,14 @@ "Arn": { "type": "string", "maxLength": 2048, - "pattern": "" + "pattern": "(^arn:[a-z\\d-]+:rekognition:[a-z\\d-]+:\\d{12}:project/[a-zA-Z0-9_.\\-]{1,255}/[0-9]+$)" }, "ProjectName": { "description": "The name of the project", "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "[a-zA-Z0-9][a-zA-Z0-9_\\-]*" } }, "properties": { diff --git a/internal/service/cloudformation/schemas/AWS_ResilienceHub_App.json b/internal/service/cloudformation/schemas/AWS_ResilienceHub_App.json index 7d4ec76d8f..8d8ae03205 100644 --- a/internal/service/cloudformation/schemas/AWS_ResilienceHub_App.json +++ b/internal/service/cloudformation/schemas/AWS_ResilienceHub_App.json @@ -22,11 +22,11 @@ "properties": { "AwsAccountId": { "type": "string", - "pattern": "" + "pattern": "^[0-9]{12}$" }, "AwsRegion": { "type": "string", - "pattern": "" + "pattern": "^[a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]$" }, "Identifier": { "type": "string", @@ -35,7 +35,7 @@ }, "Type": { "type": "string", - "pattern": "" + "pattern": "Arn|Native" } }, "required": [ @@ -53,11 +53,11 @@ }, "MappingType": { "type": "string", - "pattern": "" + "pattern": "CfnStack|Resource" }, "ResourceName": { "type": "string", - "pattern": "" + "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$" }, "PhysicalResourceId": { "$ref": "#/definitions/PhysicalResourceId" @@ -73,7 +73,7 @@ "Name": { "description": "Name of the app.", "type": "string", - "pattern": "" + "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$" }, "Description": { "description": "App description.", @@ -99,7 +99,7 @@ "type": "string", "minLength": 0, "maxLength": 5000, - "pattern": "" + "pattern": "^[\\w\\s:,-\\.'{}\\[\\]:\"]+$" }, "ResourceMappings": { "description": "An array of ResourceMapping objects.", diff --git a/internal/service/cloudformation/schemas/AWS_ResilienceHub_ResiliencyPolicy.json b/internal/service/cloudformation/schemas/AWS_ResilienceHub_ResiliencyPolicy.json index 9d9e60bd4f..a0f9f3615a 100644 --- a/internal/service/cloudformation/schemas/AWS_ResilienceHub_ResiliencyPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_ResilienceHub_ResiliencyPolicy.json @@ -49,7 +49,7 @@ "PolicyName": { "description": "Name of Resiliency Policy.", "type": "string", - "pattern": "" + "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$" }, "PolicyDescription": { "description": "Description of Resiliency Policy.", diff --git a/internal/service/cloudformation/schemas/AWS_RoboMaker_Fleet.json b/internal/service/cloudformation/schemas/AWS_RoboMaker_Fleet.json index 22e823cd2e..02d93db0f3 100644 --- a/internal/service/cloudformation/schemas/AWS_RoboMaker_Fleet.json +++ b/internal/service/cloudformation/schemas/AWS_RoboMaker_Fleet.json @@ -6,7 +6,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" }, "Tags": { "description": "A key-value pair to associate with a resource.", @@ -34,7 +34,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "[a-zA-Z0-9_\\-]{1,255}$" } }, "handlers": { @@ -75,4 +75,4 @@ "primaryIdentifier": [ "/properties/Arn" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_RoboMaker_Robot.json b/internal/service/cloudformation/schemas/AWS_RoboMaker_Robot.json index 1a67237a0b..68683d568f 100644 --- a/internal/service/cloudformation/schemas/AWS_RoboMaker_Robot.json +++ b/internal/service/cloudformation/schemas/AWS_RoboMaker_Robot.json @@ -6,7 +6,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" }, "Tags": { "description": "A key-value pair to associate with a resource.", diff --git a/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplication.json b/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplication.json index 4294013fec..0b64cdbb7c 100644 --- a/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplication.json +++ b/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplication.json @@ -5,7 +5,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" }, "Tags": { "description": "A key-value pair to associate with a resource.", diff --git a/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplicationVersion.json b/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplicationVersion.json index 0bbdcd1250..dae3a8a381 100644 --- a/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplicationVersion.json +++ b/internal/service/cloudformation/schemas/AWS_RoboMaker_RobotApplicationVersion.json @@ -5,7 +5,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" } }, "properties": { @@ -17,7 +17,7 @@ "type": "string", "minLength": 1, "maxLength": 40, - "pattern": "" + "pattern": "[a-zA-Z0-9_.\\-]*" }, "ApplicationVersion": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplication.json b/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplication.json index e55b1bc66f..68299aece5 100644 --- a/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplication.json +++ b/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplication.json @@ -5,7 +5,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" }, "Tags": { "description": "A key-value pair to associate with a resource.", @@ -32,7 +32,7 @@ "Version" : { "type": "string", "description": "The version of the rendering engine.", - "pattern": "" + "pattern": "1.x" } }, "required": [ @@ -68,7 +68,7 @@ "S3Bucket": { "type": "string", "description": "The Amazon S3 bucket name.", - "pattern": "" + "pattern": "[a-z0-9][a-z0-9.\\-]*[a-z0-9]" }, "S3Key": { "type": "string", @@ -119,7 +119,7 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "[a-zA-Z0-9_\\-]*" }, "CurrentRevisionId": { "description": "The current revision id.", diff --git a/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplicationVersion.json b/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplicationVersion.json index 66efd69741..b1ce8e570e 100644 --- a/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplicationVersion.json +++ b/internal/service/cloudformation/schemas/AWS_RoboMaker_SimulationApplicationVersion.json @@ -5,7 +5,7 @@ "definitions": { "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*" } }, "properties": { @@ -17,7 +17,7 @@ "type": "string", "minLength": 1, "maxLength": 40, - "pattern": "" + "pattern": "[a-zA-Z0-9_.\\-]*" }, "ApplicationVersion": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_Cluster.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_Cluster.json index 96832c05d5..d0d089a0f3 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_Cluster.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_Cluster.json @@ -119,4 +119,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_ControlPanel.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_ControlPanel.json index 57e9e0b1ec..4023a7ed7e 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_ControlPanel.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_ControlPanel.json @@ -116,4 +116,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_RoutingControl.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_RoutingControl.json index a497bc4e72..ebc94b0ecf 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_RoutingControl.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_RoutingControl.json @@ -85,4 +85,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_SafetyRule.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_SafetyRule.json index 1b1b0621a1..b748e17722 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_SafetyRule.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryControl_SafetyRule.json @@ -222,4 +222,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_Cell.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_Cell.json index dd3b474734..a36a53bc6d 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_Cell.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_Cell.json @@ -30,7 +30,7 @@ "CellName": { "description": "The name of the cell to create.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "maxLength": 64 }, "CellArn": { @@ -110,4 +110,4 @@ ] } } - } \ No newline at end of file + } diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ReadinessCheck.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ReadinessCheck.json index 3359c1e90e..f83f32d309 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ReadinessCheck.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ReadinessCheck.json @@ -30,14 +30,14 @@ "ResourceSetName": { "description": "The name of the resource set to check.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 64 }, "ReadinessCheckName": { "description": "Name of the ReadinessCheck to create.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 64 }, @@ -102,4 +102,4 @@ ] } } - } \ No newline at end of file + } diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_RecoveryGroup.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_RecoveryGroup.json index 838f23f06d..8d39f06a78 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_RecoveryGroup.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_RecoveryGroup.json @@ -30,7 +30,7 @@ "RecoveryGroupName": { "description": "The name of the recovery group to create.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_]+", "minLength": 1, "maxLength": 64 }, @@ -105,4 +105,4 @@ ] } } - } \ No newline at end of file + } diff --git a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ResourceSet.json b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ResourceSet.json index 67b25f0f50..87aca445b5 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ResourceSet.json +++ b/internal/service/cloudformation/schemas/AWS_Route53RecoveryReadiness_ResourceSet.json @@ -215,4 +215,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverConfig.json b/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverConfig.json index c1347074d2..3394c8d7fe 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverConfig.json +++ b/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverConfig.json @@ -71,4 +71,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverRuleAssociation.json b/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverRuleAssociation.json index 51d21603da..88f4fac25b 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverRuleAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_Route53Resolver_ResolverRuleAssociation.json @@ -61,4 +61,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Route53_DNSSEC.json b/internal/service/cloudformation/schemas/AWS_Route53_DNSSEC.json index 3edbdaea7d..5726424ad1 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53_DNSSEC.json +++ b/internal/service/cloudformation/schemas/AWS_Route53_DNSSEC.json @@ -5,7 +5,7 @@ "HostedZoneId": { "description": "The unique string (ID) used to identify a hosted zone.", "type": "string", - "pattern": "" + "pattern": "^[A-Z0-9]{1,32}$" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_Route53_HealthCheck.json b/internal/service/cloudformation/schemas/AWS_Route53_HealthCheck.json index f8879e8571..2033fc1ca1 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53_HealthCheck.json +++ b/internal/service/cloudformation/schemas/AWS_Route53_HealthCheck.json @@ -96,7 +96,7 @@ "IPAddress": { "type": "string", "maxLength": 45, - "pattern": "" + "pattern": "^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$" }, "MeasureLatency": { "type": "boolean" diff --git a/internal/service/cloudformation/schemas/AWS_Route53_KeySigningKey.json b/internal/service/cloudformation/schemas/AWS_Route53_KeySigningKey.json index 6547d11c49..069f69f016 100644 --- a/internal/service/cloudformation/schemas/AWS_Route53_KeySigningKey.json +++ b/internal/service/cloudformation/schemas/AWS_Route53_KeySigningKey.json @@ -5,7 +5,7 @@ "HostedZoneId": { "description": "The unique string (ID) used to identify a hosted zone.", "type": "string", - "pattern": "" + "pattern": "^[A-Z0-9]{1,32}$" }, "Status": { "description": "A string specifying the initial status of the key signing key (KSK). You can set the value to ACTIVE or INACTIVE.", @@ -18,7 +18,7 @@ "Name": { "description": "An alphanumeric string used to identify a key signing key (KSK). Name must be unique for each key signing key in the same hosted zone.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_]{3,128}$" }, "KeyManagementServiceArn": { "description": "The Amazon resource name (ARN) for a customer managed key (CMK) in AWS Key Management Service (KMS). The KeyManagementServiceArn must be unique for each key signing key (KSK) in a single hosted zone.", diff --git a/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPoint.json b/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPoint.json index e2b88acce5..7f027e7f08 100644 --- a/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPoint.json +++ b/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPoint.json @@ -117,13 +117,13 @@ "Name": { "description": "The name you want to assign to this Object lambda Access Point.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", "minLength": 3, "maxLength": 45 }, "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:[^:]+:s3-object-lambda:[^:]*:\\d{12}:accesspoint/.*" }, "CreationDate": { "description": "The date and time when the Object lambda Access Point was created.", diff --git a/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPointPolicy.json b/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPointPolicy.json index 35f73bd343..2bce4f164f 100644 --- a/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPointPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_S3ObjectLambda_AccessPointPolicy.json @@ -7,7 +7,7 @@ "ObjectLambdaAccessPoint": { "description": "The name of the Amazon S3 ObjectLambdaAccessPoint to which the policy applies.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", "minLength": 3, "maxLength": 45 }, diff --git a/internal/service/cloudformation/schemas/AWS_S3Outposts_AccessPoint.json b/internal/service/cloudformation/schemas/AWS_S3Outposts_AccessPoint.json index aa0318593f..a92c723d34 100644 --- a/internal/service/cloudformation/schemas/AWS_S3Outposts_AccessPoint.json +++ b/internal/service/cloudformation/schemas/AWS_S3Outposts_AccessPoint.json @@ -21,21 +21,21 @@ "description": "The Amazon Resource Name (ARN) of the specified AccessPoint.", "maxLength": 2048, "minLength": 20, - "pattern": "", + "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/accesspoint\\/[^:]+$", "type": "string" }, "Bucket": { "description": "The Amazon Resource Name (ARN) of the bucket you want to associate this AccessPoint with.", "maxLength": 2048, "minLength": 20, - "pattern": "", + "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$", "type": "string" }, "Name": { "description": "A name for the AccessPoint.", "maxLength": 50, "minLength": 3, - "pattern": "", + "pattern": "^[a-z0-9]([a-z0-9\\\\-]*[a-z0-9])?$", "type": "string" }, "VpcConfiguration": { diff --git a/internal/service/cloudformation/schemas/AWS_S3Outposts_Bucket.json b/internal/service/cloudformation/schemas/AWS_S3Outposts_Bucket.json index a4484019fd..50785822a6 100644 --- a/internal/service/cloudformation/schemas/AWS_S3Outposts_Bucket.json +++ b/internal/service/cloudformation/schemas/AWS_S3Outposts_Bucket.json @@ -17,7 +17,7 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$" } }, "required": [ @@ -134,7 +134,7 @@ "iso8601UTC": { "description": "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" }, "AbortIncompleteMultipartUpload": { "description": "Specifies the days since the initiation of an incomplete multipart upload that Amazon S3Outposts will wait before permanently removing all parts of the upload.", @@ -164,13 +164,13 @@ "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$" }, "Value": { "type": "string", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$" } }, "required": [ @@ -211,7 +211,7 @@ "description": "The Amazon Resource Name (ARN) of the specified bucket.", "maxLength": 2048, "minLength": 20, - "pattern": "", + "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$", "type": "string" }, "BucketName": { @@ -223,7 +223,7 @@ }, "OutpostId": { "description": "The id of the customer outpost on which the bucket resides.", - "pattern": "", + "pattern": "^(op-[a-f0-9]{17}|\\d{12}|ec2)$", "type": "string" }, "Tags": { diff --git a/internal/service/cloudformation/schemas/AWS_S3Outposts_BucketPolicy.json b/internal/service/cloudformation/schemas/AWS_S3Outposts_BucketPolicy.json index 2a9fef79ac..9289d42f02 100644 --- a/internal/service/cloudformation/schemas/AWS_S3Outposts_BucketPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_S3Outposts_BucketPolicy.json @@ -8,7 +8,7 @@ "description": "The Amazon Resource Name (ARN) of the specified bucket.", "maxLength": 2048, "minLength": 20, - "pattern": "", + "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$", "type": "string" }, "PolicyDocument": { diff --git a/internal/service/cloudformation/schemas/AWS_S3Outposts_Endpoint.json b/internal/service/cloudformation/schemas/AWS_S3Outposts_Endpoint.json index d4fb32204c..0e86b42507 100644 --- a/internal/service/cloudformation/schemas/AWS_S3Outposts_Endpoint.json +++ b/internal/service/cloudformation/schemas/AWS_S3Outposts_Endpoint.json @@ -6,7 +6,7 @@ "iso8601UTC": { "description": "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" }, "NetworkInterface": { "description": "The container for the network interface.", @@ -30,7 +30,7 @@ "minLength": 5, "maxLength": 500, "type": "string", - "pattern": "" + "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/endpoint/[a-zA-Z0-9]{19}$" }, "CidrBlock": { "description": "The VPC CIDR committed by this endpoint.", @@ -47,7 +47,7 @@ "minLength": 5, "maxLength": 500, "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9]{19}$" }, "NetworkInterfaces": { "description": "The network interfaces of the endpoint.", @@ -60,7 +60,7 @@ }, "OutpostId": { "description": "The id of the customer outpost on which the bucket resides.", - "pattern": "", + "pattern": "^(op-[a-f0-9]{17}|\\d{12}|ec2)$", "type": "string" }, "SecurityGroupId": { @@ -68,7 +68,7 @@ "minLength": 1, "maxLength": 100, "type": "string", - "pattern": "" + "pattern": "^sg-([0-9a-f]{8}|[0-9a-f]{17})$" }, "Status": { "type": "string", @@ -83,7 +83,7 @@ "minLength": 1, "maxLength": 100, "type": "string", - "pattern": "" + "pattern": "^subnet-([0-9a-f]{8}|[0-9a-f]{17})$" }, "AccessType": { "description": "The type of access for the on-premise network connectivity for the Outpost endpoint. To access endpoint from an on-premises network, you must specify the access type and provide the customer owned Ipv4 pool.", @@ -97,7 +97,7 @@ "CustomerOwnedIpv4Pool": { "description": "The ID of the customer-owned IPv4 pool for the Endpoint. IP addresses will be allocated from this pool for the endpoint.", "type": "string", - "pattern": "" + "pattern": "^ipv4pool-coip-([0-9a-f]{17})$" } }, "taggable": false, diff --git a/internal/service/cloudformation/schemas/AWS_S3_AccessPoint.json b/internal/service/cloudformation/schemas/AWS_S3_AccessPoint.json index ca386203ff..8b286fb3b0 100644 --- a/internal/service/cloudformation/schemas/AWS_S3_AccessPoint.json +++ b/internal/service/cloudformation/schemas/AWS_S3_AccessPoint.json @@ -45,14 +45,14 @@ "Name": { "description": "The name you want to assign to this Access Point. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the access point name.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", "minLength": 3, "maxLength": 50 }, "Alias": { "description": "The alias of this Access Point. This alias can be used for compatibility purposes with other AWS services and third-party applications.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", "minLength": 3, "maxLength": 63 }, diff --git a/internal/service/cloudformation/schemas/AWS_S3_Bucket.json b/internal/service/cloudformation/schemas/AWS_S3_Bucket.json index 9756a61a08..f1c4aefe48 100644 --- a/internal/service/cloudformation/schemas/AWS_S3_Bucket.json +++ b/internal/service/cloudformation/schemas/AWS_S3_Bucket.json @@ -37,7 +37,7 @@ "description": "A name for the bucket. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the bucket name.", "maxLength": 63, "minLength": 3, - "pattern": "", + "pattern": "^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$", "type": "string" }, "CorsConfiguration": { @@ -635,12 +635,12 @@ "ObjectSizeGreaterThan": { "type":"string", "maxLength": 20, - "pattern": "" + "pattern": "[0-9]+" }, "ObjectSizeLessThan": { "type":"string", "maxLength": 20, - "pattern": "" + "pattern": "[0-9]+" }, "Transition": { "$ref": "#/definitions/Transition" @@ -676,7 +676,7 @@ "iso8601UTC": { "description": "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", "type": "string", - "pattern": "" + "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$" }, "NoncurrentVersionExpiration": { "type": "object", diff --git a/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPoint.json b/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPoint.json index 76c907be30..cba1012c21 100644 --- a/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPoint.json +++ b/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPoint.json @@ -31,7 +31,7 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$" } }, "required": [ @@ -44,7 +44,7 @@ "Name": { "description": "The name you want to assign to this Multi Region Access Point.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9][-a-z0-9]{1,48}[a-z0-9]$", "minLength": 3, "maxLength": 50 }, diff --git a/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPointPolicy.json b/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPointPolicy.json index da0876e4be..79724c6535 100644 --- a/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPointPolicy.json +++ b/internal/service/cloudformation/schemas/AWS_S3_MultiRegionAccessPointPolicy.json @@ -5,7 +5,7 @@ "MrapName": { "description": "The name of the Multi Region Access Point to apply policy", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9][-a-z0-9]{1,48}[a-z0-9]$", "minLength": 3, "maxLength": 50 }, @@ -75,4 +75,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_S3_StorageLens.json b/internal/service/cloudformation/schemas/AWS_S3_StorageLens.json index 68c53d2639..78a4172898 100644 --- a/internal/service/cloudformation/schemas/AWS_S3_StorageLens.json +++ b/internal/service/cloudformation/schemas/AWS_S3_StorageLens.json @@ -8,7 +8,7 @@ "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-zA-Z0-9\\-_.]+$" }, "Arn": { "description": "The Amazon Resource Name (ARN) of the specified resource.", diff --git a/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSet.json b/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSet.json index a0f3b807df..105728e133 100644 --- a/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSet.json +++ b/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSet.json @@ -6,7 +6,7 @@ "Name": { "description": "The name of the configuration set.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_-]{1,64}$" } }, "createOnlyProperties": [ diff --git a/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSetEventDestination.json b/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSetEventDestination.json index 9fb02b3e50..6448705804 100644 --- a/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSetEventDestination.json +++ b/internal/service/cloudformation/schemas/AWS_SES_ConfigurationSetEventDestination.json @@ -10,7 +10,7 @@ "Name" : { "description": "The name of the event destination set.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_-]{0,64}$" }, "Enabled" : { "description" : "Sets whether Amazon SES publishes events to this destination when you send an email with the associated configuration set. Set to true to enable publishing to this destination; set to false to prevent publishing to this destination. The default value is false. ", @@ -85,14 +85,14 @@ "DefaultDimensionValue" : { "description" : "The default value of the dimension that is published to Amazon CloudWatch if you do not provide the value of the dimension when you send an email.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]{1,256}$", "maxLength": 256, "minLength": 1 }, "DimensionName" : { "description" : "The name of an Amazon CloudWatch dimension associated with an email sending metric.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]{1,256}$", "maxLength": 256, "minLength": 1 } @@ -158,4 +158,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SES_ContactList.json b/internal/service/cloudformation/schemas/AWS_SES_ContactList.json index f7a0770912..6313820a45 100644 --- a/internal/service/cloudformation/schemas/AWS_SES_ContactList.json +++ b/internal/service/cloudformation/schemas/AWS_SES_ContactList.json @@ -29,7 +29,7 @@ "TopicName": { "description": "The name of the topic.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_-]{1,64}$" }, "DisplayName": { "description": "The display name of the topic.", @@ -59,7 +59,7 @@ "ContactListName": { "description": "The name of the contact list.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_-]{1,64}$" }, "Description": { "description": "The description of the contact list.", diff --git a/internal/service/cloudformation/schemas/AWS_SES_Template.json b/internal/service/cloudformation/schemas/AWS_SES_Template.json index a2d087ed36..076463974a 100644 --- a/internal/service/cloudformation/schemas/AWS_SES_Template.json +++ b/internal/service/cloudformation/schemas/AWS_SES_Template.json @@ -11,7 +11,7 @@ "TemplateName" : { "description" : "The name of the template.", "type" : "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]{1,64}$", "maxLength": 64, "minLength": 1 }, diff --git a/internal/service/cloudformation/schemas/AWS_SSMContacts_Contact.json b/internal/service/cloudformation/schemas/AWS_SSMContacts_Contact.json index 1c086e7435..3b3d3b8755 100644 --- a/internal/service/cloudformation/schemas/AWS_SSMContacts_Contact.json +++ b/internal/service/cloudformation/schemas/AWS_SSMContacts_Contact.json @@ -94,14 +94,14 @@ "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-z0-9_\\-\\.]*$" }, "DisplayName": { "description": "Name of the contact. String value with 3 to 256 characters. Only alphabetical, space, numeric characters, dash, or underscore allowed.", "type": "string", "minLength": 1, "maxLength": 255, - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-\\s]*$" }, "Type": { "description": "Contact type, which specify type of contact. Currently supported values: ?PERSONAL?, ?SHARED?, ?OTHER?.", diff --git a/internal/service/cloudformation/schemas/AWS_SSMContacts_ContactChannel.json b/internal/service/cloudformation/schemas/AWS_SSMContacts_ContactChannel.json index 515f437033..dd9e1fd994 100644 --- a/internal/service/cloudformation/schemas/AWS_SSMContacts_ContactChannel.json +++ b/internal/service/cloudformation/schemas/AWS_SSMContacts_ContactChannel.json @@ -8,7 +8,7 @@ "type": "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "arn:[-\\w+=\\/,.@]+:[-\\w+=\\/,.@]+:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*" }, "ChannelName": { "description": "The device name. String of 6 to 50 alphabetical, numeric, dash, and underscore characters.", diff --git a/internal/service/cloudformation/schemas/AWS_SSMIncidents_ReplicationSet.json b/internal/service/cloudformation/schemas/AWS_SSMIncidents_ReplicationSet.json index 51a3a1ef76..2b0e766727 100644 --- a/internal/service/cloudformation/schemas/AWS_SSMIncidents_ReplicationSet.json +++ b/internal/service/cloudformation/schemas/AWS_SSMIncidents_ReplicationSet.json @@ -6,7 +6,7 @@ "Arn": { "description": "The ARN of the ReplicationSet.", "type": "string", - "pattern": "", + "pattern": "^arn:aws(-(cn|us-gov|iso(-b)?))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", "maxLength": 1000 }, "RegionName": { diff --git a/internal/service/cloudformation/schemas/AWS_SSMIncidents_ResponsePlan.json b/internal/service/cloudformation/schemas/AWS_SSMIncidents_ResponsePlan.json index 62f5030b20..c3770d313c 100644 --- a/internal/service/cloudformation/schemas/AWS_SSMIncidents_ResponsePlan.json +++ b/internal/service/cloudformation/schemas/AWS_SSMIncidents_ResponsePlan.json @@ -6,13 +6,13 @@ "SSMContact": { "description": "The ARN of the contact.", "type": "string", - "pattern": "", + "pattern": "^arn:aws(-(cn|us-gov))?:ssm-contacts:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", "maxLength": 1000 }, "SnsArn": { "description": "The ARN of the Chatbot SNS topic.", "type": "string", - "pattern": "", + "pattern": "^arn:aws(-(cn|us-gov))?:sns:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", "maxLength": 1000 }, "NotificationTargetItem": { @@ -47,7 +47,7 @@ "RoleArn": { "description": "The role ARN to use when starting the SSM automation document.", "type": "string", - "pattern": "", + "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", "maxLength": 1000 }, "DocumentName": { @@ -199,13 +199,13 @@ "Arn": { "description": "The ARN of the response plan.", "type": "string", - "pattern": "", + "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", "maxLength": 1000 }, "Name": { "description": "The name of the response plan.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_-]*$", "maxLength": 200, "minLength": 1 }, diff --git a/internal/service/cloudformation/schemas/AWS_SSM_Association.json b/internal/service/cloudformation/schemas/AWS_SSM_Association.json index 2d36906104..b5a7c0d1a4 100644 --- a/internal/service/cloudformation/schemas/AWS_SSM_Association.json +++ b/internal/service/cloudformation/schemas/AWS_SSM_Association.json @@ -8,7 +8,7 @@ "properties": { "Key": { "type": "string", - "pattern": "" + "pattern": "^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]{1,128}$|resource-groups:Name" }, "Values": { "type": "array", @@ -74,7 +74,7 @@ "AssociationId": { "description": "Unique identifier of the association.", "type": "string", - "pattern": "", + "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", "examples": [ "88df7b09-95e8-48c4-a3cb-08c2c20d5110", "203dd0ec-0055-4bf0-a872-707f72ef06aa" @@ -83,17 +83,17 @@ "AssociationName": { "description": "The name of the association.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-.]{3,128}$" }, "DocumentVersion": { "description": "The version of the SSM document to associate with the target.", "type": "string", - "pattern": "" + "pattern": "([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)" }, "InstanceId": { "description": "The ID of the instance that the SSM document is associated with.", "type": "string", - "pattern": "", + "pattern": "(^i-(\\w{8}|\\w{17})$)|(^mi-\\w{17}$)", "examples": [ "i-0e60836d21cf313c4", "mi-0532c22e49636ee13" @@ -102,7 +102,7 @@ "Name": { "description": "The name of the SSM document.", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_\\-.:/]{3,200}$", "examples": [ "AWS-GatherSoftwareInventory", "MyCustomSSMDocument" @@ -149,7 +149,7 @@ }, "MaxErrors": { "type": "string", - "pattern": "", + "pattern": "^([1-9][0-9]{0,6}|[0]|[1-9][0-9]%|[0-9]%|100%)$", "examples": [ "1%", "10%", @@ -159,7 +159,7 @@ }, "MaxConcurrency": { "type": "string", - "pattern": "", + "pattern": "^([1-9][0-9]{0,6}|[1-9][0-9]%|[1-9]%|100%)$", "examples": [ "1%", "10%", diff --git a/internal/service/cloudformation/schemas/AWS_SSM_Document.json b/internal/service/cloudformation/schemas/AWS_SSM_Document.json index 731adfeddf..f95800b14a 100644 --- a/internal/service/cloudformation/schemas/AWS_SSM_Document.json +++ b/internal/service/cloudformation/schemas/AWS_SSM_Document.json @@ -30,7 +30,7 @@ "Name": { "description": "The name of the document attachment file.", "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 1, "maxLength": 128 } @@ -43,14 +43,14 @@ "Key": { "description": "The name of the tag.", "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 1, "maxLength": 128 }, "Value": { "description": "The value of the tag.", "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 1, "maxLength": 256 } @@ -63,13 +63,13 @@ "Name": { "description": "The name of the required SSM document. The name can be an Amazon Resource Name (ARN).", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9_\\-.:/]{3,200}$", "maxLength": 200 }, "Version": { "description": "The document version required by the current document.", "type": "string", - "pattern": "", + "pattern": "([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)", "maxLength": 8 } }, @@ -97,12 +97,12 @@ "Name": { "description": "A name for the Systems Manager document.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-.]{3,128}$" }, "VersionName": { "description": "An optional field specifying the version of the artifact you are creating with the document. This value is unique across all versions of a document, and cannot be changed.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_\\-.]{1,128}$" }, "DocumentType": { "description": "The type of document to create.", @@ -136,7 +136,7 @@ "TargetType": { "description": "Specify a target type to define the kinds of resources the document can run on.", "type": "string", - "pattern": "" + "pattern": "^\\/[\\w\\.\\-\\:\\/]*$" }, "Tags": { "description": "Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment.", diff --git a/internal/service/cloudformation/schemas/AWS_SSO_Assignment.json b/internal/service/cloudformation/schemas/AWS_SSO_Assignment.json index aecf4bb1f7..4eea34fbed 100644 --- a/internal/service/cloudformation/schemas/AWS_SSO_Assignment.json +++ b/internal/service/cloudformation/schemas/AWS_SSO_Assignment.json @@ -7,14 +7,14 @@ "InstanceArn": { "description": "The sso instance that the permission set is owned.", "type": "string", - "pattern": "", + "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", "minLength": 10, "maxLength": 1224 }, "TargetId": { "description": "The account id to be provisioned.", "type": "string", - "pattern": "" + "pattern": "\\d{12}" }, "TargetType": { "description": "The type of resource to be provsioned to, only aws account now", @@ -26,7 +26,7 @@ "PermissionSetArn": { "description": "The permission set that the assignemt will be assigned", "type": "string", - "pattern": "", + "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::permissionSet/(sso)?ins-[a-zA-Z0-9-.]{16}/ps-[a-zA-Z0-9-./]{16}", "minLength": 10, "maxLength": 1224 }, @@ -41,7 +41,7 @@ "PrincipalId": { "description": "The assignee's identifier, user id/group id", "type": "string", - "pattern": "", + "pattern": "^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$", "minLength": 1, "maxLength": 47 } diff --git a/internal/service/cloudformation/schemas/AWS_SSO_InstanceAccessControlAttributeConfiguration.json b/internal/service/cloudformation/schemas/AWS_SSO_InstanceAccessControlAttributeConfiguration.json index 104734e726..1f21e944c3 100644 --- a/internal/service/cloudformation/schemas/AWS_SSO_InstanceAccessControlAttributeConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_SSO_InstanceAccessControlAttributeConfiguration.json @@ -8,7 +8,7 @@ "type": "string", "minLength": 0, "maxLength": 256, - "pattern": "" + "pattern": "[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@\\[\\]\\{\\}\\$\\\\\"]*" }, "AccessControlAttributeValueSourceList": { "type": "array", @@ -35,7 +35,7 @@ "properties": { "Key": { "type": "string", - "pattern": "", + "pattern": "[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]+", "minLength": 1, "maxLength": 128 }, @@ -62,7 +62,7 @@ "InstanceArn": { "description": "The ARN of the AWS SSO instance under which the operation will be executed.", "type": "string", - "pattern": "", + "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", "minLength": 10, "maxLength": 1224 }, diff --git a/internal/service/cloudformation/schemas/AWS_SSO_PermissionSet.json b/internal/service/cloudformation/schemas/AWS_SSO_PermissionSet.json index 1d1035c3e6..c8c594c407 100644 --- a/internal/service/cloudformation/schemas/AWS_SSO_PermissionSet.json +++ b/internal/service/cloudformation/schemas/AWS_SSO_PermissionSet.json @@ -10,13 +10,13 @@ "properties": { "Key": { "type": "string", - "pattern": "", + "pattern": "[\\w+=,.@-]+", "minLength": 1, "maxLength": 128 }, "Value": { "type": "string", - "pattern": "", + "pattern": "[\\w+=,.@-]+", "minLength": 0, "maxLength": 256 } @@ -38,28 +38,28 @@ "Name": { "description": "The name you want to assign to this permission set.", "type": "string", - "pattern": "", + "pattern": "[\\w+=,.@-]+", "minLength": 1, "maxLength": 32 }, "PermissionSetArn": { "description": "The permission set that the policy will be attached to", "type": "string", - "pattern": "", + "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::permissionSet/(sso)?ins-[a-zA-Z0-9-.]{16}/ps-[a-zA-Z0-9-./]{16}", "minLength": 10, "maxLength": 1224 }, "Description": { "description": "The permission set description.", "type": "string", - "pattern": "", + "pattern": "[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*", "minLength": 1, "maxLength": 700 }, "InstanceArn": { "description": "The sso instance arn that the permission set is owned.", "type": "string", - "pattern": "", + "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", "minLength": 10, "maxLength": 1224 }, @@ -73,7 +73,7 @@ "RelayStateType": { "description": "The relay state URL that redirect links to any service in the AWS Management Console.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9&$@#\\/%?=~\\-_'"|!:,.;*+\\[\\]\\ \\(\\)\\{\\}]+", "minLength": 1, "maxLength": 240 }, diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_App.json b/internal/service/cloudformation/schemas/AWS_SageMaker_App.json index 55041ab87e..a9ea414641 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_App.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_App.json @@ -8,14 +8,14 @@ "description": "The Amazon Resource Name (ARN) of the app.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:app/.*" }, "AppName": { "type": "string", "description": "The name of the app.", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}" }, "AppType": { "type": "string", @@ -50,7 +50,7 @@ "description": "The user profile name.", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}" } }, "definitions": { @@ -101,14 +101,14 @@ "description": "The ARN of the SageMaker image that the image version belongs to.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$" }, "SageMakerImageVersionArn": { "type": "string", "description": "The ARN of the image version created on the instance.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$" } } }, @@ -181,4 +181,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_AppImageConfig.json b/internal/service/cloudformation/schemas/AWS_SageMaker_AppImageConfig.json index 5b6063ad2a..8c3466cf6f 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_AppImageConfig.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_AppImageConfig.json @@ -8,14 +8,14 @@ "description": "The Amazon Resource Name (ARN) of the AppImageConfig.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:app-image-config/.*" }, "AppImageConfigName": { "type": "string", "description": "The Name of the AppImageConfig.", "minLength": 1, "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}" }, "KernelGatewayImageConfig": { "$ref": "#/definitions/KernelGatewayImageConfig", @@ -78,7 +78,7 @@ "description": "The path within the image to mount the user's EFS home directory. The directory should be empty. If not specified, defaults to /home/sagemaker-user.", "minLength": 1, "maxLength": 1024, - "pattern": "" + "pattern": "^\/.*" } } }, diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_DataQualityJobDefinition.json b/internal/service/cloudformation/schemas/AWS_SageMaker_DataQualityJobDefinition.json index 5b54f5864e..58d044e2e2 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_DataQualityJobDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_DataQualityJobDefinition.json @@ -33,7 +33,7 @@ "RoleArn": { "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", "type" : "string", - "pattern": "", + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", "minLength": 20, "maxLength": 2048 }, @@ -95,7 +95,7 @@ "S3Uri": { "type": "string", "description": "The Amazon S3 URI.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength": 1024 }, "DataQualityAppSpecification" : { @@ -126,7 +126,7 @@ "ImageUri": { "type" : "string", "description" : "The container image to be run by the monitoring job.", - "pattern": "", + "pattern": ".*", "maxLength" : 255 }, "PostAnalyticsProcessorSourceUri": { @@ -178,7 +178,7 @@ "LocalPath": { "type" : "string", "description" : "Path to the filesystem where the endpoint data is available to the container.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3DataDistributionType": { @@ -208,7 +208,7 @@ "KmsKeyId": { "type" : "string", "description" : "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", - "pattern": "", + "pattern": ".*", "maxLength" : 2048 }, "MonitoringOutputs" : { @@ -242,7 +242,7 @@ "LocalPath": { "type" : "string", "description" : "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3UploadMode" : { @@ -256,7 +256,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -334,7 +334,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "Subnets": { @@ -345,7 +345,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } } }, @@ -375,13 +375,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ] @@ -389,19 +389,19 @@ "EndpointName": { "type" : "string", "description" : "The name of the endpoint used to run the monitoring job.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", "maxLength" : 63 }, "JobDefinitionName": { "type" : "string", "description" : "The name of the job definition.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 63 }, "ProcessingJobName": { "type" : "string", "description" : "The name of a processing job", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength" : 1, "maxLength" : 63 } @@ -443,4 +443,4 @@ "/properties/StoppingCondition", "/properties/Tags" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_Device.json b/internal/service/cloudformation/schemas/AWS_SageMaker_Device.json index 0c6352c086..2499659fb0 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_Device.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_Device.json @@ -10,21 +10,21 @@ "Description": { "description": "Description of the device", "type": "string", - "pattern": "", + "pattern": "[\\S\\s]+", "minLength": 1, "maxLength": 40 }, "DeviceName": { "description": "The name of the device", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength": 1, "maxLength": 63 }, "IotThingName": { "description": "AWS Internet of Things (IoT) object name.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "maxLength": 128 } }, @@ -46,7 +46,7 @@ "Value": { "description": "The key value of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 0, "maxLength": 256 } @@ -62,7 +62,7 @@ "DeviceFleetName": { "description": "The name of the edge device fleet", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*_*[a-zA-Z0-9])*$", "minLength": 1, "maxLength": 63 }, diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_DeviceFleet.json b/internal/service/cloudformation/schemas/AWS_SageMaker_DeviceFleet.json index e9c2350417..25dd3516da 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_DeviceFleet.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_DeviceFleet.json @@ -9,13 +9,13 @@ "S3OutputLocation": { "description": "The Amazon Simple Storage (S3) bucket URI", "type": "string", - "pattern": "", + "pattern": "^s3://([^/]+)/?(.*)$", "maxLength": 1024 }, "KmsKeyId": { "description": "The KMS key id used for encryption on the S3 bucket", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9:_-]+", "minLength": 1, "maxLength": 2048 } @@ -39,7 +39,7 @@ "Value": { "description": "The key value of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "type": "string", - "pattern": "", + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", "minLength": 0, "maxLength": 256 } @@ -55,14 +55,14 @@ "Description": { "description": "Description for the edge device fleet", "type": "string", - "pattern": "", + "pattern": "[\\S\\s]+", "minLength": 0, "maxLength": 800 }, "DeviceFleetName": { "description": "The name of the edge device fleet", "type": "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*_*[a-zA-Z0-9])*$", "minLength": 1, "maxLength": 63 }, @@ -73,7 +73,7 @@ "RoleArn": { "description": "Role associated with the device fleet", "type": "string", - "pattern": "", + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", "minLength": 20, "maxLength": 2048 }, diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_Domain.json b/internal/service/cloudformation/schemas/AWS_SageMaker_Domain.json index 65a856ed12..0f5046ad74 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_Domain.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_Domain.json @@ -7,7 +7,7 @@ "type": "string", "description": "The Amazon Resource Name (ARN) of the created domain.", "maxLength": 256, - "pattern": "" + "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:domain/.*" }, "Url": { "type": "string", @@ -38,13 +38,13 @@ "type": "string", "description": "A name for the domain.", "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}" }, "KmsKeyId": { "type": "string", "description": "SageMaker uses AWS KMS to encrypt the EFS volume attached to the domain with an AWS managed customer master key (CMK) by default.", "maxLength": 2048, - "pattern": "" + "pattern": ".*" }, "SubnetIds": { "type": "array", @@ -55,7 +55,7 @@ "items": { "type": "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "Tags": { @@ -72,13 +72,13 @@ "type": "string", "description": "The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" }, "DomainId": { "type": "string", "description": "The domain name.", "maxLength": 63, - "pattern": "" + "pattern": "^d-(-*[a-z0-9])+" }, "HomeEfsFileSystemId": { "type" : "string", @@ -102,7 +102,7 @@ "description": "The user profile Amazon Resource Name (ARN).", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "JupyterServerAppSettings": { "$ref": "#/definitions/JupyterServerAppSettings", @@ -121,7 +121,7 @@ "items": { "type": "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "SharingSettings": { @@ -186,13 +186,13 @@ "type": "string", "description": "The ARN of the SageMaker image that the image version belongs to.", "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$" }, "SageMakerImageVersionArn": { "type": "string", "description": "The ARN of the image version created on the instance.", "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$" } } }, @@ -226,13 +226,13 @@ "type": "string", "description": "The Name of the AppImageConfig.", "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}" }, "ImageName": { "type": "string", "description": "The name of the CustomImage. Must be unique to your account.", "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$" }, "ImageVersionNumber": { "type": "integer", @@ -262,13 +262,13 @@ "type": "string", "description": "When NotebookOutputOption is Allowed, the AWS Key Management Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket.", "maxLength": 2048, - "pattern": "" + "pattern": ".*" }, "S3OutputPath": { "type": "string", "description": "When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the shared notebook snapshots.", "maxLength": 1024, - "pattern": "" + "pattern": "^(https|s3)://([^/]+)/?(.*)$" } } }, @@ -364,4 +364,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_FeatureGroup.json b/internal/service/cloudformation/schemas/AWS_SageMaker_FeatureGroup.json index 7075a599ee..11bb2b7da3 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_FeatureGroup.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_FeatureGroup.json @@ -8,21 +8,21 @@ "description": "The Name of the FeatureGroup.", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}" }, "RecordIdentifierFeatureName": { "type": "string", "description": "The Record Identifier Feature Name.", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}" }, "EventTimeFeatureName": { "type": "string", "description": "The Event Time Feature Name.", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}" }, "FeatureDefinitions": { "type": "array", @@ -67,7 +67,7 @@ "description": "Role Arn", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "Description": { "type": "string", @@ -93,7 +93,7 @@ "type": "string", "minLength": 1, "maxLength": 64, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}" }, "FeatureType": { "type": "string", @@ -126,7 +126,7 @@ "S3Uri": { "type": "string", "maxLength": 1024, - "pattern": "" + "pattern": "^(https|s3)://([^/]+)/?(.*)$" }, "KmsKeyId": { "$ref": "#/definitions/KmsKeyId" @@ -224,4 +224,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_Image.json b/internal/service/cloudformation/schemas/AWS_SageMaker_Image.json index 3c1d442580..71a0e76762 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_Image.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_Image.json @@ -32,7 +32,7 @@ "ImageName": { "type" : "string", "description" : "The name of the image.", - "pattern": "", + "pattern": "^[a-zA-Z0-9]([-.]?[a-zA-Z0-9])*$", "minLength": 1, "maxLength" : 63 }, @@ -41,26 +41,26 @@ "type" : "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:image\\/[a-z0-9]([-.]?[a-z0-9])*$" }, "ImageRoleArn": { "description": "The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on behalf of the customer.", "type" : "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*$" }, "ImageDisplayName": { "type" : "string", "description" : "The display name of the image.", - "pattern": "", + "pattern": "^[A-Za-z0-9 -_]+$", "minLength" : 1, "maxLength" : 128 }, "ImageDescription": { "type" : "string", "description" : "A description of the image.", - "pattern": "", + "pattern": ".+", "minLength" : 1, "maxLength" : 512 }, diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_ImageVersion.json b/internal/service/cloudformation/schemas/AWS_SageMaker_ImageVersion.json index 0dbbb9ddc7..0ffa0ba872 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_ImageVersion.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_ImageVersion.json @@ -26,7 +26,7 @@ "ImageName": { "type" : "string", "description" : "The name of the image this version belongs to.", - "pattern": "", + "pattern": "^[A-Za-z0-9]([-.]?[A-Za-z0-9])*$", "minLength": 1, "maxLength" : 63 }, @@ -35,28 +35,28 @@ "description": "The Amazon Resource Name (ARN) of the parent image.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:image\\/[a-z0-9]([-.]?[a-z0-9])*$" }, "ImageVersionArn": { "type" : "string", "description": "The Amazon Resource Name (ARN) of the image version.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:image-version\\/[a-z0-9]([-.]?[a-z0-9])*\\/[0-9]+$" }, "BaseImage": { "type" : "string", "description" : "The registry path of the container image on which this image version is based.", "minLength" : 1, "maxLength" : 255, - "pattern": "" + "pattern": ".+" }, "ContainerImage": { "type" : "string", "description" : "The registry path of the container image that contains this image version.", "minLength" : 1, "maxLength" : 255, - "pattern": "" + "pattern": ".+" }, "Version": { "type" : "integer", @@ -105,4 +105,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelBiasJobDefinition.json b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelBiasJobDefinition.json index 9c209c1857..1ad2a9b0a8 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelBiasJobDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelBiasJobDefinition.json @@ -33,7 +33,7 @@ "RoleArn": { "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", "type" : "string", - "pattern": "", + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", "minLength": 20, "maxLength": 2048 }, @@ -81,7 +81,7 @@ "S3Uri": { "type": "string", "description": "The Amazon S3 URI.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength": 1024 }, "ModelBiasAppSpecification" : { @@ -92,7 +92,7 @@ "ImageUri": { "type" : "string", "description" : "The container image to be run by the monitoring job.", - "pattern": "", + "pattern": ".*", "maxLength" : 255 }, "ConfigUri": { @@ -143,7 +143,7 @@ "LocalPath": { "type" : "string", "description" : "Path to the filesystem where the endpoint data is available to the container.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3DataDistributionType": { @@ -200,7 +200,7 @@ "KmsKeyId": { "type" : "string", "description" : "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", - "pattern": "", + "pattern": ".*", "maxLength" : 2048 }, "MonitoringOutputs" : { @@ -234,7 +234,7 @@ "LocalPath": { "type" : "string", "description" : "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3UploadMode" : { @@ -248,7 +248,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -326,7 +326,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "Subnets": { @@ -337,7 +337,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } } }, @@ -367,13 +367,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ] @@ -381,26 +381,26 @@ "EndpointName": { "type" : "string", "description" : "The name of the endpoint used to run the monitoring job.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", "maxLength" : 63 }, "JobDefinitionName": { "type" : "string", "description" : "The name of the job definition.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 63 }, "ProcessingJobName": { "type" : "string", "description" : "The name of a processing job", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength" : 1, "maxLength" : 63 }, "MonitoringTimeOffsetString": { "type" : "string", "description" : "The time offsets in ISO duration format", - "pattern": "", + "pattern": "^.?P.*", "minLength" : 1, "maxLength" : 15 }, @@ -412,7 +412,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -456,4 +456,4 @@ "/properties/StoppingCondition", "/properties/Tags" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelExplainabilityJobDefinition.json b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelExplainabilityJobDefinition.json index 4256f176a0..db9e50ecda 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelExplainabilityJobDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelExplainabilityJobDefinition.json @@ -33,7 +33,7 @@ "RoleArn": { "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", "type" : "string", - "pattern": "", + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", "minLength": 20, "maxLength": 2048 }, @@ -81,7 +81,7 @@ "S3Uri": { "type": "string", "description": "The Amazon S3 URI.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength": 1024 }, "ModelExplainabilityAppSpecification" : { @@ -92,7 +92,7 @@ "ImageUri": { "type" : "string", "description" : "The container image to be run by the monitoring job.", - "pattern": "", + "pattern": ".*", "maxLength" : 255 }, "ConfigUri": { @@ -140,7 +140,7 @@ "LocalPath": { "type" : "string", "description" : "Path to the filesystem where the endpoint data is available to the container.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3DataDistributionType": { @@ -185,7 +185,7 @@ "KmsKeyId": { "type" : "string", "description" : "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", - "pattern": "", + "pattern": ".*", "maxLength" : 2048 }, "MonitoringOutputs" : { @@ -219,7 +219,7 @@ "LocalPath": { "type" : "string", "description" : "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3UploadMode" : { @@ -233,7 +233,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -311,7 +311,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "Subnets": { @@ -322,7 +322,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } } }, @@ -352,13 +352,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ] @@ -366,26 +366,26 @@ "EndpointName": { "type" : "string", "description" : "The name of the endpoint used to run the monitoring job.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", "maxLength" : 63 }, "JobDefinitionName": { "type" : "string", "description" : "The name of the job definition.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 63 }, "ProcessingJobName": { "type" : "string", "description" : "The name of a processing job", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength" : 1, "maxLength" : 63 }, "MonitoringTimeOffsetString": { "type" : "string", "description" : "The time offsets in ISO duration format", - "pattern": "", + "pattern": "^.?P.*", "minLength" : 1, "maxLength" : 15 } @@ -427,4 +427,4 @@ "/properties/StoppingCondition", "/properties/Tags" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelPackageGroup.json b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelPackageGroup.json index 33e06e3935..c19af05fbc 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelPackageGroup.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelPackageGroup.json @@ -50,13 +50,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ], @@ -65,13 +65,13 @@ "ModelPackageGroupDescription": { "type" : "string", "description" : "The description of the model package group.", - "pattern": "", + "pattern": "[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*", "maxLength" : 1024 }, "ModelPackageGroupName": { "type" : "string", "description" : "The name of the model package group.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 63 }, "ModelPackageGroupArn": { @@ -79,7 +79,7 @@ "type" : "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "arn:.*" } }, "required": [ diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelQualityJobDefinition.json b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelQualityJobDefinition.json index 32ddfb0b7f..04e340bf40 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_ModelQualityJobDefinition.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_ModelQualityJobDefinition.json @@ -33,7 +33,7 @@ "RoleArn": { "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", "type" : "string", - "pattern": "", + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", "minLength": 20, "maxLength": 2048 }, @@ -81,7 +81,7 @@ "S3Uri": { "type": "string", "description": "The Amazon S3 URI.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength": 1024 }, "ModelQualityAppSpecification" : { @@ -112,7 +112,7 @@ "ImageUri": { "type" : "string", "description" : "The container image to be run by the monitoring job.", - "pattern": "", + "pattern": ".*", "maxLength" : 255 }, "PostAnalyticsProcessorSourceUri": { @@ -170,7 +170,7 @@ "LocalPath": { "type" : "string", "description" : "Path to the filesystem where the endpoint data is available to the container.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3DataDistributionType": { @@ -222,7 +222,7 @@ "KmsKeyId": { "type" : "string", "description" : "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", - "pattern": "", + "pattern": ".*", "maxLength" : 2048 }, "MonitoringOutputs" : { @@ -256,7 +256,7 @@ "LocalPath": { "type" : "string", "description" : "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3UploadMode" : { @@ -270,7 +270,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -348,7 +348,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "Subnets": { @@ -359,7 +359,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } } }, @@ -389,13 +389,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ] @@ -403,26 +403,26 @@ "EndpointName": { "type" : "string", "description" : "The name of the endpoint used to run the monitoring job.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", "maxLength" : 63 }, "JobDefinitionName": { "type" : "string", "description" : "The name of the job definition.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 63 }, "ProcessingJobName": { "type" : "string", "description" : "The name of a processing job", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength" : 1, "maxLength" : 63 }, "MonitoringTimeOffsetString": { "type" : "string", "description" : "The time offsets in ISO duration format", - "pattern": "", + "pattern": "^.?P.*", "minLength" : 1, "maxLength" : 15 }, @@ -443,7 +443,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -487,4 +487,4 @@ "/properties/StoppingCondition", "/properties/Tags" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_MonitoringSchedule.json b/internal/service/cloudformation/schemas/AWS_SageMaker_MonitoringSchedule.json index 2e9ca3fcb5..b41427ff9d 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_MonitoringSchedule.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_MonitoringSchedule.json @@ -67,7 +67,7 @@ "MonitoringJobDefinitionName": { "description": "Name of the job definition", "type" : "string", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength": 1, "maxLength": 63 }, @@ -130,7 +130,7 @@ "RoleArn": { "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", "type" : "string", - "pattern": "", + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", "minLength": 20, "maxLength": 2048 }, @@ -178,7 +178,7 @@ "S3Uri": { "type": "string", "description": "The Amazon S3 URI.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength": 1024 }, "MonitoringAppSpecification" : { @@ -207,7 +207,7 @@ "ImageUri": { "type" : "string", "description" : "The container image to be run by the monitoring job.", - "pattern": "", + "pattern": ".*", "maxLength" : 255 }, "PostAnalyticsProcessorSourceUri": { @@ -260,7 +260,7 @@ "LocalPath": { "type" : "string", "description" : "Path to the filesystem where the endpoint data is available to the container.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3DataDistributionType": { @@ -290,7 +290,7 @@ "KmsKeyId": { "type" : "string", "description" : "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", - "pattern": "", + "pattern": ".*", "maxLength" : 2048 }, "MonitoringOutputs" : { @@ -324,7 +324,7 @@ "LocalPath": { "type" : "string", "description" : "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", - "pattern": "", + "pattern": ".*", "maxLength" : 256 }, "S3UploadMode" : { @@ -338,7 +338,7 @@ "S3Uri" : { "type" : "string", "description" : "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", - "pattern": "", + "pattern": "^(https|s3)://([^/]+)/?(.*)$", "maxLength" : 512 } }, @@ -416,7 +416,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "Subnets": { @@ -427,7 +427,7 @@ "items" : { "type" : "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } } }, @@ -470,13 +470,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ] @@ -520,7 +520,7 @@ "ProcessingJobArn" : { "description": "The Amazon Resource Name (ARN) of the monitoring job.", "type" : "string", - "pattern": "", + "pattern": "aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:processing-job/.*", "maxLength": 256 }, "ScheduledTime": { @@ -533,13 +533,13 @@ "EndpointName": { "type" : "string", "description" : "The name of the endpoint used to run the monitoring job.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", "maxLength" : 63 }, "MonitoringScheduleName": { "type" : "string", "description" : "The name of the monitoring schedule.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 63 } }, @@ -584,4 +584,4 @@ "createOnlyProperties": [ "/properties/MonitoringScheduleName" ] -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_Pipeline.json b/internal/service/cloudformation/schemas/AWS_SageMaker_Pipeline.json index d12545126c..3728d0abac 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_Pipeline.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_Pipeline.json @@ -8,14 +8,14 @@ "description": "The name of the Pipeline.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*" }, "PipelineDisplayName": { "type": "string", "description": "The display name of the Pipeline.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*" }, "PipelineDescription": { "type": "string", @@ -52,7 +52,7 @@ "description": "Role Arn", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "Tags": { "type": "array", @@ -148,4 +148,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_Project.json b/internal/service/cloudformation/schemas/AWS_SageMaker_Project.json index ebe003f705..6145331e08 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_Project.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_Project.json @@ -11,13 +11,13 @@ "description" : "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "minLength" : 1, "maxLength" : 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value" : { "type" : "string", "description" : "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", "maxLength" : 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "required" : [ "Key", "Value" ], @@ -26,13 +26,13 @@ "ProjectDescription": { "type" : "string", "description" : "The description of the project.", - "pattern": "", + "pattern": ".*", "maxLength" : 1024 }, "ProjectId": { "type" : "string", "description" : "Project Id.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", "maxLength" : 20 }, "ProvisionedProductStatusMessage": { @@ -42,7 +42,7 @@ "ProjectName": { "type" : "string", "description" : "The name of the project.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "minLength": 1, "maxLength" : 32 }, @@ -51,24 +51,24 @@ "type" : "string", "minLength": 1, "maxLength": 2048, - "pattern": "" + "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:project.*" }, "ProductId": { "type" : "string", "description" : "Service Catalog product identifier.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 100 }, "ProvisioningArtifactId": { "type" : "string", "description" : "The identifier of the provisioning artifact (also known as a version).", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 100 }, "PathId": { "type" : "string", "description" : "The path identifier of the product.", - "pattern": "", + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", "maxLength" : 100 }, "ProvisioningParameter" : { @@ -80,13 +80,13 @@ "description" : "The parameter key.", "minLength" : 1, "maxLength" : 1000, - "pattern": "" + "pattern": ".*" }, "Value" : { "type" : "string", "description" : "The parameter value.", "maxLength" : 4096, - "pattern": "" + "pattern": ".*" } }, "required" : [ "Key", "Value" ], diff --git a/internal/service/cloudformation/schemas/AWS_SageMaker_UserProfile.json b/internal/service/cloudformation/schemas/AWS_SageMaker_UserProfile.json index 69055dfc3d..37ed37e487 100644 --- a/internal/service/cloudformation/schemas/AWS_SageMaker_UserProfile.json +++ b/internal/service/cloudformation/schemas/AWS_SageMaker_UserProfile.json @@ -7,7 +7,7 @@ "type": "string", "description": "The user profile Amazon Resource Name (ARN).", "maxLength": 256, - "pattern": "" + "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:user-profile/.*" }, "DomainId": { "type": "string", @@ -18,7 +18,7 @@ "SingleSignOnUserIdentifier": { "type": "string", "description": "A specifier for the type of value specified in SingleSignOnUserValue. Currently, the only supported value is \"UserName\". If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.", - "pattern": "" + "pattern": "UserName" }, "SingleSignOnUserValue": { "type": "string", @@ -61,7 +61,7 @@ "description": "The user profile Amazon Resource Name (ARN).", "minLength": 20, "maxLength": 2048, - "pattern": "" + "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$" }, "JupyterServerAppSettings": { "$ref": "#/definitions/JupyterServerAppSettings", @@ -80,7 +80,7 @@ "items": { "type": "string", "maxLength": 32, - "pattern": "" + "pattern": "[-0-9a-zA-Z]+" } }, "SharingSettings": { @@ -145,13 +145,13 @@ "type": "string", "description": "The ARN of the SageMaker image that the image version belongs to.", "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$" }, "SageMakerImageVersionArn": { "type": "string", "description": "The ARN of the image version created on the instance.", "maxLength": 256, - "pattern": "" + "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$" } } }, @@ -185,13 +185,13 @@ "type": "string", "description": "The Name of the AppImageConfig.", "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}" }, "ImageName": { "type": "string", "description": "The name of the CustomImage. Must be unique to your account.", "maxLength": 63, - "pattern": "" + "pattern": "^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$" }, "ImageVersionNumber": { "type": "integer", @@ -221,13 +221,13 @@ "type": "string", "description": "When NotebookOutputOption is Allowed, the AWS Key Management Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket.", "maxLength": 2048, - "pattern": "" + "pattern": ".*" }, "S3OutputPath": { "type": "string", "description": "When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the shared notebook snapshots.", "maxLength": 1024, - "pattern": "" + "pattern": "^(https|s3)://([^/]+)/?(.*)$" } } }, diff --git a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_Application.json b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_Application.json index eb911004e5..3f23f208db 100644 --- a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_Application.json +++ b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_Application.json @@ -19,18 +19,18 @@ "properties": { "Id": { "type": "string", - "pattern": "" + "pattern": "[a-z0-9]{26}" }, "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[a-z0-9]+" }, "Name": { "type": "string", "description": "The name of the application. ", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "\\w+" }, "Description": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroup.json b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroup.json index 0af2957593..68f952db7c 100644 --- a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroup.json +++ b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroup.json @@ -19,18 +19,18 @@ "properties": { "Id": { "type": "string", - "pattern": "" + "pattern": "[a-z0-9]{12}" }, "Arn": { "type": "string", - "pattern": "" + "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[a-z0-9]+" }, "Name": { "type": "string", "description": "The name of the attribute group. ", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "\\w+" }, "Description": { "type": "string", diff --git a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroupAssociation.json b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroupAssociation.json index fb5d23cbb1..973b800765 100644 --- a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroupAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_AttributeGroupAssociation.json @@ -9,22 +9,22 @@ "description": "The name or the Id of the Application.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "\\w+|[a-z0-9]{12}" }, "AttributeGroup": { "type": "string", "description": "The name or the Id of the AttributeGroup.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "\\w+|[a-z0-9]{12}" }, "ApplicationArn": { "type": "string", - "pattern": "" + "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[a-z0-9]+" }, "AttributeGroupArn": { "type": "string", - "pattern": "" + "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[a-z0-9]+" }, "Id": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_ResourceAssociation.json b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_ResourceAssociation.json index 625c23c332..635fd42b43 100644 --- a/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_ResourceAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_ServiceCatalogAppRegistry_ResourceAssociation.json @@ -9,12 +9,12 @@ "description": "The name or the Id of the Application.", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "\\w+|[a-z0-9]{12}" }, "Resource": { "type": "string", "description": "The name or the Id of the Resource.", - "pattern": "" + "pattern": "\\w+|arn:aws[-a-z]*:cloudformation:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:stack/[a-zA-Z][-A-Za-z0-9]{0,127}/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}" }, "ResourceType": { "type": "string", @@ -25,11 +25,11 @@ }, "ApplicationArn": { "type": "string", - "pattern": "" + "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[a-z0-9]+" }, "ResourceArn": { "type": "string", - "pattern": "" + "pattern": "arn:aws[-a-z]*:cloudformation:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:stack/[a-zA-Z][-A-Za-z0-9]{0,127}/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}" }, "Id": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_ServiceCatalog_CloudFormationProvisionedProduct.json b/internal/service/cloudformation/schemas/AWS_ServiceCatalog_CloudFormationProvisionedProduct.json index da802ede47..fcf3092d2f 100644 --- a/internal/service/cloudformation/schemas/AWS_ServiceCatalog_CloudFormationProvisionedProduct.json +++ b/internal/service/cloudformation/schemas/AWS_ServiceCatalog_CloudFormationProvisionedProduct.json @@ -12,7 +12,7 @@ "uniqueItems": true, "items" : { "type" : "string", - "pattern": "" + "pattern": "^[0-9]{12}$" } }, "StackSetFailureToleranceCount": { @@ -46,7 +46,7 @@ "uniqueItems": true, "items" : { "type" : "string", - "pattern": "" + "pattern": "^[a-z]{2}-([a-z]+-)+[1-9]" } } }, @@ -78,13 +78,13 @@ "type": "string", "minLength": 1, "maxLength": 128, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" }, "Value": { "type": "string", "minLength": 1, "maxLength": 256, - "pattern": "" + "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$" } }, "additionalProperties": false, diff --git a/internal/service/cloudformation/schemas/AWS_Signer_ProfilePermission.json b/internal/service/cloudformation/schemas/AWS_Signer_ProfilePermission.json index 8d8d03f489..5107b8fed4 100644 --- a/internal/service/cloudformation/schemas/AWS_Signer_ProfilePermission.json +++ b/internal/service/cloudformation/schemas/AWS_Signer_ProfilePermission.json @@ -8,7 +8,7 @@ }, "ProfileVersion": { "type": "string", - "pattern": "" + "pattern": "^[0-9a-zA-Z]{10}$" }, "Action": { "type": "string" diff --git a/internal/service/cloudformation/schemas/AWS_Signer_SigningProfile.json b/internal/service/cloudformation/schemas/AWS_Signer_SigningProfile.json index 4d0dc6cbd5..d1457e18fd 100644 --- a/internal/service/cloudformation/schemas/AWS_Signer_SigningProfile.json +++ b/internal/service/cloudformation/schemas/AWS_Signer_SigningProfile.json @@ -11,11 +11,11 @@ }, "Arn": { "type": "string", - "pattern": "" + "pattern": "^arn:aws(-(cn|gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$" }, "ProfileVersion": { "type": "string", - "pattern": "" + "pattern": "^[0-9a-zA-Z]{10}$" }, "SignatureValidityPeriod": { "type": "object", diff --git a/internal/service/cloudformation/schemas/AWS_Synthetics_Canary.json b/internal/service/cloudformation/schemas/AWS_Synthetics_Canary.json index 8fc2e9d792..31e70985e7 100644 --- a/internal/service/cloudformation/schemas/AWS_Synthetics_Canary.json +++ b/internal/service/cloudformation/schemas/AWS_Synthetics_Canary.json @@ -6,7 +6,7 @@ "Name": { "description": "Name of the canary.", "type": "string", - "pattern": "" + "pattern": "^[0-9a-z_\\-]{1,21}$" }, "Id": { "description": "Id of the canary", @@ -23,7 +23,7 @@ "ArtifactS3Location": { "description": "Provide the s3 bucket output location for test results", "type": "string", - "pattern": "" + "pattern": "^(s3|S3)://" }, "ArtifactConfig": { "description": "Provide artifact configuration", diff --git a/internal/service/cloudformation/schemas/AWS_Timestream_Database.json b/internal/service/cloudformation/schemas/AWS_Timestream_Database.json index 913b3a730e..af74239620 100644 --- a/internal/service/cloudformation/schemas/AWS_Timestream_Database.json +++ b/internal/service/cloudformation/schemas/AWS_Timestream_Database.json @@ -28,7 +28,7 @@ "DatabaseName": { "description": "The name for the database. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the database name.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_.-]{3,256}$" }, "KmsKeyId": { "description": "The KMS key for the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account.", @@ -91,4 +91,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Timestream_ScheduledQuery.json b/internal/service/cloudformation/schemas/AWS_Timestream_ScheduledQuery.json index d07b8e4534..a8af91daaf 100644 --- a/internal/service/cloudformation/schemas/AWS_Timestream_ScheduledQuery.json +++ b/internal/service/cloudformation/schemas/AWS_Timestream_ScheduledQuery.json @@ -12,7 +12,7 @@ "ScheduledQueryName": { "description": "The name of the scheduled query. Scheduled query names must be unique within each Region.", "type": "string", - "pattern": "", + "pattern": "[a-zA-Z0-9_.-]+", "minLength": 1, "maxLength": 64 }, @@ -347,14 +347,14 @@ "type": "string", "minLength": 3, "maxLength": 63, - "pattern": "" + "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]" }, "ObjectKeyPrefix": { "description": "Prefix for error report keys.", "type": "string", "minLength": 1, "maxLength": 896, - "pattern": "" + "pattern": "[a-zA-Z0-9|!\\-_*'\\(\\)]([a-zA-Z0-9]|[!\\-_*'\\(\\)\\/.])+" }, "EncryptionOption": { "description": "Encryption at rest options for the error reports. If no encryption option is specified, Timestream will choose SSE_S3 as default.", diff --git a/internal/service/cloudformation/schemas/AWS_Timestream_Table.json b/internal/service/cloudformation/schemas/AWS_Timestream_Table.json index e9c2cbe014..6b3aba35e8 100644 --- a/internal/service/cloudformation/schemas/AWS_Timestream_Table.json +++ b/internal/service/cloudformation/schemas/AWS_Timestream_Table.json @@ -32,12 +32,12 @@ "DatabaseName": { "description": "The name for the database which the table to be created belongs to.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_.-]{3,256}$" }, "TableName": { "description": "The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9_.-]{3,256}$" }, "RetentionProperties": { "description": "The retention duration of the memory store and the magnetic store.", diff --git a/internal/service/cloudformation/schemas/AWS_Transfer_Workflow.json b/internal/service/cloudformation/schemas/AWS_Transfer_Workflow.json index a191672c97..f85b9f819b 100644 --- a/internal/service/cloudformation/schemas/AWS_Transfer_Workflow.json +++ b/internal/service/cloudformation/schemas/AWS_Transfer_Workflow.json @@ -32,14 +32,14 @@ "Bucket": { "description": "Specifies the S3 bucket that contains the file being copied.", "type": "string", - "pattern": "", + "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", "minLength": 3, "maxLength": 63 }, "Key": { "description": "The name assigned to the file when it was created in S3. You use the object key to retrieve the object.", "type": "string", - "pattern": "", + "pattern": ".*", "minLength": 0, "maxLength": 1024 } @@ -70,7 +70,7 @@ "Name": { "description": "The name of the step, used as an identifier.", "type": "string", - "pattern": "", + "pattern": "^[\\w-]*$", "minLength": 0, "maxLength": 30 }, @@ -92,14 +92,14 @@ "Name": { "description": "The name of the step, used as an identifier.", "type": "string", - "pattern": "", + "pattern": "^[\\w-]*$", "minLength": 0, "maxLength": 30 }, "Target": { "description": "The ARN for the lambda function that is being called.", "type": "string", - "pattern": "", + "pattern": "arn:[a-z-]+:lambda:.*$", "minLength": 0, "maxLength": 170 }, @@ -119,7 +119,7 @@ "Name": { "description": "The name of the step, used as an identifier.", "type": "string", - "pattern": "", + "pattern": "^[\\w-]*$", "minLength": 0, "maxLength": 30 } @@ -133,7 +133,7 @@ "Name": { "description": "The name of the step, used as an identifier.", "type": "string", - "pattern": "", + "pattern": "^[\\w-]*$", "minLength": 0, "maxLength": 30 }, @@ -220,21 +220,21 @@ "Description": { "description": "A textual description for the workflow.", "type": "string", - "pattern": "", + "pattern": "^[\\w\\- ]*$", "minLength": 0, "maxLength": 256 }, "WorkflowId": { "description": "A unique identifier for the workflow.", "type": "string", - "pattern": "", + "pattern": "^w-([a-z0-9]{17})$", "minLength": 19, "maxLength": 19 }, "Arn": { "description": "Specifies the unique Amazon Resource Name (ARN) for the workflow.", "type": "string", - "pattern": "", + "pattern": "arn:.*", "minLength": 20, "maxLength": 1600 } diff --git a/internal/service/cloudformation/schemas/AWS_WAFv2_IPSet.json b/internal/service/cloudformation/schemas/AWS_WAFv2_IPSet.json index 716b3bcfdc..61042e2858 100644 --- a/internal/service/cloudformation/schemas/AWS_WAFv2_IPSet.json +++ b/internal/service/cloudformation/schemas/AWS_WAFv2_IPSet.json @@ -6,17 +6,17 @@ "EntityName": { "description": "Name of the IPSet.", "type": "string", - "pattern": "" + "pattern": "^[0-9A-Za-z_-]{1,128}$" }, "EntityDescription": { "description": "Description of the entity.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$" }, "EntityId": { "description": "Id of the IPSet", "type": "string", - "pattern": "" + "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$" }, "Scope": { "description": "Use CLOUDFRONT for CloudFront IPSet, use REGIONAL for Application Load Balancer and API Gateway.", diff --git a/internal/service/cloudformation/schemas/AWS_WAFv2_LoggingConfiguration.json b/internal/service/cloudformation/schemas/AWS_WAFv2_LoggingConfiguration.json index 2f48ec2233..503f8ac894 100644 --- a/internal/service/cloudformation/schemas/AWS_WAFv2_LoggingConfiguration.json +++ b/internal/service/cloudformation/schemas/AWS_WAFv2_LoggingConfiguration.json @@ -277,4 +277,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_WAFv2_RegexPatternSet.json b/internal/service/cloudformation/schemas/AWS_WAFv2_RegexPatternSet.json index baff585b54..f8ccee2939 100644 --- a/internal/service/cloudformation/schemas/AWS_WAFv2_RegexPatternSet.json +++ b/internal/service/cloudformation/schemas/AWS_WAFv2_RegexPatternSet.json @@ -28,17 +28,17 @@ "Description": { "description": "Description of the entity.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$" }, "Name": { "description": "Name of the RegexPatternSet.", "type": "string", - "pattern": "" + "pattern": "^[0-9A-Za-z_-]{1,128}$" }, "Id": { "description": "Id of the RegexPatternSet", "type": "string", - "pattern": "" + "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$" }, "RegularExpressionList": { "type": "array", diff --git a/internal/service/cloudformation/schemas/AWS_WAFv2_RuleGroup.json b/internal/service/cloudformation/schemas/AWS_WAFv2_RuleGroup.json index 948fd63a69..4c493ed72e 100644 --- a/internal/service/cloudformation/schemas/AWS_WAFv2_RuleGroup.json +++ b/internal/service/cloudformation/schemas/AWS_WAFv2_RuleGroup.json @@ -51,12 +51,12 @@ "EntityDescription": { "description": "Description of the entity.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$" }, "EntityName": { "description": "Name of the RuleGroup.", "type": "string", - "pattern": "" + "pattern": "^[0-9A-Za-z_-]{1,128}$" }, "FieldToMatch": { "description": "Field of the request to match.", @@ -193,7 +193,7 @@ "EntityId": { "description": "Id of the RuleGroup", "type": "string", - "pattern": "" + "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$" }, "IPSetReferenceStatement": { "type": "object", @@ -539,7 +539,7 @@ "CustomResponseBodyKey": { "description": "Custom response body key.", "type": "string", - "pattern": "" + "pattern": "^[\\w\\-]+$" }, "ResponseHeaders": { "description": "Collection of HTTP headers.", diff --git a/internal/service/cloudformation/schemas/AWS_WAFv2_WebACL.json b/internal/service/cloudformation/schemas/AWS_WAFv2_WebACL.json index 9dfa5c5d48..447b715281 100644 --- a/internal/service/cloudformation/schemas/AWS_WAFv2_WebACL.json +++ b/internal/service/cloudformation/schemas/AWS_WAFv2_WebACL.json @@ -67,12 +67,12 @@ "EntityDescription": { "description": "Description of the entity.", "type": "string", - "pattern": "" + "pattern": "^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$" }, "EntityName": { "description": "Name of the WebACL.", "type": "string", - "pattern": "" + "pattern": "^[0-9A-Za-z_-]{1,128}$" }, "ExcludedRule": { "description": "Excluded Rule in the RuleGroup or ManagedRuleGroup will not be evaluated.", @@ -228,7 +228,7 @@ "EntityId": { "description": "Id of the WebACL", "type": "string", - "pattern": "" + "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$" }, "IPSetReferenceStatement": { "type": "object", @@ -256,7 +256,7 @@ }, "Version": { "type": "string", - "pattern": "", + "pattern": "^[\\w#:\\.\\-/]+$", "minLength": 1, "maxLength": 64 }, @@ -653,7 +653,7 @@ "CustomResponseBodyKey": { "description": "Custom response body key.", "type": "string", - "pattern": "" + "pattern": "^[\\w\\-]+$" }, "ResponseHeaders": { "description": "Collection of HTTP headers.", @@ -1056,7 +1056,7 @@ "properties": { "LoginPath": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 256 }, @@ -1081,7 +1081,7 @@ "properties": { "Identifier": { "type": "string", - "pattern": "", + "pattern": ".*\\S.*", "minLength": 1, "maxLength": 512 } diff --git a/internal/service/cloudformation/schemas/AWS_Wisdom_Assistant.json b/internal/service/cloudformation/schemas/AWS_Wisdom_Assistant.json index a7474adc47..5ed96838bd 100644 --- a/internal/service/cloudformation/schemas/AWS_Wisdom_Assistant.json +++ b/internal/service/cloudformation/schemas/AWS_Wisdom_Assistant.json @@ -52,11 +52,11 @@ }, "AssistantArn": { "type": "string", - "pattern": "" + "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$" }, "AssistantId": { "type": "string", - "pattern": "" + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" }, "ServerSideEncryptionConfiguration": { "$ref": "#/definitions/ServerSideEncryptionConfiguration" @@ -123,4 +123,4 @@ ] } } -} \ No newline at end of file +} diff --git a/internal/service/cloudformation/schemas/AWS_Wisdom_AssistantAssociation.json b/internal/service/cloudformation/schemas/AWS_Wisdom_AssistantAssociation.json index 298b2b27c4..aabc74f485 100644 --- a/internal/service/cloudformation/schemas/AWS_Wisdom_AssistantAssociation.json +++ b/internal/service/cloudformation/schemas/AWS_Wisdom_AssistantAssociation.json @@ -7,7 +7,7 @@ "properties": { "KnowledgeBaseId": { "type": "string", - "pattern": "" + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" } }, "required": [ @@ -46,19 +46,19 @@ "properties": { "AssistantAssociationArn": { "type": "string", - "pattern": "" + "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$" }, "AssistantArn": { "type": "string", - "pattern": "" + "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$" }, "AssistantAssociationId": { "type": "string", - "pattern": "" + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" }, "AssistantId": { "type": "string", - "pattern": "" + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" }, "Association": { "$ref": "#/definitions/AssociationData" diff --git a/internal/service/cloudformation/schemas/AWS_Wisdom_KnowledgeBase.json b/internal/service/cloudformation/schemas/AWS_Wisdom_KnowledgeBase.json index 26e7fe0679..01a50f42ae 100644 --- a/internal/service/cloudformation/schemas/AWS_Wisdom_KnowledgeBase.json +++ b/internal/service/cloudformation/schemas/AWS_Wisdom_KnowledgeBase.json @@ -20,7 +20,7 @@ "type": "string", "maxLength": 2048, "minLength": 1, - "pattern": "" + "pattern": "^arn:[a-z-]+?:[a-z-]+?:[a-z0-9-]*?:([0-9]{12})?:[a-zA-Z0-9-:/]+$" } }, "required": [ @@ -104,11 +104,11 @@ }, "KnowledgeBaseArn": { "type": "string", - "pattern": "" + "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$" }, "KnowledgeBaseId": { "type": "string", - "pattern": "" + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" }, "KnowledgeBaseType": { "$ref": "#/definitions/KnowledgeBaseType" diff --git a/internal/service/cloudformation/schemas/AWS_WorkSpaces_ConnectionAlias.json b/internal/service/cloudformation/schemas/AWS_WorkSpaces_ConnectionAlias.json index 13d3a0aa17..543ee7c32e 100644 --- a/internal/service/cloudformation/schemas/AWS_WorkSpaces_ConnectionAlias.json +++ b/internal/service/cloudformation/schemas/AWS_WorkSpaces_ConnectionAlias.json @@ -15,7 +15,7 @@ }, "ResourceId": { "type": "string", - "pattern": "", + "pattern": ".+", "minLength": 1, "maxLength": 1000 }, @@ -23,7 +23,7 @@ "type": "string", "maxLength": 20, "minLength": 1, - "pattern": "" + "pattern": "^[a-zA-Z0-9]+$" } } }, @@ -52,13 +52,13 @@ }, "AliasId": { "type": "string", - "pattern": "", + "pattern": "^wsca-[0-9a-z]{8,63}$", "maxLength": 68, "minLength": 13 }, "ConnectionString": { "type": "string", - "pattern": "", + "pattern": "^[.0-9a-zA-Z\\-]{1,255}$", "minLength": 1, "maxLength": 255 }, From a14327069a8c432822b63cefc88b1663d91d44e3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 15:22:12 -0500 Subject: [PATCH 11/19] Don't emit 'include regexp' if there are no validators. --- .../generators/shared/codegen/emitter.go | 16 ++++++++-------- internal/provider/generators/shared/generator.go | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/internal/provider/generators/shared/codegen/emitter.go b/internal/provider/generators/shared/codegen/emitter.go index 3b50e62728..1cb906a7f5 100644 --- a/internal/provider/generators/shared/codegen/emitter.go +++ b/internal/provider/generators/shared/codegen/emitter.go @@ -16,12 +16,12 @@ import ( type Features int const ( - HasUpdatableProperty Features = 1 << iota // At least one property can be updated. - HasRequiredRootProperty // At least one root property is required. - UsesFrameworkAttr // Uses a type from the terraform-plugin-framework/attr package. - UsesRegexp // Uses a type from the Go standard regexp package. - UsesValidation // Uses a type from the internal/validate package. - HasIDRootProperty // Has a root property named "id" + HasUpdatableProperty Features = 1 << iota // At least one property can be updated. + HasRequiredRootProperty // At least one root property is required. + UsesFrameworkAttr // Uses a type from the terraform-plugin-framework/attr package. + UsesRegexpWithValidation // Uses a type from the Go standard regexp package with a type or function from the internal/validate package. + UsesValidation // Uses a type or function from the internal/validate package. + HasIDRootProperty // Has a root property named "id" ) var ( @@ -993,8 +993,8 @@ func stringValidators(path []string, property *cfschema.Property) (Features, []s } if property.Pattern != nil && *property.Pattern != "" { - features |= UsesRegexp - validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(`%s`), \"\")", *property.Pattern)) + features |= UsesRegexpWithValidation + validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(%q), \"\")", *property.Pattern)) } if property.Format != nil { diff --git a/internal/provider/generators/shared/generator.go b/internal/provider/generators/shared/generator.go index 1747b926d2..4a60dac055 100644 --- a/internal/provider/generators/shared/generator.go +++ b/internal/provider/generators/shared/generator.go @@ -147,11 +147,12 @@ func (g *Generator) GenerateTemplateData(cfTypeSchemaFile, resType, tfResourceTy if codeFeatures&codegen.HasUpdatableProperty == 0 { templateData.HasUpdateMethod = false } - if codeFeatures&codegen.UsesRegexp > 0 { - templateData.ImportRegexp = true - } if codeFeatures&codegen.UsesValidation > 0 || requiredAttributesValidator != "" { templateData.ImportValidate = true + + if codeFeatures&codegen.UsesRegexpWithValidation > 0 { + templateData.ImportRegexp = true + } } if codeFeatures&codegen.HasIDRootProperty > 0 { templateData.SyntheticIDAttribute = false From aff0daf4c5421b9754e7e7a9c151c4e858c77e04 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 15:24:14 -0500 Subject: [PATCH 12/19] Revert "Don't emit 'include regexp' if there are no validators." This reverts commit a14327069a8c432822b63cefc88b1663d91d44e3. --- .../generators/shared/codegen/emitter.go | 16 ++++++++-------- internal/provider/generators/shared/generator.go | 7 +++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/internal/provider/generators/shared/codegen/emitter.go b/internal/provider/generators/shared/codegen/emitter.go index 1cb906a7f5..3b50e62728 100644 --- a/internal/provider/generators/shared/codegen/emitter.go +++ b/internal/provider/generators/shared/codegen/emitter.go @@ -16,12 +16,12 @@ import ( type Features int const ( - HasUpdatableProperty Features = 1 << iota // At least one property can be updated. - HasRequiredRootProperty // At least one root property is required. - UsesFrameworkAttr // Uses a type from the terraform-plugin-framework/attr package. - UsesRegexpWithValidation // Uses a type from the Go standard regexp package with a type or function from the internal/validate package. - UsesValidation // Uses a type or function from the internal/validate package. - HasIDRootProperty // Has a root property named "id" + HasUpdatableProperty Features = 1 << iota // At least one property can be updated. + HasRequiredRootProperty // At least one root property is required. + UsesFrameworkAttr // Uses a type from the terraform-plugin-framework/attr package. + UsesRegexp // Uses a type from the Go standard regexp package. + UsesValidation // Uses a type from the internal/validate package. + HasIDRootProperty // Has a root property named "id" ) var ( @@ -993,8 +993,8 @@ func stringValidators(path []string, property *cfschema.Property) (Features, []s } if property.Pattern != nil && *property.Pattern != "" { - features |= UsesRegexpWithValidation - validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(%q), \"\")", *property.Pattern)) + features |= UsesRegexp + validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(`%s`), \"\")", *property.Pattern)) } if property.Format != nil { diff --git a/internal/provider/generators/shared/generator.go b/internal/provider/generators/shared/generator.go index 4a60dac055..1747b926d2 100644 --- a/internal/provider/generators/shared/generator.go +++ b/internal/provider/generators/shared/generator.go @@ -147,12 +147,11 @@ func (g *Generator) GenerateTemplateData(cfTypeSchemaFile, resType, tfResourceTy if codeFeatures&codegen.HasUpdatableProperty == 0 { templateData.HasUpdateMethod = false } + if codeFeatures&codegen.UsesRegexp > 0 { + templateData.ImportRegexp = true + } if codeFeatures&codegen.UsesValidation > 0 || requiredAttributesValidator != "" { templateData.ImportValidate = true - - if codeFeatures&codegen.UsesRegexpWithValidation > 0 { - templateData.ImportRegexp = true - } } if codeFeatures&codegen.HasIDRootProperty > 0 { templateData.SyntheticIDAttribute = false From 99a45b7a56a0467c3bb7922c2c6f3016be6c5a3f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 15:35:10 -0500 Subject: [PATCH 13/19] Don't emit 'include regexp' if there are no validators. --- internal/provider/generators/shared/codegen/emitter.go | 8 +++++--- internal/provider/generators/shared/generator.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/provider/generators/shared/codegen/emitter.go b/internal/provider/generators/shared/codegen/emitter.go index 3b50e62728..ef23dfa76b 100644 --- a/internal/provider/generators/shared/codegen/emitter.go +++ b/internal/provider/generators/shared/codegen/emitter.go @@ -19,8 +19,8 @@ const ( HasUpdatableProperty Features = 1 << iota // At least one property can be updated. HasRequiredRootProperty // At least one root property is required. UsesFrameworkAttr // Uses a type from the terraform-plugin-framework/attr package. - UsesRegexp // Uses a type from the Go standard regexp package. - UsesValidation // Uses a type from the internal/validate package. + UsesRegexpInValidation // Uses a type from the Go standard regexp package for attribute validation. + UsesValidation // Uses a type or function from the internal/validate package. HasIDRootProperty // Has a root property named "id" ) @@ -614,6 +614,8 @@ func (e Emitter) emitAttribute(attributeNameMap map[string]string, path []string } e.printf("},\n") } + } else { + features &^= UsesRegexpInValidation } if computed { @@ -993,7 +995,7 @@ func stringValidators(path []string, property *cfschema.Property) (Features, []s } if property.Pattern != nil && *property.Pattern != "" { - features |= UsesRegexp + features |= UsesRegexpInValidation validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(`%s`), \"\")", *property.Pattern)) } diff --git a/internal/provider/generators/shared/generator.go b/internal/provider/generators/shared/generator.go index 1747b926d2..278df6d202 100644 --- a/internal/provider/generators/shared/generator.go +++ b/internal/provider/generators/shared/generator.go @@ -147,7 +147,7 @@ func (g *Generator) GenerateTemplateData(cfTypeSchemaFile, resType, tfResourceTy if codeFeatures&codegen.HasUpdatableProperty == 0 { templateData.HasUpdateMethod = false } - if codeFeatures&codegen.UsesRegexp > 0 { + if codeFeatures&codegen.UsesValidation > 0 && codeFeatures&codegen.UsesRegexpInValidation > 0 { templateData.ImportRegexp = true } if codeFeatures&codegen.UsesValidation > 0 || requiredAttributesValidator != "" { From 76f31028b167dba1d42f68d9335bd949caf5a19a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 15:44:02 -0500 Subject: [PATCH 14/19] Emit regexp as '%q' due to embedded backtocks. --- internal/provider/generators/shared/codegen/emitter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/generators/shared/codegen/emitter.go b/internal/provider/generators/shared/codegen/emitter.go index ef23dfa76b..0016ad047c 100644 --- a/internal/provider/generators/shared/codegen/emitter.go +++ b/internal/provider/generators/shared/codegen/emitter.go @@ -996,7 +996,7 @@ func stringValidators(path []string, property *cfschema.Property) (Features, []s if property.Pattern != nil && *property.Pattern != "" { features |= UsesRegexpInValidation - validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(`%s`), \"\")", *property.Pattern)) + validators = append(validators, fmt.Sprintf("validate.StringMatch(regexp.MustCompile(%q), \"\")", *property.Pattern)) } if property.Format != nil { From 7dddd0e58ae5ded07bc52448308f33dadbf4d006 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 16:00:57 -0500 Subject: [PATCH 15/19] Regenerate Terraform resource schemas with string attribute pattern validation. --- internal/aws/amplify/app_resource_gen.go | 57 +++-- internal/aws/amplify/branch_resource_gen.go | 27 ++- internal/aws/amplify/domain_resource_gen.go | 18 +- .../appflow/connector_profile_resource_gen.go | 212 ++++++++++++------ internal/aws/appflow/flow_resource_gen.go | 114 ++++++---- .../data_integration_resource_gen.go | 21 +- .../event_integration_resource_gen.go | 24 +- .../application_resource_gen.go | 122 +++++++--- .../aws/apprunner/service_resource_gen.go | 22 +- .../apprunner/vpc_connector_resource_gen.go | 4 +- ...omain_name_api_association_resource_gen.go | 4 +- .../aws/appsync/domain_name_resource_gen.go | 7 +- .../aps/rule_groups_namespace_resource_gen.go | 8 +- internal/aws/aps/workspace_resource_gen.go | 2 +- .../aws/athena/work_group_resource_gen.go | 6 +- .../auditmanager/assessment_resource_gen.go | 47 ++-- .../aws/backup/backup_vault_resource_gen.go | 7 +- internal/aws/backup/framework_resource_gen.go | 4 +- .../aws/backup/report_plan_resource_gen.go | 7 +- .../aws/cassandra/keyspace_resource_gen.go | 6 +- internal/aws/cassandra/table_resource_gen.go | 26 ++- .../aws/ce/anomaly_monitor_resource_gen.go | 12 +- .../ce/anomaly_subscription_resource_gen.go | 16 +- internal/aws/ce/cost_category_resource_gen.go | 4 +- ...lack_channel_configuration_resource_gen.go | 12 +- .../hook_default_version_resource_gen.go | 18 +- .../hook_type_config_resource_gen.go | 21 +- .../hook_version_resource_gen.go | 18 +- .../module_default_version_resource_gen.go | 16 +- .../module_version_resource_gen.go | 11 +- .../public_type_version_resource_gen.go | 17 +- .../cloudformation/publisher_resource_gen.go | 11 +- .../resource_default_version_resource_gen.go | 18 +- .../resource_version_resource_gen.go | 15 +- .../cloudformation/stack_set_resource_gen.go | 18 +- .../type_activation_resource_gen.go | 20 +- .../cloudfront/cache_policy_resource_gen.go | 16 +- .../origin_request_policy_resource_gen.go | 17 +- .../response_headers_policy_resource_gen.go | 12 +- internal/aws/cloudtrail/trail_resource_gen.go | 4 +- .../aws/codeartifact/domain_resource_gen.go | 8 +- .../codeartifact/repository_resource_gen.go | 11 +- .../profiling_group_resource_gen.go | 21 +- .../repository_association_resource_gen.go | 15 +- .../connection_resource_gen.go | 8 +- .../notification_rule_resource_gen.go | 11 +- .../aggregation_authorization_resource_gen.go | 6 +- .../configuration_aggregator_resource_gen.go | 4 +- .../config/conformance_pack_resource_gen.go | 7 +- ...anization_conformance_pack_resource_gen.go | 7 +- .../aws/config/stored_query_resource_gen.go | 12 +- .../contact_flow_module_resource_gen.go | 12 +- .../aws/connect/contact_flow_resource_gen.go | 6 +- .../hours_of_operation_resource_gen.go | 8 +- .../aws/connect/quick_connect_resource_gen.go | 33 ++- .../user_hierarchy_group_resource_gen.go | 13 +- internal/aws/connect/user_resource_gen.go | 24 +- .../aws/cur/report_definition_resource_gen.go | 13 +- .../customerprofiles/domain_resource_gen.go | 4 +- .../integration_resource_gen.go | 55 +++-- .../object_type_resource_gen.go | 19 +- internal/aws/databrew/dataset_resource_gen.go | 19 +- internal/aws/databrew/job_resource_gen.go | 19 +- internal/aws/databrew/ruleset_resource_gen.go | 7 +- internal/aws/datasync/agent_resource_gen.go | 26 ++- .../aws/datasync/location_efs_resource_gen.go | 23 +- .../location_fsx_windows_resource_gen.go | 29 ++- .../datasync/location_hdfs_resource_gen.go | 23 +- .../aws/datasync/location_nfs_resource_gen.go | 20 +- .../location_object_storage_resource_gen.go | 29 ++- .../aws/datasync/location_s3_resource_gen.go | 20 +- .../aws/datasync/location_smb_resource_gen.go | 29 ++- internal/aws/datasync/task_resource_gen.go | 40 ++-- .../member_invitation_resource_gen.go | 16 +- .../notification_channel_resource_gen.go | 6 +- .../resource_collection_resource_gen.go | 4 +- internal/aws/ec2/ec2_fleet_resource_gen.go | 7 +- ...icate_iam_role_association_resource_gen.go | 7 +- internal/aws/ec2/spot_fleet_resource_gen.go | 10 +- .../pull_through_cache_rule_resource_gen.go | 4 +- .../aws/ecr/registry_policy_resource_gen.go | 2 +- .../replication_configuration_resource_gen.go | 16 +- internal/aws/ecr/repository_resource_gen.go | 4 +- internal/aws/efs/access_point_resource_gen.go | 6 +- internal/aws/eks/cluster_resource_gen.go | 9 +- .../elasticache/user_group_resource_gen.go | 6 +- internal/aws/elasticache/user_resource_gen.go | 6 +- internal/aws/emr/studio_resource_gen.go | 42 +++- .../studio_session_mapping_resource_gen.go | 9 +- .../virtual_cluster_resource_gen.go | 10 +- .../aws/evidently/experiment_resource_gen.go | 35 ++- .../aws/evidently/feature_resource_gen.go | 18 +- internal/aws/evidently/launch_resource_gen.go | 24 +- .../aws/evidently/project_resource_gen.go | 15 +- .../aws/finspace/environment_resource_gen.go | 51 +++-- .../fms/notification_channel_resource_gen.go | 7 +- internal/aws/fms/policy_resource_gen.go | 32 ++- .../forecast/dataset_group_resource_gen.go | 9 +- internal/aws/forecast/dataset_resource_gen.go | 22 +- .../frauddetector/detector_resource_gen.go | 7 +- .../frauddetector/entity_type_resource_gen.go | 4 +- .../frauddetector/event_type_resource_gen.go | 4 +- .../aws/frauddetector/label_resource_gen.go | 4 +- .../aws/frauddetector/outcome_resource_gen.go | 4 +- .../frauddetector/variable_resource_gen.go | 6 +- internal/aws/gamelift/alias_resource_gen.go | 9 +- internal/aws/gamelift/fleet_resource_gen.go | 38 +++- .../game_server_group_resource_gen.go | 14 +- .../accelerator_resource_gen.go | 9 +- internal/aws/glue/registry_resource_gen.go | 2 +- internal/aws/glue/schema_resource_gen.go | 10 +- .../schema_version_metadata_resource_gen.go | 6 +- .../aws/glue/schema_version_resource_gen.go | 8 +- .../component_version_resource_gen.go | 6 +- .../dataflow_endpoint_group_resource_gen.go | 16 +- .../mission_profile_resource_gen.go | 16 +- .../healthlake/fhir_datastore_resource_gen.go | 6 +- .../aws/iam/oidc_provider_resource_gen.go | 4 +- .../aws/iam/saml_provider_resource_gen.go | 4 +- .../iam/server_certificate_resource_gen.go | 4 +- .../iam/virtual_mfa_device_resource_gen.go | 6 +- internal/aws/iot/authorizer_resource_gen.go | 4 +- .../aws/iot/custom_metric_resource_gen.go | 4 +- internal/aws/iot/dimension_resource_gen.go | 4 +- .../iot/domain_configuration_resource_gen.go | 18 +- internal/aws/iot/job_template_resource_gen.go | 3 + internal/aws/iot/logging_resource_gen.go | 4 +- .../aws/iot/mitigation_action_resource_gen.go | 4 +- .../iot/provisioning_template_resource_gen.go | 4 +- .../resource_specific_logging_resource_gen.go | 6 +- .../aws/iot/scheduled_audit_resource_gen.go | 9 +- .../aws/iot/security_profile_resource_gen.go | 19 +- .../iotevents/detector_model_resource_gen.go | 51 +++-- internal/aws/iotevents/input_resource_gen.go | 7 +- .../iotfleethub/application_resource_gen.go | 14 +- .../iotwireless/destination_resource_gen.go | 4 +- .../partner_account_resource_gen.go | 15 +- .../task_definition_resource_gen.go | 2 +- .../wireless_device_resource_gen.go | 71 ++++-- .../wireless_gateway_resource_gen.go | 6 +- internal/aws/ivs/channel_resource_gen.go | 9 +- .../aws/ivs/playback_key_pair_resource_gen.go | 6 +- .../recording_configuration_resource_gen.go | 9 +- internal/aws/ivs/stream_key_resource_gen.go | 8 +- .../kafkaconnect/connector_resource_gen.go | 18 +- .../aws/kendra/data_source_resource_gen.go | 73 ++++-- internal/aws/kendra/faq_resource_gen.go | 4 +- internal/aws/kendra/index_resource_gen.go | 7 +- internal/aws/kinesis/stream_resource_gen.go | 4 +- .../delivery_stream_resource_gen.go | 103 ++++++--- .../signaling_channel_resource_gen.go | 4 +- .../aws/kinesisvideo/stream_resource_gen.go | 13 +- internal/aws/kms/alias_resource_gen.go | 4 +- .../code_signing_config_resource_gen.go | 8 +- .../event_source_mapping_resource_gen.go | 30 ++- internal/aws/lambda/function_resource_gen.go | 30 ++- internal/aws/lex/bot_alias_resource_gen.go | 18 +- internal/aws/lex/bot_resource_gen.go | 47 ++-- internal/aws/lex/bot_version_resource_gen.go | 9 +- .../aws/lex/resource_policy_resource_gen.go | 2 +- internal/aws/lightsail/alarm_resource_gen.go | 7 +- internal/aws/lightsail/bucket_resource_gen.go | 4 +- .../aws/lightsail/container_resource_gen.go | 4 +- .../aws/lightsail/database_resource_gen.go | 4 +- internal/aws/lightsail/disk_resource_gen.go | 9 +- .../lightsail/distribution_resource_gen.go | 6 +- .../aws/lightsail/instance_resource_gen.go | 12 +- .../lightsail/load_balancer_resource_gen.go | 6 +- ...d_balancer_tls_certificate_resource_gen.go | 7 +- .../geofence_collection_resource_gen.go | 12 +- internal/aws/location/map_resource_gen.go | 15 +- .../aws/location/place_index_resource_gen.go | 12 +- .../location/route_calculator_resource_gen.go | 12 +- .../location/tracker_consumer_resource_gen.go | 7 +- internal/aws/location/tracker_resource_gen.go | 12 +- .../aws/logs/query_definition_resource_gen.go | 7 +- .../aws/logs/resource_policy_resource_gen.go | 4 +- .../inference_scheduler_resource_gen.go | 34 ++- .../aws/lookoutmetrics/alert_resource_gen.go | 24 +- .../anomaly_detector_resource_gen.go | 111 ++++++--- .../aws/lookoutvision/project_resource_gen.go | 4 +- internal/aws/memorydb/acl_resource_gen.go | 6 +- internal/aws/memorydb/cluster_resource_gen.go | 11 +- .../aws/memorydb/subnet_group_resource_gen.go | 6 +- internal/aws/memorydb/user_resource_gen.go | 6 +- internal/aws/mwaa/environment_resource_gen.go | 48 ++-- .../firewall_policy_resource_gen.go | 29 ++- .../networkfirewall/firewall_resource_gen.go | 17 +- .../logging_configuration_resource_gen.go | 7 +- .../rule_group_resource_gen.go | 53 +++-- .../launch_profile_resource_gen.go | 13 +- .../streaming_image_resource_gen.go | 11 +- .../studio_component_resource_gen.go | 15 +- .../aws/nimblestudio/studio_resource_gen.go | 9 +- .../application_instance_resource_gen.go | 35 ++- internal/aws/panorama/package_resource_gen.go | 12 +- .../panorama/package_version_resource_gen.go | 18 +- internal/aws/qldb/stream_resource_gen.go | 13 +- .../aws/quicksight/analysis_resource_gen.go | 45 +++- .../aws/quicksight/dashboard_resource_gen.go | 45 +++- .../aws/quicksight/data_set_resource_gen.go | 16 +- .../quicksight/data_source_resource_gen.go | 9 +- .../aws/quicksight/template_resource_gen.go | 25 ++- internal/aws/quicksight/theme_resource_gen.go | 200 +++++++++++++---- .../aws/rds/db_proxy_endpoint_resource_gen.go | 15 +- internal/aws/rds/db_proxy_resource_gen.go | 10 +- .../rds/db_proxy_target_group_resource_gen.go | 4 +- .../aws/rds/global_cluster_resource_gen.go | 6 +- .../redshift/endpoint_access_resource_gen.go | 7 +- .../endpoint_authorization_resource_gen.go | 18 +- .../environment_resource_gen.go | 10 +- .../aws/refactorspaces/route_resource_gen.go | 17 +- .../refactorspaces/service_resource_gen.go | 26 ++- .../rekognition/collection_resource_gen.go | 7 +- .../aws/rekognition/project_resource_gen.go | 6 +- .../aws/resiliencehub/app_resource_gen.go | 34 ++- .../resiliency_policy_resource_gen.go | 6 +- internal/aws/robomaker/fleet_resource_gen.go | 6 +- .../robot_application_resource_gen.go | 2 +- .../robot_application_version_resource_gen.go | 11 +- internal/aws/robomaker/robot_resource_gen.go | 2 +- .../simulation_application_resource_gen.go | 16 +- ...lation_application_version_resource_gen.go | 11 +- internal/aws/route53/dnssec_resource_gen.go | 7 +- .../aws/route53/health_check_resource_gen.go | 4 +- .../route53/key_signing_key_resource_gen.go | 11 +- .../cell_resource_gen.go | 4 +- .../readiness_check_resource_gen.go | 7 +- .../recovery_group_resource_gen.go | 4 +- internal/aws/rum/app_monitor_resource_gen.go | 18 +- internal/aws/s3/access_point_resource_gen.go | 4 +- internal/aws/s3/bucket_resource_gen.go | 25 ++- ...region_access_point_policy_resource_gen.go | 4 +- .../multi_region_access_point_resource_gen.go | 7 +- internal/aws/s3/storage_lens_resource_gen.go | 4 +- .../access_point_policy_resource_gen.go | 4 +- .../access_point_resource_gen.go | 6 +- .../s3outposts/access_point_resource_gen.go | 9 +- .../s3outposts/bucket_policy_resource_gen.go | 4 +- .../aws/s3outposts/bucket_resource_gen.go | 28 ++- .../app_image_config_resource_gen.go | 9 +- internal/aws/sagemaker/app_resource_gen.go | 15 +- ...ata_quality_job_definition_resource_gen.go | 52 +++-- .../sagemaker/device_fleet_resource_gen.go | 19 +- internal/aws/sagemaker/device_resource_gen.go | 16 +- internal/aws/sagemaker/domain_resource_gen.go | 47 ++-- .../sagemaker/feature_group_resource_gen.go | 19 +- internal/aws/sagemaker/image_resource_gen.go | 15 +- .../sagemaker/image_version_resource_gen.go | 13 +- .../model_bias_job_definition_resource_gen.go | 55 +++-- ...lainability_job_definition_resource_gen.go | 46 ++-- .../model_package_group_resource_gen.go | 15 +- ...del_quality_job_definition_resource_gen.go | 58 +++-- .../monitoring_schedule_resource_gen.go | 64 ++++-- .../aws/sagemaker/pipeline_resource_gen.go | 10 +- .../aws/sagemaker/project_resource_gen.go | 35 ++- .../sagemaker/user_profile_resource_gen.go | 38 +++- ...mation_provisioned_product_resource_gen.go | 13 +- .../application_resource_gen.go | 8 +- ...ttribute_group_association_resource_gen.go | 11 +- .../attribute_group_resource_gen.go | 8 +- .../resource_association_resource_gen.go | 13 +- ...tion_set_event_destination_resource_gen.go | 12 +- .../aws/ses/configuration_set_resource_gen.go | 7 +- internal/aws/ses/contact_list_resource_gen.go | 11 +- internal/aws/ses/template_resource_gen.go | 4 +- .../signer/profile_permission_resource_gen.go | 7 +- .../signer/signing_profile_resource_gen.go | 6 +- internal/aws/ssm/association_resource_gen.go | 38 +++- internal/aws/ssm/document_resource_gen.go | 31 ++- .../contact_channel_resource_gen.go | 4 +- .../aws/ssmcontacts/contact_resource_gen.go | 7 +- .../replication_set_resource_gen.go | 6 +- .../response_plan_resource_gen.go | 18 +- internal/aws/sso/assignment_resource_gen.go | 15 +- ...ol_attribute_configuration_resource_gen.go | 16 +- .../aws/sso/permission_set_resource_gen.go | 21 +- .../aws/timestream/database_resource_gen.go | 6 +- .../scheduled_query_resource_gen.go | 10 +- internal/aws/timestream/table_resource_gen.go | 11 +- .../aws/transfer/workflow_resource_gen.go | 50 +++-- internal/aws/wafv2/ip_set_resource_gen.go | 13 +- .../wafv2/regex_pattern_set_resource_gen.go | 13 +- .../assistant_association_resource_gen.go | 17 +- internal/aws/wisdom/assistant_resource_gen.go | 4 +- .../aws/wisdom/knowledge_base_resource_gen.go | 8 +- .../connection_alias_resource_gen.go | 12 +- 287 files changed, 3576 insertions(+), 1497 deletions(-) diff --git a/internal/aws/amplify/app_resource_gen.go b/internal/aws/amplify/app_resource_gen.go index 7f896d2803..716f86249a 100644 --- a/internal/aws/amplify/app_resource_gen.go +++ b/internal/aws/amplify/app_resource_gen.go @@ -4,6 +4,7 @@ package amplify import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 20, // "minLength": 1, - // "pattern": "", + // "pattern": "d[a-z0-9]+", // "type": "string" // } Type: types.StringType, @@ -56,7 +57,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // } Type: types.StringType, @@ -70,7 +71,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, @@ -136,12 +137,12 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "maxLength": 255, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // }, // "Value": { // "maxLength": 5500, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } // }, @@ -156,7 +157,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "PullRequestEnvironmentName": { // "maxLength": 20, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // }, // "Stage": { @@ -249,6 +250,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "value": { @@ -257,6 +259,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(5500), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, }, @@ -270,6 +273,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(20), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "stage": { @@ -347,13 +351,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 25000, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 25000), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, }, "custom_headers": { @@ -362,13 +367,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 25000, // "minLength": 0, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 25000), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "custom_rules": { @@ -381,25 +387,25 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Condition": { // "maxLength": 2048, // "minLength": 0, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // }, // "Source": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // }, // "Status": { // "maxLength": 7, // "minLength": 3, - // "pattern": "", + // "pattern": ".{3,7}", // "type": "string" // }, // "Target": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // } // }, @@ -420,6 +426,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 2048), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "source": { @@ -428,6 +435,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, }, "status": { @@ -436,6 +444,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 7), + validate.StringMatch(regexp.MustCompile(".{3,7}"), ""), }, }, "target": { @@ -444,6 +453,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, }, }, @@ -470,13 +480,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "enable_branch_auto_deletion": { @@ -497,12 +508,12 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "maxLength": 255, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // }, // "Value": { // "maxLength": 5500, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } // }, @@ -523,6 +534,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "value": { @@ -531,6 +543,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(5500), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, }, @@ -544,13 +557,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 1000, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1000), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "name": { @@ -559,13 +573,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, }, "oauth_token": { @@ -573,13 +588,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, // OauthToken is a write-only property. }, @@ -587,11 +603,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Repository // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), + }, }, "tags": { // Property: Tags diff --git a/internal/aws/amplify/branch_resource_gen.go b/internal/aws/amplify/branch_resource_gen.go index c901695212..65d08eee99 100644 --- a/internal/aws/amplify/branch_resource_gen.go +++ b/internal/aws/amplify/branch_resource_gen.go @@ -4,6 +4,7 @@ package amplify import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,13 +27,14 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 20, // "minLength": 1, - // "pattern": "", + // "pattern": "d[a-z0-9]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 20), + validate.StringMatch(regexp.MustCompile("d[a-z0-9]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -43,7 +45,7 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, @@ -112,13 +114,14 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -130,13 +133,14 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 25000, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 25000), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, }, "description": { @@ -144,13 +148,14 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "enable_auto_build": { @@ -189,12 +194,12 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "maxLength": 255, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // }, // "Value": { // "maxLength": 5500, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } // }, @@ -215,6 +220,7 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "value": { @@ -223,6 +229,7 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(5500), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, }, @@ -235,13 +242,14 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 20, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(20), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, "stage": { @@ -286,7 +294,7 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Value": { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -315,6 +323,7 @@ func branchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/amplify/domain_resource_gen.go b/internal/aws/amplify/domain_resource_gen.go index 9e325e1a69..cab3975d8a 100644 --- a/internal/aws/amplify/domain_resource_gen.go +++ b/internal/aws/amplify/domain_resource_gen.go @@ -4,6 +4,7 @@ package amplify import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,13 +27,14 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 20, // "minLength": 1, - // "pattern": "", + // "pattern": "d[a-z0-9]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 20), + validate.StringMatch(regexp.MustCompile("d[a-z0-9]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -43,7 +45,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } Type: types.StringType, @@ -59,7 +61,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // }, // "type": "array", @@ -69,6 +71,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 2048)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("(?s).+"), "")), }, }, "auto_sub_domain_iam_role": { @@ -76,13 +79,14 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1000, - // "pattern": "", + // "pattern": "^$|^arn:.+:iam::\\d{12}:role.+", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("^$|^arn:.+:iam::\\d{12}:role.+"), ""), }, }, "certificate_record": { @@ -159,12 +163,12 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BranchName": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "(?s).+", // "type": "string" // }, // "Prefix": { // "maxLength": 255, - // "pattern": "", + // "pattern": "(?s).*", // "type": "string" // } // }, @@ -186,6 +190,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("(?s).+"), ""), }, }, "prefix": { @@ -194,6 +199,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("(?s).*"), ""), }, }, }, diff --git a/internal/aws/appflow/connector_profile_resource_gen.go b/internal/aws/appflow/connector_profile_resource_gen.go index 745d956c33..bc49c2dc33 100644 --- a/internal/aws/appflow/connector_profile_resource_gen.go +++ b/internal/aws/appflow/connector_profile_resource_gen.go @@ -4,6 +4,7 @@ package appflow import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -47,7 +48,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // { // "description": "Unique identifier for connector profile resources", // "maxLength": 512, - // "pattern": "", + // "pattern": "arn:aws:appflow:.*:[0-9]+:.*", // "type": "string" // } Description: "Unique identifier for connector profile resources", @@ -71,12 +72,12 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "ApiKey": { // "description": "A unique alphanumeric identi?er used to authenticate a user, developer, or calling program to your API.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "SecretKey": { // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -91,13 +92,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "ApiKey": { // "description": "A unique alphanumeric identi?er used to authenticate a user, developer, or calling program to your API.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ApplicationKey": { // "description": "Application keys, in conjunction with your API key, give you full access to Datadog?s programmatic API. Application keys are associated with the user account that created them. The application key is used to log all requests made to the API.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -112,7 +113,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "ApiToken": { // "description": "The API tokens used by Dynatrace API to authenticate various API calls.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -126,19 +127,19 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccessToken": { // "description": "The credentials used to access protected resources.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientId": { // "description": "The identi?er for the desired client.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientSecret": { // "description": "The client secret used by the oauth client to authenticate to the authorization server.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ConnectorOAuthRequest": { @@ -158,7 +159,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "RefreshToken": { // "description": "The credentials used to acquire new access tokens.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -173,25 +174,25 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccessKeyId": { // "description": "The Access Key portion of the credentials.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Datakey": { // "description": "The encryption keys used to encrypt data.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "SecretAccessKey": { // "description": "The secret key used to sign requests.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "UserId": { // "description": "The identi?er for the user.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -208,19 +209,19 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccessToken": { // "description": "The credentials used to access protected resources.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientId": { // "description": "The identi?er for the desired client.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientSecret": { // "description": "The client secret used by the oauth client to authenticate to the authorization server.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ConnectorOAuthRequest": { @@ -249,13 +250,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "Password": { // "description": "The password that corresponds to the username.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Username": { // "description": "The name of the user.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -272,13 +273,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "Password": { // "description": "The password that corresponds to the username.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Username": { // "description": "The name of the user.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -288,17 +289,17 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "properties": { // "AccessToken": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientId": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientSecret": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ConnectorOAuthRequest": { @@ -316,7 +317,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // }, // "RefreshToken": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -330,13 +331,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccessToken": { // "description": "The credentials used to access protected resources.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientCredentialsArn": { // "description": "The client credentials to fetch access token and refresh token.", // "maxLength": 2048, - // "pattern": "", + // "pattern": "arn:aws:secretsmanager:.*:[0-9]+:.*", // "type": "string" // }, // "ConnectorOAuthRequest": { @@ -356,7 +357,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "RefreshToken": { // "description": "The credentials used to acquire new access tokens.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -367,13 +368,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "Password": { // "description": "The password that corresponds to the username.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Username": { // "description": "The name of the user.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -388,7 +389,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "ApiKey": { // "description": "A unique alphanumeric identi?er used to authenticate a user, developer, or calling program to your API.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -402,19 +403,19 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccessToken": { // "description": "The credentials used to access protected resources.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientId": { // "description": "The identi?er for the desired client.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientSecret": { // "description": "The client secret used by the oauth client to authenticate to the authorization server.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ConnectorOAuthRequest": { @@ -443,13 +444,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "Password": { // "description": "The password that corresponds to the username.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Username": { // "description": "The name of the user.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -464,7 +465,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "ApiSecretKey": { // "description": "The Secret Access Key portion of the credentials.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -478,13 +479,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "Password": { // "description": "The password that corresponds to the username.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Username": { // "description": "The name of the user.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -499,19 +500,19 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccessToken": { // "description": "The credentials used to access protected resources.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientId": { // "description": "The identi?er for the desired client.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientSecret": { // "description": "The client secret used by the oauth client to authenticate to the authorization server.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ConnectorOAuthRequest": { @@ -546,7 +547,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Datadog resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -560,7 +561,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Dynatrace resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -574,7 +575,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the InforNexus resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -588,7 +589,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Marketo resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -603,7 +604,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The name of the Amazon S3 bucket associated with Redshift.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -614,13 +615,13 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "DatabaseUrl": { // "description": "The JDBC URL of the Amazon Redshift cluster.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "RoleArn": { // "description": "The Amazon Resource Name (ARN) of the IAM role.", // "maxLength": 512, - // "pattern": "", + // "pattern": "arn:aws:iam:.*:[0-9]+:.*", // "type": "string" // } // }, @@ -635,36 +636,36 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "properties": { // "ApplicationHostUrl": { // "maxLength": 256, - // "pattern": "", + // "pattern": "^(https?)://[-a-zA-Z0-9+\u0026amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\u0026amp;@#/%=~_|]", // "type": "string" // }, // "ApplicationServicePath": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "ClientNumber": { // "maxLength": 3, // "minLength": 3, - // "pattern": "", + // "pattern": "^\\d{3}$", // "type": "string" // }, // "LogonLanguage": { // "maxLength": 2, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_]*$", // "type": "string" // }, // "OAuthProperties": { // "properties": { // "AuthCodeUrl": { // "maxLength": 256, - // "pattern": "", + // "pattern": "^(https?)://[-a-zA-Z0-9+\u0026amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\u0026amp;@#/%=~_|]", // "type": "string" // }, // "OAuthScopes": { // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "[/\\w]*", // "type": "string" // }, // "type": "array", @@ -672,7 +673,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // }, // "TokenUrl": { // "maxLength": 256, - // "pattern": "", + // "pattern": "^(https?)://[-a-zA-Z0-9+\u0026amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\u0026amp;@#/%=~_|]", // "type": "string" // } // }, @@ -685,7 +686,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // }, // "PrivateLinkServiceName": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -696,7 +697,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Salesforce resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "isSandboxEnvironment": { @@ -710,7 +711,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the ServiceNow resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -724,7 +725,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Slack resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -738,14 +739,14 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "AccountName": { // "description": "The name of the account.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketName": { // "description": "The name of the Amazon S3 bucket associated with Snow?ake.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -756,25 +757,25 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "PrivateLinkServiceName": { // "description": "The Snow?ake Private Link service name to be used for private data transfers.", // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Region": { // "description": "The region of the Snow?ake account.", // "maxLength": 64, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Stage": { // "description": "The name of the Amazon S3 stage that was created while setting up an Amazon S3 stage in the\nSnow?ake account. This is written in the following format: \u003c Database\u003e\u003c Schema\u003e\u003cStage Name\u003e.", // "maxLength": 16, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Warehouse": { // "description": "The name of the Snow?ake warehouse.", // "maxLength": 512, - // "pattern": "", + // "pattern": "[\\s\\w/!@#+=.-]*", // "type": "string" // } // }, @@ -790,7 +791,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Veeva resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -804,7 +805,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "InstanceUrl": { // "description": "The location of the Zendesk resource", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -841,6 +842,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "secret_key": { @@ -849,6 +851,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -866,6 +869,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "application_key": { @@ -875,6 +879,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -892,6 +897,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -909,6 +915,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_id": { @@ -918,6 +925,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_secret": { @@ -927,6 +935,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "connector_o_auth_request": { @@ -957,6 +966,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -974,6 +984,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "datakey": { @@ -983,6 +994,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "secret_access_key": { @@ -992,6 +1004,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "user_id": { @@ -1001,6 +1014,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1018,6 +1032,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_id": { @@ -1027,6 +1042,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_secret": { @@ -1036,6 +1052,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "connector_o_auth_request": { @@ -1074,6 +1091,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "username": { @@ -1083,6 +1101,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1104,6 +1123,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "username": { @@ -1113,6 +1133,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1129,6 +1150,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_id": { @@ -1137,6 +1159,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_secret": { @@ -1145,6 +1168,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "connector_o_auth_request": { @@ -1173,6 +1197,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1194,6 +1219,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_credentials_arn": { @@ -1203,6 +1229,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile("arn:aws:secretsmanager:.*:[0-9]+:.*"), ""), }, }, "connector_o_auth_request": { @@ -1233,6 +1260,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1250,6 +1278,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "username": { @@ -1259,6 +1288,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1276,6 +1306,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1293,6 +1324,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_id": { @@ -1302,6 +1334,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_secret": { @@ -1311,6 +1344,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "connector_o_auth_request": { @@ -1349,6 +1383,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "username": { @@ -1358,6 +1393,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1375,6 +1411,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1392,6 +1429,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "username": { @@ -1401,6 +1439,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1418,6 +1457,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_id": { @@ -1427,6 +1467,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_secret": { @@ -1436,6 +1477,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "connector_o_auth_request": { @@ -1483,6 +1525,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1500,6 +1543,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1517,6 +1561,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1534,6 +1579,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1551,6 +1597,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -1569,6 +1616,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "role_arn": { @@ -1578,6 +1626,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("arn:aws:iam:.*:[0-9]+:.*"), ""), }, }, }, @@ -1594,6 +1643,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"), ""), }, }, "application_service_path": { @@ -1602,6 +1652,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "client_number": { @@ -1610,6 +1661,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 3), + validate.StringMatch(regexp.MustCompile("^\\d{3}$"), ""), }, }, "logon_language": { @@ -1618,6 +1670,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_]*$"), ""), }, }, "o_auth_properties": { @@ -1630,6 +1683,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"), ""), }, }, "o_auth_scopes": { @@ -1639,6 +1693,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Validators: []tfsdk.AttributeValidator{ validate.UniqueItems(), validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[/\\w]*"), "")), }, }, "token_url": { @@ -1647,6 +1702,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"), ""), }, }, }, @@ -1667,6 +1723,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1684,6 +1741,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "is_sandbox_environment": { @@ -1706,6 +1764,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1723,6 +1782,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1740,6 +1800,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_name": { @@ -1749,6 +1810,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -1767,6 +1829,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "region": { @@ -1776,6 +1839,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(64), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "stage": { @@ -1785,6 +1849,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(16), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "warehouse": { @@ -1794,6 +1859,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("[\\s\\w/!@#+=.-]*"), ""), }, }, }, @@ -1811,6 +1877,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1828,6 +1895,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1849,7 +1917,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // { // "description": "The maximum number of items to retrieve in a single batch.", // "maxLength": 256, - // "pattern": "", + // "pattern": "[\\w/!@#+=.-]+", // "type": "string" // } Description: "The maximum number of items to retrieve in a single batch.", @@ -1857,6 +1925,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("[\\w/!@#+=.-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -1920,7 +1989,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // { // "description": "A unique Arn for Connector-Profile resource", // "maxLength": 512, - // "pattern": "", + // "pattern": "arn:aws:.*:.*:[0-9]+:.*", // "type": "string" // } Description: "A unique Arn for Connector-Profile resource", @@ -1937,7 +2006,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "arn:aws:kms:.*:[0-9]+:.*", // "type": "string" // } Description: "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", @@ -1946,6 +2015,7 @@ func connectorProfileResourceType(ctx context.Context) (tfsdk.ResourceType, erro Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("arn:aws:kms:.*:[0-9]+:.*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/appflow/flow_resource_gen.go b/internal/aws/appflow/flow_resource_gen.go index aceff55b21..79d31c9cd1 100644 --- a/internal/aws/appflow/flow_resource_gen.go +++ b/internal/aws/appflow/flow_resource_gen.go @@ -4,6 +4,7 @@ package appflow import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Description of the flow.", // "maxLength": 2048, - // "pattern": "", + // "pattern": "[\\w!@#\\-.?,\\s]*", // "type": "string" // } Description: "Description of the flow.", @@ -34,6 +35,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile("[\\w!@#\\-.?,\\s]*"), ""), }, }, "destination_flow_config_list": { @@ -48,7 +50,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ConnectorProfileName": { // "description": "Name of destination connector profile", // "maxLength": 256, - // "pattern": "", + // "pattern": "[\\w/!@#+=.-]+", // "type": "string" // }, // "ConnectorType": { @@ -89,7 +91,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -104,7 +106,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -118,7 +120,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -137,7 +139,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -153,12 +155,12 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "IntermediateBucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -174,7 +176,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -246,7 +248,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -268,7 +270,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "WriteOperationType": { @@ -298,7 +300,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -314,12 +316,12 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "IntermediateBucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -335,7 +337,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 16, - // "pattern": "", + // "pattern": "^(upsolver-appflow)\\S*", // "type": "string" // }, // "BucketPrefix": { @@ -411,7 +413,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -433,7 +435,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "WriteOperationType": { @@ -472,6 +474,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("[\\w/!@#+=.-]+"), ""), }, }, "connector_type": { @@ -523,6 +526,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -548,6 +552,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -564,6 +569,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -592,6 +598,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -617,6 +624,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "object": { @@ -625,6 +633,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -641,6 +650,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -742,6 +752,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -773,6 +784,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "write_operation_type": { @@ -813,6 +825,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -838,6 +851,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "object": { @@ -846,6 +860,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -862,6 +877,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(16, 63), + validate.StringMatch(regexp.MustCompile("^(upsolver-appflow)\\S*"), ""), }, }, "bucket_prefix": { @@ -963,6 +979,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -994,6 +1011,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "write_operation_type": { @@ -1027,7 +1045,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "ARN identifier of the flow.", // "maxLength": 512, - // "pattern": "", + // "pattern": "arn:aws:appflow:.*:[0-9]+:.*", // "type": "string" // } Description: "ARN identifier of the flow.", @@ -1044,7 +1062,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Name of the flow.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9][\\w!@#.-]+", // "type": "string" // } Description: "Name of the flow.", @@ -1052,6 +1070,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9][\\w!@#.-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -1064,7 +1083,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "arn:aws:kms:.*:[0-9]+:.*", // "type": "string" // } Description: "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", @@ -1073,6 +1092,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("arn:aws:kms:.*:[0-9]+:.*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -1089,7 +1109,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ConnectorProfileName": { // "description": "Name of source connector profile", // "maxLength": 256, - // "pattern": "", + // "pattern": "[\\w/!@#+=.-]+", // "type": "string" // }, // "ConnectorType": { @@ -1137,7 +1157,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1151,7 +1171,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1165,7 +1185,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1179,7 +1199,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1193,7 +1213,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1207,7 +1227,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1222,7 +1242,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { @@ -1253,7 +1273,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "ObjectPath": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1273,7 +1293,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1287,7 +1307,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1301,7 +1321,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1315,7 +1335,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1329,7 +1349,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1343,7 +1363,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "DocumentType": { // "maxLength": 512, - // "pattern": "", + // "pattern": "[\\s\\w_-]+", // "type": "string" // }, // "IncludeAllVersions": { @@ -1357,7 +1377,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1371,7 +1391,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Object": { // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -1400,6 +1420,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("[\\w/!@#+=.-]+"), ""), }, }, "connector_type": { @@ -1465,6 +1486,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1481,6 +1503,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1497,6 +1520,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1513,6 +1537,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1529,6 +1554,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1545,6 +1571,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1561,6 +1588,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -1604,6 +1632,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1630,6 +1659,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1646,6 +1676,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1662,6 +1693,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1678,6 +1710,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1694,6 +1727,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1710,6 +1744,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("[\\s\\w_-]+"), ""), }, }, "include_all_versions": { @@ -1733,6 +1768,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -1749,6 +1785,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -2173,7 +2210,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Value": { // "maxLength": 2048, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } // }, @@ -2629,6 +2666,7 @@ func flowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".+"), ""), }, }, }, diff --git a/internal/aws/appintegrations/data_integration_resource_gen.go b/internal/aws/appintegrations/data_integration_resource_gen.go index e4cc683179..a7d560fe5c 100644 --- a/internal/aws/appintegrations/data_integration_resource_gen.go +++ b/internal/aws/appintegrations/data_integration_resource_gen.go @@ -4,6 +4,7 @@ package appintegrations import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -60,7 +61,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The unique identifer of the data integration.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", // "type": "string" // } Description: "The unique identifer of the data integration.", @@ -77,7 +78,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The KMS key of the data integration.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "The KMS key of the data integration.", @@ -85,6 +86,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -97,7 +99,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The name of the data integration.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9/\\._\\-]+$", // "type": "string" // } Description: "The name of the data integration.", @@ -105,6 +107,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9/\\._\\-]+$"), ""), }, }, "schedule_config": { @@ -118,21 +121,21 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The start date for objects to import in the first flow run. Epoch or ISO timestamp format is supported.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Object": { // "description": "The name of the object to pull from the data source.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9/\\._\\-]+$", // "type": "string" // }, // "ScheduleExpression": { // "description": "How often the data should be pulled from data source.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } // }, @@ -153,6 +156,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "object": { @@ -162,6 +166,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9/\\._\\-]+$"), ""), }, }, "schedule_expression": { @@ -171,6 +176,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, }, @@ -187,7 +193,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The URI of the data source.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^\\w+\\:\\/\\/\\w+\\/[\\w/!@#+=.-]+$", // "type": "string" // } Description: "The URI of the data source.", @@ -195,6 +201,7 @@ func dataIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^\\w+\\:\\/\\/\\w+\\/[\\w/!@#+=.-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/appintegrations/event_integration_resource_gen.go b/internal/aws/appintegrations/event_integration_resource_gen.go index 81e7e15445..99dfa1ac9e 100644 --- a/internal/aws/appintegrations/event_integration_resource_gen.go +++ b/internal/aws/appintegrations/event_integration_resource_gen.go @@ -4,6 +4,7 @@ package appintegrations import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -37,14 +38,14 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "A key to identify the metadata.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Value": { // "description": "Corresponding metadata value for the key.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } // }, @@ -66,7 +67,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The name of the Eventbridge rule.", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9/\\._\\-]+$", // "type": "string" // }, // "EventIntegrationAssociationArn": { @@ -78,7 +79,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // }, // "EventIntegrationAssociationId": { // "description": "The identifier for the event integration association.", - // "pattern": "", + // "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", // "type": "string" // } // }, @@ -102,6 +103,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "value": { @@ -111,6 +113,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, }, @@ -134,6 +137,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9/\\._\\-]+$"), ""), }, }, "event_integration_association_arn": { @@ -150,6 +154,9 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Description: "The identifier for the event integration association.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, @@ -182,7 +189,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The Amazon Eventbridge bus for the event integration.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9/\\._\\-]+$", // "type": "string" // } Description: "The Amazon Eventbridge bus for the event integration.", @@ -190,6 +197,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9/\\._\\-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -206,7 +214,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The source of the events.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^aws\\.partner\\/.*$", // "type": "string" // } // }, @@ -225,6 +233,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^aws\\.partner\\/.*$"), ""), }, }, }, @@ -258,7 +267,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The name of the event integration.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9/\\._\\-]+$", // "type": "string" // } Description: "The name of the event integration.", @@ -266,6 +275,7 @@ func eventIntegrationResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9/\\._\\-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/applicationinsights/application_resource_gen.go b/internal/aws/applicationinsights/application_resource_gen.go index 2d86d664d4..27a7dc992a 100644 --- a/internal/aws/applicationinsights/application_resource_gen.go +++ b/internal/aws/applicationinsights/application_resource_gen.go @@ -4,6 +4,7 @@ package applicationinsights import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -82,7 +83,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ARN of the compnonent.", // "maxLength": 300, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$", // "type": "string" // }, // "ComponentConfigurationMode": { @@ -98,7 +99,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the component.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\d\\w\\-_.+]*$", // "type": "string" // }, // "CustomComponentConfiguration": { @@ -241,26 +242,26 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "LogPath": { // "description": "The path of the logs to be monitored.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$", // "type": "string" // }, // "LogType": { // "description": "The log type decides the log patterns against which Application Insights analyzes the log.", - // "pattern": "", + // "pattern": "^[A-Z][[A-Z]_]*$", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -299,21 +300,21 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The type of Windows Events to log.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_ \\\\/-]$", // "type": "string" // }, // "LogGroupName": { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -379,26 +380,26 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "LogPath": { // "description": "The path of the logs to be monitored.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$", // "type": "string" // }, // "LogType": { // "description": "The log type decides the log patterns against which Application Insights analyzes the log.", - // "pattern": "", + // "pattern": "^[A-Z][[A-Z]_]*$", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -437,21 +438,21 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The type of Windows Events to log.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_ \\\\/-]$", // "type": "string" // }, // "LogGroupName": { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -628,26 +629,26 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "LogPath": { // "description": "The path of the logs to be monitored.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$", // "type": "string" // }, // "LogType": { // "description": "The log type decides the log patterns against which Application Insights analyzes the log.", - // "pattern": "", + // "pattern": "^[A-Z][[A-Z]_]*$", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -686,21 +687,21 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The type of Windows Events to log.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_ \\\\/-]$", // "type": "string" // }, // "LogGroupName": { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -766,26 +767,26 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "LogPath": { // "description": "The path of the logs to be monitored.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$", // "type": "string" // }, // "LogType": { // "description": "The log type decides the log patterns against which Application Insights analyzes the log.", - // "pattern": "", + // "pattern": "^[A-Z][[A-Z]_]*$", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -824,21 +825,21 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The type of Windows Events to log.", // "maxLength": 260, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_ \\\\/-]$", // "type": "string" // }, // "LogGroupName": { // "description": "The CloudWatch log group name to be associated to the monitored log.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "PatternSet": { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -877,7 +878,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Tier": { // "description": "The tier of the application component.", - // "pattern": "", + // "pattern": "^[A-Z][[A-Z]_]*$", // "type": "string" // } // }, @@ -900,6 +901,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 300), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$"), ""), }, }, "component_configuration_mode": { @@ -922,6 +924,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[\\d\\w\\-_.+]*$"), ""), }, }, "custom_component_configuration": { @@ -1088,6 +1091,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "log_path": { @@ -1097,6 +1101,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$"), ""), }, }, "log_type": { @@ -1104,6 +1109,9 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The log type decides the log patterns against which Application Insights analyzes the log.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z][[A-Z]_]*$"), ""), + }, }, "pattern_set": { // Property: PatternSet @@ -1112,6 +1120,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1147,6 +1156,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_ \\\\/-]$"), ""), }, }, "log_group_name": { @@ -1156,6 +1166,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "pattern_set": { @@ -1165,6 +1176,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1227,6 +1239,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "log_path": { @@ -1236,6 +1249,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$"), ""), }, }, "log_type": { @@ -1243,6 +1257,9 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The log type decides the log patterns against which Application Insights analyzes the log.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z][[A-Z]_]*$"), ""), + }, }, "pattern_set": { // Property: PatternSet @@ -1251,6 +1268,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1286,6 +1304,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_ \\\\/-]$"), ""), }, }, "log_group_name": { @@ -1295,6 +1314,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "pattern_set": { @@ -1304,6 +1324,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1503,6 +1524,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "log_path": { @@ -1512,6 +1534,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$"), ""), }, }, "log_type": { @@ -1519,6 +1542,9 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The log type decides the log patterns against which Application Insights analyzes the log.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z][[A-Z]_]*$"), ""), + }, }, "pattern_set": { // Property: PatternSet @@ -1527,6 +1553,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1562,6 +1589,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_ \\\\/-]$"), ""), }, }, "log_group_name": { @@ -1571,6 +1599,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "pattern_set": { @@ -1580,6 +1609,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1642,6 +1672,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "log_path": { @@ -1651,6 +1682,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^([a-zA-Z]:\\\\[\\\\\\S|*\\S]?.*|/[^\"']*)$"), ""), }, }, "log_type": { @@ -1658,6 +1690,9 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The log type decides the log patterns against which Application Insights analyzes the log.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z][[A-Z]_]*$"), ""), + }, }, "pattern_set": { // Property: PatternSet @@ -1666,6 +1701,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1701,6 +1737,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 260), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_ \\\\/-]$"), ""), }, }, "log_group_name": { @@ -1710,6 +1747,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, }, "pattern_set": { @@ -1719,6 +1757,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1759,6 +1798,9 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The tier of the application component.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z][[A-Z]_]*$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, @@ -1792,7 +1834,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the component.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\d\\w\\-_.+]*$", // "type": "string" // }, // "ResourceList": { @@ -1801,7 +1843,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 300, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$", // "type": "string" // }, // "minItems": 1, @@ -1827,6 +1869,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[\\d\\w\\-_.+]*$"), ""), }, }, "resource_list": { @@ -1837,6 +1880,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), validate.ArrayForEach(validate.StringLenBetween(20, 300)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$"), "")), }, }, }, @@ -1874,7 +1918,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the log pattern.", // "maxLength": 50, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // }, // "Rank": { @@ -1896,7 +1940,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the log pattern set.", // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } // }, @@ -1933,6 +1977,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 50), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, "rank": { @@ -1956,6 +2001,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 30), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, }, }, @@ -1984,7 +2030,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The SNS topic provided to Application Insights that is associated to the created opsItem.", // "maxLength": 300, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$", // "type": "string" // } Description: "The SNS topic provided to Application Insights that is associated to the created opsItem.", @@ -1992,6 +2038,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 300), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:[\\w\\d-]+:([\\w\\d-]*)?:[\\w\\d_-]*([:/].+)*$"), ""), }, }, "resource_group_name": { @@ -2001,7 +2048,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the resource group.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9.-_]*", // "type": "string" // } Description: "The name of the resource group.", @@ -2009,6 +2056,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9.-_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/apprunner/service_resource_gen.go b/internal/aws/apprunner/service_resource_gen.go index c474698697..152eabc1ed 100644 --- a/internal/aws/apprunner/service_resource_gen.go +++ b/internal/aws/apprunner/service_resource_gen.go @@ -4,6 +4,7 @@ package apprunner import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -49,7 +50,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The KMS Key", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:aws(-[\\w]+)*:kms:[a-z\\-]+-[0-9]{1}:[0-9]{12}:key\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", // "type": "string" // } // }, @@ -68,6 +69,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("arn:aws(-[\\w]+)*:kms:[a-z\\-]+-[0-9]{1}:[0-9]{12}:key\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"), ""), }, }, }, @@ -192,21 +194,21 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "CPU", // "maxLength": 6, // "minLength": 4, - // "pattern": "", + // "pattern": "1024|2048|(1|2) vCPU", // "type": "string" // }, // "InstanceRoleArn": { // "description": "Instance Role Arn", // "maxLength": 102, // "minLength": 29, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):iam::[0-9]{12}:role/[\\w+=,.@-]{1,64}", // "type": "string" // }, // "Memory": { // "description": "Memory", // "maxLength": 4, // "minLength": 4, - // "pattern": "", + // "pattern": "2048|3072|4096|(2|3|4) GB", // "type": "string" // } // }, @@ -222,6 +224,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 6), + validate.StringMatch(regexp.MustCompile("1024|2048|(1|2) vCPU"), ""), }, }, "instance_role_arn": { @@ -231,6 +234,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(29, 102), + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):iam::[0-9]{12}:role/[\\w+=,.@-]{1,64}"), ""), }, }, "memory": { @@ -240,6 +244,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 4), + validate.StringMatch(regexp.MustCompile("2048|3072|4096|(2|3|4) GB"), ""), }, }, }, @@ -361,7 +366,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The AppRunner Service Name.", // "maxLength": 40, // "minLength": 4, - // "pattern": "", + // "pattern": "[A-Za-z0-9][A-Za-z0-9-_]{3,39}", // "type": "string" // } Description: "The AppRunner Service Name.", @@ -370,6 +375,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 40), + validate.StringMatch(regexp.MustCompile("[A-Za-z0-9][A-Za-z0-9-_]{3,39}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -405,7 +411,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Access Role Arn", // "maxLength": 102, // "minLength": 29, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):iam::[0-9]{12}:role/[\\w+=,.@-]{1,64}", // "type": "string" // }, // "ConnectionArn": { @@ -560,7 +566,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Image Identifier", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "([0-9]{12}.dkr.ecr.[a-z\\-]+-[0-9]{1}.amazonaws.com\\/.*)|(^public\\.ecr\\.aws\\/.+\\/.+)", // "type": "string" // }, // "ImageRepositoryType": { @@ -596,6 +602,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(29, 102), + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):iam::[0-9]{12}:role/[\\w+=,.@-]{1,64}"), ""), }, }, "connection_arn": { @@ -789,6 +796,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("([0-9]{12}.dkr.ecr.[a-z\\-]+-[0-9]{1}.amazonaws.com\\/.*)|(^public\\.ecr\\.aws\\/.+\\/.+)"), ""), }, }, "image_repository_type": { diff --git a/internal/aws/apprunner/vpc_connector_resource_gen.go b/internal/aws/apprunner/vpc_connector_resource_gen.go index 9f2d47973e..d543a35ff8 100644 --- a/internal/aws/apprunner/vpc_connector_resource_gen.go +++ b/internal/aws/apprunner/vpc_connector_resource_gen.go @@ -4,6 +4,7 @@ package apprunner import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -131,7 +132,7 @@ func vpcConnectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A name for the VPC connector. If you don't specify a name, AWS CloudFormation generates a name for your VPC connector.", // "maxLength": 40, // "minLength": 4, - // "pattern": "", + // "pattern": "^[A-Za-z0-9][A-Za-z0-9-\\\\_]{3,39}$", // "type": "string" // } Description: "A name for the VPC connector. If you don't specify a name, AWS CloudFormation generates a name for your VPC connector.", @@ -140,6 +141,7 @@ func vpcConnectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 40), + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9][A-Za-z0-9-\\\\_]{3,39}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/appsync/domain_name_api_association_resource_gen.go b/internal/aws/appsync/domain_name_api_association_resource_gen.go index 7d735c5c34..41f5ff804b 100644 --- a/internal/aws/appsync/domain_name_api_association_resource_gen.go +++ b/internal/aws/appsync/domain_name_api_association_resource_gen.go @@ -4,6 +4,7 @@ package appsync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -47,13 +48,14 @@ func domainNameApiAssociationResourceType(ctx context.Context) (tfsdk.ResourceTy // { // "maxLength": 253, // "minLength": 1, - // "pattern": "", + // "pattern": "^(\\*[a-z\\d-]*\\.)?([a-z\\d-]+\\.)+[a-z\\d-]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 253), + validate.StringMatch(regexp.MustCompile("^(\\*[a-z\\d-]*\\.)?([a-z\\d-]+\\.)+[a-z\\d-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/appsync/domain_name_resource_gen.go b/internal/aws/appsync/domain_name_resource_gen.go index 414590376c..207c2af04f 100644 --- a/internal/aws/appsync/domain_name_resource_gen.go +++ b/internal/aws/appsync/domain_name_resource_gen.go @@ -4,6 +4,7 @@ package appsync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -38,13 +39,14 @@ func domainNameResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 3, - // "pattern": "", + // "pattern": "^arn:[a-z-]*:acm:[a-z0-9-]*:\\d{12}:certificate/[0-9A-Za-z_/-]*$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[a-z-]*:acm:[a-z0-9-]*:\\d{12}:certificate/[0-9A-Za-z_/-]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -70,13 +72,14 @@ func domainNameResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 253, // "minLength": 1, - // "pattern": "", + // "pattern": "^(\\*[a-z\\d-]*\\.)?([a-z\\d-]+\\.)+[a-z\\d-]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 253), + validate.StringMatch(regexp.MustCompile("^(\\*[a-z\\d-]*\\.)?([a-z\\d-]+\\.)+[a-z\\d-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/aps/rule_groups_namespace_resource_gen.go b/internal/aws/aps/rule_groups_namespace_resource_gen.go index 9e7a19fe52..d71004952a 100644 --- a/internal/aws/aps/rule_groups_namespace_resource_gen.go +++ b/internal/aws/aps/rule_groups_namespace_resource_gen.go @@ -4,6 +4,7 @@ package aps import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func ruleGroupsNamespaceResourceType(ctx context.Context) (tfsdk.ResourceType, e // CloudFormation resource type schema: // { // "description": "The RuleGroupsNamespace ARN.", - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn):aps:[a-z0-9-]+:[0-9]+:rulegroupsnamespace/[a-zA-Z0-9-]+/[0-9A-Za-z][-.0-9A-Z_a-z]*$", // "type": "string" // } Description: "The RuleGroupsNamespace ARN.", @@ -128,12 +129,15 @@ func ruleGroupsNamespaceResourceType(ctx context.Context) (tfsdk.ResourceType, e // CloudFormation resource type schema: // { // "description": "Required to identify a specific APS Workspace associated with this RuleGroupsNamespace.", - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn):aps:[a-z0-9-]+:[0-9]+:workspace/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Required to identify a specific APS Workspace associated with this RuleGroupsNamespace.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-us-gov|aws-cn):aps:[a-z0-9-]+:[0-9]+:workspace/[a-zA-Z0-9-]+$"), ""), + }, }, } diff --git a/internal/aws/aps/workspace_resource_gen.go b/internal/aws/aps/workspace_resource_gen.go index 614861fe12..e66fd0afaf 100644 --- a/internal/aws/aps/workspace_resource_gen.go +++ b/internal/aws/aps/workspace_resource_gen.go @@ -54,7 +54,7 @@ func workspaceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Workspace arn.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:\u0008(aws|aws-us-gov|aws-cn)\u0008:aps:[a-z0-9-]+:[0-9]+:workspace/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Workspace arn.", diff --git a/internal/aws/athena/work_group_resource_gen.go b/internal/aws/athena/work_group_resource_gen.go index b8e5f0dd0c..c92b91446a 100644 --- a/internal/aws/athena/work_group_resource_gen.go +++ b/internal/aws/athena/work_group_resource_gen.go @@ -4,6 +4,7 @@ package athena import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -55,12 +56,15 @@ func workGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The workGroup name.", - // "pattern": "", + // "pattern": "[a-zA-Z0-9._-]{1,128}", // "type": "string" // } Description: "The workGroup name.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9._-]{1,128}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/auditmanager/assessment_resource_gen.go b/internal/aws/auditmanager/assessment_resource_gen.go index 45b6444900..d84a6f4cdc 100644 --- a/internal/aws/auditmanager/assessment_resource_gen.go +++ b/internal/aws/auditmanager/assessment_resource_gen.go @@ -4,6 +4,7 @@ package auditmanager import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the assessment.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:.*:auditmanager:.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the assessment.", @@ -43,7 +44,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } Type: types.StringType, @@ -108,14 +109,14 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique identifier for the email account.", // "maxLength": 320, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*@.*$", // "type": "string" // }, // "Id": { // "description": "The identifier for the specified AWS account.", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // }, // "Name": { @@ -138,6 +139,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 320), + validate.StringMatch(regexp.MustCompile("^.*@.*$"), ""), }, }, "id": { @@ -147,6 +149,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, }, "name": { @@ -193,34 +196,34 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "AssessmentId": { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // }, // "AssessmentName": { // "description": "The name of the related assessment.", // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_\\.]+$", // "type": "string" // }, // "Comment": { // "description": "The comment related to the delegation.", // "maxLength": 350, - // "pattern": "", + // "pattern": "^[\\w\\W\\s\\S]*$", // "type": "string" // }, // "ControlSetId": { // "description": "The identifier for the specified control set.", // "maxLength": 300, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\w\\W\\s\\S]*$", // "type": "string" // }, // "CreatedBy": { // "description": "The IAM user or role that performed the action.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_()\\[\\]\\s]+$", // "type": "string" // }, // "CreationTime": { @@ -230,7 +233,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Id": { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // }, // "LastUpdated": { @@ -241,7 +244,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the IAM user or role.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:.*:iam:.*", // "type": "string" // }, // "RoleType": { @@ -275,6 +278,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(36, 36), + validate.StringMatch(regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"), ""), }, }, "assessment_name": { @@ -284,6 +288,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_\\.]+$"), ""), }, }, "comment": { @@ -293,6 +298,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(350), + validate.StringMatch(regexp.MustCompile("^[\\w\\W\\s\\S]*$"), ""), }, }, "control_set_id": { @@ -302,6 +308,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 300), + validate.StringMatch(regexp.MustCompile("^[\\w\\W\\s\\S]*$"), ""), }, }, "created_by": { @@ -311,6 +318,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_()\\[\\]\\s]+$"), ""), }, }, "creation_time": { @@ -325,6 +333,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(36, 36), + validate.StringMatch(regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"), ""), }, }, "last_updated": { @@ -340,6 +349,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:.*:iam:.*"), ""), }, }, "role_type": { @@ -394,7 +404,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The identifier for the specified framework.", // "maxLength": 36, // "minLength": 32, - // "pattern": "", + // "pattern": "^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|.*\\S.*)$", // "type": "string" // } Description: "The identifier for the specified framework.", @@ -403,6 +413,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(32, 36), + validate.StringMatch(regexp.MustCompile("^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|.*\\S.*)$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -416,7 +427,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the related assessment.", // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_\\.]+$", // "type": "string" // } Description: "The name of the related assessment.", @@ -424,6 +435,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_\\.]+$"), ""), }, // Name is a write-only property. }, @@ -440,7 +452,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the IAM user or role.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:.*:iam:.*", // "type": "string" // }, // "RoleType": { @@ -466,6 +478,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:.*:iam:.*"), ""), }, }, "role_type": { @@ -502,14 +515,14 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique identifier for the email account.", // "maxLength": 320, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*@.*$", // "type": "string" // }, // "Id": { // "description": "The identifier for the specified AWS account.", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // }, // "Name": { @@ -557,6 +570,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 320), + validate.StringMatch(regexp.MustCompile("^.*@.*$"), ""), }, }, "id": { @@ -566,6 +580,7 @@ func assessmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, }, "name": { diff --git a/internal/aws/backup/backup_vault_resource_gen.go b/internal/aws/backup/backup_vault_resource_gen.go index f89faf48dc..0f218a062a 100644 --- a/internal/aws/backup/backup_vault_resource_gen.go +++ b/internal/aws/backup/backup_vault_resource_gen.go @@ -4,11 +4,13 @@ package backup import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -44,11 +46,14 @@ func backupVaultResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: BackupVaultName // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]{2,50}$", // "type": "string" // } Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_]{2,50}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/backup/framework_resource_gen.go b/internal/aws/backup/framework_resource_gen.go index 8a4a9f3aad..d8aa20f2ea 100644 --- a/internal/aws/backup/framework_resource_gen.go +++ b/internal/aws/backup/framework_resource_gen.go @@ -4,6 +4,7 @@ package backup import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -272,7 +273,7 @@ func frameworkResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique name of a framework. This name is between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z][_a-zA-Z0-9]*", // "type": "string" // } Description: "The unique name of a framework. This name is between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).", @@ -281,6 +282,7 @@ func frameworkResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z][_a-zA-Z0-9]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/backup/report_plan_resource_gen.go b/internal/aws/backup/report_plan_resource_gen.go index c9102b041e..3149277dee 100644 --- a/internal/aws/backup/report_plan_resource_gen.go +++ b/internal/aws/backup/report_plan_resource_gen.go @@ -4,6 +4,7 @@ package backup import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -96,7 +97,7 @@ func reportPlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An optional description of the report plan with a maximum of 1,024 characters.", // "maxLength": 1024, // "minLength": 0, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "An optional description of the report plan with a maximum of 1,024 characters.", @@ -104,6 +105,7 @@ func reportPlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 1024), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "report_plan_name": { @@ -113,7 +115,7 @@ func reportPlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z][_a-zA-Z0-9]*", // "type": "string" // } Description: "The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).", @@ -122,6 +124,7 @@ func reportPlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z][_a-zA-Z0-9]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/cassandra/keyspace_resource_gen.go b/internal/aws/cassandra/keyspace_resource_gen.go index d836f90db1..57f1e56798 100644 --- a/internal/aws/cassandra/keyspace_resource_gen.go +++ b/internal/aws/cassandra/keyspace_resource_gen.go @@ -4,6 +4,7 @@ package cassandra import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,13 +26,16 @@ func keyspaceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Name for Cassandra keyspace", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$", // "type": "string" // } Description: "Name for Cassandra keyspace", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/cassandra/table_resource_gen.go b/internal/aws/cassandra/table_resource_gen.go index 4cee6abb17..3336e58700 100644 --- a/internal/aws/cassandra/table_resource_gen.go +++ b/internal/aws/cassandra/table_resource_gen.go @@ -4,6 +4,7 @@ package cassandra import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -121,7 +122,7 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "ColumnName": { - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$", // "type": "string" // }, // "ColumnType": { @@ -162,6 +163,9 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: ColumnName Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$"), ""), + }, }, "column_type": { // Property: ColumnType @@ -277,12 +281,15 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Name for Cassandra keyspace", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$", // "type": "string" // } Description: "Name for Cassandra keyspace", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -297,7 +304,7 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "ColumnName": { - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$", // "type": "string" // }, // "ColumnType": { @@ -321,6 +328,9 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: ColumnName Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$"), ""), + }, }, "column_type": { // Property: ColumnType @@ -360,7 +370,7 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "ColumnName": { - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$", // "type": "string" // }, // "ColumnType": { @@ -383,6 +393,9 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: ColumnName Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$"), ""), + }, }, "column_type": { // Property: ColumnType @@ -399,13 +412,16 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Name for Cassandra table", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$", // "type": "string" // } Description: "Name for Cassandra table", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/ce/anomaly_monitor_resource_gen.go b/internal/aws/ce/anomaly_monitor_resource_gen.go index c802596c99..8ab2de2610 100644 --- a/internal/aws/ce/anomaly_monitor_resource_gen.go +++ b/internal/aws/ce/anomaly_monitor_resource_gen.go @@ -4,6 +4,7 @@ package ce import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func anomalyMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The date when the monitor was created. ", // "maxLength": 40, // "minLength": 0, - // "pattern": "", + // "pattern": "(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}Z)?", // "type": "string" // } Description: "The date when the monitor was created. ", @@ -59,7 +60,7 @@ func anomalyMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The date when the monitor last evaluated for anomalies.", // "maxLength": 40, // "minLength": 0, - // "pattern": "", + // "pattern": "(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}Z)?", // "type": "string" // } Description: "The date when the monitor last evaluated for anomalies.", @@ -76,7 +77,7 @@ func anomalyMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The date when the monitor was last updated.", // "maxLength": 40, // "minLength": 0, - // "pattern": "", + // "pattern": "(\\d{4}-\\d{2}-\\d{2})(T\\d{2}:\\d{2}:\\d{2}Z)?", // "type": "string" // } Description: "The date when the monitor was last updated.", @@ -91,7 +92,7 @@ func anomalyMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "Monitor ARN", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$", // "type": "string" // } Description: "Monitor ARN", @@ -132,7 +133,7 @@ func anomalyMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the monitor.", // "maxLength": 1024, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\S\\s]*", // "type": "string" // } Description: "The name of the monitor.", @@ -140,6 +141,7 @@ func anomalyMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 1024), + validate.StringMatch(regexp.MustCompile("[\\S\\s]*"), ""), }, }, "monitor_specification": { diff --git a/internal/aws/ce/anomaly_subscription_resource_gen.go b/internal/aws/ce/anomaly_subscription_resource_gen.go index 8bbacd2c44..491788b1cd 100644 --- a/internal/aws/ce/anomaly_subscription_resource_gen.go +++ b/internal/aws/ce/anomaly_subscription_resource_gen.go @@ -4,6 +4,7 @@ package ce import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -67,7 +68,7 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e // "insertionOrder": false, // "items": { // "description": "Subscription ARN", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$", // "type": "string" // }, // "type": "array" @@ -75,6 +76,9 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e Description: "A list of cost anomaly monitors.", Type: types.ListType{ElemType: types.StringType}, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$"), "")), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, @@ -89,7 +93,7 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e // "additionalProperties": false, // "properties": { // "Address": { - // "pattern": "", + // "pattern": "(^[a-zA-Z0-9.!#$%\u0026'*+=?^_‘{|}~-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$)|(^arn:(aws[a-zA-Z-]*):sns:[a-zA-Z0-9-]+:[0-9]{12}:[a-zA-Z0-9_-]+$)", // "type": "string" // }, // "Status": { @@ -122,6 +126,9 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e // Property: Address Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("(^[a-zA-Z0-9.!#$%&'*+=?^_‘{|}~-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$)|(^arn:(aws[a-zA-Z-]*):sns:[a-zA-Z0-9-]+:[0-9]{12}:[a-zA-Z0-9_-]+$)"), ""), + }, }, "status": { // Property: Status @@ -158,7 +165,7 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e // CloudFormation resource type schema: // { // "description": "Subscription ARN", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$", // "type": "string" // } Description: "Subscription ARN", @@ -175,7 +182,7 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e // "description": "The name of the subscription.", // "maxLength": 1024, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\S\\s]*", // "type": "string" // } Description: "The name of the subscription.", @@ -183,6 +190,7 @@ func anomalySubscriptionResourceType(ctx context.Context) (tfsdk.ResourceType, e Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 1024), + validate.StringMatch(regexp.MustCompile("[\\S\\s]*"), ""), }, }, "threshold": { diff --git a/internal/aws/ce/cost_category_resource_gen.go b/internal/aws/ce/cost_category_resource_gen.go index 86c72bc70d..8a5c9aa2bd 100644 --- a/internal/aws/ce/cost_category_resource_gen.go +++ b/internal/aws/ce/cost_category_resource_gen.go @@ -25,7 +25,7 @@ func costCategoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Cost category ARN", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$", // "type": "string" // } Description: "Cost category ARN", @@ -58,7 +58,7 @@ func costCategoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "ISO 8601 date time with offset format", // "maxLength": 25, // "minLength": 20, - // "pattern": "", + // "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(([+-]\\d\\d:\\d\\d)|Z)$", // "type": "string" // } Description: "ISO 8601 date time with offset format", diff --git a/internal/aws/chatbot/slack_channel_configuration_resource_gen.go b/internal/aws/chatbot/slack_channel_configuration_resource_gen.go index 8a9ec7703e..3b9f885bcf 100644 --- a/internal/aws/chatbot/slack_channel_configuration_resource_gen.go +++ b/internal/aws/chatbot/slack_channel_configuration_resource_gen.go @@ -4,6 +4,7 @@ package chatbot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func slackChannelConfigurationResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The name of the configuration", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Za-z0-9-_]+$", // "type": "string" // } Description: "The name of the configuration", @@ -50,6 +51,7 @@ func slackChannelConfigurationResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9-_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -92,13 +94,16 @@ func slackChannelConfigurationResourceType(ctx context.Context) (tfsdk.ResourceT // { // "default": "NONE", // "description": "Specifies the logging level for this configuration:ERROR,INFO or NONE. This property affects the log entries pushed to Amazon CloudWatch logs", - // "pattern": "", + // "pattern": "^(ERROR|INFO|NONE)$", // "type": "string" // } Description: "Specifies the logging level for this configuration:ERROR,INFO or NONE. This property affects the log entries pushed to Amazon CloudWatch logs", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(ERROR|INFO|NONE)$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.String{Value: "NONE"}), tfsdk.UseStateForUnknown(), @@ -111,7 +116,7 @@ func slackChannelConfigurationResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The id of the Slack channel", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Za-z0-9]+$", // "type": "string" // } Description: "The id of the Slack channel", @@ -119,6 +124,7 @@ func slackChannelConfigurationResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]+$"), ""), }, }, "slack_workspace_id": { diff --git a/internal/aws/cloudformation/hook_default_version_resource_gen.go b/internal/aws/cloudformation/hook_default_version_resource_gen.go index b3c3e53726..c006dc2900 100644 --- a/internal/aws/cloudformation/hook_default_version_resource_gen.go +++ b/internal/aws/cloudformation/hook_default_version_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func hookDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type. This is used to uniquely identify a HookDefaultVersion", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type. This is used to uniquely identify a HookDefaultVersion", @@ -40,36 +41,45 @@ func hookDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$"), ""), + }, }, "type_version_arn": { // Property: TypeVersionArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type version.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type version.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$"), ""), + }, }, "version_id": { // Property: VersionId // CloudFormation resource type schema: // { // "description": "The ID of an existing version of the hook to set as the default.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9-]{1,128}$", // "type": "string" // } Description: "The ID of an existing version of the hook to set as the default.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9-]{1,128}$"), ""), + }, }, } diff --git a/internal/aws/cloudformation/hook_type_config_resource_gen.go b/internal/aws/cloudformation/hook_type_config_resource_gen.go index 5b69f1b618..5801c1be89 100644 --- a/internal/aws/cloudformation/hook_type_config_resource_gen.go +++ b/internal/aws/cloudformation/hook_type_config_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,12 +26,15 @@ func hookTypeConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The configuration data for the extension, in this account and region.", - // "pattern": "", + // "pattern": "[\\s\\S]+", // "type": "string" // } Description: "The configuration data for the extension, in this account and region.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[\\s\\S]+"), ""), + }, }, "configuration_alias": { // Property: ConfigurationAlias @@ -41,7 +45,7 @@ func hookTypeConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "enum": [ // "default" // ], - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]{1,256}$", // "type": "string" // } Description: "An alias by which to refer to this extension configuration data.", @@ -49,6 +53,7 @@ func hookTypeConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]{1,256}$"), ""), validate.StringInSlice([]string{ "default", }), @@ -64,7 +69,7 @@ func hookTypeConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the configuration data, in this account and region.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type-configuration/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the configuration data, in this account and region.", @@ -79,13 +84,16 @@ func hookTypeConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type version.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type version.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -96,12 +104,15 @@ func hookTypeConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$"), ""), + }, }, } diff --git a/internal/aws/cloudformation/hook_version_resource_gen.go b/internal/aws/cloudformation/hook_version_resource_gen.go index 4ae377200e..35a1734df7 100644 --- a/internal/aws/cloudformation/hook_version_resource_gen.go +++ b/internal/aws/cloudformation/hook_version_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type, here the HookVersion. This is used to uniquely identify a HookVersion resource", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type, here the HookVersion. This is used to uniquely identify a HookVersion resource", @@ -41,7 +42,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the IAM execution role to use to register the type. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. CloudFormation then assumes that execution role to provide your resource type with the appropriate credentials.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:.+:iam::[0-9]{12}:role/.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the IAM execution role to use to register the type. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. CloudFormation then assumes that execution role to provide your resource type with the appropriate credentials.", @@ -50,6 +51,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:.+:iam::[0-9]{12}:role/.+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -81,7 +83,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", // "type": "string" // }, // "LogRoleArn": { @@ -103,6 +105,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("^[\\.\\-_/#A-Za-z0-9]+$"), ""), }, }, "log_role_arn": { @@ -147,7 +150,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type without the versionID.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type without the versionID.", @@ -162,12 +165,15 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -177,7 +183,7 @@ func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ID of the version of the type represented by this hook instance.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9-]{1,128}$", // "type": "string" // } Description: "The ID of the version of the type represented by this hook instance.", diff --git a/internal/aws/cloudformation/module_default_version_resource_gen.go b/internal/aws/cloudformation/module_default_version_resource_gen.go index 41793ee229..7669bc54e9 100644 --- a/internal/aws/cloudformation/module_default_version_resource_gen.go +++ b/internal/aws/cloudformation/module_default_version_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,13 +26,16 @@ func moduleDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the module version to set as the default version.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/module/.+/[0-9]{8}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the module version to set as the default version.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/module/.+/[0-9]{8}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -42,13 +46,16 @@ func moduleDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The name of a module existing in the registry.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::MODULE", // "type": "string" // } Description: "The name of a module existing in the registry.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::MODULE"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -60,13 +67,16 @@ func moduleDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The ID of an existing version of the named module to set as the default.", - // "pattern": "", + // "pattern": "^[0-9]{8}$", // "type": "string" // } Description: "The ID of an existing version of the named module to set as the default.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9]{8}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/cloudformation/module_version_resource_gen.go b/internal/aws/cloudformation/module_version_resource_gen.go index f04fff4c69..9df42e930b 100644 --- a/internal/aws/cloudformation/module_version_resource_gen.go +++ b/internal/aws/cloudformation/module_version_resource_gen.go @@ -4,11 +4,13 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -24,7 +26,7 @@ func moduleVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the module.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/module/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the module.", @@ -84,12 +86,15 @@ func moduleVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The name of the module being registered.\n\nRecommended module naming pattern: company_or_organization::service::type::MODULE.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::MODULE", // "type": "string" // } Description: "The name of the module being registered.\n\nRecommended module naming pattern: company_or_organization::service::type::MODULE.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::MODULE"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -144,7 +149,7 @@ func moduleVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The version ID of the module represented by this module instance.", - // "pattern": "", + // "pattern": "^[0-9]{8}$", // "type": "string" // } Description: "The version ID of the module represented by this module instance.", diff --git a/internal/aws/cloudformation/public_type_version_resource_gen.go b/internal/aws/cloudformation/public_type_version_resource_gen.go index df92408d32..f8dfb8aeaa 100644 --- a/internal/aws/cloudformation/public_type_version_resource_gen.go +++ b/internal/aws/cloudformation/public_type_version_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,13 +26,16 @@ func publicTypeVersionResourceType(ctx context.Context) (tfsdk.ResourceType, err // CloudFormation resource type schema: // { // "description": "The Amazon Resource Number (ARN) of the extension.", - // "pattern": "", + // "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:[0-9]{12}:type/.+", // "type": "string" // } Description: "The Amazon Resource Number (ARN) of the extension.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:[0-9]{12}:type/.+"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -59,7 +63,7 @@ func publicTypeVersionResourceType(ctx context.Context) (tfsdk.ResourceType, err // { // "description": "The Amazon Resource Number (ARN) assigned to the public extension upon publication", // "maxLength": 1024, - // "pattern": "", + // "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+", // "type": "string" // } Description: "The Amazon Resource Number (ARN) assigned to the public extension upon publication", @@ -97,7 +101,7 @@ func publicTypeVersionResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The publisher id assigned by CloudFormation for publishing in this region.", // "maxLength": 40, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9a-zA-Z]{40}", // "type": "string" // } Description: "The publisher id assigned by CloudFormation for publishing in this region.", @@ -140,13 +144,16 @@ func publicTypeVersionResourceType(ctx context.Context) (tfsdk.ResourceType, err // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -157,7 +164,7 @@ func publicTypeVersionResourceType(ctx context.Context) (tfsdk.ResourceType, err // CloudFormation resource type schema: // { // "description": "The Amazon Resource Number (ARN) of the extension with the versionId.", - // "pattern": "", + // "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:[0-9]{12}:type/.+", // "type": "string" // } Description: "The Amazon Resource Number (ARN) of the extension with the versionId.", diff --git a/internal/aws/cloudformation/publisher_resource_gen.go b/internal/aws/cloudformation/publisher_resource_gen.go index ccf7b619ce..8bc26df5eb 100644 --- a/internal/aws/cloudformation/publisher_resource_gen.go +++ b/internal/aws/cloudformation/publisher_resource_gen.go @@ -4,11 +4,13 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -38,13 +40,16 @@ func publisherResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "If you are using a Bitbucket or GitHub account for identity verification, the Amazon Resource Name (ARN) for your connection to that account.", - // "pattern": "", + // "pattern": "arn:aws(-[w]+)*:.+:.+:[0-9]{12}:.+", // "type": "string" // } Description: "If you are using a Bitbucket or GitHub account for identity verification, the Amazon Resource Name (ARN) for your connection to that account.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:aws(-[w]+)*:.+:.+:[0-9]{12}:.+"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -76,7 +81,7 @@ func publisherResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The publisher id assigned by CloudFormation for publishing in this region.", // "maxLength": 40, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9a-zA-Z]{40}", // "type": "string" // } Description: "The publisher id assigned by CloudFormation for publishing in this region.", @@ -92,7 +97,7 @@ func publisherResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The URL to the publisher's profile with the identity provider.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "(http:|https:)+[^s]+[w]", // "type": "string" // } Description: "The URL to the publisher's profile with the identity provider.", diff --git a/internal/aws/cloudformation/resource_default_version_resource_gen.go b/internal/aws/cloudformation/resource_default_version_resource_gen.go index 3973464a89..80babd118b 100644 --- a/internal/aws/cloudformation/resource_default_version_resource_gen.go +++ b/internal/aws/cloudformation/resource_default_version_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func resourceDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type. This is used to uniquely identify a ResourceDefaultVersion", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type. This is used to uniquely identify a ResourceDefaultVersion", @@ -40,36 +41,45 @@ func resourceDefaultVersionResourceType(ctx context.Context) (tfsdk.ResourceType // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$"), ""), + }, }, "type_version_arn": { // Property: TypeVersionArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type version.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type version.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$"), ""), + }, }, "version_id": { // Property: VersionId // CloudFormation resource type schema: // { // "description": "The ID of an existing version of the resource to set as the default.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9-]{1,128}$", // "type": "string" // } Description: "The ID of an existing version of the resource to set as the default.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9-]{1,128}$"), ""), + }, }, } diff --git a/internal/aws/cloudformation/resource_version_resource_gen.go b/internal/aws/cloudformation/resource_version_resource_gen.go index 10a2515121..92794d4934 100644 --- a/internal/aws/cloudformation/resource_version_resource_gen.go +++ b/internal/aws/cloudformation/resource_version_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func resourceVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type, here the ResourceVersion. This is used to uniquely identify a ResourceVersion resource", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type, here the ResourceVersion. This is used to uniquely identify a ResourceVersion resource", @@ -76,7 +77,7 @@ func resourceVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", // "type": "string" // }, // "LogRoleArn": { @@ -98,6 +99,7 @@ func resourceVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("^[\\.\\-_/#A-Za-z0-9]+$"), ""), }, }, "log_role_arn": { @@ -157,7 +159,7 @@ func resourceVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type without the versionID.", - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/resource/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type without the versionID.", @@ -172,12 +174,15 @@ func resourceVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -187,7 +192,7 @@ func resourceVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The ID of the version of the type represented by this resource instance.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9-]{1,128}$", // "type": "string" // } Description: "The ID of the version of the type represented by this resource instance.", diff --git a/internal/aws/cloudformation/stack_set_resource_gen.go b/internal/aws/cloudformation/stack_set_resource_gen.go index 773064b78c..7370329979 100644 --- a/internal/aws/cloudformation/stack_set_resource_gen.go +++ b/internal/aws/cloudformation/stack_set_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -217,7 +218,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "RegionOrder": { // "items": { - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-]{1,128}$", // "type": "string" // }, // "type": "array" @@ -276,6 +277,9 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: RegionOrder Type: types.ListType{ElemType: types.StringType}, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-]{1,128}$"), "")), + }, }, }, ), @@ -372,7 +376,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "description": "AWS account that you want to create stack instances in the specified Region(s) for.", - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // }, // "minItems": 1, @@ -383,7 +387,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The organization root ID or organizational unit (OU) IDs to which StackSets deploys.", // "insertionOrder": false, // "items": { - // "pattern": "", + // "pattern": "^(ou-[a-z0-9]{4,32}-[a-z0-9]{8,32}|r-[a-z0-9]{4,32})$", // "type": "string" // }, // "minItems": 1, @@ -421,7 +425,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The names of one or more Regions where you want to create stack instances using the specified AWS account(s).", // "insertionOrder": false, // "items": { - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-]{1,128}$", // "type": "string" // }, // "minItems": 1, @@ -453,6 +457,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), "")), }, }, "organizational_unit_ids": { @@ -462,6 +467,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(ou-[a-z0-9]{4,32}-[a-z0-9]{8,32}|r-[a-z0-9]{4,32})$"), "")), }, }, }, @@ -497,6 +503,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-]{1,128}$"), "")), }, }, }, @@ -524,7 +531,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name to associate with the stack set. The name must be unique in the Region where you create your stack set.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9\\-]{0,127}$", // "type": "string" // } Description: "The name to associate with the stack set. The name must be unique in the Region where you create your stack set.", @@ -532,6 +539,7 @@ func stackSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9\\-]{0,127}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/cloudformation/type_activation_resource_gen.go b/internal/aws/cloudformation/type_activation_resource_gen.go index 25575f0ce4..c76c34ea97 100644 --- a/internal/aws/cloudformation/type_activation_resource_gen.go +++ b/internal/aws/cloudformation/type_activation_resource_gen.go @@ -4,6 +4,7 @@ package cloudformation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the extension.", - // "pattern": "", + // "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the extension.", @@ -73,7 +74,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", // "type": "string" // }, // "LogRoleArn": { @@ -95,6 +96,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("^[\\.\\-_/#A-Za-z0-9]+$"), ""), }, }, "log_role_arn": { @@ -137,7 +139,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "description": "The Amazon Resource Number (ARN) assigned to the public extension upon publication", // "maxLength": 1024, - // "pattern": "", + // "pattern": "arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+", // "type": "string" // } Description: "The Amazon Resource Number (ARN) assigned to the public extension upon publication", @@ -146,6 +148,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/.+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -159,7 +162,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The publisher id assigned by CloudFormation for publishing in this region.", // "maxLength": 40, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9a-zA-Z]{40}", // "type": "string" // } Description: "The publisher id assigned by CloudFormation for publishing in this region.", @@ -168,6 +171,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 40), + validate.StringMatch(regexp.MustCompile("[0-9a-zA-Z]{40}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -207,13 +211,16 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", - // "pattern": "", + // "pattern": "[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -226,7 +233,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "An alias to assign to the public extension in this account and region. If you specify an alias for the extension, you must then use the alias to refer to the extension in your templates.", // "maxLength": 204, // "minLength": 10, - // "pattern": "", + // "pattern": "[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}", // "type": "string" // } Description: "An alias to assign to the public extension in this account and region. If you specify an alias for the extension, you must then use the alias to refer to the extension in your templates.", @@ -235,6 +242,7 @@ func typeActivationResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 204), + validate.StringMatch(regexp.MustCompile("[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}(::MODULE){0,1}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/cloudfront/cache_policy_resource_gen.go b/internal/aws/cloudfront/cache_policy_resource_gen.go index 7b213ec986..fca0ff5bd6 100644 --- a/internal/aws/cloudfront/cache_policy_resource_gen.go +++ b/internal/aws/cloudfront/cache_policy_resource_gen.go @@ -4,6 +4,7 @@ package cloudfront import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -51,7 +52,7 @@ func cachePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "CookieBehavior": { - // "pattern": "", + // "pattern": "^(none|whitelist|allExcept|all)$", // "type": "string" // }, // "Cookies": { @@ -77,7 +78,7 @@ func cachePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "HeaderBehavior": { - // "pattern": "", + // "pattern": "^(none|whitelist)$", // "type": "string" // }, // "Headers": { @@ -97,7 +98,7 @@ func cachePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "QueryStringBehavior": { - // "pattern": "", + // "pattern": "^(none|whitelist|allExcept|all)$", // "type": "string" // }, // "QueryStrings": { @@ -180,6 +181,9 @@ func cachePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: CookieBehavior Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(none|whitelist|allExcept|all)$"), ""), + }, }, "cookies": { // Property: Cookies @@ -208,6 +212,9 @@ func cachePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: HeaderBehavior Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(none|whitelist)$"), ""), + }, }, "headers": { // Property: Headers @@ -226,6 +233,9 @@ func cachePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: QueryStringBehavior Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(none|whitelist|allExcept|all)$"), ""), + }, }, "query_strings": { // Property: QueryStrings diff --git a/internal/aws/cloudfront/origin_request_policy_resource_gen.go b/internal/aws/cloudfront/origin_request_policy_resource_gen.go index e553c30afa..06f2b4819d 100644 --- a/internal/aws/cloudfront/origin_request_policy_resource_gen.go +++ b/internal/aws/cloudfront/origin_request_policy_resource_gen.go @@ -4,11 +4,13 @@ package cloudfront import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -56,7 +58,7 @@ func originRequestPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, e // "additionalProperties": false, // "properties": { // "CookieBehavior": { - // "pattern": "", + // "pattern": "^(none|whitelist|all)$", // "type": "string" // }, // "Cookies": { @@ -76,7 +78,7 @@ func originRequestPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, e // "additionalProperties": false, // "properties": { // "HeaderBehavior": { - // "pattern": "", + // "pattern": "^(none|whitelist|allViewer|allViewerAndWhitelistCloudFront)$", // "type": "string" // }, // "Headers": { @@ -99,7 +101,7 @@ func originRequestPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, e // "additionalProperties": false, // "properties": { // "QueryStringBehavior": { - // "pattern": "", + // "pattern": "^(none|whitelist|all)$", // "type": "string" // }, // "QueryStrings": { @@ -139,6 +141,9 @@ func originRequestPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, e // Property: CookieBehavior Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(none|whitelist|all)$"), ""), + }, }, "cookies": { // Property: Cookies @@ -157,6 +162,9 @@ func originRequestPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, e // Property: HeaderBehavior Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(none|whitelist|allViewer|allViewerAndWhitelistCloudFront)$"), ""), + }, }, "headers": { // Property: Headers @@ -180,6 +188,9 @@ func originRequestPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, e // Property: QueryStringBehavior Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(none|whitelist|all)$"), ""), + }, }, "query_strings": { // Property: QueryStrings diff --git a/internal/aws/cloudfront/response_headers_policy_resource_gen.go b/internal/aws/cloudfront/response_headers_policy_resource_gen.go index f1ce8ab243..e9a27e180f 100644 --- a/internal/aws/cloudfront/response_headers_policy_resource_gen.go +++ b/internal/aws/cloudfront/response_headers_policy_resource_gen.go @@ -4,11 +4,13 @@ package cloudfront import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -210,7 +212,7 @@ func responseHeadersPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, // "additionalProperties": false, // "properties": { // "FrameOption": { - // "pattern": "", + // "pattern": "^(DENY|SAMEORIGIN)$", // "type": "string" // }, // "Override": { @@ -230,7 +232,7 @@ func responseHeadersPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, // "type": "boolean" // }, // "ReferrerPolicy": { - // "pattern": "", + // "pattern": "^(no-referrer|no-referrer-when-downgrade|origin|origin-when-cross-origin|same-origin|strict-origin|strict-origin-when-cross-origin|unsafe-url)$", // "type": "string" // } // }, @@ -470,6 +472,9 @@ func responseHeadersPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: FrameOption Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(DENY|SAMEORIGIN)$"), ""), + }, }, "override": { // Property: Override @@ -493,6 +498,9 @@ func responseHeadersPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: ReferrerPolicy Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(no-referrer|no-referrer-when-downgrade|origin|origin-when-cross-origin|same-origin|strict-origin|strict-origin-when-cross-origin|unsafe-url)$"), ""), + }, }, }, ), diff --git a/internal/aws/cloudtrail/trail_resource_gen.go b/internal/aws/cloudtrail/trail_resource_gen.go index 7bc48d1294..6133a1ac28 100644 --- a/internal/aws/cloudtrail/trail_resource_gen.go +++ b/internal/aws/cloudtrail/trail_resource_gen.go @@ -4,6 +4,7 @@ package cloudtrail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -386,7 +387,7 @@ func trailResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 3, - // "pattern": "", + // "pattern": "(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9]([a-zA-Z0-9\\._-])*[a-zA-Z0-9]$)", // "type": "string" // } Type: types.StringType, @@ -394,6 +395,7 @@ func trailResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 128), + validate.StringMatch(regexp.MustCompile("(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9]([a-zA-Z0-9\\._-])*[a-zA-Z0-9]$)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/codeartifact/domain_resource_gen.go b/internal/aws/codeartifact/domain_resource_gen.go index 4e44ffdac1..46efbe20dd 100644 --- a/internal/aws/codeartifact/domain_resource_gen.go +++ b/internal/aws/codeartifact/domain_resource_gen.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -43,7 +44,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the domain.", // "maxLength": 50, // "minLength": 2, - // "pattern": "", + // "pattern": "^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$", // "type": "string" // } Description: "The name of the domain.", @@ -51,6 +52,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 50), + validate.StringMatch(regexp.MustCompile("^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -78,7 +80,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the domain. This field is used for GetAtt", // "maxLength": 50, // "minLength": 2, - // "pattern": "", + // "pattern": "^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$", // "type": "string" // } Description: "The name of the domain. This field is used for GetAtt", @@ -93,7 +95,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The 12-digit account ID of the AWS account that owns the domain. This field is used for GetAtt", - // "pattern": "", + // "pattern": "[0-9]{12}", // "type": "string" // } Description: "The 12-digit account ID of the AWS account that owns the domain. This field is used for GetAtt", diff --git a/internal/aws/codeartifact/repository_resource_gen.go b/internal/aws/codeartifact/repository_resource_gen.go index 7726d64a55..58a133543a 100644 --- a/internal/aws/codeartifact/repository_resource_gen.go +++ b/internal/aws/codeartifact/repository_resource_gen.go @@ -4,6 +4,7 @@ package codeartifact import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -58,7 +59,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the domain that contains the repository.", // "maxLength": 50, // "minLength": 2, - // "pattern": "", + // "pattern": "^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$", // "type": "string" // } Description: "The name of the domain that contains the repository.", @@ -66,6 +67,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 50), + validate.StringMatch(regexp.MustCompile("^([a-z][a-z0-9\\-]{0,48}[a-z0-9])$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -76,7 +78,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The 12-digit account ID of the AWS account that owns the domain.", - // "pattern": "", + // "pattern": "[0-9]{12}", // "type": "string" // } Description: "The 12-digit account ID of the AWS account that owns the domain.", @@ -108,7 +110,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the repository. This is used for GetAtt", // "maxLength": 100, // "minLength": 2, - // "pattern": "", + // "pattern": "^([A-Za-z0-9][A-Za-z0-9._\\-]{1,99})$", // "type": "string" // } Description: "The name of the repository. This is used for GetAtt", @@ -138,7 +140,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the repository.", // "maxLength": 100, // "minLength": 2, - // "pattern": "", + // "pattern": "^([A-Za-z0-9][A-Za-z0-9._\\-]{1,99})$", // "type": "string" // } Description: "The name of the repository.", @@ -146,6 +148,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 100), + validate.StringMatch(regexp.MustCompile("^([A-Za-z0-9][A-Za-z0-9._\\-]{1,99})$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/codeguruprofiler/profiling_group_resource_gen.go b/internal/aws/codeguruprofiler/profiling_group_resource_gen.go index 151a5dd0e6..13c6446e0a 100644 --- a/internal/aws/codeguruprofiler/profiling_group_resource_gen.go +++ b/internal/aws/codeguruprofiler/profiling_group_resource_gen.go @@ -4,6 +4,7 @@ package codeguruprofiler import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -30,7 +31,7 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Principals": { // "description": "The principals for the agent permissions.", // "items": { - // "pattern": "", + // "pattern": "^arn:aws([-\\w]*):iam::([0-9]{12}):[\\S]+$", // "type": "string" // }, // "type": "array" @@ -49,6 +50,9 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "The principals for the agent permissions.", Type: types.ListType{ElemType: types.StringType}, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws([-\\w]*):iam::([0-9]{12}):[\\S]+$"), "")), + }, }, }, ), @@ -64,12 +68,12 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "properties": { // "channelId": { // "description": "Unique identifier for each Channel in the notification configuration of a Profiling Group", - // "pattern": "", + // "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", // "type": "string" // }, // "channelUri": { // "description": "Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.", - // "pattern": "", + // "pattern": "^arn:aws([-\\w]*):[a-z-]+:(([a-z]+-)+[0-9]+)?:([0-9]{12}):[^.]+$", // "type": "string" // } // }, @@ -88,12 +92,18 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "Unique identifier for each Channel in the notification configuration of a Profiling Group", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"), ""), + }, }, "channel_uri": { // Property: channelUri Description: "Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws([-\\w]*):[a-z-]+:(([a-z]+-)+[0-9]+)?:([0-9]{12}):[^.]+$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, @@ -105,7 +115,7 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the specified profiling group.", - // "pattern": "", + // "pattern": "^arn:aws([-\\w]*):codeguru-profiler:(([a-z]+-)+[0-9]+):([0-9]{12}):profilingGroup/[^.]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the specified profiling group.", @@ -148,7 +158,7 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the profiling group.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\w-]+$", // "type": "string" // } Description: "The name of the profiling group.", @@ -156,6 +166,7 @@ func profilingGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[\\w-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/codegurureviewer/repository_association_resource_gen.go b/internal/aws/codegurureviewer/repository_association_resource_gen.go index 45384b03b1..09d322a019 100644 --- a/internal/aws/codegurureviewer/repository_association_resource_gen.go +++ b/internal/aws/codegurureviewer/repository_association_resource_gen.go @@ -4,6 +4,7 @@ package codegurureviewer import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The Amazon Resource Name (ARN) of the repository association.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the repository association.", @@ -44,7 +45,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The name of the S3 bucket associated with an associated S3 repository. It must start with `codeguru-reviewer-`.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^\\S(.*\\S)?$", // "type": "string" // } Description: "The name of the S3 bucket associated with an associated S3 repository. It must start with `codeguru-reviewer-`.", @@ -53,6 +54,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^\\S(.*\\S)?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -66,7 +68,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.", @@ -75,6 +77,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -88,7 +91,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "Name of the repository to be associated.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^\\S[\\w.-]*$", // "type": "string" // } Description: "Name of the repository to be associated.", @@ -96,6 +99,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^\\S[\\w.-]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -108,7 +112,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The owner of the repository. For a Bitbucket repository, this is the username for the account that owns the repository.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^\\S(.*\\S)?$", // "type": "string" // } Description: "The owner of the repository. For a Bitbucket repository, this is the username for the account that owns the repository.", @@ -117,6 +121,7 @@ func repositoryAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^\\S(.*\\S)?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/codestarconnections/connection_resource_gen.go b/internal/aws/codestarconnections/connection_resource_gen.go index 5450231c97..50452825ad 100644 --- a/internal/aws/codestarconnections/connection_resource_gen.go +++ b/internal/aws/codestarconnections/connection_resource_gen.go @@ -4,6 +4,7 @@ package codestarconnections import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func connectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between AWS services.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between AWS services.", @@ -77,7 +78,7 @@ func connectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The host arn configured to represent the infrastructure where your third-party provider is installed. You must specify either a ProviderType or a HostArn.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+", // "type": "string" // } Description: "The host arn configured to represent the infrastructure where your third-party provider is installed. You must specify either a ProviderType or a HostArn.", @@ -86,6 +87,7 @@ func connectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -99,7 +101,7 @@ func connectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "[0-9]{12}", // "type": "string" // } Description: "The name of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.", diff --git a/internal/aws/codestarnotifications/notification_rule_resource_gen.go b/internal/aws/codestarnotifications/notification_rule_resource_gen.go index 5e8d4dd07c..20ae8dd8ae 100644 --- a/internal/aws/codestarnotifications/notification_rule_resource_gen.go +++ b/internal/aws/codestarnotifications/notification_rule_resource_gen.go @@ -4,6 +4,7 @@ package codestarnotifications import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func notificationRuleResourceType(ctx context.Context) (tfsdk.ResourceType, erro // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:aws[^:\\s]*:codestar-notifications:[^:\\s]+:\\d{12}:notificationrule\\/(.*\\S)?$", // "type": "string" // } Type: types.StringType, @@ -104,24 +105,28 @@ func notificationRuleResourceType(ctx context.Context) (tfsdk.ResourceType, erro // { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[A-Za-z0-9\\-_ ]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[A-Za-z0-9\\-_ ]+$"), ""), }, }, "resource": { // Property: Resource // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:aws[^:\\s]*:[^:\\s]*:[^:\\s]*:[0-9]{12}:[^\\s]+$", // "type": "string" // } Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[^:\\s]*:[^:\\s]*:[^:\\s]*:[0-9]{12}:[^\\s]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/config/aggregation_authorization_resource_gen.go b/internal/aws/config/aggregation_authorization_resource_gen.go index 75b974ead6..ad641d502e 100644 --- a/internal/aws/config/aggregation_authorization_resource_gen.go +++ b/internal/aws/config/aggregation_authorization_resource_gen.go @@ -4,6 +4,7 @@ package config import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -39,12 +40,15 @@ func aggregationAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceTy // CloudFormation resource type schema: // { // "description": "The 12-digit account ID of the account authorized to aggregate data.", - // "pattern": "", + // "pattern": "^\\d{12}$", // "type": "string" // } Description: "The 12-digit account ID of the account authorized to aggregate data.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^\\d{12}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/config/configuration_aggregator_resource_gen.go b/internal/aws/config/configuration_aggregator_resource_gen.go index 3effe285ac..a35ef51f17 100644 --- a/internal/aws/config/configuration_aggregator_resource_gen.go +++ b/internal/aws/config/configuration_aggregator_resource_gen.go @@ -4,6 +4,7 @@ package config import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -96,7 +97,7 @@ func configurationAggregatorResourceType(ctx context.Context) (tfsdk.ResourceTyp // "description": "The name of the aggregator.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } Description: "The name of the aggregator.", @@ -105,6 +106,7 @@ func configurationAggregatorResourceType(ctx context.Context) (tfsdk.ResourceTyp Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/config/conformance_pack_resource_gen.go b/internal/aws/config/conformance_pack_resource_gen.go index 0acb8c9815..66cdabb720 100644 --- a/internal/aws/config/conformance_pack_resource_gen.go +++ b/internal/aws/config/conformance_pack_resource_gen.go @@ -4,6 +4,7 @@ package config import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -87,7 +88,7 @@ func conformancePackResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Name of the conformance pack which will be assigned as the unique identifier.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z][-a-zA-Z0-9]*", // "type": "string" // } Description: "Name of the conformance pack which will be assigned as the unique identifier.", @@ -95,6 +96,7 @@ func conformancePackResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z][-a-zA-Z0-9]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -156,7 +158,7 @@ func conformancePackResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Location of file containing the template body which points to the conformance pack template that is located in an Amazon S3 bucket. You can only specify one of the template body or template S3Uri fields.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "s3://.*", // "type": "string" // } Description: "Location of file containing the template body which points to the conformance pack template that is located in an Amazon S3 bucket. You can only specify one of the template body or template S3Uri fields.", @@ -164,6 +166,7 @@ func conformancePackResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("s3://.*"), ""), }, // TemplateS3Uri is a write-only property. }, diff --git a/internal/aws/config/organization_conformance_pack_resource_gen.go b/internal/aws/config/organization_conformance_pack_resource_gen.go index d4e4b2f30f..bfdca7b86a 100644 --- a/internal/aws/config/organization_conformance_pack_resource_gen.go +++ b/internal/aws/config/organization_conformance_pack_resource_gen.go @@ -4,6 +4,7 @@ package config import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -134,7 +135,7 @@ func organizationConformancePackResourceType(ctx context.Context) (tfsdk.Resourc // "description": "The name of the organization conformance pack.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z][-a-zA-Z0-9]*", // "type": "string" // } Description: "The name of the organization conformance pack.", @@ -142,6 +143,7 @@ func organizationConformancePackResourceType(ctx context.Context) (tfsdk.Resourc Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z][-a-zA-Z0-9]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -171,7 +173,7 @@ func organizationConformancePackResourceType(ctx context.Context) (tfsdk.Resourc // "description": "Location of file containing the template body.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "s3://.*", // "type": "string" // } Description: "Location of file containing the template body.", @@ -179,6 +181,7 @@ func organizationConformancePackResourceType(ctx context.Context) (tfsdk.Resourc Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("s3://.*"), ""), }, // TemplateS3Uri is a write-only property. }, diff --git a/internal/aws/config/stored_query_resource_gen.go b/internal/aws/config/stored_query_resource_gen.go index 30e8a0356a..a3ac60e935 100644 --- a/internal/aws/config/stored_query_resource_gen.go +++ b/internal/aws/config/stored_query_resource_gen.go @@ -4,6 +4,7 @@ package config import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,13 +41,14 @@ func storedQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\s\\S]*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("[\\s\\S]*"), ""), }, }, "query_expression": { @@ -55,13 +57,14 @@ func storedQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 4096, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\s\\S]*", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 4096), + validate.StringMatch(regexp.MustCompile("[\\s\\S]*"), ""), }, }, "query_id": { @@ -70,7 +73,7 @@ func storedQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 36, // "minLength": 1, - // "pattern": "", + // "pattern": "^\\S+$", // "type": "string" // } Type: types.StringType, @@ -85,13 +88,14 @@ func storedQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/connect/contact_flow_module_resource_gen.go b/internal/aws/connect/contact_flow_module_resource_gen.go index 1eaf637fcf..a496005077 100644 --- a/internal/aws/connect/contact_flow_module_resource_gen.go +++ b/internal/aws/connect/contact_flow_module_resource_gen.go @@ -4,6 +4,7 @@ package connect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The identifier of the contact flow module (ARN).", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/flow-module/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the contact flow module (ARN).", @@ -59,7 +60,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err // { // "description": "The description of the contact flow module.", // "maxLength": 500, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "The description of the contact flow module.", @@ -67,6 +68,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(500), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "instance_arn": { @@ -76,7 +78,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The identifier of the Amazon Connect instance (ARN).", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the Amazon Connect instance (ARN).", @@ -84,6 +86,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"), ""), }, }, "name": { @@ -93,7 +96,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The name of the contact flow module.", // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "The name of the contact flow module.", @@ -101,6 +104,7 @@ func contactFlowModuleResourceType(ctx context.Context) (tfsdk.ResourceType, err Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "state": { diff --git a/internal/aws/connect/contact_flow_resource_gen.go b/internal/aws/connect/contact_flow_resource_gen.go index f768555660..e2eedcd325 100644 --- a/internal/aws/connect/contact_flow_resource_gen.go +++ b/internal/aws/connect/contact_flow_resource_gen.go @@ -4,6 +4,7 @@ package connect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func contactFlowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The identifier of the contact flow (ARN).", // "maxLength": 500, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the contact flow (ARN).", @@ -75,7 +76,7 @@ func contactFlowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The identifier of the Amazon Connect instance (ARN).", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the Amazon Connect instance (ARN).", @@ -83,6 +84,7 @@ func contactFlowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"), ""), }, }, "name": { diff --git a/internal/aws/connect/hours_of_operation_resource_gen.go b/internal/aws/connect/hours_of_operation_resource_gen.go index 45305957d3..9aef73dc62 100644 --- a/internal/aws/connect/hours_of_operation_resource_gen.go +++ b/internal/aws/connect/hours_of_operation_resource_gen.go @@ -4,6 +4,7 @@ package connect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -204,7 +205,7 @@ func hoursOfOperationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the hours of operation.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/operating-hours/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the hours of operation.", @@ -219,12 +220,15 @@ func hoursOfOperationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // CloudFormation resource type schema: // { // "description": "The identifier of the Amazon Connect instance.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the Amazon Connect instance.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"), ""), + }, }, "name": { // Property: Name diff --git a/internal/aws/connect/quick_connect_resource_gen.go b/internal/aws/connect/quick_connect_resource_gen.go index 4d1e14747f..7009d1a1ff 100644 --- a/internal/aws/connect/quick_connect_resource_gen.go +++ b/internal/aws/connect/quick_connect_resource_gen.go @@ -4,6 +4,7 @@ package connect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,12 +42,15 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The identifier of the Amazon Connect instance.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the Amazon Connect instance.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"), ""), + }, }, "name": { // Property: Name @@ -69,7 +73,7 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the quick connect.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/transfer-destination/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the quick connect.", @@ -92,7 +96,7 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "PhoneNumber": { // "description": "The phone number in E.164 format.", - // "pattern": "", + // "pattern": "^\\+[1-9]\\d{1,14}$", // "type": "string" // } // }, @@ -107,12 +111,12 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "ContactFlowArn": { // "description": "The identifier of the contact flow.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$", // "type": "string" // }, // "QueueArn": { // "description": "The identifier for the queue.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/queue/[-a-zA-Z0-9]*$", // "type": "string" // } // }, @@ -137,12 +141,12 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "ContactFlowArn": { // "description": "The identifier of the contact flow.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$", // "type": "string" // }, // "UserArn": { // "description": "The identifier of the user.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$", // "type": "string" // } // }, @@ -171,6 +175,9 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The phone number in E.164 format.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^\\+[1-9]\\d{1,14}$"), ""), + }, }, }, ), @@ -186,12 +193,18 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The identifier of the contact flow.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$"), ""), + }, }, "queue_arn": { // Property: QueueArn Description: "The identifier for the queue.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/queue/[-a-zA-Z0-9]*$"), ""), + }, }, }, ), @@ -220,12 +233,18 @@ func quickConnectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The identifier of the contact flow.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/contact-flow/[-a-zA-Z0-9]*$"), ""), + }, }, "user_arn": { // Property: UserArn Description: "The identifier of the user.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$"), ""), + }, }, }, ), diff --git a/internal/aws/connect/user_hierarchy_group_resource_gen.go b/internal/aws/connect/user_hierarchy_group_resource_gen.go index eb867d5541..9f0116a60f 100644 --- a/internal/aws/connect/user_hierarchy_group_resource_gen.go +++ b/internal/aws/connect/user_hierarchy_group_resource_gen.go @@ -4,6 +4,7 @@ package connect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,12 +26,15 @@ func userHierarchyGroupResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The identifier of the Amazon Connect instance.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the Amazon Connect instance.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"), ""), + }, }, "name": { // Property: Name @@ -53,13 +57,16 @@ func userHierarchyGroupResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the parent user hierarchy group.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the parent user hierarchy group.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -70,7 +77,7 @@ func userHierarchyGroupResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the user hierarchy group.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the user hierarchy group.", diff --git a/internal/aws/connect/user_resource_gen.go b/internal/aws/connect/user_resource_gen.go index e1cb8b676b..12c0d69c52 100644 --- a/internal/aws/connect/user_resource_gen.go +++ b/internal/aws/connect/user_resource_gen.go @@ -4,6 +4,7 @@ package connect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -36,12 +37,15 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The identifier of the hierarchy group for the user.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the hierarchy group for the user.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent-group/[-a-zA-Z0-9]*$"), ""), + }, }, "identity_info": { // Property: IdentityInfo @@ -95,12 +99,15 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The identifier of the Amazon Connect instance.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the Amazon Connect instance.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*$"), ""), + }, }, "password": { // Property: Password @@ -194,12 +201,15 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The identifier of the routing profile for the user.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/routing-profile/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The identifier of the routing profile for the user.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/routing-profile/[-a-zA-Z0-9]*$"), ""), + }, }, "security_profile_arns": { // Property: SecurityProfileArns @@ -209,7 +219,7 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "description": "The identifier of the security profile for the user.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/security-profile/[-a-zA-Z0-9]*$", // "type": "string" // }, // "maxItems": 10, @@ -222,6 +232,7 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 10), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/security-profile/[-a-zA-Z0-9]*$"), "")), }, }, "tags": { @@ -291,7 +302,7 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the user.", - // "pattern": "", + // "pattern": "^arn:aws[-a-z0-9]*:connect:[-a-z0-9]*:[0-9]{12}:instance/[-a-zA-Z0-9]*/agent/[-a-zA-Z0-9]*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the user.", @@ -308,7 +319,7 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The user name for the account.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\\_\\-\\.\\@]+", // "type": "string" // } Description: "The user name for the account.", @@ -316,6 +327,7 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9\\_\\-\\.\\@]+"), ""), }, }, } diff --git a/internal/aws/cur/report_definition_resource_gen.go b/internal/aws/cur/report_definition_resource_gen.go index 7893c97978..e92ea5f5ae 100644 --- a/internal/aws/cur/report_definition_resource_gen.go +++ b/internal/aws/cur/report_definition_resource_gen.go @@ -4,6 +4,7 @@ package cur import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -91,7 +92,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "(arn:aws(-cn)?:billing::[0-9]{12}:billingview/)?[a-zA-Z0-9_\\+=\\.\\-@].{1,30}", // "type": "string" // } Description: "The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs.", @@ -100,6 +101,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("(arn:aws(-cn)?:billing::[0-9]{12}:billingview/)?[a-zA-Z0-9_\\+=\\.\\-@].{1,30}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -168,7 +170,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9A-Za-z!\\-_.*\\'()]+", // "type": "string" // } Description: "The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces.", @@ -176,6 +178,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[0-9A-Za-z!\\-_.*\\'()]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -212,7 +215,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The S3 bucket where AWS delivers the report.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[A-Za-z0-9_\\.\\-]+", // "type": "string" // } Description: "The S3 bucket where AWS delivers the report.", @@ -220,6 +223,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[A-Za-z0-9_\\.\\-]+"), ""), }, }, "s3_prefix": { @@ -229,7 +233,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9A-Za-z!\\-_.*\\'()/]*", // "type": "string" // } Description: "The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.", @@ -237,6 +241,7 @@ func reportDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, erro Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[0-9A-Za-z!\\-_.*\\'()/]*"), ""), }, }, "s3_region": { diff --git a/internal/aws/customerprofiles/domain_resource_gen.go b/internal/aws/customerprofiles/domain_resource_gen.go index 05caa345da..d7070ac567 100644 --- a/internal/aws/customerprofiles/domain_resource_gen.go +++ b/internal/aws/customerprofiles/domain_resource_gen.go @@ -4,6 +4,7 @@ package customerprofiles import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -89,7 +90,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique name of the domain.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // } Description: "The unique name of the domain.", @@ -97,6 +98,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/customerprofiles/integration_resource_gen.go b/internal/aws/customerprofiles/integration_resource_gen.go index 3bc5dfaeac..4e5f3b3c80 100644 --- a/internal/aws/customerprofiles/integration_resource_gen.go +++ b/internal/aws/customerprofiles/integration_resource_gen.go @@ -4,6 +4,7 @@ package customerprofiles import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique name of the domain.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // } Description: "The unique name of the domain.", @@ -49,6 +50,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -62,18 +64,18 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Description": { // "maxLength": 2048, - // "pattern": "", + // "pattern": "[\\w!@#\\-.?,\\s]*", // "type": "string" // }, // "FlowName": { // "maxLength": 256, - // "pattern": "", + // "pattern": "[a-zA-Z0-9][\\w!@#.-]+", // "type": "string" // }, // "KmsArn": { // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "arn:aws:kms:.*:[0-9]+:.*", // "type": "string" // }, // "SourceFlowConfig": { @@ -81,7 +83,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "ConnectorProfileName": { // "maxLength": 256, - // "pattern": "", + // "pattern": "[\\w/!@#+=.-]+", // "type": "string" // }, // "ConnectorType": { @@ -113,7 +115,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Object": { // "additionalProperties": false, // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -128,12 +130,12 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // }, // "BucketPrefix": { // "maxLength": 512, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -154,7 +156,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Object": { // "additionalProperties": false, // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -169,7 +171,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Object": { // "additionalProperties": false, // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -184,7 +186,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Object": { // "additionalProperties": false, // "maxLength": 512, - // "pattern": "", + // "pattern": "\\S+", // "type": "string" // } // }, @@ -332,13 +334,13 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "DestinationField": { // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "SourceFields": { // "items": { // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "type": "array" @@ -368,7 +370,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Property": { // "maxLength": 2048, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } // }, @@ -425,7 +427,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "ScheduleExpression": { // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "ScheduleOffset": { @@ -438,7 +440,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Timezone": { // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -482,6 +484,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile("[\\w!@#\\-.?,\\s]*"), ""), }, }, "flow_name": { @@ -490,6 +493,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9][\\w!@#.-]+"), ""), }, }, "kms_arn": { @@ -498,6 +502,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("arn:aws:kms:.*:[0-9]+:.*"), ""), }, }, "source_flow_config": { @@ -510,6 +515,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("[\\w/!@#+=.-]+"), ""), }, }, "connector_type": { @@ -556,6 +562,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -572,6 +579,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, "bucket_prefix": { @@ -580,6 +588,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -606,6 +615,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -622,6 +632,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -638,6 +649,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("\\S+"), ""), }, }, }, @@ -807,6 +819,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "source_fields": { @@ -815,6 +828,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(2048)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile(".*"), "")), }, }, "task_properties": { @@ -850,6 +864,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".+"), ""), }, }, }, @@ -917,6 +932,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "schedule_offset": { @@ -938,6 +954,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -990,7 +1007,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the ObjectType defined for the 3rd party data in Profile Service", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", // "type": "string" // } Description: "The name of the ObjectType defined for the 3rd party data in Profile Service", @@ -998,6 +1015,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z_][a-zA-Z_0-9-]*$"), ""), }, }, "object_type_names": { @@ -1016,7 +1034,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Value": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", // "type": "string" // } // }, @@ -1045,6 +1063,7 @@ func integrationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z_][a-zA-Z_0-9-]*$"), ""), }, }, }, diff --git a/internal/aws/customerprofiles/object_type_resource_gen.go b/internal/aws/customerprofiles/object_type_resource_gen.go index 2b6445294b..4bfc70bec5 100644 --- a/internal/aws/customerprofiles/object_type_resource_gen.go +++ b/internal/aws/customerprofiles/object_type_resource_gen.go @@ -4,6 +4,7 @@ package customerprofiles import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -68,7 +69,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique name of the domain.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // } Description: "The unique name of the domain.", @@ -76,6 +77,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -125,7 +127,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Name": { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // }, // "ObjectTypeField": { @@ -172,6 +174,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, }, "object_type_field": { @@ -236,7 +239,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Name": { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // }, // "ObjectTypeKeyList": { @@ -250,7 +253,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // }, // "type": "array" @@ -288,6 +291,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, }, "object_type_key_list": { @@ -301,6 +305,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 64)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), "")), }, }, "standard_identifiers": { @@ -355,7 +360,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the profile object type.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", // "type": "string" // } Description: "The name of the profile object type.", @@ -364,6 +369,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z_][a-zA-Z_0-9-]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -434,7 +440,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A unique identifier for the object template.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // } Description: "A unique identifier for the object template.", @@ -442,6 +448,7 @@ func objectTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, }, } diff --git a/internal/aws/databrew/dataset_resource_gen.go b/internal/aws/databrew/dataset_resource_gen.go index 9ebd05d0de..c2fe3a1794 100644 --- a/internal/aws/databrew/dataset_resource_gen.go +++ b/internal/aws/databrew/dataset_resource_gen.go @@ -4,6 +4,7 @@ package databrew import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -501,7 +502,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Filtering expression for a parameter", // "maxLength": 1024, // "minLength": 4, - // "pattern": "", + // "pattern": "^[\u003e\u003c0-9A-Za-z_.,:)(!= ]+$", // "type": "string" // }, // "ValuesMap": { @@ -519,7 +520,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Variable name", // "maxLength": 128, // "minLength": 2, - // "pattern": "", + // "pattern": "^:[A-Za-z0-9_]+$", // "type": "string" // } // }, @@ -564,14 +565,14 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Locale code for a date parameter", // "maxLength": 100, // "minLength": 2, - // "pattern": "", + // "pattern": "^[A-Za-z0-9_\\.#@\\-]+$", // "type": "string" // }, // "TimezoneOffset": { // "description": "Timezone offset", // "maxLength": 6, // "minLength": 1, - // "pattern": "", + // "pattern": "^(Z|[-+](\\d|\\d{2}|\\d{2}:?\\d{2}))$", // "type": "string" // } // }, @@ -587,7 +588,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Filtering expression for a parameter", // "maxLength": 1024, // "minLength": 4, - // "pattern": "", + // "pattern": "^[\u003e\u003c0-9A-Za-z_.,:)(!= ]+$", // "type": "string" // }, // "ValuesMap": { @@ -605,7 +606,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Variable name", // "maxLength": 128, // "minLength": 2, - // "pattern": "", + // "pattern": "^:[A-Za-z0-9_]+$", // "type": "string" // } // }, @@ -715,6 +716,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 1024), + validate.StringMatch(regexp.MustCompile("^[><0-9A-Za-z_.,:)(!= ]+$"), ""), }, }, "values_map": { @@ -736,6 +738,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 128), + validate.StringMatch(regexp.MustCompile("^:[A-Za-z0-9_]+$"), ""), }, }, }, @@ -781,6 +784,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 100), + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9_\\.#@\\-]+$"), ""), }, }, "timezone_offset": { @@ -790,6 +794,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 6), + validate.StringMatch(regexp.MustCompile("^(Z|[-+](\\d|\\d{2}|\\d{2}:?\\d{2}))$"), ""), }, }, }, @@ -807,6 +812,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 1024), + validate.StringMatch(regexp.MustCompile("^[><0-9A-Za-z_.,:)(!= ]+$"), ""), }, }, "values_map": { @@ -828,6 +834,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 128), + validate.StringMatch(regexp.MustCompile("^:[A-Za-z0-9_]+$"), ""), }, }, }, diff --git a/internal/aws/databrew/job_resource_gen.go b/internal/aws/databrew/job_resource_gen.go index 7fa4fe5662..38307c19bf 100644 --- a/internal/aws/databrew/job_resource_gen.go +++ b/internal/aws/databrew/job_resource_gen.go @@ -4,6 +4,7 @@ package databrew import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -819,7 +820,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Z\\_]+$", // "type": "string" // }, // "minItems": 1, @@ -842,7 +843,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Statistic": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Z\\_]+$", // "type": "string" // } // }, @@ -875,7 +876,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Z\\_]+$", // "type": "string" // }, // "minItems": 1, @@ -898,7 +899,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Statistic": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Z\\_]+$", // "type": "string" // } // }, @@ -925,7 +926,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Z\\_]+$", // "type": "string" // }, // "minItems": 1, @@ -942,7 +943,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Z_][A-Z\\\\d_]*$", // "type": "string" // }, // "minItems": 1, @@ -1024,6 +1025,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), validate.ArrayForEach(validate.StringLenBetween(1, 128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[A-Z\\_]+$"), "")), }, }, "overrides": { @@ -1042,6 +1044,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[A-Z\\_]+$"), ""), }, }, }, @@ -1075,6 +1078,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), validate.ArrayForEach(validate.StringLenBetween(1, 128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[A-Z\\_]+$"), "")), }, }, "overrides": { @@ -1093,6 +1097,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[A-Z\\_]+$"), ""), }, }, }, @@ -1122,6 +1127,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), validate.ArrayForEach(validate.StringLenBetween(1, 128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[A-Z\\_]+$"), "")), }, }, }, @@ -1135,6 +1141,7 @@ func jobResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), validate.ArrayForEach(validate.StringLenBetween(1, 128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[A-Z_][A-Z\\\\d_]*$"), "")), }, }, }, diff --git a/internal/aws/databrew/ruleset_resource_gen.go b/internal/aws/databrew/ruleset_resource_gen.go index 88ff8e012c..a86d604eea 100644 --- a/internal/aws/databrew/ruleset_resource_gen.go +++ b/internal/aws/databrew/ruleset_resource_gen.go @@ -4,6 +4,7 @@ package databrew import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -68,7 +69,7 @@ func rulesetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Expression with rule conditions", // "maxLength": 1024, // "minLength": 4, - // "pattern": "", + // "pattern": "^[\u003e\u003c0-9A-Za-z_.,:)(!= ]+$", // "type": "string" // }, // "ColumnSelectors": { @@ -121,7 +122,7 @@ func rulesetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Variable name", // "maxLength": 128, // "minLength": 2, - // "pattern": "", + // "pattern": "^:[A-Za-z0-9_]+$", // "type": "string" // } // }, @@ -184,6 +185,7 @@ func rulesetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 1024), + validate.StringMatch(regexp.MustCompile("^[><0-9A-Za-z_.,:)(!= ]+$"), ""), }, }, "column_selectors": { @@ -251,6 +253,7 @@ func rulesetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 128), + validate.StringMatch(regexp.MustCompile("^:[A-Za-z0-9_]+$"), ""), }, }, }, diff --git a/internal/aws/datasync/agent_resource_gen.go b/internal/aws/datasync/agent_resource_gen.go index cbad92ea25..316505dffd 100644 --- a/internal/aws/datasync/agent_resource_gen.go +++ b/internal/aws/datasync/agent_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Activation key of the Agent.", // "maxLength": 29, - // "pattern": "", + // "pattern": "[A-Z0-9]{5}(-[A-Z0-9]{5}){4}", // "type": "string" // } Description: "Activation key of the Agent.", @@ -34,6 +35,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(29), + validate.StringMatch(regexp.MustCompile("[A-Z0-9]{5}(-[A-Z0-9]{5}){4}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -46,7 +48,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The DataSync Agent ARN.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", // "type": "string" // } Description: "The DataSync Agent ARN.", @@ -63,7 +65,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name configured for the agent. Text reference used to identify the agent in the console.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } Description: "The name configured for the agent. Text reference used to identify the agent in the console.", @@ -71,6 +73,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, "endpoint_type": { @@ -100,7 +103,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$", // "type": "string" // }, // "type": "array" @@ -111,6 +114,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -126,7 +130,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$", // "type": "string" // }, // "type": "array" @@ -137,6 +141,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -158,14 +163,14 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -189,6 +194,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -198,6 +204,7 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, @@ -213,13 +220,16 @@ func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ID of the VPC endpoint that the agent has access to.", - // "pattern": "", + // "pattern": "^vpce-[0-9a-f]{17}$", // "type": "string" // } Description: "The ID of the VPC endpoint that the agent has access to.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^vpce-[0-9a-f]{17}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/datasync/location_efs_resource_gen.go b/internal/aws/datasync/location_efs_resource_gen.go index add1988b19..f5bbc61ab4 100644 --- a/internal/aws/datasync/location_efs_resource_gen.go +++ b/internal/aws/datasync/location_efs_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -32,7 +33,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$", // "type": "string" // }, // "maxItems": 5, @@ -42,7 +43,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SubnetArn": { // "description": "The ARN of the subnet that DataSync uses to access the target EFS file system.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$", // "type": "string" // } // }, @@ -63,6 +64,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -75,6 +77,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$"), ""), }, }, }, @@ -90,7 +93,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) for the Amazon EFS file system.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):elasticfilesystem:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the Amazon EFS file system.", @@ -98,6 +101,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):elasticfilesystem:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -110,7 +114,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the Amazon EFS file system location that is created.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the Amazon EFS file system location that is created.", @@ -126,7 +130,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The URL of the EFS location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9.\\-/]+$", // "type": "string" // } Description: "The URL of the EFS location that was described.", @@ -142,7 +146,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "A subdirectory in the location's path. This subdirectory in the EFS file system is used to read data from the EFS source location or write data to the EFS destination.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "A subdirectory in the location's path. This subdirectory in the EFS file system is used to read data from the EFS source location or write data to the EFS destination.", @@ -151,6 +155,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -172,14 +177,14 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -203,6 +208,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -212,6 +218,7 @@ func locationEFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, diff --git a/internal/aws/datasync/location_fsx_windows_resource_gen.go b/internal/aws/datasync/location_fsx_windows_resource_gen.go index cc7d4f07f5..6242a0efe2 100644 --- a/internal/aws/datasync/location_fsx_windows_resource_gen.go +++ b/internal/aws/datasync/location_fsx_windows_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The name of the Windows domain that the FSx for Windows server belongs to.", // "maxLength": 253, - // "pattern": "", + // "pattern": "^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$", // "type": "string" // } Description: "The name of the Windows domain that the FSx for Windows server belongs to.", @@ -35,6 +36,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(253), + validate.StringMatch(regexp.MustCompile("^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -47,7 +49,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The Amazon Resource Name (ARN) for the FSx for Windows file system.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):fsx:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the FSx for Windows file system.", @@ -55,6 +57,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):fsx:[a-z\\-0-9]*:[0-9]{12}:file-system/fs-.*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -67,7 +70,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The Amazon Resource Name (ARN) of the Amazon FSx for Windows file system location that is created.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the Amazon FSx for Windows file system location that is created.", @@ -83,7 +86,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The URL of the FSx for Windows location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$", // "type": "string" // } Description: "The URL of the FSx for Windows location that was described.", @@ -99,7 +102,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The password of the user who has the permissions to access files and folders in the FSx for Windows file system.", // "maxLength": 104, - // "pattern": "", + // "pattern": "^.{0,104}$", // "type": "string" // } Description: "The password of the user who has the permissions to access files and folders in the FSx for Windows file system.", @@ -107,6 +110,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(104), + validate.StringMatch(regexp.MustCompile("^.{0,104}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -121,7 +125,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$", // "type": "string" // }, // "type": "array" @@ -131,6 +135,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -143,7 +148,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "A subdirectory in the location's path.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "A subdirectory in the location's path.", @@ -152,6 +157,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -173,14 +179,14 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -204,6 +210,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -213,6 +220,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, @@ -229,7 +237,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The user who has the permissions to access files and folders in the FSx for Windows file system.", // "maxLength": 104, - // "pattern": "", + // "pattern": "^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$", // "type": "string" // } Description: "The user who has the permissions to access files and folders in the FSx for Windows file system.", @@ -237,6 +245,7 @@ func locationFSxWindowsResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(104), + validate.StringMatch(regexp.MustCompile("^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/datasync/location_hdfs_resource_gen.go b/internal/aws/datasync/location_hdfs_resource_gen.go index fa9bdd2893..bc6712115c 100644 --- a/internal/aws/datasync/location_hdfs_resource_gen.go +++ b/internal/aws/datasync/location_hdfs_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -28,7 +29,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", // "type": "string" // }, // "maxItems": 4, @@ -41,6 +42,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 4), validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -115,7 +117,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique identity, or principal, to which Kerberos can assign tickets.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } Description: "The unique identity, or principal, to which Kerberos can assign tickets.", @@ -123,6 +125,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, "kms_key_provider_uri": { @@ -132,7 +135,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The identifier for the Key Management Server where the encryption keys that encrypt data inside HDFS clusters are stored.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^kms:\\/\\/http[s]?@(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])(;(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9]))*:[0-9]{1,5}\\/kms$", // "type": "string" // } Description: "The identifier for the Key Management Server where the encryption keys that encrypt data inside HDFS clusters are stored.", @@ -140,6 +143,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^kms:\\/\\/http[s]?@(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])(;(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9]))*:[0-9]{1,5}\\/kms$"), ""), }, }, "location_arn": { @@ -148,7 +152,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the HDFS location.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the HDFS location.", @@ -164,7 +168,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The URL of the HDFS location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw|hdfs)://[a-zA-Z0-9.:/\\-]+$", // "type": "string" // } Description: "The URL of the HDFS location that was described.", @@ -187,7 +191,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Hostname": { // "description": "The DNS name or IP address of the Name Node in the customer's on premises HDFS cluster.", // "maxLength": 255, - // "pattern": "", + // "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", // "type": "string" // }, // "Port": { @@ -216,6 +220,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$"), ""), }, }, "port": { @@ -345,7 +350,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The user name that has read and write permissions on the specified HDFS cluster.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[_.A-Za-z0-9][-_.A-Za-z0-9]*$", // "type": "string" // } Description: "The user name that has read and write permissions on the specified HDFS cluster.", @@ -353,6 +358,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[_.A-Za-z0-9][-_.A-Za-z0-9]*$"), ""), }, }, "subdirectory": { @@ -361,7 +367,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The subdirectory in HDFS that is used to read data from the HDFS source location or write data to the HDFS destination.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "The subdirectory in HDFS that is used to read data from the HDFS source location or write data to the HDFS destination.", @@ -369,6 +375,7 @@ func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, // Subdirectory is a write-only property. }, diff --git a/internal/aws/datasync/location_nfs_resource_gen.go b/internal/aws/datasync/location_nfs_resource_gen.go index 5208d38726..c9c38aed56 100644 --- a/internal/aws/datasync/location_nfs_resource_gen.go +++ b/internal/aws/datasync/location_nfs_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -27,7 +28,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the NFS location.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the NFS location.", @@ -43,7 +44,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The URL of the NFS location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$", // "type": "string" // } Description: "The URL of the NFS location that was described.", @@ -122,7 +123,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", // "type": "string" // }, // "maxItems": 4, @@ -146,6 +147,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 4), validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -161,7 +163,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name of the NFS server. This value is the IP address or DNS name of the NFS server.", // "maxLength": 255, - // "pattern": "", + // "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", // "type": "string" // } Description: "The name of the NFS server. This value is the IP address or DNS name of the NFS server.", @@ -169,6 +171,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -181,7 +184,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The subdirectory in the NFS file system that is used to read data from the NFS source location or write data to the NFS destination.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "The subdirectory in the NFS file system that is used to read data from the NFS source location or write data to the NFS destination.", @@ -189,6 +192,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, // Subdirectory is a write-only property. }, @@ -206,14 +210,14 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -237,6 +241,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -246,6 +251,7 @@ func locationNFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, diff --git a/internal/aws/datasync/location_object_storage_resource_gen.go b/internal/aws/datasync/location_object_storage_resource_gen.go index f7afdfe798..1de190a9c0 100644 --- a/internal/aws/datasync/location_object_storage_resource_gen.go +++ b/internal/aws/datasync/location_object_storage_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "Optional. The access key is used if credentials are required to access the self-managed object storage server.", // "maxLength": 200, // "minLength": 8, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } Description: "Optional. The access key is used if credentials are required to access the self-managed object storage server.", @@ -35,6 +36,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(8, 200), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, "agent_arns": { @@ -45,7 +47,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", // "type": "string" // }, // "maxItems": 4, @@ -58,6 +60,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 4), validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -70,7 +73,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The name of the bucket on the self-managed object storage server.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "The name of the bucket on the self-managed object storage server.", @@ -78,6 +81,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -90,7 +94,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // { // "description": "The Amazon Resource Name (ARN) of the location that is created.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the location that is created.", @@ -106,7 +110,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // { // "description": "The URL of the object storage location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw|object-storage)://[a-zA-Z0-9./\\-]+$", // "type": "string" // } Description: "The URL of the object storage location that was described.", @@ -123,7 +127,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "Optional. The secret key is used if credentials are required to access the self-managed object storage server.", // "maxLength": 200, // "minLength": 8, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } Description: "Optional. The secret key is used if credentials are required to access the self-managed object storage server.", @@ -131,6 +135,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(8, 200), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, // SecretKey is a write-only property. }, @@ -140,7 +145,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // { // "description": "The name of the self-managed object storage server. This value is the IP address or Domain Name Service (DNS) name of the object storage server.", // "maxLength": 255, - // "pattern": "", + // "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", // "type": "string" // } Description: "The name of the self-managed object storage server. This value is the IP address or Domain Name Service (DNS) name of the object storage server.", @@ -148,6 +153,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -197,7 +203,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // { // "description": "The subdirectory in the self-managed object storage server that is used to read data from.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\p{Zs}]*$", // "type": "string" // } Description: "The subdirectory in the self-managed object storage server that is used to read data from.", @@ -205,6 +211,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\p{Zs}]*$"), ""), }, // Subdirectory is a write-only property. }, @@ -222,14 +229,14 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -253,6 +260,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -262,6 +270,7 @@ func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, diff --git a/internal/aws/datasync/location_s3_resource_gen.go b/internal/aws/datasync/location_s3_resource_gen.go index 9e9892521b..ec925b3f3a 100644 --- a/internal/aws/datasync/location_s3_resource_gen.go +++ b/internal/aws/datasync/location_s3_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the Amazon S3 bucket location.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the Amazon S3 bucket location.", @@ -42,7 +43,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The URL of the S3 location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9.\\-/]+$", // "type": "string" // } Description: "The URL of the S3 location that was described.", @@ -58,7 +59,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the Amazon S3 bucket.", // "maxLength": 156, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):s3:[a-z\\-0-9]*:[0-9]*:.*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the Amazon S3 bucket.", @@ -66,6 +67,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(156), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):s3:[a-z\\-0-9]*:[0-9]*:.*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -82,7 +84,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketAccessRoleArn": { // "description": "The ARN of the IAM role of the Amazon S3 bucket.", // "maxLength": 2048, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):iam::[0-9]{12}:role/.*$", // "type": "string" // } // }, @@ -101,6 +103,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):iam::[0-9]{12}:role/.*$"), ""), }, }, }, @@ -152,7 +155,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is used to read data from the S3 source location or write data to the S3 destination.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}\\p{C}]*$", // "type": "string" // } Description: "A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is used to read data from the S3 source location or write data to the S3 destination.", @@ -161,6 +164,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}\\p{C}]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -182,14 +186,14 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -213,6 +217,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -222,6 +227,7 @@ func locationS3ResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, diff --git a/internal/aws/datasync/location_smb_resource_gen.go b/internal/aws/datasync/location_smb_resource_gen.go index e1d0649859..f59411a8f1 100644 --- a/internal/aws/datasync/location_smb_resource_gen.go +++ b/internal/aws/datasync/location_smb_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -29,7 +30,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": false, // "items": { // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", // "type": "string" // }, // "maxItems": 4, @@ -42,6 +43,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 4), validate.ArrayForEach(validate.StringLenAtMost(128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -53,7 +55,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name of the Windows domain that the SMB server belongs to.", // "maxLength": 253, - // "pattern": "", + // "pattern": "^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$", // "type": "string" // } Description: "The name of the Windows domain that the SMB server belongs to.", @@ -61,6 +63,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(253), + validate.StringMatch(regexp.MustCompile("^([A-Za-z0-9]+[A-Za-z0-9-.]*)*[A-Za-z0-9-]*[A-Za-z0-9]$"), ""), }, }, "location_arn": { @@ -69,7 +72,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the SMB location that is created.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the SMB location that is created.", @@ -85,7 +88,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The URL of the SMB location that was described.", // "maxLength": 4356, - // "pattern": "", + // "pattern": "^(efs|nfs|s3|smb|fsxw)://[a-zA-Z0-9./\\-]+$", // "type": "string" // } Description: "The URL of the SMB location that was described.", @@ -156,7 +159,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The password of the user who can mount the share and has the permissions to access files and folders in the SMB share.", // "maxLength": 104, - // "pattern": "", + // "pattern": "^.{0,104}$", // "type": "string" // } Description: "The password of the user who can mount the share and has the permissions to access files and folders in the SMB share.", @@ -164,6 +167,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(104), + validate.StringMatch(regexp.MustCompile("^.{0,104}$"), ""), }, // Password is a write-only property. }, @@ -173,7 +177,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name of the SMB server. This value is the IP address or Domain Name Service (DNS) name of the SMB server.", // "maxLength": 255, - // "pattern": "", + // "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", // "type": "string" // } Description: "The name of the SMB server. This value is the IP address or Domain Name Service (DNS) name of the SMB server.", @@ -181,6 +185,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -193,7 +198,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The subdirectory in the SMB file system that is used to read data from the SMB source location or write data to the SMB destination", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "The subdirectory in the SMB file system that is used to read data from the SMB source location or write data to the SMB destination", @@ -201,6 +206,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, // Subdirectory is a write-only property. }, @@ -218,14 +224,14 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -249,6 +255,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -258,6 +265,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, @@ -274,7 +282,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The user who can mount the share, has the permissions to access files and folders in the SMB share.", // "maxLength": 104, - // "pattern": "", + // "pattern": "^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$", // "type": "string" // } Description: "The user who can mount the share, has the permissions to access files and folders in the SMB share.", @@ -282,6 +290,7 @@ func locationSMBResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(104), + validate.StringMatch(regexp.MustCompile("^[^\\x5B\\x5D\\\\/:;|=,+*?]{1,104}$"), ""), }, }, } diff --git a/internal/aws/datasync/task_resource_gen.go b/internal/aws/datasync/task_resource_gen.go index 9087f90533..661d141fdd 100644 --- a/internal/aws/datasync/task_resource_gen.go +++ b/internal/aws/datasync/task_resource_gen.go @@ -4,6 +4,7 @@ package datasync import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task.", // "maxLength": 562, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\\-0-9]*:[0-9]{12}:log-group:([^:\\*]*)(:\\*)?$", // "type": "string" // } Description: "The ARN of the Amazon CloudWatch log group that is used to monitor and log events in the task.", @@ -34,6 +35,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(562), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):logs:[a-z\\-0-9]*:[0-9]{12}:log-group:([^:\\*]*)(:\\*)?$"), ""), }, }, "destination_location_arn": { @@ -42,7 +44,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The ARN of an AWS storage resource's location.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The ARN of an AWS storage resource's location.", @@ -50,6 +52,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -62,7 +65,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Names (ARNs) of the destination ENIs (Elastic Network Interfaces) that were created for your subnet.", // "insertionOrder": false, // "items": { - // "pattern": "", + // "pattern": "^arn:aws[\\-a-z]{0,}:ec2:[a-z\\-0-9]*:[0-9]{12}:network-interface/eni-[0-9a-f]+$", // "type": "string" // }, // "maxItems": 128, @@ -119,13 +122,13 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SIMPLE_PATTERN" // ], // "maxLength": 128, - // "pattern": "", + // "pattern": "^[A-Z0-9_]+$", // "type": "string" // }, // "Value": { // "description": "A single filter string that consists of the patterns to include or exclude. The patterns are delimited by \"|\".", // "maxLength": 409600, - // "pattern": "", + // "pattern": "^[^\\x00]+$", // "type": "string" // } // }, @@ -144,6 +147,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^[A-Z0-9_]+$"), ""), validate.StringInSlice([]string{ "SIMPLE_PATTERN", }), @@ -156,6 +160,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(409600), + validate.StringMatch(regexp.MustCompile("^[^\\x00]+$"), ""), }, }, }, @@ -184,13 +189,13 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SIMPLE_PATTERN" // ], // "maxLength": 128, - // "pattern": "", + // "pattern": "^[A-Z0-9_]+$", // "type": "string" // }, // "Value": { // "description": "A single filter string that consists of the patterns to include or exclude. The patterns are delimited by \"|\".", // "maxLength": 409600, - // "pattern": "", + // "pattern": "^[^\\x00]+$", // "type": "string" // } // }, @@ -209,6 +214,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^[A-Z0-9_]+$"), ""), validate.StringInSlice([]string{ "SIMPLE_PATTERN", }), @@ -221,6 +227,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(409600), + validate.StringMatch(regexp.MustCompile("^[^\\x00]+$"), ""), }, }, }, @@ -241,7 +248,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of a task. This value is a text reference that is used to identify the task in the console.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } Description: "The name of a task. This value is a text reference that is used to identify the task in the console.", @@ -249,6 +256,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, "options": { @@ -567,7 +575,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ScheduleExpression": { // "description": "A cron expression that specifies when AWS DataSync initiates a scheduled transfer from a source to a destination location", // "maxLength": 256, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\ \\_\\*\\?\\,\\|\\^\\-\\/\\#\\s\\(\\)\\+]*$", // "type": "string" // } // }, @@ -586,6 +594,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\ \\_\\*\\?\\,\\|\\^\\-\\/\\#\\s\\(\\)\\+]*$"), ""), }, }, }, @@ -598,7 +607,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The ARN of the source location for the task.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The ARN of the source location for the task.", @@ -606,6 +615,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -618,7 +628,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Names (ARNs) of the source ENIs (Elastic Network Interfaces) that were created for your subnet.", // "insertionOrder": false, // "items": { - // "pattern": "", + // "pattern": "^arn:aws[\\-a-z]{0,}:ec2:[a-z\\-0-9]*:[0-9]{12}:network-interface/eni-[0-9a-f]+$", // "type": "string" // }, // "maxItems": 128, @@ -667,14 +677,14 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, @@ -698,6 +708,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { @@ -707,6 +718,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, @@ -723,7 +735,7 @@ func taskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The ARN of the task.", // "maxLength": 128, - // "pattern": "", + // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]*:[0-9]{12}:task/task-[0-9a-f]{17}$", // "type": "string" // } Description: "The ARN of the task.", diff --git a/internal/aws/detective/member_invitation_resource_gen.go b/internal/aws/detective/member_invitation_resource_gen.go index f35500bdc7..3ffd98e918 100644 --- a/internal/aws/detective/member_invitation_resource_gen.go +++ b/internal/aws/detective/member_invitation_resource_gen.go @@ -4,6 +4,7 @@ package detective import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,12 +43,15 @@ func memberInvitationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // CloudFormation resource type schema: // { // "description": "The ARN of the graph to which the member account will be invited", - // "pattern": "", + // "pattern": "arn:aws(-[\\w]+)*:detective:(([a-z]+-)+[0-9]+):[0-9]{12}:graph:[0-9a-f]{32}", // "type": "string" // } Description: "The ARN of the graph to which the member account will be invited", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:aws(-[\\w]+)*:detective:(([a-z]+-)+[0-9]+):[0-9]{12}:graph:[0-9a-f]{32}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -57,24 +61,30 @@ func memberInvitationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // CloudFormation resource type schema: // { // "description": "The root email address for the account to be invited, for validation. Updating this field has no effect.", - // "pattern": "", + // "pattern": ".*@.*", // "type": "string" // } Description: "The root email address for the account to be invited, for validation. Updating this field has no effect.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*@.*"), ""), + }, }, "member_id": { // Property: MemberId // CloudFormation resource type schema: // { // "description": "The AWS account ID to be invited to join the graph as a member", - // "pattern": "", + // "pattern": "[0-9]{12}", // "type": "string" // } Description: "The AWS account ID to be invited to join the graph as a member", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[0-9]{12}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/devopsguru/notification_channel_resource_gen.go b/internal/aws/devopsguru/notification_channel_resource_gen.go index 3090e7efc1..cacd5e20f7 100644 --- a/internal/aws/devopsguru/notification_channel_resource_gen.go +++ b/internal/aws/devopsguru/notification_channel_resource_gen.go @@ -4,6 +4,7 @@ package devopsguru import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -34,7 +35,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e // "TopicArn": { // "maxLength": 1024, // "minLength": 36, - // "pattern": "", + // "pattern": "^arn:aws[a-z0-9-]*:sns:[a-z0-9-]+:\\d{12}:[^:]+$", // "type": "string" // } // }, @@ -57,6 +58,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(36, 1024), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z0-9-]*:sns:[a-z0-9-]+:\\d{12}:[^:]+$"), ""), }, }, }, @@ -77,7 +79,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e // "description": "The ID of a notification channel.", // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } Description: "The ID of a notification channel.", diff --git a/internal/aws/devopsguru/resource_collection_resource_gen.go b/internal/aws/devopsguru/resource_collection_resource_gen.go index 800ed193e7..1b6d2a6686 100644 --- a/internal/aws/devopsguru/resource_collection_resource_gen.go +++ b/internal/aws/devopsguru/resource_collection_resource_gen.go @@ -4,6 +4,7 @@ package devopsguru import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -36,7 +37,7 @@ func resourceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er // "items": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z*]+[a-zA-Z0-9-]*$", // "type": "string" // }, // "maxItems": 200, @@ -65,6 +66,7 @@ func resourceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 200), validate.ArrayForEach(validate.StringLenBetween(1, 128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z*]+[a-zA-Z0-9-]*$"), "")), }, }, }, diff --git a/internal/aws/ec2/ec2_fleet_resource_gen.go b/internal/aws/ec2/ec2_fleet_resource_gen.go index c32e1570d3..580f2ebc44 100644 --- a/internal/aws/ec2/ec2_fleet_resource_gen.go +++ b/internal/aws/ec2/ec2_fleet_resource_gen.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -76,7 +77,7 @@ func eC2FleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "LaunchTemplateName": { // "maxLength": 128, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\\(\\)\\.\\-/_]+", // "type": "string" // }, // "Version": { @@ -206,7 +207,7 @@ func eC2FleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\\.\\*]+", // "type": "string" // }, // "type": "array", @@ -389,6 +390,7 @@ func eC2FleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9\\(\\)\\.\\-/_]+"), ""), }, }, "version": { @@ -552,6 +554,7 @@ func eC2FleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 30)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9\\.\\*]+"), "")), }, }, "instance_generations": { diff --git a/internal/aws/ec2/enclave_certificate_iam_role_association_resource_gen.go b/internal/aws/ec2/enclave_certificate_iam_role_association_resource_gen.go index 6c7f7f6b19..fe38c3498c 100644 --- a/internal/aws/ec2/enclave_certificate_iam_role_association_resource_gen.go +++ b/internal/aws/ec2/enclave_certificate_iam_role_association_resource_gen.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func enclaveCertificateIamRoleAssociationResourceType(ctx context.Context) (tfsd // "description": "The Amazon Resource Name (ARN) of the ACM certificate with which to associate the IAM role.", // "maxLength": 1283, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:acm:[A-Za-z0-9-]{1,64}:([0-9]{12})?:certificate/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the ACM certificate with which to associate the IAM role.", @@ -35,6 +36,7 @@ func enclaveCertificateIamRoleAssociationResourceType(ctx context.Context) (tfsd Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1283), + validate.StringMatch(regexp.MustCompile("^arn:aws[A-Za-z0-9-]{0,64}:acm:[A-Za-z0-9-]{1,64}:([0-9]{12})?:certificate/.+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -89,7 +91,7 @@ func enclaveCertificateIamRoleAssociationResourceType(ctx context.Context) (tfsd // "description": "The Amazon Resource Name (ARN) of the IAM role to associate with the ACM certificate. You can associate up to 16 IAM roles with an ACM certificate.", // "maxLength": 1283, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:iam:.*:([0-9]{12})?:role/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the IAM role to associate with the ACM certificate. You can associate up to 16 IAM roles with an ACM certificate.", @@ -97,6 +99,7 @@ func enclaveCertificateIamRoleAssociationResourceType(ctx context.Context) (tfsd Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1283), + validate.StringMatch(regexp.MustCompile("^arn:aws[A-Za-z0-9-]{0,64}:iam:.*:([0-9]{12})?:role/.+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/ec2/spot_fleet_resource_gen.go b/internal/aws/ec2/spot_fleet_resource_gen.go index e7075a2355..6498a84d1f 100644 --- a/internal/aws/ec2/spot_fleet_resource_gen.go +++ b/internal/aws/ec2/spot_fleet_resource_gen.go @@ -4,6 +4,7 @@ package ec2 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -262,7 +263,7 @@ func spotFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\\.\\*]+", // "type": "string" // }, // "type": "array", @@ -620,7 +621,7 @@ func spotFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "LaunchTemplateName": { // "maxLength": 128, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\\(\\)\\.\\-/_]+", // "type": "string" // }, // "Version": { @@ -753,7 +754,7 @@ func spotFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 30, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\\.\\*]+", // "type": "string" // }, // "type": "array", @@ -1342,6 +1343,7 @@ func spotFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 30)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9\\.\\*]+"), "")), }, }, "instance_generations": { @@ -1810,6 +1812,7 @@ func spotFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9\\(\\)\\.\\-/_]+"), ""), }, }, "version": { @@ -1973,6 +1976,7 @@ func spotFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 30)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9\\.\\*]+"), "")), }, }, "instance_generations": { diff --git a/internal/aws/ecr/pull_through_cache_rule_resource_gen.go b/internal/aws/ecr/pull_through_cache_rule_resource_gen.go index 9d3f5dab98..6375129792 100644 --- a/internal/aws/ecr/pull_through_cache_rule_resource_gen.go +++ b/internal/aws/ecr/pull_through_cache_rule_resource_gen.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func pullThroughCacheRuleResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The ECRRepositoryPrefix is a custom alias for upstream registry url.", // "maxLength": 20, // "minLength": 2, - // "pattern": "", + // "pattern": "^([a-z0-9]+(?:[._-][a-z0-9]+)*)$", // "type": "string" // } Description: "The ECRRepositoryPrefix is a custom alias for upstream registry url.", @@ -36,6 +37,7 @@ func pullThroughCacheRuleResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 20), + validate.StringMatch(regexp.MustCompile("^([a-z0-9]+(?:[._-][a-z0-9]+)*)$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/ecr/registry_policy_resource_gen.go b/internal/aws/ecr/registry_policy_resource_gen.go index 152d9e23fb..920fc07d9a 100644 --- a/internal/aws/ecr/registry_policy_resource_gen.go +++ b/internal/aws/ecr/registry_policy_resource_gen.go @@ -37,7 +37,7 @@ func registryPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The registry id.", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Description: "The registry id.", diff --git a/internal/aws/ecr/replication_configuration_resource_gen.go b/internal/aws/ecr/replication_configuration_resource_gen.go index d630857cd1..a97da637d5 100644 --- a/internal/aws/ecr/replication_configuration_resource_gen.go +++ b/internal/aws/ecr/replication_configuration_resource_gen.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -55,12 +56,12 @@ func replicationConfigurationResourceType(ctx context.Context) (tfsdk.ResourceTy // "properties": { // "Region": { // "description": "A Region to replicate to.", - // "pattern": "", + // "pattern": "[0-9a-z-]{2,25}", // "type": "string" // }, // "RegistryId": { // "description": "The account ID of the destination registry to replicate to.", - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } // }, @@ -82,7 +83,7 @@ func replicationConfigurationResourceType(ctx context.Context) (tfsdk.ResourceTy // "properties": { // "Filter": { // "description": "The repository filter to be applied for replication.", - // "pattern": "", + // "pattern": "^(?:[a-z0-9]+(?:[._-][a-z0-9]*)*/)*[a-z0-9]*(?:[._-][a-z0-9]*)*$", // "type": "string" // }, // "FilterType": { @@ -137,12 +138,18 @@ func replicationConfigurationResourceType(ctx context.Context) (tfsdk.ResourceTy Description: "A Region to replicate to.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[0-9a-z-]{2,25}"), ""), + }, }, "registry_id": { // Property: RegistryId Description: "The account ID of the destination registry to replicate to.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, @@ -162,6 +169,9 @@ func replicationConfigurationResourceType(ctx context.Context) (tfsdk.ResourceTy Description: "The repository filter to be applied for replication.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(?:[a-z0-9]+(?:[._-][a-z0-9]*)*/)*[a-z0-9]*(?:[._-][a-z0-9]*)*$"), ""), + }, }, "filter_type": { // Property: FilterType diff --git a/internal/aws/ecr/repository_resource_gen.go b/internal/aws/ecr/repository_resource_gen.go index 496573628f..446fe988b0 100644 --- a/internal/aws/ecr/repository_resource_gen.go +++ b/internal/aws/ecr/repository_resource_gen.go @@ -4,6 +4,7 @@ package ecr import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -165,7 +166,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. ", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } // }, @@ -190,6 +191,7 @@ func repositoryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, }, }, diff --git a/internal/aws/efs/access_point_resource_gen.go b/internal/aws/efs/access_point_resource_gen.go index c49aad5ab7..85e2ebc4e3 100644 --- a/internal/aws/efs/access_point_resource_gen.go +++ b/internal/aws/efs/access_point_resource_gen.go @@ -4,6 +4,7 @@ package efs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -212,7 +213,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "Permissions": { // "description": "Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing the file's mode bits.", - // "pattern": "", + // "pattern": "^[0-7]{3,4}$", // "type": "string" // } // }, @@ -257,6 +258,9 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing the file's mode bits.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-7]{3,4}$"), ""), + }, }, }, ), diff --git a/internal/aws/eks/cluster_resource_gen.go b/internal/aws/eks/cluster_resource_gen.go index 4427e17394..e493837b29 100644 --- a/internal/aws/eks/cluster_resource_gen.go +++ b/internal/aws/eks/cluster_resource_gen.go @@ -4,6 +4,7 @@ package eks import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -316,7 +317,7 @@ func clusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The unique name to give to your cluster.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9A-Za-z][A-Za-z0-9\\-_]*", // "type": "string" // } Description: "The unique name to give to your cluster.", @@ -325,6 +326,7 @@ func clusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[0-9A-Za-z][A-Za-z0-9\\-_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -520,12 +522,15 @@ func clusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The desired Kubernetes version for your cluster. If you don't specify a value here, the latest version available in Amazon EKS is used.", - // "pattern": "", + // "pattern": "1\\.\\d\\d", // "type": "string" // } Description: "The desired Kubernetes version for your cluster. If you don't specify a value here, the latest version available in Amazon EKS is used.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("1\\.\\d\\d"), ""), + }, }, } diff --git a/internal/aws/elasticache/user_group_resource_gen.go b/internal/aws/elasticache/user_group_resource_gen.go index 0aaaf1fd90..cd2cea3593 100644 --- a/internal/aws/elasticache/user_group_resource_gen.go +++ b/internal/aws/elasticache/user_group_resource_gen.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -75,12 +76,15 @@ func userGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ID of the user group.", - // "pattern": "", + // "pattern": "[a-z][a-z0-9\\\\-]*", // "type": "string" // } Description: "The ID of the user group.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\\\-]*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/elasticache/user_resource_gen.go b/internal/aws/elasticache/user_resource_gen.go index f4be6751eb..c381d8c967 100644 --- a/internal/aws/elasticache/user_resource_gen.go +++ b/internal/aws/elasticache/user_resource_gen.go @@ -4,6 +4,7 @@ package elasticache import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -120,12 +121,15 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ID of the user.", - // "pattern": "", + // "pattern": "[a-z][a-z0-9\\\\-]*", // "type": "string" // } Description: "The ID of the user.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\\\-]*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/emr/studio_resource_gen.go b/internal/aws/emr/studio_resource_gen.go index 7a44d96517..ce8fd82cf6 100644 --- a/internal/aws/emr/studio_resource_gen.go +++ b/internal/aws/emr/studio_resource_gen.go @@ -4,6 +4,7 @@ package emr import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the EMR Studio.", - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the EMR Studio.", @@ -66,7 +67,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The default Amazon S3 location to back up EMR Studio Workspaces and notebook files. A Studio user can select an alternative Amazon S3 location when creating a Workspace.", // "maxLength": 10280, // "minLength": 6, - // "pattern": "", + // "pattern": "^s3://.*", // "type": "string" // } Description: "The default Amazon S3 location to back up EMR Studio Workspaces and notebook files. A Studio user can select an alternative Amazon S3 location when creating a Workspace.", @@ -74,6 +75,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(6, 10280), + validate.StringMatch(regexp.MustCompile("^s3://.*"), ""), }, }, "description": { @@ -99,7 +101,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by VpcId.", // "maxLength": 256, // "minLength": 4, - // "pattern": "", + // "pattern": "^sg-[a-zA-Z0-9\\-._]+$", // "type": "string" // } Description: "The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by VpcId.", @@ -107,6 +109,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 256), + validate.StringMatch(regexp.MustCompile("^sg-[a-zA-Z0-9\\-._]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -118,7 +121,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Your identity provider's authentication endpoint. Amazon EMR Studio redirects federated users to this endpoint for authentication when logging in to a Studio with the Studio URL.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^https://[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])(:[0-9]*)*([?/#].*)?$", // "type": "string" // } Description: "Your identity provider's authentication endpoint. Amazon EMR Studio redirects federated users to this endpoint for authentication when logging in to a Studio with the Studio URL.", @@ -126,6 +129,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile("^https://[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])(:[0-9]*)*([?/#].*)?$"), ""), }, }, "idp_relay_state_parameter_name": { @@ -151,7 +155,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A descriptive name for the Amazon EMR Studio.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_-]+", // "type": "string" // } Description: "A descriptive name for the Amazon EMR Studio.", @@ -159,6 +163,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_-]+"), ""), }, }, "service_role": { @@ -166,12 +171,15 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The IAM role that will be assumed by the Amazon EMR Studio. The service role provides a way for Amazon EMR Studio to interoperate with other AWS services.", - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The IAM role that will be assumed by the Amazon EMR Studio. The service role provides a way for Amazon EMR Studio to interoperate with other AWS services.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -183,7 +191,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ID of the EMR Studio.", // "maxLength": 256, // "minLength": 4, - // "pattern": "", + // "pattern": "^es-[0-9A-Z]+", // "type": "string" // } Description: "The ID of the EMR Studio.", @@ -234,7 +242,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The value for the tag. You can specify a value that is 0 to 255 Unicode characters in length. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[a-zA-Z+-=._:/]+$", // "type": "string" // } // }, @@ -266,6 +274,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z+-=._:/]+$"), ""), }, }, }, @@ -279,7 +288,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The unique Studio access URL.", // "maxLength": 4096, - // "pattern": "", + // "pattern": "^https://[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])(:[0-9]*)*([?/#].*)?$", // "type": "string" // } Description: "The unique Studio access URL.", @@ -294,13 +303,16 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The IAM user role that will be assumed by users and groups logged in to a Studio. The permissions attached to this IAM role can be scoped down for each user or group using session policies.", - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The IAM user role that will be assumed by users and groups logged in to a Studio. The permissions attached to this IAM role can be scoped down for each user or group using session policies.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -311,12 +323,15 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.", - // "pattern": "", + // "pattern": "^(vpc-[0-9a-f]{8}|vpc-[0-9a-f]{17})$", // "type": "string" // } Description: "The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(vpc-[0-9a-f]{8}|vpc-[0-9a-f]{17})$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -326,12 +341,15 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by VpcId.", - // "pattern": "", + // "pattern": "^sg-[a-zA-Z0-9\\-._]+$", // "type": "string" // } Description: "The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by VpcId.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^sg-[a-zA-Z0-9\\-._]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/emr/studio_session_mapping_resource_gen.go b/internal/aws/emr/studio_session_mapping_resource_gen.go index 58aec85000..027e3f667c 100644 --- a/internal/aws/emr/studio_session_mapping_resource_gen.go +++ b/internal/aws/emr/studio_session_mapping_resource_gen.go @@ -4,6 +4,7 @@ package emr import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -63,12 +64,15 @@ func studioSessionMappingResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. Session policies refine Studio user permissions without the need to use multiple IAM user roles.", - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:iam::([0-9]{12})?:policy\\/[^.]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. Session policies refine Studio user permissions without the need to use multiple IAM user roles.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:iam::([0-9]{12})?:policy\\/[^.]+$"), ""), + }, }, "studio_id": { // Property: StudioId @@ -77,7 +81,7 @@ func studioSessionMappingResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The ID of the Amazon EMR Studio to which the user or group will be mapped.", // "maxLength": 256, // "minLength": 4, - // "pattern": "", + // "pattern": "^es-[0-9A-Z]+", // "type": "string" // } Description: "The ID of the Amazon EMR Studio to which the user or group will be mapped.", @@ -85,6 +89,7 @@ func studioSessionMappingResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(4, 256), + validate.StringMatch(regexp.MustCompile("^es-[0-9A-Z]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/emrcontainers/virtual_cluster_resource_gen.go b/internal/aws/emrcontainers/virtual_cluster_resource_gen.go index 6bccf718fc..91c5ebbd33 100644 --- a/internal/aws/emrcontainers/virtual_cluster_resource_gen.go +++ b/internal/aws/emrcontainers/virtual_cluster_resource_gen.go @@ -4,6 +4,7 @@ package emrcontainers import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -43,7 +44,7 @@ func virtualClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The ID of the container cluster", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9A-Za-z][A-Za-z0-9\\-_]*", // "type": "string" // }, // "Info": { @@ -55,7 +56,7 @@ func virtualClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Namespace": { // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?", // "type": "string" // } // }, @@ -92,6 +93,7 @@ func virtualClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[0-9A-Za-z][A-Za-z0-9\\-_]*"), ""), }, }, "info": { @@ -108,6 +110,7 @@ func virtualClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9]([-a-z0-9]*[a-z0-9])?"), ""), }, }, }, @@ -154,7 +157,7 @@ func virtualClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "Name of the virtual cluster.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // } Description: "Name of the virtual cluster.", @@ -162,6 +165,7 @@ func virtualClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/evidently/experiment_resource_gen.go b/internal/aws/evidently/experiment_resource_gen.go index be260ecfd4..2ef995a81a 100644 --- a/internal/aws/evidently/experiment_resource_gen.go +++ b/internal/aws/evidently/experiment_resource_gen.go @@ -4,6 +4,7 @@ package evidently import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/experiment/[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, @@ -73,13 +74,13 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "MetricName": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\S]+$", // "type": "string" // }, // "UnitLabel": { // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "ValueKey": { @@ -132,6 +133,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[\\S]+$"), ""), }, }, "unit_label": { @@ -140,6 +142,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "value_key": { @@ -163,13 +166,14 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -184,7 +188,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ControlTreatmentName": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // }, // "TreatmentWeights": { @@ -200,7 +204,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Treatment": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } // }, @@ -224,6 +228,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, "treatment_weights": { @@ -244,6 +249,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, }, @@ -261,13 +267,14 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 0, - // "pattern": "", + // "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 2048), + validate.StringMatch(regexp.MustCompile("([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -279,13 +286,14 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 0, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 127), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "sampling_rate": { @@ -373,19 +381,19 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "type": "string" // }, // "Feature": { - // "pattern": "", + // "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:.*)", // "type": "string" // }, // "TreatmentName": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // }, // "Variation": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } // }, @@ -412,6 +420,9 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Feature Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:.*)"), ""), + }, }, "treatment_name": { // Property: TreatmentName @@ -419,6 +430,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, "variation": { @@ -427,6 +439,7 @@ func experimentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, }, diff --git a/internal/aws/evidently/feature_resource_gen.go b/internal/aws/evidently/feature_resource_gen.go index 15e65677cb..3ff2fe5a66 100644 --- a/internal/aws/evidently/feature_resource_gen.go +++ b/internal/aws/evidently/feature_resource_gen.go @@ -4,6 +4,7 @@ package evidently import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/feature/[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, @@ -41,13 +42,14 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, "description": { @@ -78,7 +80,7 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Variation": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } // }, @@ -102,6 +104,7 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, }, @@ -137,13 +140,14 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -155,13 +159,14 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 0, - // "pattern": "", + // "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 2048), + validate.StringMatch(regexp.MustCompile("([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -277,7 +282,7 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "VariationName": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } // }, @@ -319,6 +324,7 @@ func featureResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, }, diff --git a/internal/aws/evidently/launch_resource_gen.go b/internal/aws/evidently/launch_resource_gen.go index 3167a379d1..41b0cf03cf 100644 --- a/internal/aws/evidently/launch_resource_gen.go +++ b/internal/aws/evidently/launch_resource_gen.go @@ -4,6 +4,7 @@ package evidently import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*/launch/[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, @@ -66,7 +67,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "GroupName": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // }, // "Variation": { @@ -106,6 +107,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, "variation": { @@ -141,13 +143,13 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "MetricName": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\S]+$", // "type": "string" // }, // "UnitLabel": { // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "ValueKey": { @@ -188,6 +190,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[\\S]+$"), ""), }, }, "unit_label": { @@ -196,6 +199,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "value_key": { @@ -219,13 +223,14 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -237,13 +242,14 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 0, - // "pattern": "", + // "pattern": "([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 2048), + validate.StringMatch(regexp.MustCompile("([-a-zA-Z0-9._]*)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -255,13 +261,14 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 0, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 127), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "scheduled_splits_config": { @@ -280,7 +287,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "GroupName": { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // }, // "SplitWeight": { @@ -323,6 +330,7 @@ func launchResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, }, "split_weight": { diff --git a/internal/aws/evidently/project_resource_gen.go b/internal/aws/evidently/project_resource_gen.go index 3fbcf83c2e..34ee82fab0 100644 --- a/internal/aws/evidently/project_resource_gen.go +++ b/internal/aws/evidently/project_resource_gen.go @@ -4,6 +4,7 @@ package evidently import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, @@ -57,7 +58,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "LogGroup": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-a-zA-Z0-9._/]+$", // "type": "string" // }, // "S3": { @@ -66,13 +67,13 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][-a-z0-9]*[a-z0-9]$", // "type": "string" // }, // "Prefix": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-a-zA-Z0-9!_.*'()/]*$", // "type": "string" // } // }, @@ -93,6 +94,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("^[-a-zA-Z0-9._/]+$"), ""), }, }, "s3": { @@ -105,6 +107,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][-a-z0-9]*[a-z0-9]$"), ""), }, }, "prefix": { @@ -113,6 +116,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^[-a-zA-Z0-9!_.*'()/]*$"), ""), }, }, }, @@ -155,13 +159,14 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 127, // "minLength": 1, - // "pattern": "", + // "pattern": "[-a-zA-Z0-9._]*", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), + validate.StringMatch(regexp.MustCompile("[-a-zA-Z0-9._]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/finspace/environment_resource_gen.go b/internal/aws/finspace/environment_resource_gen.go index 1bdfe17e7e..b83c1d5ebb 100644 --- a/internal/aws/finspace/environment_resource_gen.go +++ b/internal/aws/finspace/environment_resource_gen.go @@ -4,6 +4,7 @@ package finspace import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "AWS account ID associated with the Environment", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]{1,26}$", // "type": "string" // } Description: "AWS account ID associated with the Environment", @@ -41,7 +42,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "ARNs of FinSpace Data Bundles to install", // "items": { - // "pattern": "", + // "pattern": "^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\\d*:data-bundle/[0-9A-Za-z_-]{1,128}$", // "type": "string" // }, // "type": "array", @@ -51,6 +52,9 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Type: types.ListType{ElemType: types.StringType}, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\\d*:data-bundle/[0-9A-Za-z_-]{1,128}$"), "")), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -61,7 +65,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "ID for FinSpace created account used to store Environment artifacts", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]{1,26}$", // "type": "string" // } Description: "ID for FinSpace created account used to store Environment artifacts", @@ -76,19 +80,22 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Description of the Environment", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9. ]{1,1000}$", // "type": "string" // } Description: "Description of the Environment", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9. ]{1,1000}$"), ""), + }, }, "environment_arn": { // Property: EnvironmentArn // CloudFormation resource type schema: // { // "description": "ARN of the Environment", - // "pattern": "", + // "pattern": "^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\\d+:environment/[0-9A-Za-z_-]{1,128}$", // "type": "string" // } Description: "ARN of the Environment", @@ -103,7 +110,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Unique identifier for representing FinSpace Environment", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]{1,26}$", // "type": "string" // } Description: "Unique identifier for representing FinSpace Environment", @@ -118,7 +125,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "URL used to login to the Environment", - // "pattern": "", + // "pattern": "^[-a-zA-Z0-9+\u0026amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\u0026amp;@#/%=~_|]{1,1000}", // "type": "string" // } Description: "URL used to login to the Environment", @@ -157,7 +164,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "ApplicationCallBackURL": { // "description": "SAML metadata URL to link with the Environment", - // "pattern": "", + // "pattern": "^https?://[-a-zA-Z0-9+\u0026amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\u0026amp;@#/%=~_|]{1,1000}", // "type": "string" // }, // "AttributeMap": { @@ -168,7 +175,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Federation provider name to link with the Environment", // "maxLength": 32, // "minLength": 1, - // "pattern": "", + // "pattern": "[^_\\p{Z}][\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}][^_\\p{Z}]+", // "type": "string" // }, // "FederationURN": { @@ -180,12 +187,12 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "SAML metadata document to link the federation provider to the Environment", // "maxLength": 10000000, // "minLength": 1000, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "SamlMetadataURL": { // "description": "SAML metadata URL to link with the Environment", - // "pattern": "", + // "pattern": "^https?://[-a-zA-Z0-9+\u0026amp;@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\u0026amp;@#/%=~_|]{1,1000}", // "type": "string" // } // }, @@ -199,6 +206,9 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "SAML metadata URL to link with the Environment", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]{1,1000}"), ""), + }, }, "attribute_map": { // Property: AttributeMap @@ -213,6 +223,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 32), + validate.StringMatch(regexp.MustCompile("[^_\\p{Z}][\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}][^_\\p{Z}]+"), ""), }, }, "federation_urn": { @@ -228,6 +239,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1000, 10000000), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "saml_metadata_url": { @@ -235,6 +247,9 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "SAML metadata URL to link with the Environment", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]{1,1000}"), ""), + }, }, }, ), @@ -262,12 +277,15 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Name of the Environment", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]{1,255}$", // "type": "string" // } Description: "Name of the Environment", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]{1,255}$"), ""), + }, }, "sage_maker_studio_domain_url": { // Property: SageMakerStudioDomainUrl @@ -320,21 +338,21 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Email address", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+[.]+[A-Za-z]+", // "type": "string" // }, // "FirstName": { // "description": "First name", // "maxLength": 50, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]{1,50}$", // "type": "string" // }, // "LastName": { // "description": "Last name", // "maxLength": 50, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]{1,50}$", // "type": "string" // } // }, @@ -350,6 +368,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+[.]+[A-Za-z]+"), ""), }, }, "first_name": { @@ -359,6 +378,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 50), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]{1,50}$"), ""), }, }, "last_name": { @@ -368,6 +388,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 50), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]{1,50}$"), ""), }, }, }, diff --git a/internal/aws/fms/notification_channel_resource_gen.go b/internal/aws/fms/notification_channel_resource_gen.go index 08bfb45ff2..76631ff1df 100644 --- a/internal/aws/fms/notification_channel_resource_gen.go +++ b/internal/aws/fms/notification_channel_resource_gen.go @@ -4,6 +4,7 @@ package fms import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e // "description": "A resource ARN.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^\\s]+)$", // "type": "string" // } Description: "A resource ARN.", @@ -35,6 +36,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([^\\s]+)$"), ""), }, }, "sns_topic_arn": { @@ -44,7 +46,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e // "description": "A resource ARN.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^\\s]+)$", // "type": "string" // } Description: "A resource ARN.", @@ -52,6 +54,7 @@ func notificationChannelResourceType(ctx context.Context) (tfsdk.ResourceType, e Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([^\\s]+)$"), ""), }, }, } diff --git a/internal/aws/fms/policy_resource_gen.go b/internal/aws/fms/policy_resource_gen.go index 94eb6e6b1d..412093d8d6 100644 --- a/internal/aws/fms/policy_resource_gen.go +++ b/internal/aws/fms/policy_resource_gen.go @@ -4,6 +4,7 @@ package fms import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A resource ARN.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^\\s]*)$", // "type": "string" // } Description: "A resource ARN.", @@ -60,7 +61,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An AWS account ID.", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^([0-9]*)$", // "type": "string" // }, // "type": "array" @@ -71,7 +72,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An Organizational Unit ID.", // "maxLength": 68, // "minLength": 16, - // "pattern": "", + // "pattern": "^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$", // "type": "string" // }, // "type": "array" @@ -88,6 +89,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(12, 12)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^([0-9]*)$"), "")), }, }, "orgunit": { @@ -96,6 +98,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(16, 68)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$"), "")), }, }, }, @@ -117,7 +120,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^[a-z0-9A-Z-]{36}$", // "type": "string" // } Type: types.StringType, @@ -139,7 +142,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An AWS account ID.", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^([0-9]*)$", // "type": "string" // }, // "type": "array" @@ -150,7 +153,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An Organizational Unit ID.", // "maxLength": 68, // "minLength": 16, - // "pattern": "", + // "pattern": "^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$", // "type": "string" // }, // "type": "array" @@ -167,6 +170,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(12, 12)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^([0-9]*)$"), "")), }, }, "orgunit": { @@ -175,6 +179,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(16, 68)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$"), "")), }, }, }, @@ -187,13 +192,14 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-zA-Z0-9_.:/=+\\-@]+)$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([a-zA-Z0-9_.:/=+\\-@]+)$"), ""), }, }, "remediation_enabled": { @@ -265,7 +271,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An AWS resource type", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^\\s]*)$", // "type": "string" // } Description: "An AWS resource type", @@ -273,6 +279,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([^\\s]*)$"), ""), }, }, "resource_type_list": { @@ -284,7 +291,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An AWS resource type", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^\\s]*)$", // "type": "string" // }, // "type": "array" @@ -293,6 +300,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 128)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^([^\\s]*)$"), "")), }, }, "resources_clean_up": { @@ -377,12 +385,12 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^\\s]*)$", // "type": "string" // }, // "Value": { // "maxLength": 256, - // "pattern": "", + // "pattern": "^([^\\s]*)$", // "type": "string" // } // }, @@ -402,6 +410,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([^\\s]*)$"), ""), }, }, "value": { @@ -410,6 +419,7 @@ func policyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([^\\s]*)$"), ""), }, }, }, diff --git a/internal/aws/forecast/dataset_group_resource_gen.go b/internal/aws/forecast/dataset_group_resource_gen.go index a25c7515bb..7ed79e6e87 100644 --- a/internal/aws/forecast/dataset_group_resource_gen.go +++ b/internal/aws/forecast/dataset_group_resource_gen.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -28,7 +29,7 @@ func datasetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": true, // "items": { // "maxLength": 256, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$", // "type": "string" // }, // "type": "array" @@ -38,6 +39,7 @@ func datasetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(256)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$"), "")), }, }, "dataset_group_arn": { @@ -46,7 +48,7 @@ func datasetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the dataset group to delete.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the dataset group to delete.", @@ -63,7 +65,7 @@ func datasetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A name for the dataset group.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*", // "type": "string" // } Description: "A name for the dataset group.", @@ -71,6 +73,7 @@ func datasetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/forecast/dataset_resource_gen.go b/internal/aws/forecast/dataset_resource_gen.go index 5ce539d53c..faac75a385 100644 --- a/internal/aws/forecast/dataset_resource_gen.go +++ b/internal/aws/forecast/dataset_resource_gen.go @@ -4,6 +4,7 @@ package forecast import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 256, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$", // "type": "string" // } Type: types.StringType, @@ -39,12 +40,15 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Frequency of data collection. This parameter is required for RELATED_TIME_SERIES", - // "pattern": "", + // "pattern": "^Y|M|W|D|H|30min|15min|10min|5min|1min$", // "type": "string" // } Description: "Frequency of data collection. This parameter is required for RELATED_TIME_SERIES", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^Y|M|W|D|H|30min|15min|10min|5min|1min$"), ""), + }, }, "dataset_name": { // Property: DatasetName @@ -53,7 +57,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A name for the dataset", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*", // "type": "string" // } Description: "A name for the dataset", @@ -61,6 +65,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -129,13 +134,13 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "KmsKeyArn": { // "description": "KMS key used to encrypt the Dataset data", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:kms:.*:key/.*", // "type": "string" // }, // "RoleArn": { // "description": "The ARN of the IAM role that Amazon Forecast can assume to access the AWS KMS key.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$", // "type": "string" // } // }, @@ -150,6 +155,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:aws[-a-z]*:kms:.*:key/.*"), ""), }, }, "role_arn": { @@ -159,6 +165,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$"), ""), }, }, }, @@ -178,7 +185,7 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "AttributeName": { // "description": "Name of the dataset field", - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*", // "type": "string" // }, // "AttributeType": { @@ -213,6 +220,9 @@ func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "Name of the dataset field", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*"), ""), + }, }, "attribute_type": { // Property: AttributeType diff --git a/internal/aws/frauddetector/detector_resource_gen.go b/internal/aws/frauddetector/detector_resource_gen.go index dda781050a..a07862ff55 100644 --- a/internal/aws/frauddetector/detector_resource_gen.go +++ b/internal/aws/frauddetector/detector_resource_gen.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -110,7 +111,7 @@ func detectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ID of the detector", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z_-]+$", // "type": "string" // } Description: "The ID of the detector", @@ -118,6 +119,7 @@ func detectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[0-9a-z_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -432,7 +434,7 @@ func detectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name for the event type", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z_-]+$", // "type": "string" // }, // "Tags": { @@ -835,6 +837,7 @@ func detectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[0-9a-z_-]+$"), ""), }, }, "tags": { diff --git a/internal/aws/frauddetector/entity_type_resource_gen.go b/internal/aws/frauddetector/entity_type_resource_gen.go index 74b2845808..fabe34c5e1 100644 --- a/internal/aws/frauddetector/entity_type_resource_gen.go +++ b/internal/aws/frauddetector/entity_type_resource_gen.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -85,7 +86,7 @@ func entityTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the entity type.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z_-]+$", // "type": "string" // } Description: "The name of the entity type.", @@ -93,6 +94,7 @@ func entityTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[0-9a-z_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/frauddetector/event_type_resource_gen.go b/internal/aws/frauddetector/event_type_resource_gen.go index 02a5e5bb6d..7be4b874c6 100644 --- a/internal/aws/frauddetector/event_type_resource_gen.go +++ b/internal/aws/frauddetector/event_type_resource_gen.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -649,7 +650,7 @@ func eventTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name for the event type", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z_-]+$", // "type": "string" // } Description: "The name for the event type", @@ -657,6 +658,7 @@ func eventTypeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[0-9a-z_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/frauddetector/label_resource_gen.go b/internal/aws/frauddetector/label_resource_gen.go index d4a60bcde9..b12ae2b065 100644 --- a/internal/aws/frauddetector/label_resource_gen.go +++ b/internal/aws/frauddetector/label_resource_gen.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -85,7 +86,7 @@ func labelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the label.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z_-]+$", // "type": "string" // } Description: "The name of the label.", @@ -93,6 +94,7 @@ func labelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[0-9a-z_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/frauddetector/outcome_resource_gen.go b/internal/aws/frauddetector/outcome_resource_gen.go index f32dc8f0d3..a52114290c 100644 --- a/internal/aws/frauddetector/outcome_resource_gen.go +++ b/internal/aws/frauddetector/outcome_resource_gen.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -85,7 +86,7 @@ func outcomeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the outcome.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z_-]+$", // "type": "string" // } Description: "The name of the outcome.", @@ -93,6 +94,7 @@ func outcomeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[0-9a-z_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/frauddetector/variable_resource_gen.go b/internal/aws/frauddetector/variable_resource_gen.go index f54affa113..2ad80cba76 100644 --- a/internal/aws/frauddetector/variable_resource_gen.go +++ b/internal/aws/frauddetector/variable_resource_gen.go @@ -4,6 +4,7 @@ package frauddetector import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -140,12 +141,15 @@ func variableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the variable.", - // "pattern": "", + // "pattern": "^[a-z_][a-z0-9_]{0,99}?$", // "type": "string" // } Description: "The name of the variable.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-z_][a-z0-9_]{0,99}?$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/gamelift/alias_resource_gen.go b/internal/aws/gamelift/alias_resource_gen.go index f96afbebaf..dc79951a51 100644 --- a/internal/aws/gamelift/alias_resource_gen.go +++ b/internal/aws/gamelift/alias_resource_gen.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -57,7 +58,7 @@ func aliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A descriptive label that is associated with an alias. Alias names do not need to be unique.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "A descriptive label that is associated with an alias. Alias names do not need to be unique.", @@ -65,6 +66,7 @@ func aliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "routing_strategy": { @@ -88,7 +90,7 @@ func aliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "FleetId": { // "description": "A unique identifier for a fleet that the alias points to. If you specify SIMPLE for the Type property, you must specify this property.", - // "pattern": "", + // "pattern": "^fleet-\\S+", // "type": "string" // }, // "Message": { @@ -117,6 +119,9 @@ func aliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "A unique identifier for a fleet that the alias points to. If you specify SIMPLE for the Type property, you must specify this property.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^fleet-\\S+"), ""), + }, }, "message": { // Property: Message diff --git a/internal/aws/gamelift/fleet_resource_gen.go b/internal/aws/gamelift/fleet_resource_gen.go index ea0b483c9b..b6055ff00c 100644 --- a/internal/aws/gamelift/fleet_resource_gen.go +++ b/internal/aws/gamelift/fleet_resource_gen.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,13 +26,16 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "A unique identifier for a build to be deployed on the new fleet. If you are deploying the fleet with a custom game build, you must specify this property. The build must have been successfully uploaded to Amazon GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.", - // "pattern": "", + // "pattern": "^build-\\S+|^arn:.*:build\\/build-\\S+", // "type": "string" // } Description: "A unique identifier for a build to be deployed on the new fleet. If you are deploying the fleet with a custom game build, you must specify this property. The build must have been successfully uploaded to Amazon GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^build-\\S+|^arn:.*:build\\/build-\\S+"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -129,7 +133,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "IpRange": { // "description": "A range of allowed IP addresses. This value must be expressed in CIDR notation. Example: \"000.000.000.000/[subnet mask]\" or optionally the shortened version \"0.0.0.0/[subnet mask]\".", - // "pattern": "", + // "pattern": "(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$)", // "type": "string" // }, // "Protocol": { @@ -175,6 +179,9 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "A range of allowed IP addresses. This value must be expressed in CIDR notation. Example: \"000.000.000.000/[subnet mask]\" or optionally the shortened version \"0.0.0.0/[subnet mask]\".", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$)"), ""), + }, }, "protocol": { // Property: Protocol @@ -213,13 +220,16 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions.", - // "pattern": "", + // "pattern": "^.*..*$", // "type": "string" // } Description: "The name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^.*..*$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -230,7 +240,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Unique fleet ID", - // "pattern": "", + // "pattern": "^fleet-\\S+", // "type": "string" // } Description: "Unique fleet ID", @@ -272,7 +282,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "A unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN from the IAM dashboard in the AWS Management Console.", // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-.*)?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "A unique identifier for an AWS IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN from the IAM dashboard in the AWS Management Console.", @@ -281,6 +291,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtLeast(1), + validate.StringMatch(regexp.MustCompile("^arn:aws(-.*)?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -299,7 +310,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Location": { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-z]+(-([a-z]+|\\d))*", // "type": "string" // }, // "LocationCapacity": { @@ -347,6 +358,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-z]+(-([a-z]+|\\d))*"), ""), }, }, "location_capacity": { @@ -513,7 +525,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A unique identifier for the AWS account with the VPC that you want to peer your Amazon GameLift fleet with. You can find your account ID in the AWS Management Console under account settings.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Description: "A unique identifier for the AWS account with the VPC that you want to peer your Amazon GameLift fleet with. You can find your account ID in the AWS Management Console under account settings.", @@ -522,6 +534,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -535,7 +548,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the AWS Management Console.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^vpc-\\S+", // "type": "string" // } Description: "A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the AWS Management Console.", @@ -544,6 +557,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^vpc-\\S+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -630,7 +644,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The location of the server executable in a custom game build or the name of the Realtime script file that contains the Init() function. Game builds and Realtime scripts are installed on instances at the root:\n\nWindows (for custom game builds only): C:\\game. Example: \"C:\\game\\MyGame\\server.exe\"\n\nLinux: /local/game. Examples: \"/local/game/MyGame/server.exe\" or \"/local/game/MyRealtimeScript.js\"", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([Cc]:\\\\game\\S+|/local/game/\\S+)", // "type": "string" // }, // "Parameters": { @@ -694,6 +708,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([Cc]:\\\\game\\S+|/local/game/\\S+)"), ""), }, }, "parameters": { @@ -725,13 +740,16 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "A unique identifier for a Realtime script to be deployed on a new Realtime Servers fleet. The script must have been successfully uploaded to Amazon GameLift. This fleet setting cannot be changed once the fleet is created.\n\nNote: It is not currently possible to use the !Ref command to reference a script created with a CloudFormation template for the fleet property ScriptId. Instead, use Fn::GetAtt Script.Arn or Fn::GetAtt Script.Id to retrieve either of these properties as input for ScriptId. Alternatively, enter a ScriptId string manually.", - // "pattern": "", + // "pattern": "^script-\\S+|^arn:.*:script\\/script-\\S+", // "type": "string" // } Description: "A unique identifier for a Realtime script to be deployed on a new Realtime Servers fleet. The script must have been successfully uploaded to Amazon GameLift. This fleet setting cannot be changed once the fleet is created.\n\nNote: It is not currently possible to use the !Ref command to reference a script created with a CloudFormation template for the fleet property ScriptId. Instead, use Fn::GetAtt Script.Arn or Fn::GetAtt Script.Id to retrieve either of these properties as input for ScriptId. Alternatively, enter a ScriptId string manually.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^script-\\S+|^arn:.*:script\\/script-\\S+"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/gamelift/game_server_group_resource_gen.go b/internal/aws/gamelift/game_server_group_resource_gen.go index ff0ed9a890..4659d144ef 100644 --- a/internal/aws/gamelift/game_server_group_resource_gen.go +++ b/internal/aws/gamelift/game_server_group_resource_gen.go @@ -4,6 +4,7 @@ package gamelift import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "A generated unique ID for the EC2 Auto Scaling group that is associated with this game server group.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[ -퟿-�𐀀-􏿿\r\n\t]*", // "type": "string" // } Description: "A generated unique ID for the EC2 Auto Scaling group that is associated with this game server group.", @@ -150,7 +151,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "A generated unique ID for the game server group.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:.*:gameservergroup\\/[a-zA-Z0-9-\\.]*", // "type": "string" // } Description: "A generated unique ID for the game server group.", @@ -167,7 +168,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "An identifier for the new game server group.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9-\\.]+", // "type": "string" // } Description: "An identifier for the new game server group.", @@ -175,6 +176,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9-\\.]+"), ""), }, }, "game_server_protection_policy": { @@ -337,7 +339,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The Amazon Resource Name (ARN) for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:.*:role\\/[\\w+=,.@-]+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups.", @@ -345,6 +347,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:.*:role\\/[\\w+=,.@-]+"), ""), }, }, "tags": { @@ -406,7 +409,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error // "items": { // "maxLength": 24, // "minLength": 15, - // "pattern": "", + // "pattern": "^subnet-[0-9a-z]+$", // "type": "string" // }, // "maxItems": 20, @@ -419,6 +422,7 @@ func gameServerGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 20), validate.ArrayForEach(validate.StringLenBetween(15, 24)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^subnet-[0-9a-z]+$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), diff --git a/internal/aws/globalaccelerator/accelerator_resource_gen.go b/internal/aws/globalaccelerator/accelerator_resource_gen.go index 564bdfbb9b..8eaf5e384b 100644 --- a/internal/aws/globalaccelerator/accelerator_resource_gen.go +++ b/internal/aws/globalaccelerator/accelerator_resource_gen.go @@ -4,6 +4,7 @@ package globalaccelerator import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -99,7 +100,7 @@ func acceleratorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The IP addresses from BYOIP Prefix pool.", // "items": { // "description": "The IP addresses from BYOIP Prefix pool.", - // "pattern": "", + // "pattern": "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$", // "type": "string" // }, // "type": "array" @@ -107,6 +108,9 @@ func acceleratorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The IP addresses from BYOIP Prefix pool.", Type: types.ListType{ElemType: types.StringType}, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$"), "")), + }, }, "name": { // Property: Name @@ -115,7 +119,7 @@ func acceleratorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Name of accelerator.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{0,64}$", // "type": "string" // } Description: "Name of accelerator.", @@ -123,6 +127,7 @@ func acceleratorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{0,64}$"), ""), }, }, "tags": { diff --git a/internal/aws/glue/registry_resource_gen.go b/internal/aws/glue/registry_resource_gen.go index fc3ee69c06..fc224ba3e3 100644 --- a/internal/aws/glue/registry_resource_gen.go +++ b/internal/aws/glue/registry_resource_gen.go @@ -25,7 +25,7 @@ func registryResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Amazon Resource Name for the created Registry.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*", // "type": "string" // } Description: "Amazon Resource Name for the created Registry.", diff --git a/internal/aws/glue/schema_resource_gen.go b/internal/aws/glue/schema_resource_gen.go index 377f96409c..9b4290da01 100644 --- a/internal/aws/glue/schema_resource_gen.go +++ b/internal/aws/glue/schema_resource_gen.go @@ -4,6 +4,7 @@ package glue import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func schemaResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Amazon Resource Name for the Schema.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*", // "type": "string" // } Description: "Amazon Resource Name for the Schema.", @@ -157,7 +158,7 @@ func schemaResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Represents the version ID associated with the initial schema version.", - // "pattern": "", + // "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", // "type": "string" // } Description: "Represents the version ID associated with the initial schema version.", @@ -195,7 +196,7 @@ func schemaResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Arn": { // "description": "Amazon Resource Name for the Registry.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*", // "type": "string" // }, // "Name": { @@ -215,6 +216,9 @@ func schemaResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "Amazon Resource Name for the Registry.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn):glue:.*"), ""), + }, }, "name": { // Property: Name diff --git a/internal/aws/glue/schema_version_metadata_resource_gen.go b/internal/aws/glue/schema_version_metadata_resource_gen.go index da911fff42..1ff98c1a81 100644 --- a/internal/aws/glue/schema_version_metadata_resource_gen.go +++ b/internal/aws/glue/schema_version_metadata_resource_gen.go @@ -4,6 +4,7 @@ package glue import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -44,12 +45,15 @@ func schemaVersionMetadataResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "Represents the version ID associated with the schema version.", - // "pattern": "", + // "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", // "type": "string" // } Description: "Represents the version ID associated with the schema version.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/glue/schema_version_resource_gen.go b/internal/aws/glue/schema_version_resource_gen.go index f340a998c2..1cd3028412 100644 --- a/internal/aws/glue/schema_version_resource_gen.go +++ b/internal/aws/glue/schema_version_resource_gen.go @@ -4,6 +4,7 @@ package glue import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -35,7 +36,7 @@ func schemaVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // }, // "SchemaArn": { // "description": "Amazon Resource Name for the Schema. This attribute can be used to uniquely represent the Schema.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):glue:.*", // "type": "string" // }, // "SchemaName": { @@ -64,6 +65,9 @@ func schemaVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "Amazon Resource Name for the Schema. This attribute can be used to uniquely represent the Schema.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn):glue:.*"), ""), + }, }, "schema_name": { // Property: SchemaName @@ -105,7 +109,7 @@ func schemaVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "Represents the version ID associated with the schema version.", - // "pattern": "", + // "pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", // "type": "string" // } Description: "Represents the version ID associated with the schema version.", diff --git a/internal/aws/greengrassv2/component_version_resource_gen.go b/internal/aws/greengrassv2/component_version_resource_gen.go index 7c05dc66d3..62d2b0f0cf 100644 --- a/internal/aws/greengrassv2/component_version_resource_gen.go +++ b/internal/aws/greengrassv2/component_version_resource_gen.go @@ -4,6 +4,7 @@ package greengrassv2 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -269,7 +270,7 @@ func componentVersionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "type": "string" // }, // "LambdaArn": { - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:lambda:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } // }, @@ -536,6 +537,9 @@ func componentVersionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // Property: LambdaArn Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:lambda:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), + }, }, }, ), diff --git a/internal/aws/groundstation/dataflow_endpoint_group_resource_gen.go b/internal/aws/groundstation/dataflow_endpoint_group_resource_gen.go index 3ffe61345c..797488762b 100644 --- a/internal/aws/groundstation/dataflow_endpoint_group_resource_gen.go +++ b/internal/aws/groundstation/dataflow_endpoint_group_resource_gen.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -58,7 +59,7 @@ func dataflowEndpointGroupResourceType(ctx context.Context) (tfsdk.ResourceType, // "type": "integer" // }, // "Name": { - // "pattern": "", + // "pattern": "^[ a-zA-Z0-9_:-]{1,256}$", // "type": "string" // } // }, @@ -124,6 +125,9 @@ func dataflowEndpointGroupResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: Name Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[ a-zA-Z0-9_:-]{1,256}$"), ""), + }, }, }, ), @@ -180,11 +184,11 @@ func dataflowEndpointGroupResourceType(ctx context.Context) (tfsdk.ResourceType, // "additionalProperties": false, // "properties": { // "Key": { - // "pattern": "", + // "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$", // "type": "string" // }, // "Value": { - // "pattern": "", + // "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$", // "type": "string" // } // }, @@ -198,11 +202,17 @@ func dataflowEndpointGroupResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: Key Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$"), ""), + }, }, "value": { // Property: Value Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, diff --git a/internal/aws/groundstation/mission_profile_resource_gen.go b/internal/aws/groundstation/mission_profile_resource_gen.go index a96ffa253b..98edd73c62 100644 --- a/internal/aws/groundstation/mission_profile_resource_gen.go +++ b/internal/aws/groundstation/mission_profile_resource_gen.go @@ -4,6 +4,7 @@ package groundstation import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -123,12 +124,15 @@ func missionProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "A name used to identify a mission profile.", - // "pattern": "", + // "pattern": "^[ a-zA-Z0-9_:-]{1,256}$", // "type": "string" // } Description: "A name used to identify a mission profile.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[ a-zA-Z0-9_:-]{1,256}$"), ""), + }, }, "region": { // Property: Region @@ -150,11 +154,11 @@ func missionProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "additionalProperties": false, // "properties": { // "Key": { - // "pattern": "", + // "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$", // "type": "string" // }, // "Value": { - // "pattern": "", + // "pattern": "^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$", // "type": "string" // } // }, @@ -168,11 +172,17 @@ func missionProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: Key Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[ a-zA-Z0-9\\+\\-=._:/@]{1,128}$"), ""), + }, }, "value": { // Property: Value Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[ a-zA-Z0-9\\+\\-=._:/@]{1,256}$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, diff --git a/internal/aws/healthlake/fhir_datastore_resource_gen.go b/internal/aws/healthlake/fhir_datastore_resource_gen.go index a686c2bec3..47a2191d89 100644 --- a/internal/aws/healthlake/fhir_datastore_resource_gen.go +++ b/internal/aws/healthlake/fhir_datastore_resource_gen.go @@ -4,6 +4,7 @@ package healthlake import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -69,7 +70,7 @@ func fHIRDatastoreResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name used in the creation of the Data Store.", - // "pattern": "", + // "pattern": "^arn:aws((-us-gov)|(-iso)|(-iso-b)|(-cn))?:healthlake:[a-zA-Z0-9-]+:[0-9]{12}:datastore/.+?", // "type": "string" // } Description: "The Amazon Resource Name used in the creation of the Data Store.", @@ -239,7 +240,7 @@ func fHIRDatastoreResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The KMS encryption key id/alias used to encrypt the Data Store contents at rest.", // "maxLength": 400, // "minLength": 1, - // "pattern": "", + // "pattern": "(arn:aws((-us-gov)|(-iso)|(-iso-b)|(-cn))?:kms:)?([a-z]{2}-[a-z]+(-[a-z]+)?-\\d:)?(\\d{12}:)?(((key/)?[a-zA-Z0-9-_]+)|(alias/[a-zA-Z0-9:/_-]+))", // "type": "string" // } // }, @@ -281,6 +282,7 @@ func fHIRDatastoreResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 400), + validate.StringMatch(regexp.MustCompile("(arn:aws((-us-gov)|(-iso)|(-iso-b)|(-cn))?:kms:)?([a-z]{2}-[a-z]+(-[a-z]+)?-\\d:)?(\\d{12}:)?(((key/)?[a-zA-Z0-9-_]+)|(alias/[a-zA-Z0-9:/_-]+))"), ""), }, }, }, diff --git a/internal/aws/iam/oidc_provider_resource_gen.go b/internal/aws/iam/oidc_provider_resource_gen.go index 4a7aae9ca8..c628e0f167 100644 --- a/internal/aws/iam/oidc_provider_resource_gen.go +++ b/internal/aws/iam/oidc_provider_resource_gen.go @@ -4,6 +4,7 @@ package iam import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -115,7 +116,7 @@ func oIDCProviderResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 40, // "minLength": 40, - // "pattern": "", + // "pattern": "[0-9A-Fa-f]{40}", // "type": "string" // }, // "maxItems": 5, @@ -126,6 +127,7 @@ func oIDCProviderResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(5), validate.ArrayForEach(validate.StringLenBetween(40, 40)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[0-9A-Fa-f]{40}"), "")), }, }, "url": { diff --git a/internal/aws/iam/saml_provider_resource_gen.go b/internal/aws/iam/saml_provider_resource_gen.go index 128e4a507a..152b9c9060 100644 --- a/internal/aws/iam/saml_provider_resource_gen.go +++ b/internal/aws/iam/saml_provider_resource_gen.go @@ -4,6 +4,7 @@ package iam import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func sAMLProviderResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w._-]+", // "type": "string" // } Type: types.StringType, @@ -50,6 +51,7 @@ func sAMLProviderResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\w._-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iam/server_certificate_resource_gen.go b/internal/aws/iam/server_certificate_resource_gen.go index b3d5f64900..e1bc58d629 100644 --- a/internal/aws/iam/server_certificate_resource_gen.go +++ b/internal/aws/iam/server_certificate_resource_gen.go @@ -4,6 +4,7 @@ package iam import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -117,7 +118,7 @@ func serverCertificateResourceType(ctx context.Context) (tfsdk.ResourceType, err // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w+=,.@-]+", // "type": "string" // } Type: types.StringType, @@ -125,6 +126,7 @@ func serverCertificateResourceType(ctx context.Context) (tfsdk.ResourceType, err Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iam/virtual_mfa_device_resource_gen.go b/internal/aws/iam/virtual_mfa_device_resource_gen.go index dcbed4e6cf..00a3ea26c6 100644 --- a/internal/aws/iam/virtual_mfa_device_resource_gen.go +++ b/internal/aws/iam/virtual_mfa_device_resource_gen.go @@ -4,6 +4,7 @@ package iam import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -46,7 +47,7 @@ func virtualMFADeviceResourceType(ctx context.Context) (tfsdk.ResourceType, erro // { // "maxLength": 256, // "minLength": 9, - // "pattern": "", + // "pattern": "[\\w+=/:,.@-]+", // "type": "string" // } Type: types.StringType, @@ -129,7 +130,7 @@ func virtualMFADeviceResourceType(ctx context.Context) (tfsdk.ResourceType, erro // { // "maxLength": 226, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w+=,.@-]+", // "type": "string" // } Type: types.StringType, @@ -137,6 +138,7 @@ func virtualMFADeviceResourceType(ctx context.Context) (tfsdk.ResourceType, erro Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 226), + validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/authorizer_resource_gen.go b/internal/aws/iot/authorizer_resource_gen.go index 28a9bb3d47..fdd0fef2a7 100644 --- a/internal/aws/iot/authorizer_resource_gen.go +++ b/internal/aws/iot/authorizer_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -47,7 +48,7 @@ func authorizerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w=,@-]+", // "type": "string" // } Type: types.StringType, @@ -55,6 +56,7 @@ func authorizerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\w=,@-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/custom_metric_resource_gen.go b/internal/aws/iot/custom_metric_resource_gen.go index 3ca152a7a9..19d83454b6 100644 --- a/internal/aws/iot/custom_metric_resource_gen.go +++ b/internal/aws/iot/custom_metric_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -58,7 +59,7 @@ func customMetricResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the custom metric. This will be used in the metric report submitted from the device/thing. Shouldn't begin with aws: . Cannot be updated once defined.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "The name of the custom metric. This will be used in the metric report submitted from the device/thing. Shouldn't begin with aws: . Cannot be updated once defined.", @@ -67,6 +68,7 @@ func customMetricResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/dimension_resource_gen.go b/internal/aws/iot/dimension_resource_gen.go index 4227954bf1..ba8531458a 100644 --- a/internal/aws/iot/dimension_resource_gen.go +++ b/internal/aws/iot/dimension_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func dimensionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A unique identifier for the dimension.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "A unique identifier for the dimension.", @@ -50,6 +51,7 @@ func dimensionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/domain_configuration_resource_gen.go b/internal/aws/iot/domain_configuration_resource_gen.go index 698a3cca00..9dfb9e6842 100644 --- a/internal/aws/iot/domain_configuration_resource_gen.go +++ b/internal/aws/iot/domain_configuration_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -44,7 +45,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e // "DefaultAuthorizerName": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\w=,@-]+$", // "type": "string" // } // }, @@ -63,6 +64,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[\\w=,@-]+$"), ""), }, }, }, @@ -75,7 +77,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[\\w.-]+$", // "type": "string" // } Type: types.StringType, @@ -83,6 +85,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[\\w.-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -151,7 +154,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e // "items": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$", // "type": "string" // }, // "maxItems": 1, @@ -164,6 +167,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 1), validate.ArrayForEach(validate.StringLenBetween(1, 2048)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -181,7 +185,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e // "ServerCertificateArn": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$", // "type": "string" // }, // "ServerCertificateStatus": { @@ -207,6 +211,7 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$"), ""), }, }, "server_certificate_status": { @@ -302,12 +307,15 @@ func domainConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, e // Property: ValidationCertificateArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$", // "type": "string" // } Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws(-cn|-us-gov|-iso-b|-iso)?:acm:[a-z]{2}-(gov-|iso-|isob-)?[a-z]{4,9}-\\d{1}:\\d{12}:certificate/[a-zA-Z0-9/-]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/iot/job_template_resource_gen.go b/internal/aws/iot/job_template_resource_gen.go index 16144e8bf1..9d60d0abc0 100644 --- a/internal/aws/iot/job_template_resource_gen.go +++ b/internal/aws/iot/job_template_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -174,6 +175,7 @@ func jobTemplateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2028), + validate.StringMatch(regexp.MustCompile("[^\\p{C}]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -452,6 +454,7 @@ func jobTemplateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/iot/logging_resource_gen.go b/internal/aws/iot/logging_resource_gen.go index 62320a67db..3bb7185cbf 100644 --- a/internal/aws/iot/logging_resource_gen.go +++ b/internal/aws/iot/logging_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func loggingResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Your 12-digit account ID (used as the primary identifier for the CloudFormation resource).", // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Description: "Your 12-digit account ID (used as the primary identifier for the CloudFormation resource).", @@ -35,6 +36,7 @@ func loggingResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/iot/mitigation_action_resource_gen.go b/internal/aws/iot/mitigation_action_resource_gen.go index de791766bc..70caf67197 100644 --- a/internal/aws/iot/mitigation_action_resource_gen.go +++ b/internal/aws/iot/mitigation_action_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func mitigationActionResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "A unique identifier for the mitigation action.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "A unique identifier for the mitigation action.", @@ -36,6 +37,7 @@ func mitigationActionResourceType(ctx context.Context) (tfsdk.ResourceType, erro Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/provisioning_template_resource_gen.go b/internal/aws/iot/provisioning_template_resource_gen.go index 7c8889f251..55b7de92a4 100644 --- a/internal/aws/iot/provisioning_template_resource_gen.go +++ b/internal/aws/iot/provisioning_template_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -147,7 +148,7 @@ func provisioningTemplateResourceType(ctx context.Context) (tfsdk.ResourceType, // { // "maxLength": 36, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9A-Za-z_-]+$", // "type": "string" // } Type: types.StringType, @@ -155,6 +156,7 @@ func provisioningTemplateResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 36), + validate.StringMatch(regexp.MustCompile("^[0-9A-Za-z_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/resource_specific_logging_resource_gen.go b/internal/aws/iot/resource_specific_logging_resource_gen.go index 9976b6c2f9..29221c4438 100644 --- a/internal/aws/iot/resource_specific_logging_resource_gen.go +++ b/internal/aws/iot/resource_specific_logging_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -54,7 +55,7 @@ func resourceSpecificLoggingResourceType(ctx context.Context) (tfsdk.ResourceTyp // "description": "Unique Id for a Target (TargetType:TargetName), this will be internally built to serve as primary identifier for a log target.", // "maxLength": 140, // "minLength": 13, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "Unique Id for a Target (TargetType:TargetName), this will be internally built to serve as primary identifier for a log target.", @@ -71,7 +72,7 @@ func resourceSpecificLoggingResourceType(ctx context.Context) (tfsdk.ResourceTyp // "description": "The target name.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "The target name.", @@ -79,6 +80,7 @@ func resourceSpecificLoggingResourceType(ctx context.Context) (tfsdk.ResourceTyp Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/iot/scheduled_audit_resource_gen.go b/internal/aws/iot/scheduled_audit_resource_gen.go index ec1db6583f..0a803a14a5 100644 --- a/internal/aws/iot/scheduled_audit_resource_gen.go +++ b/internal/aws/iot/scheduled_audit_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,12 +26,15 @@ func scheduledAuditResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The day of the month on which the scheduled audit takes place. Can be 1 through 31 or LAST. This field is required if the frequency parameter is set to MONTHLY.", - // "pattern": "", + // "pattern": "^([1-9]|[12][0-9]|3[01])$|^LAST$", // "type": "string" // } Description: "The day of the month on which the scheduled audit takes place. Can be 1 through 31 or LAST. This field is required if the frequency parameter is set to MONTHLY.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([1-9]|[12][0-9]|3[01])$|^LAST$"), ""), + }, }, "day_of_week": { // Property: DayOfWeek @@ -111,7 +115,7 @@ func scheduledAuditResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name you want to give to the scheduled audit.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "The name you want to give to the scheduled audit.", @@ -120,6 +124,7 @@ func scheduledAuditResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iot/security_profile_resource_gen.go b/internal/aws/iot/security_profile_resource_gen.go index 4291865e26..5d246c5653 100644 --- a/internal/aws/iot/security_profile_resource_gen.go +++ b/internal/aws/iot/security_profile_resource_gen.go @@ -4,6 +4,7 @@ package iot import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -34,7 +35,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "What is measured by the behavior.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // }, // "MetricDimension": { @@ -45,7 +46,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "A unique identifier for the dimension.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // }, // "Operator": { @@ -81,6 +82,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, "metric_dimension": { @@ -95,6 +97,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, "operator": { @@ -325,7 +328,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "What is measured by the behavior.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // }, // "MetricDimension": { @@ -336,7 +339,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "A unique identifier for the dimension.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // }, // "Operator": { @@ -357,7 +360,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The name for the behavior.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // }, // "SuppressAlerts": { @@ -538,6 +541,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, "metric_dimension": { @@ -552,6 +556,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, "operator": { @@ -577,6 +582,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, "suppress_alerts": { @@ -626,7 +632,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "A unique identifier for the security profile.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "A unique identifier for the security profile.", @@ -635,6 +641,7 @@ func securityProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iotevents/detector_model_resource_gen.go b/internal/aws/iotevents/detector_model_resource_gen.go index ec0ee3588b..74a2852b64 100644 --- a/internal/aws/iotevents/detector_model_resource_gen.go +++ b/internal/aws/iotevents/detector_model_resource_gen.go @@ -4,6 +4,7 @@ package iotevents import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -205,7 +206,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // }, // "Separator": { // "description": "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", - // "pattern": "", + // "pattern": "([\\n\\t])|(\\r\\n)|(,)", // "type": "string" // } // }, @@ -222,7 +223,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the AWS IoT Events input where the data is sent.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // }, // "Payload": { @@ -461,7 +462,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the variable.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // } // }, @@ -737,7 +738,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // }, // "Separator": { // "description": "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", - // "pattern": "", + // "pattern": "([\\n\\t])|(\\r\\n)|(,)", // "type": "string" // } // }, @@ -754,7 +755,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the AWS IoT Events input where the data is sent.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // }, // "Payload": { @@ -993,7 +994,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the variable.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // } // }, @@ -1269,7 +1270,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // }, // "Separator": { // "description": "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", - // "pattern": "", + // "pattern": "([\\n\\t])|(\\r\\n)|(,)", // "type": "string" // } // }, @@ -1286,7 +1287,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the AWS IoT Events input where the data is sent.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // }, // "Payload": { @@ -1525,7 +1526,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the variable.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // } // }, @@ -1794,7 +1795,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // }, // "Separator": { // "description": "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", - // "pattern": "", + // "pattern": "([\\n\\t])|(\\r\\n)|(,)", // "type": "string" // } // }, @@ -1811,7 +1812,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the AWS IoT Events input where the data is sent.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // }, // "Payload": { @@ -2050,7 +2051,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the variable.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // } // }, @@ -2408,6 +2409,9 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("([\\n\\t])|(\\r\\n)|(,)"), ""), + }, }, }, ), @@ -2425,6 +2429,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, "payload": { @@ -2715,6 +2720,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, }, @@ -3043,6 +3049,9 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("([\\n\\t])|(\\r\\n)|(,)"), ""), + }, }, }, ), @@ -3060,6 +3069,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, "payload": { @@ -3350,6 +3360,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, }, @@ -3678,6 +3689,9 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("([\\n\\t])|(\\r\\n)|(,)"), ""), + }, }, }, ), @@ -3695,6 +3709,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, "payload": { @@ -3985,6 +4000,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, }, @@ -4304,6 +4320,9 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Description: "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma).", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("([\\n\\t])|(\\r\\n)|(,)"), ""), + }, }, }, ), @@ -4321,6 +4340,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, "payload": { @@ -4611,6 +4631,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, }, @@ -4793,7 +4814,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the detector model.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]+$", // "type": "string" // } Description: "The name of the detector model.", @@ -4802,6 +4823,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -4836,7 +4858,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.\n\nThis parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^((`[\\w\\- ]+`)|([\\w\\-]+))(\\.((`[\\w\\- ]+`)|([\\w\\-]+)))*$", // "type": "string" // } Description: "The value used to identify a detector instance. When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.\n\nThis parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.", @@ -4845,6 +4867,7 @@ func detectorModelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^((`[\\w\\- ]+`)|([\\w\\-]+))(\\.((`[\\w\\- ]+`)|([\\w\\-]+)))*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iotevents/input_resource_gen.go b/internal/aws/iotevents/input_resource_gen.go index e74026b3f3..6d4765fe83 100644 --- a/internal/aws/iotevents/input_resource_gen.go +++ b/internal/aws/iotevents/input_resource_gen.go @@ -4,6 +4,7 @@ package iotevents import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -38,7 +39,7 @@ func inputResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An expression that specifies an attribute-value pair in a JSON structure. Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to AWS IoT Events (`BatchPutMessage`). Each such message contains a JSON payload. The attribute (and its paired value) specified here are available for use in the `condition` expressions used by detectors.\n\n_Syntax_: `\u003cfield-name\u003e.\u003cfield-name\u003e...`", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+))(\\.((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+)))*$", // "type": "string" // } // }, @@ -73,6 +74,7 @@ func inputResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+))(\\.((`[a-zA-Z0-9_\\- ]+`)|([a-zA-Z0-9_\\-]+)))*$"), ""), }, }, }, @@ -110,7 +112,7 @@ func inputResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the input.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // } Description: "The name of the input.", @@ -119,6 +121,7 @@ func inputResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/iotfleethub/application_resource_gen.go b/internal/aws/iotfleethub/application_resource_gen.go index 561c0dc09c..ceed2d6b31 100644 --- a/internal/aws/iotfleethub/application_resource_gen.go +++ b/internal/aws/iotfleethub/application_resource_gen.go @@ -4,6 +4,7 @@ package iotfleethub import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ARN of the application.", // "maxLength": 1600, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:[!-~]+$", // "type": "string" // } Description: "The ARN of the application.", @@ -58,7 +59,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Application Description, should be between 1 and 2048 characters.", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^[ -~]*$", // "type": "string" // } Description: "Application Description, should be between 1 and 2048 characters.", @@ -66,6 +67,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^[ -~]*$"), ""), }, }, "application_id": { @@ -75,7 +77,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ID of the application.", // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", // "type": "string" // } Description: "The ID of the application.", @@ -106,7 +108,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Application Name, should be between 1 and 256 characters.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[ -~]*$", // "type": "string" // } Description: "Application Name, should be between 1 and 256 characters.", @@ -114,6 +116,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[ -~]*$"), ""), }, }, "application_state": { @@ -165,7 +168,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ARN of the role that the web application assumes when it interacts with AWS IoT Core. For more info on configuring this attribute, see https://docs.aws.amazon.com/iot/latest/apireference/API_iotfleethub_CreateApplication.html#API_iotfleethub_CreateApplication_RequestSyntax", // "maxLength": 1600, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:[!-~]+$", // "type": "string" // } Description: "The ARN of the role that the web application assumes when it interacts with AWS IoT Core. For more info on configuring this attribute, see https://docs.aws.amazon.com/iot/latest/apireference/API_iotfleethub_CreateApplication.html#API_iotfleethub_CreateApplication_RequestSyntax", @@ -173,6 +176,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1600), + validate.StringMatch(regexp.MustCompile("^arn:[!-~]+$"), ""), }, }, "sso_client_id": { diff --git a/internal/aws/iotwireless/destination_resource_gen.go b/internal/aws/iotwireless/destination_resource_gen.go index 1fc5eead94..748e983798 100644 --- a/internal/aws/iotwireless/destination_resource_gen.go +++ b/internal/aws/iotwireless/destination_resource_gen.go @@ -4,6 +4,7 @@ package iotwireless import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -87,7 +88,7 @@ func destinationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Unique name of destination", // "maxLength": 128, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } Description: "Unique name of destination", @@ -95,6 +96,7 @@ func destinationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/iotwireless/partner_account_resource_gen.go b/internal/aws/iotwireless/partner_account_resource_gen.go index 08671267ee..810e5ba554 100644 --- a/internal/aws/iotwireless/partner_account_resource_gen.go +++ b/internal/aws/iotwireless/partner_account_resource_gen.go @@ -4,6 +4,7 @@ package iotwireless import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -50,12 +51,15 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The fingerprint of the Sidewalk application server private key.", - // "pattern": "", + // "pattern": "[a-fA-F0-9]{64}", // "type": "string" // } Description: "The fingerprint of the Sidewalk application server private key.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{64}"), ""), + }, }, "partner_account_id": { // Property: PartnerAccountId @@ -106,7 +110,7 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "AppServerPrivateKey": { // "maxLength": 4096, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-fA-F0-9]{64}", // "type": "string" // } // }, @@ -124,6 +128,7 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 4096), + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{64}"), ""), }, }, }, @@ -147,7 +152,7 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Fingerprint": { // "maxLength": 64, // "minLength": 64, - // "pattern": "", + // "pattern": "[a-fA-F0-9]{64}", // "type": "string" // } // }, @@ -175,6 +180,7 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(64, 64), + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{64}"), ""), }, }, }, @@ -194,7 +200,7 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "AppServerPrivateKey": { // "maxLength": 4096, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-fA-F0-9]{64}", // "type": "string" // } // }, @@ -209,6 +215,7 @@ func partnerAccountResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 4096), + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{64}"), ""), }, }, }, diff --git a/internal/aws/iotwireless/task_definition_resource_gen.go b/internal/aws/iotwireless/task_definition_resource_gen.go index a1c8a8a599..f3ed753c87 100644 --- a/internal/aws/iotwireless/task_definition_resource_gen.go +++ b/internal/aws/iotwireless/task_definition_resource_gen.go @@ -50,7 +50,7 @@ func taskDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The ID of the new wireless gateway task definition", - // "pattern": "", + // "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", // "type": "string" // } Description: "The ID of the new wireless gateway task definition", diff --git a/internal/aws/iotwireless/wireless_device_resource_gen.go b/internal/aws/iotwireless/wireless_device_resource_gen.go index d653445745..08375c6f65 100644 --- a/internal/aws/iotwireless/wireless_device_resource_gen.go +++ b/internal/aws/iotwireless/wireless_device_resource_gen.go @@ -4,6 +4,7 @@ package iotwireless import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -124,18 +125,18 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "additionalProperties": false, // "properties": { // "DevAddr": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{8}", // "type": "string" // }, // "SessionKeys": { // "additionalProperties": false, // "properties": { // "AppSKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // }, // "NwkSKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // } // }, @@ -156,26 +157,26 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "additionalProperties": false, // "properties": { // "DevAddr": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{8}", // "type": "string" // }, // "SessionKeys": { // "additionalProperties": false, // "properties": { // "AppSKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // }, // "FNwkSIntKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // }, // "NwkSEncKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // }, // "SNwkSIntKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // } // }, @@ -195,7 +196,7 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "type": "object" // }, // "DevEui": { - // "pattern": "", + // "pattern": "[a-f0-9]{16}", // "type": "string" // }, // "DeviceProfileId": { @@ -206,11 +207,11 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "additionalProperties": false, // "properties": { // "AppEui": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{16}", // "type": "string" // }, // "AppKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // } // }, @@ -224,15 +225,15 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "additionalProperties": false, // "properties": { // "AppKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // }, // "JoinEui": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{16}", // "type": "string" // }, // "NwkKey": { - // "pattern": "", + // "pattern": "[a-fA-F0-9]{32}", // "type": "string" // } // }, @@ -261,6 +262,9 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: DevAddr Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{8}"), ""), + }, }, "session_keys": { // Property: SessionKeys @@ -270,11 +274,17 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: AppSKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, "nwk_s_key": { // Property: NwkSKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, }, ), @@ -292,6 +302,9 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: DevAddr Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{8}"), ""), + }, }, "session_keys": { // Property: SessionKeys @@ -301,21 +314,33 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: AppSKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, "f_nwk_s_int_key": { // Property: FNwkSIntKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, "nwk_s_enc_key": { // Property: NwkSEncKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, "s_nwk_s_int_key": { // Property: SNwkSIntKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, }, ), @@ -329,6 +354,9 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: DevEui Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-f0-9]{16}"), ""), + }, }, "device_profile_id": { // Property: DeviceProfileId @@ -346,11 +374,17 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: AppEui Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{16}"), ""), + }, }, "app_key": { // Property: AppKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, }, ), @@ -364,16 +398,25 @@ func wirelessDeviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: AppKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, "join_eui": { // Property: JoinEui Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{16}"), ""), + }, }, "nwk_key": { // Property: NwkKey Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-fA-F0-9]{32}"), ""), + }, }, }, ), diff --git a/internal/aws/iotwireless/wireless_gateway_resource_gen.go b/internal/aws/iotwireless/wireless_gateway_resource_gen.go index f4969cedf5..ec3fd83b8f 100644 --- a/internal/aws/iotwireless/wireless_gateway_resource_gen.go +++ b/internal/aws/iotwireless/wireless_gateway_resource_gen.go @@ -4,6 +4,7 @@ package iotwireless import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -84,7 +85,7 @@ func wirelessGatewayResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The combination of Package, Station and Model which represents the version of the LoRaWAN Wireless Gateway.", // "properties": { // "GatewayEui": { - // "pattern": "", + // "pattern": "^(([0-9A-Fa-f]{2}-){7}|([0-9A-Fa-f]{2}:){7}|([0-9A-Fa-f]{2}\\s){7}|([0-9A-Fa-f]{2}){7})([0-9A-Fa-f]{2})$", // "type": "string" // }, // "RfRegion": { @@ -105,6 +106,9 @@ func wirelessGatewayResourceType(ctx context.Context) (tfsdk.ResourceType, error // Property: GatewayEui Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(([0-9A-Fa-f]{2}-){7}|([0-9A-Fa-f]{2}:){7}|([0-9A-Fa-f]{2}\\s){7}|([0-9A-Fa-f]{2}){7})([0-9A-Fa-f]{2})$"), ""), + }, }, "rf_region": { // Property: RfRegion diff --git a/internal/aws/ivs/channel_resource_gen.go b/internal/aws/ivs/channel_resource_gen.go index 54a011ecc8..8d699fcfcc 100644 --- a/internal/aws/ivs/channel_resource_gen.go +++ b/internal/aws/ivs/channel_resource_gen.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func channelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Channel ARN is automatically generated on creation and assigned as the unique identifier.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Channel ARN is automatically generated on creation and assigned as the unique identifier.", @@ -90,7 +91,7 @@ func channelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Channel", // "maxLength": 128, // "minLength": 0, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_]*$", // "type": "string" // } Description: "Channel", @@ -98,6 +99,7 @@ func channelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_]*$"), ""), }, }, "playback_url": { @@ -122,7 +124,7 @@ func channelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Recording Configuration ARN. A value other than an empty string indicates that recording is enabled. Default: ?? (recording is disabled).", // "maxLength": 128, // "minLength": 0, - // "pattern": "", + // "pattern": "^$|arn:aws:ivs:[a-z0-9-]+:[0-9]+:recording-configuration/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Recording Configuration ARN. A value other than an empty string indicates that recording is enabled. Default: ?? (recording is disabled).", @@ -131,6 +133,7 @@ func channelResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 128), + validate.StringMatch(regexp.MustCompile("^$|arn:aws:ivs:[a-z0-9-]+:[0-9]+:recording-configuration/[a-zA-Z0-9-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.String{Value: ""}), diff --git a/internal/aws/ivs/playback_key_pair_resource_gen.go b/internal/aws/ivs/playback_key_pair_resource_gen.go index 8f8bc036f2..70073bef9a 100644 --- a/internal/aws/ivs/playback_key_pair_resource_gen.go +++ b/internal/aws/ivs/playback_key_pair_resource_gen.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func playbackKeyPairResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Key-pair identifier.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:playback-key/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Key-pair identifier.", @@ -58,7 +59,7 @@ func playbackKeyPairResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "An arbitrary string (a nickname) assigned to a playback key pair that helps the customer identify that resource. The value does not need to be unique.", // "maxLength": 128, // "minLength": 0, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_]*$", // "type": "string" // } Description: "An arbitrary string (a nickname) assigned to a playback key pair that helps the customer identify that resource. The value does not need to be unique.", @@ -67,6 +68,7 @@ func playbackKeyPairResourceType(ctx context.Context) (tfsdk.ResourceType, error Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/ivs/recording_configuration_resource_gen.go b/internal/aws/ivs/recording_configuration_resource_gen.go index f55ee4a025..189e5405a0 100644 --- a/internal/aws/ivs/recording_configuration_resource_gen.go +++ b/internal/aws/ivs/recording_configuration_resource_gen.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func recordingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "Recording Configuration ARN is automatically generated on creation and assigned as the unique identifier.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[-a-z]*:ivs:[a-z0-9-]+:[0-9]+:recording-configuration/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Recording Configuration ARN is automatically generated on creation and assigned as the unique identifier.", @@ -51,7 +52,7 @@ func recordingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9-.]+$", // "type": "string" // } // }, @@ -80,6 +81,7 @@ func recordingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9-.]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -106,7 +108,7 @@ func recordingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "Recording Configuration Name.", // "maxLength": 128, // "minLength": 0, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_]*$", // "type": "string" // } Description: "Recording Configuration Name.", @@ -115,6 +117,7 @@ func recordingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/ivs/stream_key_resource_gen.go b/internal/aws/ivs/stream_key_resource_gen.go index 7e472a1ea7..28ab359f80 100644 --- a/internal/aws/ivs/stream_key_resource_gen.go +++ b/internal/aws/ivs/stream_key_resource_gen.go @@ -4,6 +4,7 @@ package ivs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func streamKeyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Stream Key ARN is automatically generated on creation and assigned as the unique identifier.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:stream-key/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Stream Key ARN is automatically generated on creation and assigned as the unique identifier.", @@ -42,12 +43,15 @@ func streamKeyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Channel ARN for the stream.", - // "pattern": "", + // "pattern": "^arn:aws:ivs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$", // "type": "string" // } Description: "Channel ARN for the stream.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:aws:ivs:[a-z0-9-]+:[0-9]+:channel/[a-zA-Z0-9-]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/kafkaconnect/connector_resource_gen.go b/internal/aws/kafkaconnect/connector_resource_gen.go index b64fffd62d..822c8a434f 100644 --- a/internal/aws/kafkaconnect/connector_resource_gen.go +++ b/internal/aws/kafkaconnect/connector_resource_gen.go @@ -4,6 +4,7 @@ package kafkaconnect import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -254,7 +255,7 @@ func connectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Amazon Resource Name for the created Connector.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*", // "type": "string" // } Description: "Amazon Resource Name for the created Connector.", @@ -715,7 +716,7 @@ func connectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "CustomPluginArn": { // "description": "The Amazon Resource Name (ARN) of the custom plugin to use.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*", // "type": "string" // }, // "Revision": { @@ -754,6 +755,9 @@ func connectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The Amazon Resource Name (ARN) of the custom plugin to use.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*"), ""), + }, }, "revision": { // Property: Revision @@ -784,12 +788,15 @@ func connectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon S3 objects and other external resources.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):iam:.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon S3 objects and other external resources.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn):iam:.*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -809,7 +816,7 @@ func connectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "WorkerConfigurationArn": { // "description": "The Amazon Resource Name (ARN) of the worker configuration to use.", - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*", // "type": "string" // } // }, @@ -836,6 +843,9 @@ func connectorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The Amazon Resource Name (ARN) of the worker configuration to use.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn):kafkaconnect:.*"), ""), + }, }, }, ), diff --git a/internal/aws/kendra/data_source_resource_gen.go b/internal/aws/kendra/data_source_resource_gen.go index 7d61206d11..7574e49dab 100644 --- a/internal/aws/kendra/data_source_resource_gen.go +++ b/internal/aws/kendra/data_source_resource_gen.go @@ -4,6 +4,7 @@ package kendra import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -50,7 +51,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ConditionDocumentAttributeKey": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_][a-zA-Z0-9_-]*", // "type": "string" // }, // "ConditionOnValue": { @@ -109,7 +110,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "TargetDocumentAttributeKey": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_][a-zA-Z0-9_-]*", // "type": "string" // }, // "TargetDocumentAttributeValue": { @@ -160,7 +161,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ConditionDocumentAttributeKey": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_][a-zA-Z0-9_-]*", // "type": "string" // }, // "ConditionOnValue": { @@ -218,7 +219,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "S3Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // } // }, @@ -237,7 +238,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ConditionDocumentAttributeKey": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_][a-zA-Z0-9_-]*", // "type": "string" // }, // "ConditionOnValue": { @@ -295,7 +296,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "S3Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // } // }, @@ -332,6 +333,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_][a-zA-Z0-9_-]*"), ""), }, }, "condition_on_value": { @@ -404,6 +406,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_][a-zA-Z0-9_-]*"), ""), }, }, "target_document_attribute_value": { @@ -468,6 +471,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_][a-zA-Z0-9_-]*"), ""), }, }, "condition_on_value": { @@ -539,6 +543,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, }, @@ -559,6 +564,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_][a-zA-Z0-9_-]*"), ""), }, }, "condition_on_value": { @@ -630,6 +636,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, }, @@ -880,7 +887,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ServerUrl": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(https?|ftp|file)://([^\\s]*)", // "type": "string" // }, // "SpaceConfiguration": { @@ -961,7 +968,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 10, @@ -971,7 +978,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 6, @@ -1142,7 +1149,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 10, @@ -1152,7 +1159,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 6, @@ -1350,7 +1357,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // }, // "Key": { @@ -1377,7 +1384,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "TenantDomain": { // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\\.)+[a-z]{2,}$", // "type": "string" // } // }, @@ -1406,7 +1413,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "BucketName": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // }, // "DocumentsMetadataConfiguration": { @@ -1675,7 +1682,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ServerUrl": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(https?|ftp|file)://([^\\s]*)", // "type": "string" // }, // "StandardObjectAttachmentConfiguration": { @@ -2063,7 +2070,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // }, // "Key": { @@ -2082,7 +2089,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(https?|ftp|file)://([^\\s]*)", // "type": "string" // }, // "maxItems": 100, @@ -2098,7 +2105,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 10, @@ -2108,7 +2115,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 6, @@ -2148,7 +2155,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Host": { // "maxLength": 253, // "minLength": 1, - // "pattern": "", + // "pattern": "([^\\s]*)", // "type": "string" // }, // "Port": { @@ -2202,7 +2209,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Host": { // "maxLength": 253, // "minLength": 1, - // "pattern": "", + // "pattern": "([^\\s]*)", // "type": "string" // }, // "Port": { @@ -2245,7 +2252,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(https?)://([^\\s]*)", // "type": "string" // }, // "maxItems": 100, @@ -2273,7 +2280,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(https?):\\/\\/([^\\s]*)", // "type": "string" // }, // "maxItems": 3, @@ -2351,7 +2358,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "OrganizationId": { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "d-[0-9a-fA-F]{10}", // "type": "string" // }, // "UseChangeLog": { @@ -2576,6 +2583,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^(https?|ftp|file)://([^\\s]*)"), ""), }, }, "space_configuration": { @@ -2677,6 +2685,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(10), validate.ArrayForEach(validate.StringLenBetween(1, 200)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, "subnet_ids": { @@ -2686,6 +2695,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(6), validate.ArrayForEach(validate.StringLenBetween(1, 200)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, }, @@ -2884,6 +2894,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(10), validate.ArrayForEach(validate.StringLenBetween(1, 200)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, "subnet_ids": { @@ -2893,6 +2904,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(6), validate.ArrayForEach(validate.StringLenBetween(1, 200)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, }, @@ -3086,6 +3098,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, "key": { @@ -3130,6 +3143,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\\.)+[a-z]{2,}$"), ""), }, }, }, @@ -3163,6 +3177,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, "documents_metadata_configuration": { @@ -3478,6 +3493,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^(https?|ftp|file)://([^\\s]*)"), ""), }, }, "standard_object_attachment_configuration": { @@ -3953,6 +3969,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, "key": { @@ -3974,6 +3991,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(100), validate.ArrayForEach(validate.StringLenBetween(1, 2048)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(https?|ftp|file)://([^\\s]*)"), "")), }, }, "use_change_log": { @@ -3992,6 +4010,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(10), validate.ArrayForEach(validate.StringLenBetween(1, 200)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, "subnet_ids": { @@ -4001,6 +4020,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(6), validate.ArrayForEach(validate.StringLenBetween(1, 200)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, }, @@ -4037,6 +4057,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 253), + validate.StringMatch(regexp.MustCompile("([^\\s]*)"), ""), }, }, "port": { @@ -4109,6 +4130,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 253), + validate.StringMatch(regexp.MustCompile("([^\\s]*)"), ""), }, }, "port": { @@ -4156,6 +4178,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 100), validate.ArrayForEach(validate.StringLenBetween(1, 2048)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(https?)://([^\\s]*)"), "")), }, }, "web_crawler_mode": { @@ -4185,6 +4208,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 3), validate.ArrayForEach(validate.StringLenBetween(1, 2048)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(https?):\\/\\/([^\\s]*)"), "")), }, }, }, @@ -4268,6 +4292,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("d-[0-9a-fA-F]{10}"), ""), }, }, "use_change_log": { diff --git a/internal/aws/kendra/faq_resource_gen.go b/internal/aws/kendra/faq_resource_gen.go index 88430ad869..93495907d0 100644 --- a/internal/aws/kendra/faq_resource_gen.go +++ b/internal/aws/kendra/faq_resource_gen.go @@ -4,6 +4,7 @@ package kendra import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -166,7 +167,7 @@ func faqResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // }, // "Key": { @@ -190,6 +191,7 @@ func faqResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, "key": { diff --git a/internal/aws/kendra/index_resource_gen.go b/internal/aws/kendra/index_resource_gen.go index eaa1d06a36..d5c7eaa0db 100644 --- a/internal/aws/kendra/index_resource_gen.go +++ b/internal/aws/kendra/index_resource_gen.go @@ -4,6 +4,7 @@ package kendra import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -112,7 +113,7 @@ func indexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Duration": { // "maxLength": 10, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9]+[s]", // "type": "string" // }, // "Freshness": { @@ -210,6 +211,7 @@ func indexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 10), + validate.StringMatch(regexp.MustCompile("[0-9]+[s]"), ""), }, }, "freshness": { @@ -563,7 +565,7 @@ func indexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "URL": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(https?|ftp|file):\\/\\/([^\\s]*)", // "type": "string" // }, // "UserNameAttributeField": { @@ -663,6 +665,7 @@ func indexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^(https?|ftp|file):\\/\\/([^\\s]*)"), ""), }, }, "user_name_attribute_field": { diff --git a/internal/aws/kinesis/stream_resource_gen.go b/internal/aws/kinesis/stream_resource_gen.go index 20760ef540..8ed07f2af2 100644 --- a/internal/aws/kinesis/stream_resource_gen.go +++ b/internal/aws/kinesis/stream_resource_gen.go @@ -4,6 +4,7 @@ package kinesis import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -42,7 +43,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the Kinesis stream.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_.-]+$", // "type": "string" // } Description: "The name of the Kinesis stream.", @@ -51,6 +52,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_.-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/kinesisfirehose/delivery_stream_resource_gen.go b/internal/aws/kinesisfirehose/delivery_stream_resource_gen.go index a885f5ca9c..63afbb1592 100644 --- a/internal/aws/kinesisfirehose/delivery_stream_resource_gen.go +++ b/internal/aws/kinesisfirehose/delivery_stream_resource_gen.go @@ -4,6 +4,7 @@ package kinesisfirehose import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -56,13 +57,13 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "ClusterEndpoint": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "https:.*", // "type": "string" // }, // "DomainARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "IndexName": { @@ -143,7 +144,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "S3BackupMode": { @@ -159,7 +160,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -236,7 +237,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -257,7 +258,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "SecurityGroupIds": { @@ -347,6 +348,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("https:.*"), ""), }, }, "domain_arn": { @@ -355,6 +357,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "index_name": { @@ -458,6 +461,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "s3_backup_mode": { @@ -481,6 +485,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -591,6 +596,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -615,6 +621,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "security_group_ids": { @@ -671,7 +678,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "KeyARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "KeyType": { @@ -695,6 +702,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "key_type": { @@ -718,7 +726,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9._-]+", // "type": "string" // } Type: types.StringType, @@ -726,6 +734,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9._-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -792,13 +801,13 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "ClusterEndpoint": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "https:.*", // "type": "string" // }, // "DomainARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "IndexName": { @@ -879,7 +888,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "S3BackupMode": { @@ -895,7 +904,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -972,7 +981,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -993,7 +1002,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "SecurityGroupIds": { @@ -1083,6 +1092,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("https:.*"), ""), }, }, "domain_arn": { @@ -1091,6 +1101,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "index_name": { @@ -1194,6 +1205,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "s3_backup_mode": { @@ -1217,6 +1229,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -1327,6 +1340,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -1351,6 +1365,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "security_group_ids": { @@ -1395,7 +1410,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -1577,7 +1592,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "TableName": { @@ -1698,7 +1713,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "S3BackupConfiguration": { @@ -1707,7 +1722,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -1784,7 +1799,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -1816,6 +1831,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -2078,6 +2094,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "table_name": { @@ -2237,6 +2254,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "s3_backup_configuration": { @@ -2249,6 +2267,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -2359,6 +2378,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -2539,7 +2559,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "S3BackupMode": { @@ -2551,7 +2571,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -2628,7 +2648,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -2847,6 +2867,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "s3_backup_mode": { @@ -2864,6 +2885,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -2974,6 +2996,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -2993,13 +3016,13 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "KinesisStreamARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -3017,6 +3040,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "role_arn": { @@ -3025,6 +3049,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -3154,7 +3179,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "S3BackupConfiguration": { @@ -3163,7 +3188,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -3240,7 +3265,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -3263,7 +3288,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -3340,7 +3365,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -3518,6 +3543,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "s3_backup_configuration": { @@ -3530,6 +3556,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -3640,6 +3667,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -3667,6 +3695,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -3777,6 +3806,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -3804,7 +3834,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -3881,7 +3911,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -3899,6 +3929,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -4009,6 +4040,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -4127,7 +4159,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "BucketARN": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // }, // "BufferingHints": { @@ -4204,7 +4236,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "RoleARN": { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } // }, @@ -4371,6 +4403,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, "buffering_hints": { @@ -4481,6 +4514,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("arn:.*"), ""), }, }, }, @@ -4506,7 +4540,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Value": { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@%]*$", // "type": "string" // } // }, @@ -4535,6 +4569,7 @@ func deliveryStreamResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@%]*$"), ""), }, }, }, diff --git a/internal/aws/kinesisvideo/signaling_channel_resource_gen.go b/internal/aws/kinesisvideo/signaling_channel_resource_gen.go index b4f61a623f..c1f10a19c3 100644 --- a/internal/aws/kinesisvideo/signaling_channel_resource_gen.go +++ b/internal/aws/kinesisvideo/signaling_channel_resource_gen.go @@ -4,6 +4,7 @@ package kinesisvideo import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -57,7 +58,7 @@ func signalingChannelResourceType(ctx context.Context) (tfsdk.ResourceType, erro // "description": "The name of the Kinesis Video Signaling Channel.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_.-]+", // "type": "string" // } Description: "The name of the Kinesis Video Signaling Channel.", @@ -66,6 +67,7 @@ func signalingChannelResourceType(ctx context.Context) (tfsdk.ResourceType, erro Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_.-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/kinesisvideo/stream_resource_gen.go b/internal/aws/kinesisvideo/stream_resource_gen.go index f93dbd3bbb..1f028b33f7 100644 --- a/internal/aws/kinesisvideo/stream_resource_gen.go +++ b/internal/aws/kinesisvideo/stream_resource_gen.go @@ -4,6 +4,7 @@ package kinesisvideo import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -57,7 +58,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the device that is writing to the stream.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_.-]+", // "type": "string" // } Description: "The name of the device that is writing to the stream.", @@ -65,6 +66,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_.-]+"), ""), }, }, "kms_key_id": { @@ -74,7 +76,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "AWS KMS key ID that Kinesis Video Streams uses to encrypt stream data.", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } Description: "AWS KMS key ID that Kinesis Video Streams uses to encrypt stream data.", @@ -82,6 +84,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile(".+"), ""), }, }, "media_type": { @@ -91,7 +94,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The media type of the stream. Consumers of the stream can use this information when processing the stream.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-\\.\\+]+/[\\w\\-\\.\\+]+(,[\\w\\-\\.\\+]+/[\\w\\-\\.\\+]+)*", // "type": "string" // } Description: "The media type of the stream. Consumers of the stream can use this information when processing the stream.", @@ -99,6 +102,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\w\\-\\.\\+]+/[\\w\\-\\.\\+]+(,[\\w\\-\\.\\+]+/[\\w\\-\\.\\+]+)*"), ""), }, }, "name": { @@ -108,7 +112,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the Kinesis Video stream.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_.-]+", // "type": "string" // } Description: "The name of the Kinesis Video stream.", @@ -117,6 +121,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_.-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/kms/alias_resource_gen.go b/internal/aws/kms/alias_resource_gen.go index 47fe2d75d3..bc05b2d286 100644 --- a/internal/aws/kms/alias_resource_gen.go +++ b/internal/aws/kms/alias_resource_gen.go @@ -4,6 +4,7 @@ package kms import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func aliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. The alias/aws/ prefix is reserved for AWS managed CMKs.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^(alias/)[a-zA-Z0-9:/_-]+$", // "type": "string" // } Description: "Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. The alias/aws/ prefix is reserved for AWS managed CMKs.", @@ -35,6 +36,7 @@ func aliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^(alias/)[a-zA-Z0-9:/_-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lambda/code_signing_config_resource_gen.go b/internal/aws/lambda/code_signing_config_resource_gen.go index eafcc4648e..e2aad7e31f 100644 --- a/internal/aws/lambda/code_signing_config_resource_gen.go +++ b/internal/aws/lambda/code_signing_config_resource_gen.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -32,7 +33,7 @@ func codeSigningConfigResourceType(ctx context.Context) (tfsdk.ResourceType, err // "items": { // "maxLength": 1024, // "minLength": 12, - // "pattern": "", + // "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)", // "type": "string" // }, // "maxItems": 20, @@ -56,6 +57,7 @@ func codeSigningConfigResourceType(ctx context.Context) (tfsdk.ResourceType, err Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 20), validate.ArrayForEach(validate.StringLenBetween(12, 1024)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)"), "")), }, }, }, @@ -67,7 +69,7 @@ func codeSigningConfigResourceType(ctx context.Context) (tfsdk.ResourceType, err // CloudFormation resource type schema: // { // "description": "A unique Arn for CodeSigningConfig resource", - // "pattern": "", + // "pattern": "arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:code-signing-config:csc-[a-z0-9]{17}", // "type": "string" // } Description: "A unique Arn for CodeSigningConfig resource", @@ -82,7 +84,7 @@ func codeSigningConfigResourceType(ctx context.Context) (tfsdk.ResourceType, err // CloudFormation resource type schema: // { // "description": "A unique identifier for CodeSigningConfig resource", - // "pattern": "", + // "pattern": "csc-[a-zA-Z0-9-_\\.]{17}", // "type": "string" // } Description: "A unique identifier for CodeSigningConfig resource", diff --git a/internal/aws/lambda/event_source_mapping_resource_gen.go b/internal/aws/lambda/event_source_mapping_resource_gen.go index 8a444696d6..7f2dc19a27 100644 --- a/internal/aws/lambda/event_source_mapping_resource_gen.go +++ b/internal/aws/lambda/event_source_mapping_resource_gen.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -62,7 +63,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The Amazon Resource Name (ARN) of the destination resource.", // "maxLength": 1024, // "minLength": 12, - // "pattern": "", + // "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)", // "type": "string" // } // }, @@ -86,6 +87,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 1024), + validate.StringMatch(regexp.MustCompile("arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)"), ""), }, }, }, @@ -114,7 +116,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The Amazon Resource Name (ARN) of the event source.", // "maxLength": 1024, // "minLength": 12, - // "pattern": "", + // "pattern": "arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the event source.", @@ -123,6 +125,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 1024), + validate.StringMatch(regexp.MustCompile("arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -146,7 +149,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The filter pattern that defines which events should be passed for invocations.", // "maxLength": 4096, // "minLength": 0, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -175,6 +178,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 4096), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -197,7 +201,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The name of the Lambda function.", // "maxLength": 140, // "minLength": 1, - // "pattern": "", + // "pattern": "(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?", // "type": "string" // } Description: "The name of the Lambda function.", @@ -205,6 +209,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 140), + validate.StringMatch(regexp.MustCompile("(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?"), ""), }, }, "function_response_types": { @@ -240,7 +245,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "Event Source Mapping Identifier UUID.", // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", // "type": "string" // } Description: "Event Source Mapping Identifier UUID.", @@ -322,7 +327,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "items": { // "maxLength": 1000, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\s\\S]*", // "type": "string" // }, // "maxItems": 1, @@ -337,6 +342,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er validate.ArrayLenBetween(1, 1), validate.UniqueItems(), validate.ArrayForEach(validate.StringLenBetween(1, 1000)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\s\\S]*"), "")), }, }, "self_managed_event_source": { @@ -356,7 +362,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The URL of a Kafka server.", // "maxLength": 300, // "minLength": 1, - // "pattern": "", + // "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]):[0-9]{1,5}", // "type": "string" // }, // "maxItems": 10, @@ -387,6 +393,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er validate.ArrayLenBetween(1, 10), validate.UniqueItems(), validate.ArrayForEach(validate.StringLenBetween(1, 300)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9]):[0-9]{1,5}"), "")), }, }, }, @@ -429,7 +436,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The URI for the source access configuration resource.", // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9-\\/*:_+=.@-]*", // "type": "string" // } // }, @@ -468,6 +475,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9-\\/*:_+=.@-]*"), ""), }, }, }, @@ -486,7 +494,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Streams sources.", // "maxLength": 12, // "minLength": 6, - // "pattern": "", + // "pattern": "(LATEST|TRIM_HORIZON|AT_TIMESTAMP)+", // "type": "string" // } Description: "The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Streams sources.", @@ -495,6 +503,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(6, 12), + validate.StringMatch(regexp.MustCompile("(LATEST|TRIM_HORIZON|AT_TIMESTAMP)+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -525,7 +534,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er // "items": { // "maxLength": 249, // "minLength": 1, - // "pattern": "", + // "pattern": "^[^.]([a-zA-Z0-9\\-_.]+)", // "type": "string" // }, // "maxItems": 1, @@ -540,6 +549,7 @@ func eventSourceMappingResourceType(ctx context.Context) (tfsdk.ResourceType, er validate.ArrayLenBetween(1, 1), validate.UniqueItems(), validate.ArrayForEach(validate.StringLenBetween(1, 249)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[^.]([a-zA-Z0-9\\-_.]+)"), "")), }, }, "tumbling_window_in_seconds": { diff --git a/internal/aws/lambda/function_resource_gen.go b/internal/aws/lambda/function_resource_gen.go index 02664050d9..97a8748e04 100644 --- a/internal/aws/lambda/function_resource_gen.go +++ b/internal/aws/lambda/function_resource_gen.go @@ -4,6 +4,7 @@ package lambda import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -150,12 +151,15 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "A unique Arn for CodeSigningConfig resource", - // "pattern": "", + // "pattern": "arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:code-signing-config:csc-[a-z0-9]{17}", // "type": "string" // } Description: "A unique Arn for CodeSigningConfig resource", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:code-signing-config:csc-[a-z0-9]{17}"), ""), + }, }, "dead_letter_config": { // Property: DeadLetterConfig @@ -166,7 +170,7 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "TargetArn": { // "description": "The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.", - // "pattern": "", + // "pattern": "^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$", // "type": "string" // } // }, @@ -180,6 +184,9 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$"), ""), + }, }, }, ), @@ -245,13 +252,13 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Arn": { // "description": "The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.", // "maxLength": 200, - // "pattern": "", + // "pattern": "^arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:access-point/fsap-[a-f0-9]{17}$", // "type": "string" // }, // "LocalMountPath": { // "description": "The path where the function can access the file system, starting with /mnt/.", // "maxLength": 160, - // "pattern": "", + // "pattern": "^/mnt/[a-zA-Z0-9-_.]+$", // "type": "string" // } // }, @@ -274,6 +281,7 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(200), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:access-point/fsap-[a-f0-9]{17}$"), ""), }, }, "local_mount_path": { @@ -283,6 +291,7 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(160), + validate.StringMatch(regexp.MustCompile("^/mnt/[a-zA-Z0-9-_.]+$"), ""), }, }, }, @@ -319,7 +328,7 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime", // "maxLength": 128, - // "pattern": "", + // "pattern": "^[^\\s]+$", // "type": "string" // } Description: "The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime", @@ -327,6 +336,7 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("^[^\\s]+$"), ""), }, }, "image_config": { @@ -399,12 +409,15 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", - // "pattern": "", + // "pattern": "^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$", // "type": "string" // } Description: "The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()$"), ""), + }, }, "layers": { // Property: Layers @@ -473,12 +486,15 @@ func functionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the function's execution role.", - // "pattern": "", + // "pattern": "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the function's execution role.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), + }, }, "runtime": { // Property: Runtime diff --git a/internal/aws/lex/bot_alias_resource_gen.go b/internal/aws/lex/bot_alias_resource_gen.go index 92d25bf4bf..e45f5a640f 100644 --- a/internal/aws/lex/bot_alias_resource_gen.go +++ b/internal/aws/lex/bot_alias_resource_gen.go @@ -4,6 +4,7 @@ package lex import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,7 +41,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique ID of resource", // "maxLength": 10, // "minLength": 10, - // "pattern": "", + // "pattern": "^[0-9a-zA-Z]+$", // "type": "string" // } Description: "Unique ID of resource", @@ -202,7 +203,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A unique identifier for a resource.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // } Description: "A unique identifier for a resource.", @@ -210,6 +211,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, "bot_alias_status": { @@ -300,7 +302,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique ID of resource", // "maxLength": 10, // "minLength": 10, - // "pattern": "", + // "pattern": "^[0-9a-zA-Z]+$", // "type": "string" // } Description: "Unique ID of resource", @@ -308,6 +310,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 10), + validate.StringMatch(regexp.MustCompile("^[0-9a-zA-Z]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -320,7 +323,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The version of a bot.", // "maxLength": 5, // "minLength": 1, - // "pattern": "", + // "pattern": "^(DRAFT|[0-9]+)$", // "type": "string" // } Description: "The version of a bot.", @@ -328,6 +331,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 5), + validate.StringMatch(regexp.MustCompile("^(DRAFT|[0-9]+)$"), ""), }, }, "conversation_log_settings": { @@ -356,7 +360,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of an AWS Key Management Service (KMS) key for encrypting audio log files stored in an S3 bucket.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:[\\w\\-]+:kms:[\\w\\-]+:[\\d]{12}:(?:key\\/[\\w\\-]+|alias\\/[a-zA-Z0-9:\\/_\\-]{1,256})$", // "type": "string" // }, // "LogPrefix": { @@ -369,7 +373,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of an Amazon S3 bucket where audio log files are stored.", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:[\\w\\-]+:s3:::[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // } // }, @@ -472,6 +476,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[\\w\\-]+:kms:[\\w\\-]+:[\\d]{12}:(?:key\\/[\\w\\-]+|alias\\/[a-zA-Z0-9:\\/_\\-]{1,256})$"), ""), }, }, "log_prefix": { @@ -490,6 +495,7 @@ func botAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[\\w\\-]+:s3:::[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, }, diff --git a/internal/aws/lex/bot_resource_gen.go b/internal/aws/lex/bot_resource_gen.go index 96a2b4bf02..000eab4f38 100644 --- a/internal/aws/lex/bot_resource_gen.go +++ b/internal/aws/lex/bot_resource_gen.go @@ -4,6 +4,7 @@ package lex import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 1011, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws[a-zA-Z-]*:lex:[a-z]+-[a-z]+-[0-9]:[0-9]{12}:bot/[0-9a-zA-Z]+$", // "type": "string" // } Type: types.StringType, @@ -58,14 +59,14 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // }, // "S3ObjectKey": { // "description": "The Amazon S3 key of the deployment package.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$", // "type": "string" // }, // "S3ObjectVersion": { @@ -91,6 +92,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, "s3_object_key": { @@ -100,6 +102,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$"), ""), }, }, "s3_object_version": { @@ -1526,7 +1529,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the context.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // } // }, @@ -2363,7 +2366,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the Amazon Kendra index that you want the AMAZON.KendraSearchIntent intent to search.", // "maxLength": 2048, // "minLength": 32, - // "pattern": "", + // "pattern": "^arn:aws[a-zA-Z-]*:kendra:[a-z]+-[a-z]+-[0-9]:[0-9]{12}:index/[a-zA-Z0-9][a-zA-Z0-9_-]*$", // "type": "string" // }, // "QueryFilterString": { @@ -2386,7 +2389,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique name for a resource.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // }, // "OutputContexts": { @@ -2400,7 +2403,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique name for a resource.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // }, // "TimeToLiveInSeconds": { @@ -2466,7 +2469,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the slot.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // } // }, @@ -2504,7 +2507,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique name for a resource.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // }, // "ObfuscationSetting": { @@ -3738,21 +3741,21 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon KMS key required to decrypt the contents of the grammar, if any.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:[\\w\\-]+:kms:[\\w\\-]+:[\\d]{12}:(?:key\\/[\\w\\-]+|alias\\/[a-zA-Z0-9:\\/_\\-]{1,256})$", // "type": "string" // }, // "S3BucketName": { // "description": "The name of the S3 bucket that contains the grammar source.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // }, // "S3ObjectKey": { // "description": "The path to the grammar in the S3 bucket.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$", // "type": "string" // } // }, @@ -3772,7 +3775,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique name for a resource.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // }, // "ParentSlotTypeSignature": { @@ -5537,6 +5540,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, }, @@ -6511,6 +6515,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(32, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-zA-Z-]*:kendra:[a-z]+-[a-z]+-[0-9]:[0-9]{12}:index/[a-zA-Z0-9][a-zA-Z0-9_-]*$"), ""), }, }, "query_filter_string": { @@ -6539,6 +6544,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, "output_contexts": { @@ -6553,6 +6559,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, "time_to_live_in_seconds": { @@ -6630,6 +6637,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, }, @@ -6675,6 +6683,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, "obfuscation_setting": { @@ -8103,6 +8112,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[\\w\\-]+:kms:[\\w\\-]+:[\\d]{12}:(?:key\\/[\\w\\-]+|alias\\/[a-zA-Z0-9:\\/_\\-]{1,256})$"), ""), }, }, "s3_bucket_name": { @@ -8112,6 +8122,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, "s3_object_key": { @@ -8121,6 +8132,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("[\\.\\-\\!\\*\\_\\'\\(\\)a-zA-Z0-9][\\.\\-\\!\\*\\_\\'\\(\\)\\/a-zA-Z0-9]*$"), ""), }, }, }, @@ -8142,6 +8154,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, "parent_slot_type_signature": { @@ -8391,7 +8404,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique ID of resource", // "maxLength": 10, // "minLength": 10, - // "pattern": "", + // "pattern": "^[0-9a-zA-Z]+$", // "type": "string" // } Description: "Unique ID of resource", @@ -8424,7 +8437,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique name for a resource.", // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-zA-Z][_-]?)+$", // "type": "string" // } Description: "Unique name for a resource.", @@ -8432,6 +8445,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^([0-9a-zA-Z][_-]?)+$"), ""), }, }, "role_arn": { @@ -8441,7 +8455,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.", // "maxLength": 2048, // "minLength": 32, - // "pattern": "", + // "pattern": "^arn:aws[a-zA-Z-]*:iam::[0-9]{12}:role/.*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.", @@ -8449,6 +8463,7 @@ func botResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(32, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-zA-Z-]*:iam::[0-9]{12}:role/.*$"), ""), }, }, "test_bot_alias_tags": { diff --git a/internal/aws/lex/bot_version_resource_gen.go b/internal/aws/lex/bot_version_resource_gen.go index 2ef2ac3443..7a4fa1c481 100644 --- a/internal/aws/lex/bot_version_resource_gen.go +++ b/internal/aws/lex/bot_version_resource_gen.go @@ -4,6 +4,7 @@ package lex import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func botVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Unique ID of resource", // "maxLength": 10, // "minLength": 10, - // "pattern": "", + // "pattern": "^[0-9a-zA-Z]+$", // "type": "string" // } Description: "Unique ID of resource", @@ -35,6 +36,7 @@ func botVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 10), + validate.StringMatch(regexp.MustCompile("^[0-9a-zA-Z]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -47,7 +49,7 @@ func botVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The version of a bot.", // "maxLength": 5, // "minLength": 1, - // "pattern": "", + // "pattern": "^(DRAFT|[0-9]+)$", // "type": "string" // } Description: "The version of a bot.", @@ -74,7 +76,7 @@ func botVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The version of a bot.", // "maxLength": 5, // "minLength": 1, - // "pattern": "", + // "pattern": "^(DRAFT|[0-9]+)$", // "type": "string" // } // }, @@ -112,6 +114,7 @@ func botVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 5), + validate.StringMatch(regexp.MustCompile("^(DRAFT|[0-9]+)$"), ""), }, }, }, diff --git a/internal/aws/lex/resource_policy_resource_gen.go b/internal/aws/lex/resource_policy_resource_gen.go index 0d0089a028..e2246eb0d3 100644 --- a/internal/aws/lex/resource_policy_resource_gen.go +++ b/internal/aws/lex/resource_policy_resource_gen.go @@ -68,7 +68,7 @@ func resourcePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The current revision of the resource policy. Use the revision ID to make sure that you are updating the most current version of a resource policy when you add a policy statement to a resource, delete a resource, or update a resource.", // "maxLength": 5, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9]+$", // "type": "string" // } Description: "The current revision of the resource policy. Use the revision ID to make sure that you are updating the most current version of a resource policy when you add a policy statement to a resource, delete a resource, or update a resource.", diff --git a/internal/aws/lightsail/alarm_resource_gen.go b/internal/aws/lightsail/alarm_resource_gen.go index 4a2a4c8aee..df4d2513ff 100644 --- a/internal/aws/lightsail/alarm_resource_gen.go +++ b/internal/aws/lightsail/alarm_resource_gen.go @@ -4,11 +4,13 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -36,12 +38,15 @@ func alarmResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name for the alarm. Specify the name of an existing alarm to update, and overwrite the previous configuration of the alarm.", - // "pattern": "", + // "pattern": "\\w[\\w\\-]*\\w", // "type": "string" // } Description: "The name for the alarm. Specify the name of an existing alarm to update, and overwrite the previous configuration of the alarm.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("\\w[\\w\\-]*\\w"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/lightsail/bucket_resource_gen.go b/internal/aws/lightsail/bucket_resource_gen.go index 0202f1e760..2121397551 100644 --- a/internal/aws/lightsail/bucket_resource_gen.go +++ b/internal/aws/lightsail/bucket_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -90,7 +91,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name for the bucket.", // "maxLength": 54, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][a-z0-9-]{1,52}[a-z0-9]$", // "type": "string" // } Description: "The name for the bucket.", @@ -98,6 +99,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 54), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][a-z0-9-]{1,52}[a-z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lightsail/container_resource_gen.go b/internal/aws/lightsail/container_resource_gen.go index 3266ecb708..8a0e44b41b 100644 --- a/internal/aws/lightsail/container_resource_gen.go +++ b/internal/aws/lightsail/container_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -387,7 +388,7 @@ func containerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name for the container service.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-z0-9]{1,2}|[a-z0-9][a-z0-9-]+[a-z0-9]$", // "type": "string" // } Description: "The name for the container service.", @@ -395,6 +396,7 @@ func containerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]{1,2}|[a-z0-9][a-z0-9-]+[a-z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lightsail/database_resource_gen.go b/internal/aws/lightsail/database_resource_gen.go index 4529cff0a7..73f8d6192b 100644 --- a/internal/aws/lightsail/database_resource_gen.go +++ b/internal/aws/lightsail/database_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -208,7 +209,7 @@ func databaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name to use for your new Lightsail database resource.", // "maxLength": 255, // "minLength": 2, - // "pattern": "", + // "pattern": "\\w[\\w\\-]*\\w", // "type": "string" // } Description: "The name to use for your new Lightsail database resource.", @@ -216,6 +217,7 @@ func databaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 255), + validate.StringMatch(regexp.MustCompile("\\w[\\w\\-]*\\w"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lightsail/disk_resource_gen.go b/internal/aws/lightsail/disk_resource_gen.go index 25736cc3b6..7fb9d6ef01 100644 --- a/internal/aws/lightsail/disk_resource_gen.go +++ b/internal/aws/lightsail/disk_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func diskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "SnapshotTimeOfDay": { // "description": "The daily time when an automatic snapshot will be created.", - // "pattern": "", + // "pattern": "^[0-9]{2}:00$", // "type": "string" // } // }, @@ -91,6 +92,9 @@ func diskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The daily time when an automatic snapshot will be created.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9]{2}:00$"), ""), + }, }, }, ), @@ -189,7 +193,7 @@ func diskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The names to use for your new Lightsail disk.", // "maxLength": 254, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", // "type": "string" // } Description: "The names to use for your new Lightsail disk.", @@ -197,6 +201,7 @@ func diskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 254), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lightsail/distribution_resource_gen.go b/internal/aws/lightsail/distribution_resource_gen.go index 3d82974d3f..2a0ad1c2dd 100644 --- a/internal/aws/lightsail/distribution_resource_gen.go +++ b/internal/aws/lightsail/distribution_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -337,12 +338,15 @@ func distributionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name for the distribution.", - // "pattern": "", + // "pattern": "\\w[\\w\\-]*\\w", // "type": "string" // } Description: "The name for the distribution.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("\\w[\\w\\-]*\\w"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/lightsail/instance_resource_gen.go b/internal/aws/lightsail/instance_resource_gen.go index 94a00b4a2a..decec732c3 100644 --- a/internal/aws/lightsail/instance_resource_gen.go +++ b/internal/aws/lightsail/instance_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func instanceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "SnapshotTimeOfDay": { // "description": "The daily time when an automatic snapshot will be created.", - // "pattern": "", + // "pattern": "^[0-9]{2}:00$", // "type": "string" // } // }, @@ -91,6 +92,9 @@ func instanceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The daily time when an automatic snapshot will be created.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9]{2}:00$"), ""), + }, }, }, ), @@ -210,7 +214,7 @@ func instanceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The names to use for your new Lightsail disk.", // "maxLength": 254, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", // "type": "string" // }, // "IOPS": { @@ -282,6 +286,7 @@ func instanceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 254), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$"), ""), }, }, "iops": { @@ -345,7 +350,7 @@ func instanceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The names to use for your new Lightsail instance.", // "maxLength": 254, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", // "type": "string" // } Description: "The names to use for your new Lightsail instance.", @@ -353,6 +358,7 @@ func instanceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 254), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lightsail/load_balancer_resource_gen.go b/internal/aws/lightsail/load_balancer_resource_gen.go index 0fd382ffff..d60af2cbb4 100644 --- a/internal/aws/lightsail/load_balancer_resource_gen.go +++ b/internal/aws/lightsail/load_balancer_resource_gen.go @@ -4,6 +4,7 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -94,12 +95,15 @@ func loadBalancerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of your load balancer.", - // "pattern": "", + // "pattern": "\\w[\\w\\-]*\\w", // "type": "string" // } Description: "The name of your load balancer.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("\\w[\\w\\-]*\\w"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/lightsail/load_balancer_tls_certificate_resource_gen.go b/internal/aws/lightsail/load_balancer_tls_certificate_resource_gen.go index b09df3699d..3f0e1f5840 100644 --- a/internal/aws/lightsail/load_balancer_tls_certificate_resource_gen.go +++ b/internal/aws/lightsail/load_balancer_tls_certificate_resource_gen.go @@ -4,11 +4,13 @@ package lightsail import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -84,12 +86,15 @@ func loadBalancerTlsCertificateResourceType(ctx context.Context) (tfsdk.Resource // CloudFormation resource type schema: // { // "description": "The name of your load balancer.", - // "pattern": "", + // "pattern": "\\w[\\w\\-]*\\w", // "type": "string" // } Description: "The name of your load balancer.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("\\w[\\w\\-]*\\w"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/location/geofence_collection_resource_gen.go b/internal/aws/location/geofence_collection_resource_gen.go index 6ffbc22804..debd19a336 100644 --- a/internal/aws/location/geofence_collection_resource_gen.go +++ b/internal/aws/location/geofence_collection_resource_gen.go @@ -4,6 +4,7 @@ package location import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func geofenceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -39,7 +40,7 @@ func geofenceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -54,13 +55,14 @@ func geofenceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -71,7 +73,7 @@ func geofenceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", @@ -155,7 +157,7 @@ func geofenceCollectionResourceType(ctx context.Context) (tfsdk.ResourceType, er // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", diff --git a/internal/aws/location/map_resource_gen.go b/internal/aws/location/map_resource_gen.go index b81893b03c..add1ea254a 100644 --- a/internal/aws/location/map_resource_gen.go +++ b/internal/aws/location/map_resource_gen.go @@ -4,6 +4,7 @@ package location import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -43,7 +44,7 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Style": { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } // }, @@ -60,6 +61,7 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, }, }, @@ -74,7 +76,7 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", @@ -120,7 +122,7 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -135,13 +137,14 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -174,7 +177,7 @@ func mapResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", diff --git a/internal/aws/location/place_index_resource_gen.go b/internal/aws/location/place_index_resource_gen.go index c569ed126f..dc9dcdfc24 100644 --- a/internal/aws/location/place_index_resource_gen.go +++ b/internal/aws/location/place_index_resource_gen.go @@ -4,6 +4,7 @@ package location import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func placeIndexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -39,7 +40,7 @@ func placeIndexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", @@ -123,7 +124,7 @@ func placeIndexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -138,13 +139,14 @@ func placeIndexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -177,7 +179,7 @@ func placeIndexResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", diff --git a/internal/aws/location/route_calculator_resource_gen.go b/internal/aws/location/route_calculator_resource_gen.go index f1ac5251ef..7c1b860a62 100644 --- a/internal/aws/location/route_calculator_resource_gen.go +++ b/internal/aws/location/route_calculator_resource_gen.go @@ -4,6 +4,7 @@ package location import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func routeCalculatorResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -39,7 +40,7 @@ func routeCalculatorResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -54,13 +55,14 @@ func routeCalculatorResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -71,7 +73,7 @@ func routeCalculatorResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", @@ -139,7 +141,7 @@ func routeCalculatorResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", diff --git a/internal/aws/location/tracker_consumer_resource_gen.go b/internal/aws/location/tracker_consumer_resource_gen.go index da6dcd5a61..a491cb8e48 100644 --- a/internal/aws/location/tracker_consumer_resource_gen.go +++ b/internal/aws/location/tracker_consumer_resource_gen.go @@ -4,6 +4,7 @@ package location import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,13 +26,14 @@ func trackerConsumerResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1600), + validate.StringMatch(regexp.MustCompile("^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -43,13 +45,14 @@ func trackerConsumerResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/location/tracker_resource_gen.go b/internal/aws/location/tracker_resource_gen.go index 9fd6befc46..6f88b9bec3 100644 --- a/internal/aws/location/tracker_resource_gen.go +++ b/internal/aws/location/tracker_resource_gen.go @@ -4,6 +4,7 @@ package location import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func trackerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -39,7 +40,7 @@ func trackerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", @@ -154,7 +155,7 @@ func trackerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 1600, - // "pattern": "", + // "pattern": "^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?$", // "type": "string" // } Type: types.StringType, @@ -169,13 +170,14 @@ func trackerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[-._\\w]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[-._\\w]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -186,7 +188,7 @@ func trackerResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // } Description: "The datetime value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ss.sssZ)", diff --git a/internal/aws/logs/query_definition_resource_gen.go b/internal/aws/logs/query_definition_resource_gen.go index a4d0c99413..bb12b26fb6 100644 --- a/internal/aws/logs/query_definition_resource_gen.go +++ b/internal/aws/logs/query_definition_resource_gen.go @@ -4,6 +4,7 @@ package logs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -30,7 +31,7 @@ func queryDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "LogGroup name", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // }, // "type": "array" @@ -40,6 +41,7 @@ func queryDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 512)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -52,7 +54,7 @@ func queryDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "A name for the saved query definition", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^:*\\/]+\\/?)*[^:*\\/]+$", // "type": "string" // } Description: "A name for the saved query definition", @@ -60,6 +62,7 @@ func queryDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^([^:*\\/]+\\/?)*[^:*\\/]+$"), ""), }, }, "query_definition_id": { diff --git a/internal/aws/logs/resource_policy_resource_gen.go b/internal/aws/logs/resource_policy_resource_gen.go index f9fbce7551..7f0efb339f 100644 --- a/internal/aws/logs/resource_policy_resource_gen.go +++ b/internal/aws/logs/resource_policy_resource_gen.go @@ -4,6 +4,7 @@ package logs import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -44,7 +45,7 @@ func resourcePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "A name for resource policy", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^([^:*\\/]+\\/?)*[^:*\\/]+$", // "type": "string" // } Description: "A name for resource policy", @@ -52,6 +53,7 @@ func resourcePolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^([^:*\\/]+\\/?)*[^:*\\/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/lookoutequipment/inference_scheduler_resource_gen.go b/internal/aws/lookoutequipment/inference_scheduler_resource_gen.go index 1ce7dc5c7c..0645ec472f 100644 --- a/internal/aws/lookoutequipment/inference_scheduler_resource_gen.go +++ b/internal/aws/lookoutequipment/inference_scheduler_resource_gen.go @@ -4,6 +4,7 @@ package lookoutequipment import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -51,12 +52,12 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "Indicates the delimiter character used between items in the data.", // "maxLength": 1, // "minLength": 0, - // "pattern": "", + // "pattern": "^(\\-|\\_|\\s)?$", // "type": "string" // }, // "TimestampFormat": { // "description": "The format of the timestamp, whether Epoch time, or standard, with or without hyphens (-).", - // "pattern": "", + // "pattern": "^EPOCH|yyyy-MM-dd-HH-mm-ss|yyyyMMddHHmmss$", // "type": "string" // } // }, @@ -64,7 +65,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // }, // "InputTimeZoneOffset": { // "description": "Indicates the difference between your time zone and Greenwich Mean Time (GMT).", - // "pattern": "", + // "pattern": "^(\\+|\\-)[0-9]{2}\\:[0-9]{2}$", // "type": "string" // }, // "S3InputConfiguration": { @@ -74,7 +75,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // }, // "Prefix": { @@ -109,6 +110,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 1), + validate.StringMatch(regexp.MustCompile("^(\\-|\\_|\\s)?$"), ""), }, }, "timestamp_format": { @@ -116,6 +118,9 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Description: "The format of the timestamp, whether Epoch time, or standard, with or without hyphens (-).", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^EPOCH|yyyy-MM-dd-HH-mm-ss|yyyyMMddHHmmss$"), ""), + }, }, }, ), @@ -126,6 +131,9 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Description: "Indicates the difference between your time zone and Greenwich Mean Time (GMT).", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(\\+|\\-)[0-9]{2}\\:[0-9]{2}$"), ""), + }, }, "s3_input_configuration": { // Property: S3InputConfiguration @@ -138,6 +146,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, "prefix": { @@ -177,7 +186,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // }, // "Prefix": { @@ -220,6 +229,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, "prefix": { @@ -272,7 +282,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The Amazon Resource Name (ARN) of the inference scheduler being created.", // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:aws(-[^:]+)?:lookoutequipment:[a-zA-Z0-9\\-]*:[0-9]{12}:inference-scheduler\\/.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the inference scheduler being created.", @@ -289,7 +299,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The name of the inference scheduler being created.", // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-zA-Z_-]{1,200}$", // "type": "string" // } Description: "The name of the inference scheduler being created.", @@ -298,6 +308,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("^[0-9a-zA-Z_-]{1,200}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -311,7 +322,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The name of the previously trained ML model being used to create the inference scheduler.", // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-zA-Z_-]{1,200}$", // "type": "string" // } Description: "The name of the previously trained ML model being used to create the inference scheduler.", @@ -319,6 +330,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("^[0-9a-zA-Z_-]{1,200}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -331,7 +343,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The Amazon Resource Name (ARN) of a role with permission to access the data source being used for the inference.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of a role with permission to access the data source being used for the inference.", @@ -339,6 +351,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+"), ""), }, }, "server_side_kms_key_id": { @@ -384,7 +397,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The value for the specified tag.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\s\\w+-=\\.:/@]*", // "type": "string" // } // }, @@ -417,6 +430,7 @@ func inferenceSchedulerResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("[\\s\\w+-=\\.:/@]*"), ""), }, }, }, diff --git a/internal/aws/lookoutmetrics/alert_resource_gen.go b/internal/aws/lookoutmetrics/alert_resource_gen.go index 2c4274cef6..2b4fe5b0dd 100644 --- a/internal/aws/lookoutmetrics/alert_resource_gen.go +++ b/internal/aws/lookoutmetrics/alert_resource_gen.go @@ -4,6 +4,7 @@ package lookoutmetrics import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -34,13 +35,13 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "LambdaArn": { // "description": "ARN of a Lambda to send alert notifications to.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // }, // "RoleArn": { // "description": "ARN of an IAM role that LookoutMetrics should assume to access the Lambda function.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } // }, @@ -57,13 +58,13 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "RoleArn": { // "description": "ARN of an IAM role that LookoutMetrics should assume to access the SNS topic.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // }, // "SnsTopicArn": { // "description": "ARN of an SNS topic to send alert notifications to.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } // }, @@ -91,6 +92,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, "role_arn": { @@ -100,6 +102,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, }, @@ -118,6 +121,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, "sns_topic_arn": { @@ -127,6 +131,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, }, @@ -146,7 +151,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "A description for the alert.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "A description for the alert.", @@ -155,6 +160,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -168,7 +174,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the alert. If not provided, a name is generated automatically.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // } Description: "The name of the alert. If not provided, a name is generated automatically.", @@ -177,6 +183,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -208,7 +215,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon resource name (ARN) of the Anomaly Detector to alert.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } Description: "The Amazon resource name (ARN) of the Anomaly Detector to alert.", @@ -216,6 +223,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -227,7 +235,7 @@ func alertResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "ARN assigned to the alert.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } Description: "ARN assigned to the alert.", diff --git a/internal/aws/lookoutmetrics/anomaly_detector_resource_gen.go b/internal/aws/lookoutmetrics/anomaly_detector_resource_gen.go index bb9d6e2c9b..9e0699db95 100644 --- a/internal/aws/lookoutmetrics/anomaly_detector_resource_gen.go +++ b/internal/aws/lookoutmetrics/anomaly_detector_resource_gen.go @@ -4,6 +4,7 @@ package lookoutmetrics import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -70,7 +71,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "description": "A description for the AnomalyDetector.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } Description: "A description for the AnomalyDetector.", @@ -78,6 +79,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "anomaly_detector_name": { @@ -87,7 +89,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Name for the Amazon Lookout for Metrics Anomaly Detector", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // } Description: "Name for the Amazon Lookout for Metrics Anomaly Detector", @@ -96,6 +98,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -107,7 +110,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } Type: types.StringType, @@ -123,7 +126,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "KMS key used to encrypt the AnomalyDetector data", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "arn:aws.*:kms:.*:[0-9]{12}:key/.*", // "type": "string" // } Description: "KMS key used to encrypt the AnomalyDetector data", @@ -131,6 +134,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("arn:aws.*:kms:.*:[0-9]{12}:key/.*"), ""), }, }, "metric_set_list": { @@ -148,7 +152,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Name of a column in the data.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // }, // "minItems": 0, @@ -172,13 +176,13 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Name of a column in the data.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // }, // "Namespace": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[^:].*", // "type": "string" // } // }, @@ -194,7 +198,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "MetricSetDescription": { // "description": "A description for the MetricSet.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "MetricSetFrequency": { @@ -211,7 +215,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "The name of the MetricSet.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // }, // "MetricSource": { @@ -222,12 +226,12 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "properties": { // "FlowName": { // "maxLength": 256, - // "pattern": "", + // "pattern": "[a-zA-Z0-9][\\w!@#.-]+", // "type": "string" // }, // "RoleArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } // }, @@ -242,7 +246,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "properties": { // "RoleArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // } // }, @@ -263,13 +267,13 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "DatabaseHost": { // "maxLength": 253, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "DatabaseName": { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_]+", // "type": "string" // }, // "DatabasePort": { @@ -279,18 +283,18 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // }, // "RoleArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // }, // "SecretManagerArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:secret:AmazonLookoutMetrics-.+", // "type": "string" // }, // "TableName": { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // }, // "VpcConfiguration": { @@ -300,7 +304,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "items": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "type": "array" @@ -308,7 +312,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "SubnetIdList": { // "items": { // "maxLength": 255, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "type": "array" @@ -345,13 +349,13 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "DatabaseHost": { // "maxLength": 253, // "minLength": 1, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "DatabaseName": { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-z0-9]+", // "type": "string" // }, // "DatabasePort": { @@ -361,18 +365,18 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // }, // "RoleArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // }, // "SecretManagerArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:secret:AmazonLookoutMetrics-.+", // "type": "string" // }, // "TableName": { // "maxLength": 100, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$", // "type": "string" // }, // "VpcConfiguration": { @@ -382,7 +386,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "items": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "type": "array" @@ -390,7 +394,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "SubnetIdList": { // "items": { // "maxLength": 255, - // "pattern": "", + // "pattern": "[\\-0-9a-zA-Z]+", // "type": "string" // }, // "type": "array" @@ -426,7 +430,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "properties": { // "Charset": { // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // }, // "ContainsHeader": { @@ -434,7 +438,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // }, // "Delimiter": { // "maxLength": 1, - // "pattern": "", + // "pattern": "[^\\r\\n]", // "type": "string" // }, // "FileCompression": { @@ -449,14 +453,14 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "Name of a column in the data.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // }, // "type": "array" // }, // "QuoteSymbol": { // "maxLength": 1, - // "pattern": "", + // "pattern": "[^\\r\\n]|^$", // "type": "string" // } // }, @@ -467,7 +471,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "properties": { // "Charset": { // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // }, // "FileCompression": { @@ -486,7 +490,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "HistoricalDataPathList": { // "items": { // "maxLength": 1024, - // "pattern": "", + // "pattern": "^s3://[a-z0-9].+$", // "type": "string" // }, // "maxItems": 1, @@ -495,13 +499,13 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // }, // "RoleArn": { // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:([a-z\\d-]+):.*:.*:.*:.+", // "type": "string" // }, // "TemplatedPathList": { // "items": { // "maxLength": 1024, - // "pattern": "", + // "pattern": "^s3://[a-zA-Z0-9_\\-\\/ {}=]+$", // "type": "string" // }, // "maxItems": 1, @@ -530,14 +534,14 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // "ColumnFormat": { // "description": "A timestamp format for the timestamps in the dataset", // "maxLength": 63, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "ColumnName": { // "description": "Name of a column in the data.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // } // }, @@ -545,7 +549,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error // }, // "Timezone": { // "maxLength": 60, - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } // }, @@ -571,6 +575,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(0), validate.ArrayForEach(validate.StringLenBetween(1, 63)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -600,6 +605,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, }, "namespace": { @@ -608,6 +614,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[^:].*"), ""), }, }, }, @@ -628,6 +635,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "metric_set_frequency": { @@ -651,6 +659,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, }, "metric_source": { @@ -667,6 +676,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9][\\w!@#.-]+"), ""), }, }, "role_arn": { @@ -675,6 +685,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, }, @@ -691,6 +702,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, }, @@ -715,6 +727,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 253), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "database_name": { @@ -723,6 +736,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_]+"), ""), }, }, "database_port": { @@ -739,6 +753,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, "secret_manager_arn": { @@ -747,6 +762,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:secret:AmazonLookoutMetrics-.+"), ""), }, }, "table_name": { @@ -755,6 +771,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, "vpc_configuration": { @@ -767,6 +784,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 255)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnet_id_list": { @@ -775,6 +793,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(255)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, }, @@ -803,6 +822,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 253), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "database_name": { @@ -811,6 +831,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("[a-z0-9]+"), ""), }, }, "database_port": { @@ -827,6 +848,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, "secret_manager_arn": { @@ -835,6 +857,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:secret:AmazonLookoutMetrics-.+"), ""), }, }, "table_name": { @@ -843,6 +866,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*$"), ""), }, }, "vpc_configuration": { @@ -855,6 +879,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 255)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnet_id_list": { @@ -863,6 +888,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(255)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\-0-9a-zA-Z]+"), "")), }, }, }, @@ -891,6 +917,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, }, "contains_header": { @@ -904,6 +931,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1), + validate.StringMatch(regexp.MustCompile("[^\\r\\n]"), ""), }, }, "file_compression": { @@ -923,6 +951,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 63)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), "")), }, }, "quote_symbol": { @@ -931,6 +960,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1), + validate.StringMatch(regexp.MustCompile("[^\\r\\n]|^$"), ""), }, }, }, @@ -947,6 +977,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, }, "file_compression": { @@ -975,6 +1006,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 1), validate.ArrayForEach(validate.StringLenAtMost(1024)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^s3://[a-z0-9].+$"), "")), }, }, "role_arn": { @@ -983,6 +1015,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("arn:([a-z\\d-]+):.*:.*:.*:.+"), ""), }, }, "templated_path_list": { @@ -992,6 +1025,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 1), validate.ArrayForEach(validate.StringLenAtMost(1024)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^s3://[a-zA-Z0-9_\\-\\/ {}=]+$"), "")), }, }, }, @@ -1022,6 +1056,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, "column_name": { @@ -1031,6 +1066,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, }, }, @@ -1043,6 +1079,7 @@ func anomalyDetectorResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(60), + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), }, }, }, diff --git a/internal/aws/lookoutvision/project_resource_gen.go b/internal/aws/lookoutvision/project_resource_gen.go index 946f166c77..13ba7f5688 100644 --- a/internal/aws/lookoutvision/project_resource_gen.go +++ b/internal/aws/lookoutvision/project_resource_gen.go @@ -4,6 +4,7 @@ package lookoutvision import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,7 +41,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the Amazon Lookout for Vision project", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9][a-zA-Z0-9_\\-]*", // "type": "string" // } Description: "The name of the Amazon Lookout for Vision project", @@ -48,6 +49,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9][a-zA-Z0-9_\\-]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/memorydb/acl_resource_gen.go b/internal/aws/memorydb/acl_resource_gen.go index 4918e6520a..3abafa2355 100644 --- a/internal/aws/memorydb/acl_resource_gen.go +++ b/internal/aws/memorydb/acl_resource_gen.go @@ -4,6 +4,7 @@ package memorydb import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,12 +26,15 @@ func aCLResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the acl.", - // "pattern": "", + // "pattern": "[a-z][a-z0-9\\\\-]*", // "type": "string" // } Description: "The name of the acl.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\\\-]*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/memorydb/cluster_resource_gen.go b/internal/aws/memorydb/cluster_resource_gen.go index 2c5dd0273c..1620760831 100644 --- a/internal/aws/memorydb/cluster_resource_gen.go +++ b/internal/aws/memorydb/cluster_resource_gen.go @@ -4,6 +4,7 @@ package memorydb import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,12 +26,15 @@ func clusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the Access Control List to associate with the cluster.", - // "pattern": "", + // "pattern": "[a-zA-Z][a-zA-Z0-9\\-]*", // "type": "string" // } Description: "The name of the Access Control List to associate with the cluster.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-zA-Z][a-zA-Z0-9\\-]*"), ""), + }, }, "arn": { // Property: ARN @@ -105,12 +109,15 @@ func clusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the cluster. This value must be unique as it also serves as the cluster identifier.", - // "pattern": "", + // "pattern": "[a-z][a-z0-9\\-]*", // "type": "string" // } Description: "The name of the cluster. This value must be unique as it also serves as the cluster identifier.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\-]*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/memorydb/subnet_group_resource_gen.go b/internal/aws/memorydb/subnet_group_resource_gen.go index 2c3446e6be..610b1a2932 100644 --- a/internal/aws/memorydb/subnet_group_resource_gen.go +++ b/internal/aws/memorydb/subnet_group_resource_gen.go @@ -4,6 +4,7 @@ package memorydb import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -50,12 +51,15 @@ func subnetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the subnet group. This value must be unique as it also serves as the subnet group identifier.", - // "pattern": "", + // "pattern": "[a-z][a-z0-9\\-]*", // "type": "string" // } Description: "The name of the subnet group. This value must be unique as it also serves as the subnet group identifier.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\-]*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/memorydb/user_resource_gen.go b/internal/aws/memorydb/user_resource_gen.go index 11b7ebae53..d9557e07a9 100644 --- a/internal/aws/memorydb/user_resource_gen.go +++ b/internal/aws/memorydb/user_resource_gen.go @@ -4,6 +4,7 @@ package memorydb import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -185,12 +186,15 @@ func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the user.", - // "pattern": "", + // "pattern": "[a-z][a-z0-9\\\\-]*", // "type": "string" // } Description: "The name of the user.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\\\-]*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/mwaa/environment_resource_gen.go b/internal/aws/mwaa/environment_resource_gen.go index b818793c09..1e58cc4276 100644 --- a/internal/aws/mwaa/environment_resource_gen.go +++ b/internal/aws/mwaa/environment_resource_gen.go @@ -4,6 +4,7 @@ package mwaa import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -37,7 +38,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Version of airflow to deploy to the environment.", // "maxLength": 32, - // "pattern": "", + // "pattern": "^[0-9a-z.]+$", // "type": "string" // } Description: "Version of airflow to deploy to the environment.", @@ -45,6 +46,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(32), + validate.StringMatch(regexp.MustCompile("^[0-9a-z.]+$"), ""), }, }, "arn": { @@ -54,7 +56,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "ARN for the MWAA environment.", // "maxLength": 1224, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:airflow:[a-z0-9\\-]+:\\d{12}:environment/\\w+", // "type": "string" // } Description: "ARN for the MWAA environment.", @@ -70,7 +72,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Represents an S3 prefix relative to the root of an S3 bucket.", // "maxLength": 1024, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Description: "Represents an S3 prefix relative to the root of an S3 bucket.", @@ -78,6 +80,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "environment_class": { @@ -102,7 +105,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "IAM role to be used by tasks.", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "IAM role to be used by tasks.", @@ -110,6 +113,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1224), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, }, "kms_key": { @@ -118,7 +122,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for MWAA data encryption.\n\n You can specify the CMK using any of the following:\n\n Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab.\n\n Key alias. For example, alias/ExampleAlias.\n\n Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.\n\n Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.\n\n AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^(((arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:kms:[a-z]{2}-[a-z]+-\\d:\\d+:)?key\\/)?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|(arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):kms:[a-z]{2}-[a-z]+-\\d:\\d+:)?alias/.+)$", // "type": "string" // } Description: "The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for MWAA data encryption.\n\n You can specify the CMK using any of the following:\n\n Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab.\n\n Key alias. For example, alias/ExampleAlias.\n\n Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.\n\n Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.\n\n AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.", @@ -127,6 +131,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1224), + validate.StringMatch(regexp.MustCompile("^(((arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:kms:[a-z]{2}-[a-z]+-\\d:\\d+:)?key\\/)?[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|(arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):kms:[a-z]{2}-[a-z]+-\\d:\\d+:)?alias/.+)$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -147,7 +152,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "CloudWatchLogGroupArn": { // "description": "", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:logs:[a-z0-9\\-]+:\\d{12}:log-group:\\w+", // "type": "string" // }, // "Enabled": { @@ -175,7 +180,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "CloudWatchLogGroupArn": { // "description": "", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:logs:[a-z0-9\\-]+:\\d{12}:log-group:\\w+", // "type": "string" // }, // "Enabled": { @@ -203,7 +208,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "CloudWatchLogGroupArn": { // "description": "", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:logs:[a-z0-9\\-]+:\\d{12}:log-group:\\w+", // "type": "string" // }, // "Enabled": { @@ -231,7 +236,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "CloudWatchLogGroupArn": { // "description": "", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:logs:[a-z0-9\\-]+:\\d{12}:log-group:\\w+", // "type": "string" // }, // "Enabled": { @@ -259,7 +264,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "CloudWatchLogGroupArn": { // "description": "", // "maxLength": 1224, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:logs:[a-z0-9\\-]+:\\d{12}:log-group:\\w+", // "type": "string" // }, // "Enabled": { @@ -522,7 +527,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Customer-defined identifier for the environment, unique per customer region.", // "maxLength": 80, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z][0-9a-zA-Z\\-_]*$", // "type": "string" // } Description: "Customer-defined identifier for the environment, unique per customer region.", @@ -530,6 +535,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 80), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z][0-9a-zA-Z\\-_]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -549,7 +555,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^sg-[a-zA-Z0-9\\-._]+$", // "type": "string" // }, // "maxItems": 5, @@ -562,7 +568,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "description": "", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^subnet-[a-zA-Z0-9\\-._]+$", // "type": "string" // }, // "maxItems": 2, @@ -583,6 +589,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenBetween(1, 1024)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^sg-[a-zA-Z0-9\\-._]+$"), "")), }, }, "subnet_ids": { @@ -594,6 +601,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(2, 2), validate.ArrayForEach(validate.StringLenAtMost(1024)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^subnet-[a-zA-Z0-9\\-._]+$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -625,7 +633,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Represents an S3 prefix relative to the root of an S3 bucket.", // "maxLength": 1024, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Description: "Represents an S3 prefix relative to the root of an S3 bucket.", @@ -633,6 +641,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "requirements_s3_object_version": { @@ -656,7 +665,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Represents an S3 prefix relative to the root of an S3 bucket.", // "maxLength": 1024, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Description: "Represents an S3 prefix relative to the root of an S3 bucket.", @@ -664,6 +673,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "schedulers": { @@ -688,7 +698,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "ARN for the AWS S3 bucket to use as the source of DAGs and plugins for the environment.", // "maxLength": 1224, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:s3:::[a-z0-9.\\-]+$", // "type": "string" // } Description: "ARN for the AWS S3 bucket to use as the source of DAGs and plugins for the environment.", @@ -696,6 +706,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1224), + validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b)(-[a-z]+)?:s3:::[a-z0-9.\\-]+$"), ""), }, }, "tags": { @@ -737,7 +748,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Url endpoint for the environment's Airflow UI.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^https://.+$", // "type": "string" // } Description: "Url endpoint for the environment's Airflow UI.", @@ -753,7 +764,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Start time for the weekly maintenance window.", // "maxLength": 9, - // "pattern": "", + // "pattern": "(MON|TUE|WED|THU|FRI|SAT|SUN):([01]\\d|2[0-3]):(00|30)", // "type": "string" // } Description: "Start time for the weekly maintenance window.", @@ -761,6 +772,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(9), + validate.StringMatch(regexp.MustCompile("(MON|TUE|WED|THU|FRI|SAT|SUN):([01]\\d|2[0-3]):(00|30)"), ""), }, }, } diff --git a/internal/aws/networkfirewall/firewall_policy_resource_gen.go b/internal/aws/networkfirewall/firewall_policy_resource_gen.go index ee1a299dc5..bfceed0cb9 100644 --- a/internal/aws/networkfirewall/firewall_policy_resource_gen.go +++ b/internal/aws/networkfirewall/firewall_policy_resource_gen.go @@ -4,6 +4,7 @@ package networkfirewall import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,13 +27,14 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "firewall_policy": { @@ -76,7 +78,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^(arn:aws.*)$", // "type": "string" // } // }, @@ -107,7 +109,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Value": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_ ]+$", // "type": "string" // } // }, @@ -131,7 +133,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "ActionName": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]+$", // "type": "string" // } // }, @@ -174,7 +176,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^(arn:aws.*)$", // "type": "string" // } // }, @@ -239,6 +241,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^(arn:aws.*)$"), ""), }, }, }, @@ -268,6 +271,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_ ]+$"), ""), }, }, }, @@ -289,6 +293,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]+$"), ""), }, }, }, @@ -325,6 +330,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^(arn:aws.*)$"), ""), }, }, }, @@ -343,7 +349,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^(arn:aws.*)$", // "type": "string" // } Description: "A resource ARN.", @@ -359,7 +365,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$", // "type": "string" // } Type: types.StringType, @@ -374,13 +380,14 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -397,13 +404,13 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "Value": { // "maxLength": 255, // "minLength": 0, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } // }, @@ -424,6 +431,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "value": { @@ -432,6 +440,7 @@ func firewallPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 255), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, }, diff --git a/internal/aws/networkfirewall/firewall_resource_gen.go b/internal/aws/networkfirewall/firewall_resource_gen.go index 6f9a60234b..feb6daaf21 100644 --- a/internal/aws/networkfirewall/firewall_resource_gen.go +++ b/internal/aws/networkfirewall/firewall_resource_gen.go @@ -4,6 +4,7 @@ package networkfirewall import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -34,13 +35,14 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 512, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "endpoint_ids": { @@ -66,7 +68,7 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws.*$", // "type": "string" // } Description: "A resource ARN.", @@ -82,7 +84,7 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$", // "type": "string" // } Type: types.StringType, @@ -97,13 +99,14 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -116,7 +119,7 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws.*$", // "type": "string" // } Description: "A resource ARN.", @@ -124,6 +127,7 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws.*$"), ""), }, }, "firewall_policy_change_protection": { @@ -239,13 +243,14 @@ func firewallResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^vpc-[0-9a-f]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^vpc-[0-9a-f]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/networkfirewall/logging_configuration_resource_gen.go b/internal/aws/networkfirewall/logging_configuration_resource_gen.go index 4b9ad1ee2f..a9a1f4b1fe 100644 --- a/internal/aws/networkfirewall/logging_configuration_resource_gen.go +++ b/internal/aws/networkfirewall/logging_configuration_resource_gen.go @@ -4,6 +4,7 @@ package networkfirewall import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func loggingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws.*$", // "type": "string" // } Description: "A resource ARN.", @@ -35,6 +36,7 @@ func loggingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws.*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -46,7 +48,7 @@ func loggingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-]+$", // "type": "string" // } Type: types.StringType, @@ -54,6 +56,7 @@ func loggingConfigurationResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/networkfirewall/rule_group_resource_gen.go b/internal/aws/networkfirewall/rule_group_resource_gen.go index 79e1b1cd03..0d5103cde4 100644 --- a/internal/aws/networkfirewall/rule_group_resource_gen.go +++ b/internal/aws/networkfirewall/rule_group_resource_gen.go @@ -4,6 +4,7 @@ package networkfirewall import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -38,13 +39,14 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "rule_group": { @@ -66,7 +68,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": true, // "items": { // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "type": "array", @@ -88,7 +90,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "insertionOrder": true, // "items": { // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "type": "array", @@ -168,13 +170,13 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Destination": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "DestinationPort": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "Direction": { @@ -211,13 +213,13 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Source": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "SourcePort": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } // }, @@ -239,7 +241,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Keyword": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "Settings": { @@ -247,7 +249,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "maxLength": 8192, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "type": "array", @@ -295,7 +297,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Value": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_ ]+$", // "type": "string" // } // }, @@ -319,7 +321,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ActionName": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]+$", // "type": "string" // } // }, @@ -389,7 +391,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "AddressDefinition": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-fA-F\\d:\\.]+/\\d{1,3})$", // "type": "string" // } // }, @@ -444,7 +446,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "AddressDefinition": { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^([a-fA-F\\d:\\.]+/\\d{1,3})$", // "type": "string" // } // }, @@ -571,6 +573,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtLeast(1)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^.*$"), "")), }, }, }, @@ -589,6 +592,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtLeast(1)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^.*$"), "")), }, }, }, @@ -673,6 +677,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "destination_port": { @@ -681,6 +686,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "direction": { @@ -728,6 +734,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "source_port": { @@ -736,6 +743,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, }, @@ -752,6 +760,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "settings": { @@ -760,6 +769,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(1, 8192)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^.*$"), "")), }, }, }, @@ -798,6 +808,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_ ]+$"), ""), }, }, }, @@ -819,6 +830,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]+$"), ""), }, }, }, @@ -886,6 +898,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^([a-fA-F\\d:\\.]+/\\d{1,3})$"), ""), }, }, }, @@ -936,6 +949,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^([a-fA-F\\d:\\.]+/\\d{1,3})$"), ""), }, }, }, @@ -1037,7 +1051,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A resource ARN.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^(arn:aws.*)$", // "type": "string" // } Description: "A resource ARN.", @@ -1053,7 +1067,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 36, // "minLength": 36, - // "pattern": "", + // "pattern": "^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$", // "type": "string" // } Type: types.StringType, @@ -1068,13 +1082,14 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -1091,13 +1106,13 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // }, // "Value": { // "maxLength": 255, // "minLength": 0, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } // }, @@ -1118,6 +1133,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, "value": { @@ -1126,6 +1142,7 @@ func ruleGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 255), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, }, }, diff --git a/internal/aws/nimblestudio/launch_profile_resource_gen.go b/internal/aws/nimblestudio/launch_profile_resource_gen.go index 47709d9b4d..3e9c564c2d 100644 --- a/internal/aws/nimblestudio/launch_profile_resource_gen.go +++ b/internal/aws/nimblestudio/launch_profile_resource_gen.go @@ -4,6 +4,7 @@ package nimblestudio import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -79,7 +80,7 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "\u003cp\u003eThe version number of the protocol that is used by the launch profile. The only valid\n version is \"2021-03-31\".\u003c/p\u003e", // "maxLength": 10, // "minLength": 0, - // "pattern": "", + // "pattern": "^2021\\-03\\-31$", // "type": "string" // }, // "type": "array" @@ -89,6 +90,7 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenBetween(0, 10)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^2021\\-03\\-31$"), "")), }, }, "name": { @@ -173,14 +175,14 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "\u003cp\u003eThe folder path in Linux workstations where files are uploaded.\u003c/p\u003e", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^(/?|(\\$HOME)?(/[^\\$/\\n\\s\\\\]+)*)$", // "type": "string" // }, // "Windows": { // "description": "\u003cp\u003eThe folder path in Windows workstations where files are uploaded.\u003c/p\u003e", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^((\\%HOMEPATH\\%)|[a-zA-Z]:)[\\\\/](?:[a-zA-Z0-9_-]+[\\\\/])*[a-zA-Z0-9_-]+$", // "type": "string" // } // }, @@ -194,7 +196,7 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "items": { // "maxLength": 22, // "minLength": 0, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_]*$", // "type": "string" // }, // "maxItems": 20, @@ -287,6 +289,7 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^(/?|(\\$HOME)?(/[^\\$/\\n\\s\\\\]+)*)$"), ""), }, }, "windows": { @@ -296,6 +299,7 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^((\\%HOMEPATH\\%)|[a-zA-Z]:)[\\\\/](?:[a-zA-Z0-9_-]+[\\\\/])*[a-zA-Z0-9_-]+$"), ""), }, }, }, @@ -314,6 +318,7 @@ func launchProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 20), validate.ArrayForEach(validate.StringLenBetween(0, 22)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_]*$"), "")), }, }, }, diff --git a/internal/aws/nimblestudio/streaming_image_resource_gen.go b/internal/aws/nimblestudio/streaming_image_resource_gen.go index 857fb13bf8..4cc339ead6 100644 --- a/internal/aws/nimblestudio/streaming_image_resource_gen.go +++ b/internal/aws/nimblestudio/streaming_image_resource_gen.go @@ -4,6 +4,7 @@ package nimblestudio import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,12 +42,15 @@ func streamingImageResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "\u003cp\u003eThe ID of an EC2 machine image with which to create this streaming image.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^ami-[0-9A-z]+$", // "type": "string" // } Description: "

The ID of an EC2 machine image with which to create this streaming image.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^ami-[0-9A-z]+$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -61,7 +65,7 @@ func streamingImageResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "KeyArn": { // "description": "\u003cp\u003eThe ARN for a KMS key that is used to encrypt studio data.\u003c/p\u003e", // "minLength": 4, - // "pattern": "", + // "pattern": "^arn:.*", // "type": "string" // }, // "KeyType": { @@ -87,6 +91,7 @@ func streamingImageResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtLeast(4), + validate.StringMatch(regexp.MustCompile("^arn:.*"), ""), }, }, "key_type": { @@ -159,7 +164,7 @@ func streamingImageResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "\u003cp\u003eThe platform of the streaming image, either WINDOWS or LINUX.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^[a-zA-Z]*$", // "type": "string" // } Description: "

The platform of the streaming image, either WINDOWS or LINUX.

", diff --git a/internal/aws/nimblestudio/studio_component_resource_gen.go b/internal/aws/nimblestudio/studio_component_resource_gen.go index 5ff366de40..7611900a57 100644 --- a/internal/aws/nimblestudio/studio_component_resource_gen.go +++ b/internal/aws/nimblestudio/studio_component_resource_gen.go @@ -4,6 +4,7 @@ package nimblestudio import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -111,7 +112,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "\u003cp\u003eThe mount location for a shared file system on a Linux virtual workstation.\u003c/p\u003e", // "maxLength": 128, // "minLength": 0, - // "pattern": "", + // "pattern": "^(/?|(\\$HOME)?(/[^/\\n\\s\\\\]+)*)$", // "type": "string" // }, // "ShareName": { @@ -120,7 +121,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error // }, // "WindowsMountDrive": { // "description": "\u003cp\u003eThe mount location for a shared file system on a Windows virtual workstation.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^[A-Z]$", // "type": "string" // } // }, @@ -247,6 +248,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 128), + validate.StringMatch(regexp.MustCompile("^(/?|(\\$HOME)?(/[^/\\n\\s\\\\]+)*)$"), ""), }, }, "share_name": { @@ -260,6 +262,9 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error Description: "

The mount location for a shared file system on a Windows virtual workstation.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z]$"), ""), + }, }, }, ), @@ -318,7 +323,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "\u003cp\u003eThe version number of the protocol that is used by the launch profile. The only valid version is \"2021-03-31\".\u003c/p\u003e", // "maxLength": 10, // "minLength": 0, - // "pattern": "", + // "pattern": "^2021\\-03\\-31$", // "type": "string" // }, // "Platform": { @@ -358,6 +363,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 10), + validate.StringMatch(regexp.MustCompile("^2021\\-03\\-31$"), ""), }, }, "platform": { @@ -427,7 +433,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error // "description": "\u003cp\u003eA script parameter key.\u003c/p\u003e", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z_][a-zA-Z0-9_]+$", // "type": "string" // }, // "Value": { @@ -453,6 +459,7 @@ func studioComponentResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]+$"), ""), }, }, "value": { diff --git a/internal/aws/nimblestudio/studio_resource_gen.go b/internal/aws/nimblestudio/studio_resource_gen.go index 13ed91fe71..395cd7dcf1 100644 --- a/internal/aws/nimblestudio/studio_resource_gen.go +++ b/internal/aws/nimblestudio/studio_resource_gen.go @@ -4,6 +4,7 @@ package nimblestudio import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -54,7 +55,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eThe Amazon Web Services Region where the studio resource is located.\u003c/p\u003e", // "maxLength": 50, // "minLength": 0, - // "pattern": "", + // "pattern": "[a-z]{2}-?(iso|gov)?-{1}[a-z]*-{1}[0-9]", // "type": "string" // } Description: "

The Amazon Web Services Region where the studio resource is located.

", @@ -88,7 +89,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "KeyArn": { // "description": "\u003cp\u003eThe ARN for a KMS key that is used to encrypt studio data.\u003c/p\u003e", // "minLength": 4, - // "pattern": "", + // "pattern": "^arn:.*", // "type": "string" // }, // "KeyType": { @@ -115,6 +116,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtLeast(4), + validate.StringMatch(regexp.MustCompile("^arn:.*"), ""), }, }, "key_type": { @@ -152,7 +154,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eThe studio name that is used in the URL of the Nimble Studio portal when accessed by Nimble Studio users.\u003c/p\u003e", // "maxLength": 64, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9]*$", // "type": "string" // } Description: "

The studio name that is used in the URL of the Nimble Studio portal when accessed by Nimble Studio users.

", @@ -160,6 +162,7 @@ func studioResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 64), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/panorama/application_instance_resource_gen.go b/internal/aws/panorama/application_instance_resource_gen.go index c7ea2847d2..e2aba50997 100644 --- a/internal/aws/panorama/application_instance_resource_gen.go +++ b/internal/aws/panorama/application_instance_resource_gen.go @@ -4,6 +4,7 @@ package panorama import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, @@ -41,7 +42,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, @@ -49,6 +50,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -87,13 +89,14 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -105,7 +108,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, @@ -120,7 +123,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 0, - // "pattern": "", + // "pattern": "^.*$", // "type": "string" // } Type: types.StringType, @@ -128,6 +131,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 255), + validate.StringMatch(regexp.MustCompile("^.*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -140,13 +144,14 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_]+$"), ""), }, }, "health_status": { @@ -187,7 +192,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // "PayloadData": { // "maxLength": 51200, // "minLength": 0, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } // }, @@ -201,6 +206,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 51200), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, }, @@ -221,7 +227,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // "PayloadData": { // "maxLength": 51200, // "minLength": 1, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } // }, @@ -235,6 +241,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 51200), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, }, @@ -250,7 +257,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, @@ -258,6 +265,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -270,7 +278,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:[a-z0-9][-.a-z0-9]{0,62}:iam::[0-9]{12}:role/.+$", // "type": "string" // } Type: types.StringType, @@ -278,6 +286,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^arn:[a-z0-9][-.a-z0-9]{0,62}:iam::[0-9]{12}:role/.+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -362,14 +371,14 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e // "description": "A string used to identify this tag", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // }, // "Value": { // "description": "A string containing the value for the tag", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } // }, @@ -392,6 +401,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, "value": { @@ -401,6 +411,7 @@ func applicationInstanceResourceType(ctx context.Context) (tfsdk.ResourceType, e Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, }, diff --git a/internal/aws/panorama/package_resource_gen.go b/internal/aws/panorama/package_resource_gen.go index 864d26d71c..e546ac8bd9 100644 --- a/internal/aws/panorama/package_resource_gen.go +++ b/internal/aws/panorama/package_resource_gen.go @@ -4,6 +4,7 @@ package panorama import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -52,7 +53,7 @@ func packageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_\\/]+$", // "type": "string" // } Type: types.StringType, @@ -67,13 +68,14 @@ func packageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -163,13 +165,13 @@ func packageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // }, // "Value": { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^.+$", // "type": "string" // } // }, @@ -190,6 +192,7 @@ func packageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, "value": { @@ -198,6 +201,7 @@ func packageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, }, diff --git a/internal/aws/panorama/package_version_resource_gen.go b/internal/aws/panorama/package_version_resource_gen.go index c77e1ef85d..f80b31b0bf 100644 --- a/internal/aws/panorama/package_version_resource_gen.go +++ b/internal/aws/panorama/package_version_resource_gen.go @@ -4,6 +4,7 @@ package panorama import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -47,7 +48,7 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 12, // "minLength": 1, - // "pattern": "", + // "pattern": "^[0-9a-z\\_]+$", // "type": "string" // } Type: types.StringType, @@ -55,6 +56,7 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 12), + validate.StringMatch(regexp.MustCompile("^[0-9a-z\\_]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -81,13 +83,14 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_\\/]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_\\/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -99,7 +102,7 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-\\_]+$", // "type": "string" // } Type: types.StringType, @@ -114,13 +117,14 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9]+)\\.([0-9]+)$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^([0-9]+)\\.([0-9]+)$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -132,13 +136,14 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-z0-9]+$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -194,13 +199,14 @@ func packageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-z0-9]+$", // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]+$"), ""), }, }, } diff --git a/internal/aws/qldb/stream_resource_gen.go b/internal/aws/qldb/stream_resource_gen.go index 34bdb5ae80..ee3000ccea 100644 --- a/internal/aws/qldb/stream_resource_gen.go +++ b/internal/aws/qldb/stream_resource_gen.go @@ -4,6 +4,7 @@ package qldb import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, @@ -81,7 +82,7 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "type": "boolean" // }, // "StreamArn": { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } // }, @@ -98,6 +99,9 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: StreamArn Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*"), ""), + }, }, }, ), @@ -122,11 +126,14 @@ func streamResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: RoleArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/quicksight/analysis_resource_gen.go b/internal/aws/quicksight/analysis_resource_gen.go index 25d1277994..3e5ccce5c7 100644 --- a/internal/aws/quicksight/analysis_resource_gen.go +++ b/internal/aws/quicksight/analysis_resource_gen.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,13 +27,14 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -58,13 +60,14 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -115,7 +118,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Message": { // "description": "\u003cp\u003eThe message associated with the analysis error.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Type": { @@ -147,6 +150,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The message associated with the analysis error.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "type": { // Property: Type @@ -223,7 +229,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eA display name for the date-time parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -252,7 +258,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eA display name for the decimal parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -281,7 +287,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eThe name of the integer parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -310,7 +316,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eA display name for a string parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -347,6 +353,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

A display name for the date-time parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -372,6 +381,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

A display name for the decimal parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -397,6 +409,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The name of the integer parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -422,6 +437,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

A display name for a string parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -517,14 +535,14 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eThe name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "SheetId": { // "description": "\u003cp\u003eThe unique identifier associated with a sheet.\u003c/p\u003e", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } // }, @@ -542,6 +560,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "sheet_id": { // Property: SheetId @@ -550,6 +571,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, }, }, @@ -588,7 +610,7 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "DataSetPlaceholder": { // "description": "\u003cp\u003eDataset placeholder.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } // }, @@ -641,6 +663,9 @@ func analysisResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

Dataset placeholder.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, diff --git a/internal/aws/quicksight/dashboard_resource_gen.go b/internal/aws/quicksight/dashboard_resource_gen.go index ad87d36fcb..bfc75514a1 100644 --- a/internal/aws/quicksight/dashboard_resource_gen.go +++ b/internal/aws/quicksight/dashboard_resource_gen.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,13 +41,14 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -74,13 +76,14 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -269,7 +272,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eA display name for the date-time parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -298,7 +301,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eA display name for the decimal parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -327,7 +330,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eThe name of the integer parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -356,7 +359,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eA display name for a string parameter.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Values": { @@ -393,6 +396,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

A display name for the date-time parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -418,6 +424,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

A display name for the decimal parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -443,6 +452,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The name of the integer parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -468,6 +480,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

A display name for a string parameter.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "values": { // Property: Values @@ -579,7 +594,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "DataSetPlaceholder": { // "description": "\u003cp\u003eDataset placeholder.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } // }, @@ -632,6 +647,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

Dataset placeholder.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, @@ -762,7 +780,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Message": { // "description": "\u003cp\u003eMessage.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Type": { @@ -794,14 +812,14 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eThe name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "SheetId": { // "description": "\u003cp\u003eThe unique identifier associated with a sheet.\u003c/p\u003e", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } // }, @@ -882,6 +900,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

Message.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "type": { // Property: Type @@ -920,6 +941,9 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "sheet_id": { // Property: SheetId @@ -928,6 +952,7 @@ func dashboardResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, }, }, diff --git a/internal/aws/quicksight/data_set_resource_gen.go b/internal/aws/quicksight/data_set_resource_gen.go index 29c3503d53..c27aa79a6c 100644 --- a/internal/aws/quicksight/data_set_resource_gen.go +++ b/internal/aws/quicksight/data_set_resource_gen.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,7 +41,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Type: types.StringType, @@ -48,6 +49,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -613,7 +615,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eLeft operand.\u003c/p\u003e", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9a-zA-Z-]*", // "type": "string" // }, // "OnClause": { @@ -634,7 +636,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eRight operand.\u003c/p\u003e", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9a-zA-Z-]*", // "type": "string" // }, // "Type": { @@ -659,7 +661,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003ePhysical table ID.\u003c/p\u003e", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[0-9a-zA-Z-]*", // "type": "string" // } // }, @@ -948,6 +950,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[0-9a-zA-Z-]*"), ""), }, }, "on_clause": { @@ -979,6 +982,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[0-9a-zA-Z-]*"), ""), }, }, "type": { @@ -1005,6 +1009,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[0-9a-zA-Z-]*"), ""), }, }, }, @@ -1693,7 +1698,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eThe namespace associated with the row-level permissions dataset.\u003c/p\u003e", // "maxLength": 64, // "minLength": 0, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9._-]*$", // "type": "string" // }, // "PermissionPolicy": { @@ -1737,6 +1742,7 @@ func dataSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9._-]*$"), ""), }, }, "permission_policy": { diff --git a/internal/aws/quicksight/data_source_resource_gen.go b/internal/aws/quicksight/data_source_resource_gen.go index 06eda90398..76e7447a0b 100644 --- a/internal/aws/quicksight/data_source_resource_gen.go +++ b/internal/aws/quicksight/data_source_resource_gen.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -1047,7 +1048,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Type: types.StringType, @@ -1055,6 +1056,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -1084,7 +1086,7 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "CopySourceArn": { // "description": "\u003cp\u003eThe Amazon Resource Name (ARN) of a data source that has the credential pair that you\n want to use. When \u003ccode\u003eCopySourceArn\u003c/code\u003e is not null, the credential pair from the\n data source in the ARN is used as the credentials for the\n \u003ccode\u003eDataSourceCredentials\u003c/code\u003e structure.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^arn:[-a-z0-9]*:quicksight:[-a-z0-9]*:[0-9]{12}:datasource/.+", // "type": "string" // }, // "CredentialPair": { @@ -1568,6 +1570,9 @@ func dataSourceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The Amazon Resource Name (ARN) of a data source that has the credential pair that you\n want to use. When CopySourceArn is not null, the credential pair from the\n data source in the ARN is used as the credentials for the\n DataSourceCredentials structure.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^arn:[-a-z0-9]*:quicksight:[-a-z0-9]*:[0-9]{12}:datasource/.+"), ""), + }, }, "credential_pair": { // Property: CredentialPair diff --git a/internal/aws/quicksight/template_resource_gen.go b/internal/aws/quicksight/template_resource_gen.go index de477139f0..dec8f8e5a9 100644 --- a/internal/aws/quicksight/template_resource_gen.go +++ b/internal/aws/quicksight/template_resource_gen.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,13 +41,14 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -192,7 +194,7 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "DataSetPlaceholder": { // "description": "\u003cp\u003eDataset placeholder.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // } // }, @@ -259,6 +261,9 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

Dataset placeholder.

", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, @@ -359,13 +364,14 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -480,7 +486,7 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Message": { // "description": "\u003cp\u003eDescription of the error type.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Type": { @@ -506,14 +512,14 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Name": { // "description": "\u003cp\u003eThe name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "SheetId": { // "description": "\u003cp\u003eThe unique identifier associated with a sheet.\u003c/p\u003e", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } // }, @@ -676,6 +682,9 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

Description of the error type.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "type": { // Property: Type @@ -708,6 +717,9 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The name of a sheet. This name is displayed on the sheet's tab in the QuickSight\n console.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "sheet_id": { // Property: SheetId @@ -716,6 +728,7 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, }, }, diff --git a/internal/aws/quicksight/theme_resource_gen.go b/internal/aws/quicksight/theme_resource_gen.go index a669894b62..a03b20cadc 100644 --- a/internal/aws/quicksight/theme_resource_gen.go +++ b/internal/aws/quicksight/theme_resource_gen.go @@ -4,6 +4,7 @@ package quicksight import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,13 +41,14 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 12, // "minLength": 12, - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 12), + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -59,7 +61,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eThe ID of the theme that a custom theme will inherit from. All themes inherit from one of\n\t\t\tthe starting themes defined by Amazon QuickSight. For a list of the starting themes, use\n\t\t\t\t\u003ccode\u003eListThemes\u003c/code\u003e or choose \u003cb\u003eThemes\u003c/b\u003e from\n\t\t\twithin a QuickSight analysis. \u003c/p\u003e", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } Description: "

The ID of the theme that a custom theme will inherit from. All themes inherit from one of\n\t\t\tthe starting themes defined by Amazon QuickSight. For a list of the starting themes, use\n\t\t\t\tListThemes or choose Themes from\n\t\t\twithin a QuickSight analysis.

", @@ -67,6 +69,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, // BaseThemeId is a write-only property. }, @@ -84,7 +87,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Colors": { // "description": "\u003cp\u003eThe hexadecimal codes for the colors.\u003c/p\u003e", // "items": { - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "maxItems": 100, @@ -93,13 +96,13 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "EmptyFillColor": { // "description": "\u003cp\u003eThe hexadecimal code of a color that applies to charts where a lack of data is\n highlighted.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "MinMaxGradient": { // "description": "\u003cp\u003eThe minimum and maximum hexadecimal codes that describe a color gradient. \u003c/p\u003e", // "items": { - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "maxItems": 100, @@ -190,82 +193,82 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Accent": { // "description": "\u003cp\u003eThis color is that applies to selected states and buttons.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "AccentForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n accent color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Danger": { // "description": "\u003cp\u003eThe color that applies to error messages.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "DangerForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n error color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Dimension": { // "description": "\u003cp\u003eThe color that applies to the names of fields that are identified as\n dimensions.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "DimensionForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n dimension color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Measure": { // "description": "\u003cp\u003eThe color that applies to the names of fields that are identified as measures.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "MeasureForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n measure color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "PrimaryBackground": { // "description": "\u003cp\u003eThe background color that applies to visuals and other high emphasis UI.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "PrimaryForeground": { // "description": "\u003cp\u003eThe color of text and other foreground elements that appear over the primary\n background regions, such as grid lines, borders, table banding, icons, and so on.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "SecondaryBackground": { // "description": "\u003cp\u003eThe background color that applies to the sheet background and sheet controls.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "SecondaryForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any sheet title, sheet control text, or UI that\n appears over the secondary background.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Success": { // "description": "\u003cp\u003eThe color that applies to success messages, for example the check mark for a\n successful download.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "SuccessForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n success color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Warning": { // "description": "\u003cp\u003eThis color that applies to warning and informational messages.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "WarningForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n warning color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // } // }, @@ -289,6 +292,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 100), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), "")), }, }, "empty_fill_color": { @@ -296,6 +300,9 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The hexadecimal code of a color that applies to charts where a lack of data is\n highlighted.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "min_max_gradient": { // Property: MinMaxGradient @@ -304,6 +311,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 100), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), "")), }, }, }, @@ -418,96 +426,144 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

This color is that applies to selected states and buttons.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "accent_foreground": { // Property: AccentForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n accent color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "danger": { // Property: Danger Description: "

The color that applies to error messages.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "danger_foreground": { // Property: DangerForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n error color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "dimension": { // Property: Dimension Description: "

The color that applies to the names of fields that are identified as\n dimensions.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "dimension_foreground": { // Property: DimensionForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n dimension color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "measure": { // Property: Measure Description: "

The color that applies to the names of fields that are identified as measures.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "measure_foreground": { // Property: MeasureForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n measure color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "primary_background": { // Property: PrimaryBackground Description: "

The background color that applies to visuals and other high emphasis UI.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "primary_foreground": { // Property: PrimaryForeground Description: "

The color of text and other foreground elements that appear over the primary\n background regions, such as grid lines, borders, table banding, icons, and so on.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "secondary_background": { // Property: SecondaryBackground Description: "

The background color that applies to the sheet background and sheet controls.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "secondary_foreground": { // Property: SecondaryForeground Description: "

The foreground color that applies to any sheet title, sheet control text, or UI that\n appears over the secondary background.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "success": { // Property: Success Description: "

The color that applies to success messages, for example the check mark for a\n successful download.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "success_foreground": { // Property: SuccessForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n success color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "warning": { // Property: Warning Description: "

This color that applies to warning and informational messages.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "warning_foreground": { // Property: WarningForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n warning color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, }, ), @@ -695,13 +751,14 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -739,7 +796,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "\u003cp\u003eThe Amazon QuickSight-defined ID of the theme that a custom theme inherits from. All\n themes initially inherit from a default QuickSight theme.\u003c/p\u003e", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w\\-]+", // "type": "string" // }, // "Configuration": { @@ -753,7 +810,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Colors": { // "description": "\u003cp\u003eThe hexadecimal codes for the colors.\u003c/p\u003e", // "items": { - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "maxItems": 100, @@ -762,13 +819,13 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "EmptyFillColor": { // "description": "\u003cp\u003eThe hexadecimal code of a color that applies to charts where a lack of data is\n highlighted.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "MinMaxGradient": { // "description": "\u003cp\u003eThe minimum and maximum hexadecimal codes that describe a color gradient. \u003c/p\u003e", // "items": { - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "maxItems": 100, @@ -859,82 +916,82 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Accent": { // "description": "\u003cp\u003eThis color is that applies to selected states and buttons.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "AccentForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n accent color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Danger": { // "description": "\u003cp\u003eThe color that applies to error messages.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "DangerForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n error color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Dimension": { // "description": "\u003cp\u003eThe color that applies to the names of fields that are identified as\n dimensions.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "DimensionForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n dimension color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Measure": { // "description": "\u003cp\u003eThe color that applies to the names of fields that are identified as measures.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "MeasureForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n measure color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "PrimaryBackground": { // "description": "\u003cp\u003eThe background color that applies to visuals and other high emphasis UI.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "PrimaryForeground": { // "description": "\u003cp\u003eThe color of text and other foreground elements that appear over the primary\n background regions, such as grid lines, borders, table banding, icons, and so on.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "SecondaryBackground": { // "description": "\u003cp\u003eThe background color that applies to the sheet background and sheet controls.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "SecondaryForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any sheet title, sheet control text, or UI that\n appears over the secondary background.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Success": { // "description": "\u003cp\u003eThe color that applies to success messages, for example the check mark for a\n successful download.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "SuccessForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n success color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "Warning": { // "description": "\u003cp\u003eThis color that applies to warning and informational messages.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // }, // "WarningForeground": { // "description": "\u003cp\u003eThe foreground color that applies to any text or other elements that appear over the\n warning color.\u003c/p\u003e", - // "pattern": "", + // "pattern": "^#[A-F0-9]{6}$", // "type": "string" // } // }, @@ -962,7 +1019,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Message": { // "description": "\u003cp\u003eThe error message.\u003c/p\u003e", - // "pattern": "", + // "pattern": ".*\\S.*", // "type": "string" // }, // "Type": { @@ -1013,6 +1070,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[\\w\\-]+"), ""), }, }, "configuration": { @@ -1032,6 +1090,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 100), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), "")), }, }, "empty_fill_color": { @@ -1039,6 +1098,9 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The hexadecimal code of a color that applies to charts where a lack of data is\n highlighted.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "min_max_gradient": { // Property: MinMaxGradient @@ -1047,6 +1109,7 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 100), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), "")), }, }, }, @@ -1161,96 +1224,144 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

This color is that applies to selected states and buttons.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "accent_foreground": { // Property: AccentForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n accent color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "danger": { // Property: Danger Description: "

The color that applies to error messages.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "danger_foreground": { // Property: DangerForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n error color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "dimension": { // Property: Dimension Description: "

The color that applies to the names of fields that are identified as\n dimensions.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "dimension_foreground": { // Property: DimensionForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n dimension color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "measure": { // Property: Measure Description: "

The color that applies to the names of fields that are identified as measures.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "measure_foreground": { // Property: MeasureForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n measure color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "primary_background": { // Property: PrimaryBackground Description: "

The background color that applies to visuals and other high emphasis UI.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "primary_foreground": { // Property: PrimaryForeground Description: "

The color of text and other foreground elements that appear over the primary\n background regions, such as grid lines, borders, table banding, icons, and so on.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "secondary_background": { // Property: SecondaryBackground Description: "

The background color that applies to the sheet background and sheet controls.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "secondary_foreground": { // Property: SecondaryForeground Description: "

The foreground color that applies to any sheet title, sheet control text, or UI that\n appears over the secondary background.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "success": { // Property: Success Description: "

The color that applies to success messages, for example the check mark for a\n successful download.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "success_foreground": { // Property: SuccessForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n success color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "warning": { // Property: Warning Description: "

This color that applies to warning and informational messages.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, "warning_foreground": { // Property: WarningForeground Description: "

The foreground color that applies to any text or other elements that appear over the\n warning color.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^#[A-F0-9]{6}$"), ""), + }, }, }, ), @@ -1285,6 +1396,9 @@ func themeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "

The error message.

", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile(".*\\S.*"), ""), + }, }, "type": { // Property: Type diff --git a/internal/aws/rds/db_proxy_endpoint_resource_gen.go b/internal/aws/rds/db_proxy_endpoint_resource_gen.go index 9846c9abc7..57beb46512 100644 --- a/internal/aws/rds/db_proxy_endpoint_resource_gen.go +++ b/internal/aws/rds/db_proxy_endpoint_resource_gen.go @@ -4,6 +4,7 @@ package rds import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the DB proxy endpoint.", - // "pattern": "", + // "pattern": "arn:aws[A-Za-z0-9-]{0,64}:rds:[A-Za-z0-9-]{1,64}:[0-9]{12}:.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the DB proxy endpoint.", @@ -41,7 +42,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "description": "The identifier for the DB proxy endpoint. This name must be unique for all DB proxy endpoints owned by your AWS account in the specified AWS Region.", // "maxLength": 64, - // "pattern": "", + // "pattern": "[0-z]*", // "type": "string" // } Description: "The identifier for the DB proxy endpoint. This name must be unique for all DB proxy endpoints owned by your AWS account in the specified AWS Region.", @@ -49,6 +50,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(64), + validate.StringMatch(regexp.MustCompile("[0-z]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -60,7 +62,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "description": "The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.", // "maxLength": 64, - // "pattern": "", + // "pattern": "[0-z]*", // "type": "string" // } Description: "The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.", @@ -68,6 +70,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(64), + validate.StringMatch(regexp.MustCompile("[0-z]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -113,12 +116,12 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error // "properties": { // "Key": { // "maxLength": 128, - // "pattern": "", + // "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", // "type": "string" // }, // "Value": { // "maxLength": 128, - // "pattern": "", + // "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", // "type": "string" // } // }, @@ -135,6 +138,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("(\\w|\\d|\\s|\\\\|-|\\.:=+-)*"), ""), }, }, "value": { @@ -143,6 +147,7 @@ func dBProxyEndpointResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("(\\w|\\d|\\s|\\\\|-|\\.:=+-)*"), ""), }, }, }, diff --git a/internal/aws/rds/db_proxy_resource_gen.go b/internal/aws/rds/db_proxy_resource_gen.go index 8cb7a2ccaa..f43c3882df 100644 --- a/internal/aws/rds/db_proxy_resource_gen.go +++ b/internal/aws/rds/db_proxy_resource_gen.go @@ -4,6 +4,7 @@ package rds import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -132,7 +133,7 @@ func dBProxyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.", // "maxLength": 64, - // "pattern": "", + // "pattern": "[0-z]*", // "type": "string" // } Description: "The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.", @@ -140,6 +141,7 @@ func dBProxyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(64), + validate.StringMatch(regexp.MustCompile("[0-z]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -236,12 +238,12 @@ func dBProxyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "properties": { // "Key": { // "maxLength": 128, - // "pattern": "", + // "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", // "type": "string" // }, // "Value": { // "maxLength": 128, - // "pattern": "", + // "pattern": "(\\w|\\d|\\s|\\\\|-|\\.:=+-)*", // "type": "string" // } // }, @@ -258,6 +260,7 @@ func dBProxyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("(\\w|\\d|\\s|\\\\|-|\\.:=+-)*"), ""), }, }, "value": { @@ -266,6 +269,7 @@ func dBProxyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("(\\w|\\d|\\s|\\\\|-|\\.:=+-)*"), ""), }, }, }, diff --git a/internal/aws/rds/db_proxy_target_group_resource_gen.go b/internal/aws/rds/db_proxy_target_group_resource_gen.go index 31d5601ba1..4329c58c91 100644 --- a/internal/aws/rds/db_proxy_target_group_resource_gen.go +++ b/internal/aws/rds/db_proxy_target_group_resource_gen.go @@ -4,6 +4,7 @@ package rds import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -127,7 +128,7 @@ func dBProxyTargetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The identifier for the proxy.", // "maxLength": 64, - // "pattern": "", + // "pattern": "[A-z][0-z]*", // "type": "string" // } Description: "The identifier for the proxy.", @@ -135,6 +136,7 @@ func dBProxyTargetGroupResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(64), + validate.StringMatch(regexp.MustCompile("[A-z][0-z]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/rds/global_cluster_resource_gen.go b/internal/aws/rds/global_cluster_resource_gen.go index 03b68c0155..4fcead0be9 100644 --- a/internal/aws/rds/global_cluster_resource_gen.go +++ b/internal/aws/rds/global_cluster_resource_gen.go @@ -4,6 +4,7 @@ package rds import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -80,13 +81,16 @@ func globalClusterResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The cluster identifier of the new global database cluster. This parameter is stored as a lowercase string.", - // "pattern": "", + // "pattern": "^[a-zA-Z]{1}(?:-?[a-zA-Z0-9]){0,62}$", // "type": "string" // } Description: "The cluster identifier of the new global database cluster. This parameter is stored as a lowercase string.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z]{1}(?:-?[a-zA-Z0-9]){0,62}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/redshift/endpoint_access_resource_gen.go b/internal/aws/redshift/endpoint_access_resource_gen.go index e4830d46fa..613a7c1a50 100644 --- a/internal/aws/redshift/endpoint_access_resource_gen.go +++ b/internal/aws/redshift/endpoint_access_resource_gen.go @@ -4,11 +4,13 @@ package redshift import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -111,13 +113,16 @@ func endpointAccessResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The AWS account ID of the owner of the cluster.", - // "pattern": "", + // "pattern": "^\\d{12}$", // "type": "string" // } Description: "The AWS account ID of the owner of the cluster.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^\\d{12}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/redshift/endpoint_authorization_resource_gen.go b/internal/aws/redshift/endpoint_authorization_resource_gen.go index cfdf21af29..692b1c081a 100644 --- a/internal/aws/redshift/endpoint_authorization_resource_gen.go +++ b/internal/aws/redshift/endpoint_authorization_resource_gen.go @@ -4,11 +4,13 @@ package redshift import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -24,12 +26,15 @@ func endpointAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The target AWS account ID to grant or revoke access for.", - // "pattern": "", + // "pattern": "^\\d{12}$", // "type": "string" // } Description: "The target AWS account ID to grant or revoke access for.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^\\d{12}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -55,7 +60,7 @@ func endpointAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The VPCs allowed access to the cluster.", // "insertionOrder": false, // "items": { - // "pattern": "", + // "pattern": "^vpc-\\d{1,17}$", // "type": "string" // }, // "type": "array" @@ -142,7 +147,7 @@ func endpointAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The AWS account ID of the grantee of the cluster.", - // "pattern": "", + // "pattern": "^\\d{12}$", // "type": "string" // } Description: "The AWS account ID of the grantee of the cluster.", @@ -157,7 +162,7 @@ func endpointAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceType, // CloudFormation resource type schema: // { // "description": "The AWS account ID of the cluster owner.", - // "pattern": "", + // "pattern": "^\\d{12}$", // "type": "string" // } Description: "The AWS account ID of the cluster owner.", @@ -188,7 +193,7 @@ func endpointAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The virtual private cloud (VPC) identifiers to grant or revoke access to.", // "insertionOrder": false, // "items": { - // "pattern": "", + // "pattern": "^vpc-\\d{1,17}$", // "type": "string" // }, // "type": "array" @@ -196,6 +201,9 @@ func endpointAuthorizationResourceType(ctx context.Context) (tfsdk.ResourceType, Description: "The virtual private cloud (VPC) identifiers to grant or revoke access to.", Type: types.ListType{ElemType: types.StringType}, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^vpc-\\d{1,17}$"), "")), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, diff --git a/internal/aws/refactorspaces/environment_resource_gen.go b/internal/aws/refactorspaces/environment_resource_gen.go index 717f9082f6..d4dfcd0c51 100644 --- a/internal/aws/refactorspaces/environment_resource_gen.go +++ b/internal/aws/refactorspaces/environment_resource_gen.go @@ -4,6 +4,7 @@ package refactorspaces import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:(aws[a-zA-Z-]*)?:refactor-spaces:[a-zA-Z0-9\\-]+:\\w{12}:[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Type: types.StringType, @@ -41,7 +42,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_\\s\\.\\!\\*\\#\\@\\']+$", // "type": "string" // } Type: types.StringType, @@ -49,6 +50,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_\\s\\.\\!\\*\\#\\@\\']+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -62,7 +64,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^env-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, @@ -182,7 +184,7 @@ func environmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 21, // "minLength": 21, - // "pattern": "", + // "pattern": "^tgw-[-a-f0-9]{17}$", // "type": "string" // } Type: types.StringType, diff --git a/internal/aws/refactorspaces/route_resource_gen.go b/internal/aws/refactorspaces/route_resource_gen.go index 1a832e39e8..358e0a9443 100644 --- a/internal/aws/refactorspaces/route_resource_gen.go +++ b/internal/aws/refactorspaces/route_resource_gen.go @@ -4,6 +4,7 @@ package refactorspaces import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,13 +27,14 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^app-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(14, 14), + validate.StringMatch(regexp.MustCompile("^app-([0-9A-Za-z]{10}$)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -44,7 +46,7 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:(aws[a-zA-Z-]*)?:refactor-spaces:[a-zA-Z0-9\\-]+:\\w{12}:[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Type: types.StringType, @@ -59,13 +61,14 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^env-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(14, 14), + validate.StringMatch(regexp.MustCompile("^env-([0-9A-Za-z]{10}$)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -89,7 +92,7 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^rte-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, @@ -129,13 +132,14 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^svc-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(14, 14), + validate.StringMatch(regexp.MustCompile("^svc-([0-9A-Za-z]{10}$)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -237,7 +241,7 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SourcePath": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^(/[a-zA-Z0-9._-]+)+$", // "type": "string" // } // }, @@ -288,6 +292,7 @@ func routeResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^(/[a-zA-Z0-9._-]+)+$"), ""), }, }, }, diff --git a/internal/aws/refactorspaces/service_resource_gen.go b/internal/aws/refactorspaces/service_resource_gen.go index c6917774e2..1479d9e819 100644 --- a/internal/aws/refactorspaces/service_resource_gen.go +++ b/internal/aws/refactorspaces/service_resource_gen.go @@ -4,6 +4,7 @@ package refactorspaces import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,13 +27,14 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^app-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(14, 14), + validate.StringMatch(regexp.MustCompile("^app-([0-9A-Za-z]{10}$)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -44,7 +46,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:(aws[a-zA-Z-]*)?:refactor-spaces:[a-zA-Z0-9\\-]+:\\w{12}:[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Type: types.StringType, @@ -59,7 +61,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9-_\\s\\.\\!\\*\\#\\@\\']+$", // "type": "string" // } Type: types.StringType, @@ -67,6 +69,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9-_\\s\\.\\!\\*\\#\\@\\']+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -105,13 +108,14 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^env-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(14, 14), + validate.StringMatch(regexp.MustCompile("^env-([0-9A-Za-z]{10}$)"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -126,7 +130,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Arn": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_]+(:\n(\\$LATEST|[a-zA-Z0-9-_]+))?$", // "type": "string" // } // }, @@ -143,6 +147,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_]+(:\n(\\$LATEST|[a-zA-Z0-9-_]+))?$"), ""), }, }, }, @@ -182,7 +187,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 14, // "minLength": 14, - // "pattern": "", + // "pattern": "^svc-([0-9A-Za-z]{10}$)", // "type": "string" // } Type: types.StringType, @@ -261,13 +266,13 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "HealthUrl": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^https?://[-a-zA-Z0-9+\\x38@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\\x38@#/%=~_|]$", // "type": "string" // }, // "Url": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^https?://[-a-zA-Z0-9+\\x38@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\\x38@#/%=~_|]$", // "type": "string" // } // }, @@ -284,6 +289,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^https?://[-a-zA-Z0-9+\\x38@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\\x38@#/%=~_|]$"), ""), }, }, "url": { @@ -292,6 +298,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^https?://[-a-zA-Z0-9+\\x38@#/%?=~_|!:,.;]*[-a-zA-Z0-9+\\x38@#/%=~_|]$"), ""), }, }, }, @@ -310,7 +317,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "maxLength": 21, // "minLength": 12, - // "pattern": "", + // "pattern": "^vpc-[-a-f0-9]{8}([-a-f0-9]{9})?$", // "type": "string" // } Type: types.StringType, @@ -318,6 +325,7 @@ func serviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(12, 21), + validate.StringMatch(regexp.MustCompile("^vpc-[-a-f0-9]{8}([-a-f0-9]{9})?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/rekognition/collection_resource_gen.go b/internal/aws/rekognition/collection_resource_gen.go index baaf6ddf30..b93f66389b 100644 --- a/internal/aws/rekognition/collection_resource_gen.go +++ b/internal/aws/rekognition/collection_resource_gen.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func collectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name of the collection", // "maxLength": 255, - // "pattern": "", + // "pattern": "\\A[a-zA-Z0-9_\\.\\-]+$", // "type": "string" // } Description: "The name of the collection", @@ -49,6 +50,7 @@ func collectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile("\\A[a-zA-Z0-9_\\.\\-]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -73,7 +75,7 @@ func collectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Value": { // "description": "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 256, - // "pattern": "", + // "pattern": "\\A[a-zA-Z0-9+\\-=\\._\\:\\/@]+$", // "type": "string" // } // }, @@ -107,6 +109,7 @@ func collectionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("\\A[a-zA-Z0-9+\\-=\\._\\:\\/@]+$"), ""), }, }, }, diff --git a/internal/aws/rekognition/project_resource_gen.go b/internal/aws/rekognition/project_resource_gen.go index 166e1bd89c..bba692e836 100644 --- a/internal/aws/rekognition/project_resource_gen.go +++ b/internal/aws/rekognition/project_resource_gen.go @@ -4,6 +4,7 @@ package rekognition import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,7 +26,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "maxLength": 2048, - // "pattern": "", + // "pattern": "(^arn:[a-z\\d-]+:rekognition:[a-z\\d-]+:\\d{12}:project/[a-zA-Z0-9_.\\-]{1,255}/[0-9]+$)", // "type": "string" // } Type: types.StringType, @@ -41,7 +42,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the project", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9][a-zA-Z0-9_\\-]*", // "type": "string" // } Description: "The name of the project", @@ -49,6 +50,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9][a-zA-Z0-9_\\-]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/resiliencehub/app_resource_gen.go b/internal/aws/resiliencehub/app_resource_gen.go index c4d777ae65..349461584c 100644 --- a/internal/aws/resiliencehub/app_resource_gen.go +++ b/internal/aws/resiliencehub/app_resource_gen.go @@ -4,6 +4,7 @@ package resiliencehub import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A string containing full ResilienceHub app template body.", // "maxLength": 5000, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w\\s:,-\\.'{}\\[\\]:\"]+$", // "type": "string" // } Description: "A string containing full ResilienceHub app template body.", @@ -50,6 +51,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 5000), + validate.StringMatch(regexp.MustCompile("^[\\w\\s:,-\\.'{}\\[\\]:\"]+$"), ""), }, }, "description": { @@ -73,12 +75,15 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Name of the app.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$", // "type": "string" // } Description: "Name of the app.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -109,18 +114,18 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "type": "string" // }, // "MappingType": { - // "pattern": "", + // "pattern": "CfnStack|Resource", // "type": "string" // }, // "PhysicalResourceId": { // "additionalProperties": false, // "properties": { // "AwsAccountId": { - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // }, // "AwsRegion": { - // "pattern": "", + // "pattern": "^[a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]$", // "type": "string" // }, // "Identifier": { @@ -129,7 +134,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "type": "string" // }, // "Type": { - // "pattern": "", + // "pattern": "Arn|Native", // "type": "string" // } // }, @@ -140,7 +145,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "type": "object" // }, // "ResourceName": { - // "pattern": "", + // "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$", // "type": "string" // } // }, @@ -165,6 +170,9 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: MappingType Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("CfnStack|Resource"), ""), + }, }, "physical_resource_id": { // Property: PhysicalResourceId @@ -174,11 +182,17 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: AwsAccountId Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), ""), + }, }, "aws_region": { // Property: AwsRegion Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]$"), ""), + }, }, "identifier": { // Property: Identifier @@ -192,6 +206,9 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Type Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("Arn|Native"), ""), + }, }, }, ), @@ -201,6 +218,9 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: ResourceName Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, diff --git a/internal/aws/resiliencehub/resiliency_policy_resource_gen.go b/internal/aws/resiliencehub/resiliency_policy_resource_gen.go index f790d470be..c78253a12e 100644 --- a/internal/aws/resiliencehub/resiliency_policy_resource_gen.go +++ b/internal/aws/resiliencehub/resiliency_policy_resource_gen.go @@ -4,6 +4,7 @@ package resiliencehub import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -126,12 +127,15 @@ func resiliencyPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, erro // CloudFormation resource type schema: // { // "description": "Name of Resiliency Policy.", - // "pattern": "", + // "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$", // "type": "string" // } Description: "Name of Resiliency Policy.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$"), ""), + }, }, "tags": { // Property: Tags diff --git a/internal/aws/robomaker/fleet_resource_gen.go b/internal/aws/robomaker/fleet_resource_gen.go index 9f927a41ab..be64658e63 100644 --- a/internal/aws/robomaker/fleet_resource_gen.go +++ b/internal/aws/robomaker/fleet_resource_gen.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, @@ -40,7 +41,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the fleet.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_\\-]{1,255}$", // "type": "string" // } Description: "The name of the fleet.", @@ -49,6 +50,7 @@ func fleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_\\-]{1,255}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/robomaker/robot_application_resource_gen.go b/internal/aws/robomaker/robot_application_resource_gen.go index b2ddba639c..505018c780 100644 --- a/internal/aws/robomaker/robot_application_resource_gen.go +++ b/internal/aws/robomaker/robot_application_resource_gen.go @@ -24,7 +24,7 @@ func robotApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, erro // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, diff --git a/internal/aws/robomaker/robot_application_version_resource_gen.go b/internal/aws/robomaker/robot_application_version_resource_gen.go index ffdaff54ef..2146dc3fed 100644 --- a/internal/aws/robomaker/robot_application_version_resource_gen.go +++ b/internal/aws/robomaker/robot_application_version_resource_gen.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,11 +25,14 @@ func robotApplicationVersionResourceType(ctx context.Context) (tfsdk.ResourceTyp // Property: Application // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -49,7 +53,7 @@ func robotApplicationVersionResourceType(ctx context.Context) (tfsdk.ResourceTyp // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, @@ -65,7 +69,7 @@ func robotApplicationVersionResourceType(ctx context.Context) (tfsdk.ResourceTyp // "description": "The revision ID of robot application.", // "maxLength": 40, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_.\\-]*", // "type": "string" // } Description: "The revision ID of robot application.", @@ -74,6 +78,7 @@ func robotApplicationVersionResourceType(ctx context.Context) (tfsdk.ResourceTyp Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 40), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_.\\-]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/robomaker/robot_resource_gen.go b/internal/aws/robomaker/robot_resource_gen.go index 8f28f451d4..d7620e2a23 100644 --- a/internal/aws/robomaker/robot_resource_gen.go +++ b/internal/aws/robomaker/robot_resource_gen.go @@ -50,7 +50,7 @@ func robotResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, diff --git a/internal/aws/robomaker/simulation_application_resource_gen.go b/internal/aws/robomaker/simulation_application_resource_gen.go index cd9cad87d1..7608d4c739 100644 --- a/internal/aws/robomaker/simulation_application_resource_gen.go +++ b/internal/aws/robomaker/simulation_application_resource_gen.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, @@ -62,7 +63,7 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, // "description": "The name of the simulation application.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_\\-]*", // "type": "string" // } Description: "The name of the simulation application.", @@ -71,6 +72,7 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_\\-]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -93,7 +95,7 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, // }, // "Version": { // "description": "The version of the rendering engine.", - // "pattern": "", + // "pattern": "1.x", // "type": "string" // } // }, @@ -122,6 +124,9 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, Description: "The version of the rendering engine.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("1.x"), ""), + }, }, }, ), @@ -286,7 +291,7 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, // }, // "S3Bucket": { // "description": "The Amazon S3 bucket name.", - // "pattern": "", + // "pattern": "[a-z0-9][a-z0-9.\\-]*[a-z0-9]", // "type": "string" // }, // "S3Key": { @@ -326,6 +331,9 @@ func simulationApplicationResourceType(ctx context.Context) (tfsdk.ResourceType, Description: "The Amazon S3 bucket name.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("[a-z0-9][a-z0-9.\\-]*[a-z0-9]"), ""), + }, }, "s3_key": { // Property: S3Key diff --git a/internal/aws/robomaker/simulation_application_version_resource_gen.go b/internal/aws/robomaker/simulation_application_version_resource_gen.go index 322a5e1dd5..1e16770917 100644 --- a/internal/aws/robomaker/simulation_application_version_resource_gen.go +++ b/internal/aws/robomaker/simulation_application_version_resource_gen.go @@ -4,6 +4,7 @@ package robomaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,11 +25,14 @@ func simulationApplicationVersionResourceType(ctx context.Context) (tfsdk.Resour // Property: Application // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -49,7 +53,7 @@ func simulationApplicationVersionResourceType(ctx context.Context) (tfsdk.Resour // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*", // "type": "string" // } Type: types.StringType, @@ -65,7 +69,7 @@ func simulationApplicationVersionResourceType(ctx context.Context) (tfsdk.Resour // "description": "The revision ID of robot application.", // "maxLength": 40, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_.\\-]*", // "type": "string" // } Description: "The revision ID of robot application.", @@ -74,6 +78,7 @@ func simulationApplicationVersionResourceType(ctx context.Context) (tfsdk.Resour Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 40), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_.\\-]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/route53/dnssec_resource_gen.go b/internal/aws/route53/dnssec_resource_gen.go index 3c5280f4ad..7ce729c905 100644 --- a/internal/aws/route53/dnssec_resource_gen.go +++ b/internal/aws/route53/dnssec_resource_gen.go @@ -4,11 +4,13 @@ package route53 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -24,12 +26,15 @@ func dNSSECResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The unique string (ID) used to identify a hosted zone.", - // "pattern": "", + // "pattern": "^[A-Z0-9]{1,32}$", // "type": "string" // } Description: "The unique string (ID) used to identify a hosted zone.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z0-9]{1,32}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/route53/health_check_resource_gen.go b/internal/aws/route53/health_check_resource_gen.go index 35c907c7dc..87d22acdba 100644 --- a/internal/aws/route53/health_check_resource_gen.go +++ b/internal/aws/route53/health_check_resource_gen.go @@ -4,6 +4,7 @@ package route53 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -75,7 +76,7 @@ func healthCheckResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "IPAddress": { // "maxLength": 45, - // "pattern": "", + // "pattern": "^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", // "type": "string" // }, // "InsufficientDataHealthStatus": { @@ -215,6 +216,7 @@ func healthCheckResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(45), + validate.StringMatch(regexp.MustCompile("^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$"), ""), }, }, "insufficient_data_health_status": { diff --git a/internal/aws/route53/key_signing_key_resource_gen.go b/internal/aws/route53/key_signing_key_resource_gen.go index 86c5486ed3..c8e03d5d7e 100644 --- a/internal/aws/route53/key_signing_key_resource_gen.go +++ b/internal/aws/route53/key_signing_key_resource_gen.go @@ -4,6 +4,7 @@ package route53 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,12 +26,15 @@ func keySigningKeyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The unique string (ID) used to identify a hosted zone.", - // "pattern": "", + // "pattern": "^[A-Z0-9]{1,32}$", // "type": "string" // } Description: "The unique string (ID) used to identify a hosted zone.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[A-Z0-9]{1,32}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -59,12 +63,15 @@ func keySigningKeyResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "An alphanumeric string used to identify a key signing key (KSK). Name must be unique for each key signing key in the same hosted zone.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_]{3,128}$", // "type": "string" // } Description: "An alphanumeric string used to identify a key signing key (KSK). Name must be unique for each key signing key in the same hosted zone.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_]{3,128}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/route53recoveryreadiness/cell_resource_gen.go b/internal/aws/route53recoveryreadiness/cell_resource_gen.go index 91994eaee4..866916b816 100644 --- a/internal/aws/route53recoveryreadiness/cell_resource_gen.go +++ b/internal/aws/route53recoveryreadiness/cell_resource_gen.go @@ -4,6 +4,7 @@ package route53recoveryreadiness import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func cellResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The name of the cell to create.", // "maxLength": 64, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_]+", // "type": "string" // } Description: "The name of the cell to create.", @@ -49,6 +50,7 @@ func cellResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/route53recoveryreadiness/readiness_check_resource_gen.go b/internal/aws/route53recoveryreadiness/readiness_check_resource_gen.go index 8aecaa15ef..981d184c61 100644 --- a/internal/aws/route53recoveryreadiness/readiness_check_resource_gen.go +++ b/internal/aws/route53recoveryreadiness/readiness_check_resource_gen.go @@ -4,6 +4,7 @@ package route53recoveryreadiness import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func readinessCheckResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "Name of the ReadinessCheck to create.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_]+", // "type": "string" // } Description: "Name of the ReadinessCheck to create.", @@ -50,6 +51,7 @@ func readinessCheckResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -62,7 +64,7 @@ func readinessCheckResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the resource set to check.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_]+", // "type": "string" // } Description: "The name of the resource set to check.", @@ -70,6 +72,7 @@ func readinessCheckResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_]+"), ""), }, }, "tags": { diff --git a/internal/aws/route53recoveryreadiness/recovery_group_resource_gen.go b/internal/aws/route53recoveryreadiness/recovery_group_resource_gen.go index 32b7c2e916..1acf1b3441 100644 --- a/internal/aws/route53recoveryreadiness/recovery_group_resource_gen.go +++ b/internal/aws/route53recoveryreadiness/recovery_group_resource_gen.go @@ -4,6 +4,7 @@ package route53recoveryreadiness import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -67,7 +68,7 @@ func recoveryGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the recovery group to create.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_]+", // "type": "string" // } Description: "The name of the recovery group to create.", @@ -75,6 +76,7 @@ func recoveryGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/rum/app_monitor_resource_gen.go b/internal/aws/rum/app_monitor_resource_gen.go index fc73b3bca7..babf5b980f 100644 --- a/internal/aws/rum/app_monitor_resource_gen.go +++ b/internal/aws/rum/app_monitor_resource_gen.go @@ -4,6 +4,7 @@ package rum import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Page Url", // "maxLength": 1260, // "minLength": 1, - // "pattern": "", + // "pattern": "https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?\u0026//=]*)", // "type": "string" // }, // "maxItems": 50, @@ -61,14 +62,14 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "GuestRoleArn": { // "description": "The ARN of the guest IAM role that is attached to the identity pool that is used to authorize the sending of data to RUM.", - // "pattern": "", + // "pattern": "arn:[^:]*:[^:]*:[^:]*:[^:]*:.*", // "type": "string" // }, // "IdentityPoolId": { // "description": "The ID of the identity pool that is used to authorize the sending of data to RUM.", // "maxLength": 55, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w-]+:[0-9a-f-]+", // "type": "string" // }, // "IncludedPages": { @@ -78,7 +79,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Page Url", // "maxLength": 1260, // "minLength": 1, - // "pattern": "", + // "pattern": "https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?\u0026//=]*)", // "type": "string" // }, // "maxItems": 50, @@ -130,6 +131,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 50), validate.ArrayForEach(validate.StringLenBetween(1, 1260)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -152,6 +154,9 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The ARN of the guest IAM role that is attached to the identity pool that is used to authorize the sending of data to RUM.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("arn:[^:]*:[^:]*:[^:]*:[^:]*:.*"), ""), + }, }, "identity_pool_id": { // Property: IdentityPoolId @@ -160,6 +165,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 55), + validate.StringMatch(regexp.MustCompile("[\\w-]+:[0-9a-f-]+"), ""), }, }, "included_pages": { @@ -170,6 +176,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 50), validate.ArrayForEach(validate.StringLenBetween(1, 1260)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), @@ -239,7 +246,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A name for the app monitor", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\.\\-_/#A-Za-z0-9]+", // "type": "string" // } Description: "A name for the app monitor", @@ -247,6 +254,7 @@ func appMonitorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("[\\.\\-_/#A-Za-z0-9]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/s3/access_point_resource_gen.go b/internal/aws/s3/access_point_resource_gen.go index 3b25f40a84..a1f19e5113 100644 --- a/internal/aws/s3/access_point_resource_gen.go +++ b/internal/aws/s3/access_point_resource_gen.go @@ -27,7 +27,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The alias of this Access Point. This alias can be used for compatibility purposes with other AWS services and third-party applications.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", // "type": "string" // } Description: "The alias of this Access Point. This alias can be used for compatibility purposes with other AWS services and third-party applications.", @@ -77,7 +77,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name you want to assign to this Access Point. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the access point name.", // "maxLength": 50, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", // "type": "string" // } Description: "The name you want to assign to this Access Point. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the access point name.", diff --git a/internal/aws/s3/bucket_resource_gen.go b/internal/aws/s3/bucket_resource_gen.go index b3cab546e0..970b97a492 100644 --- a/internal/aws/s3/bucket_resource_gen.go +++ b/internal/aws/s3/bucket_resource_gen.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -430,7 +431,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A name for the bucket. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the bucket name.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$", // "type": "string" // } Description: "A name for the bucket. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the bucket name.", @@ -439,6 +440,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -1069,7 +1071,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "ExpirationDate": { // "description": "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // }, // "ExpirationInDays": { @@ -1174,12 +1176,12 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "ObjectSizeGreaterThan": { // "maxLength": 20, - // "pattern": "", + // "pattern": "[0-9]+", // "type": "string" // }, // "ObjectSizeLessThan": { // "maxLength": 20, - // "pattern": "", + // "pattern": "[0-9]+", // "type": "string" // }, // "Prefix": { @@ -1232,7 +1234,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "TransitionDate": { // "description": "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // }, // "TransitionInDays": { @@ -1264,7 +1266,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "TransitionDate": { // "description": "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // }, // "TransitionInDays": { @@ -1325,6 +1327,9 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$"), ""), + }, }, "expiration_in_days": { // Property: ExpirationInDays @@ -1455,6 +1460,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(20), + validate.StringMatch(regexp.MustCompile("[0-9]+"), ""), }, }, "object_size_less_than": { @@ -1463,6 +1469,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(20), + validate.StringMatch(regexp.MustCompile("[0-9]+"), ""), }, }, "prefix": { @@ -1529,6 +1536,9 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$"), ""), + }, }, "transition_in_days": { // Property: TransitionInDays @@ -1564,6 +1574,9 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ)", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$"), ""), + }, }, "transition_in_days": { // Property: TransitionInDays diff --git a/internal/aws/s3/multi_region_access_point_policy_resource_gen.go b/internal/aws/s3/multi_region_access_point_policy_resource_gen.go index 59bacb70f6..2d5dac78ec 100644 --- a/internal/aws/s3/multi_region_access_point_policy_resource_gen.go +++ b/internal/aws/s3/multi_region_access_point_policy_resource_gen.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func multiRegionAccessPointPolicyResourceType(ctx context.Context) (tfsdk.Resour // "description": "The name of the Multi Region Access Point to apply policy", // "maxLength": 50, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][-a-z0-9]{1,48}[a-z0-9]$", // "type": "string" // } Description: "The name of the Multi Region Access Point to apply policy", @@ -35,6 +36,7 @@ func multiRegionAccessPointPolicyResourceType(ctx context.Context) (tfsdk.Resour Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 50), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][-a-z0-9]{1,48}[a-z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/s3/multi_region_access_point_resource_gen.go b/internal/aws/s3/multi_region_access_point_resource_gen.go index 9074e7b8d9..295320b4ff 100644 --- a/internal/aws/s3/multi_region_access_point_resource_gen.go +++ b/internal/aws/s3/multi_region_access_point_resource_gen.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -55,7 +56,7 @@ func multiRegionAccessPointResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "The name you want to assign to this Multi Region Access Point.", // "maxLength": 50, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][-a-z0-9]{1,48}[a-z0-9]$", // "type": "string" // } Description: "The name you want to assign to this Multi Region Access Point.", @@ -64,6 +65,7 @@ func multiRegionAccessPointResourceType(ctx context.Context) (tfsdk.ResourceType Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 50), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][-a-z0-9]{1,48}[a-z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -144,7 +146,7 @@ func multiRegionAccessPointResourceType(ctx context.Context) (tfsdk.ResourceType // "Bucket": { // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$", // "type": "string" // } // }, @@ -166,6 +168,7 @@ func multiRegionAccessPointResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$"), ""), }, }, }, diff --git a/internal/aws/s3/storage_lens_resource_gen.go b/internal/aws/s3/storage_lens_resource_gen.go index 5082d378c7..b61c68d2ed 100644 --- a/internal/aws/s3/storage_lens_resource_gen.go +++ b/internal/aws/s3/storage_lens_resource_gen.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -234,7 +235,7 @@ func storageLensResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ID that identifies the Amazon S3 Storage Lens configuration.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9\\-_.]+$", // "type": "string" // }, // "Include": { @@ -524,6 +525,7 @@ func storageLensResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-_.]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/s3objectlambda/access_point_policy_resource_gen.go b/internal/aws/s3objectlambda/access_point_policy_resource_gen.go index de5d52aeb0..20f6092bb9 100644 --- a/internal/aws/s3objectlambda/access_point_policy_resource_gen.go +++ b/internal/aws/s3objectlambda/access_point_policy_resource_gen.go @@ -4,6 +4,7 @@ package s3objectlambda import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func accessPointPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The name of the Amazon S3 ObjectLambdaAccessPoint to which the policy applies.", // "maxLength": 45, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", // "type": "string" // } Description: "The name of the Amazon S3 ObjectLambdaAccessPoint to which the policy applies.", @@ -35,6 +36,7 @@ func accessPointPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, err Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 45), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/s3objectlambda/access_point_resource_gen.go b/internal/aws/s3objectlambda/access_point_resource_gen.go index f20021cd95..8098005f16 100644 --- a/internal/aws/s3objectlambda/access_point_resource_gen.go +++ b/internal/aws/s3objectlambda/access_point_resource_gen.go @@ -4,6 +4,7 @@ package s3objectlambda import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:[^:]+:s3-object-lambda:[^:]*:\\d{12}:accesspoint/.*", // "type": "string" // } Type: types.StringType, @@ -54,7 +55,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name you want to assign to this Object lambda Access Point.", // "maxLength": 45, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$", // "type": "string" // } Description: "The name you want to assign to this Object lambda Access Point.", @@ -63,6 +64,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 45), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/s3outposts/access_point_resource_gen.go b/internal/aws/s3outposts/access_point_resource_gen.go index beb91a17cf..6bc0aaaea6 100644 --- a/internal/aws/s3outposts/access_point_resource_gen.go +++ b/internal/aws/s3outposts/access_point_resource_gen.go @@ -4,6 +4,7 @@ package s3outposts import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the specified AccessPoint.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/accesspoint\\/[^:]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the specified AccessPoint.", @@ -44,7 +45,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the bucket you want to associate this AccessPoint with.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the bucket you want to associate this AccessPoint with.", @@ -52,6 +53,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -64,7 +66,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A name for the AccessPoint.", // "maxLength": 50, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9]([a-z0-9\\\\-]*[a-z0-9])?$", // "type": "string" // } Description: "A name for the AccessPoint.", @@ -72,6 +74,7 @@ func accessPointResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 50), + validate.StringMatch(regexp.MustCompile("^[a-z0-9]([a-z0-9\\\\-]*[a-z0-9])?$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/s3outposts/bucket_policy_resource_gen.go b/internal/aws/s3outposts/bucket_policy_resource_gen.go index 0d9fd34bed..4650695238 100644 --- a/internal/aws/s3outposts/bucket_policy_resource_gen.go +++ b/internal/aws/s3outposts/bucket_policy_resource_gen.go @@ -4,6 +4,7 @@ package s3outposts import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func bucketPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the specified bucket.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the specified bucket.", @@ -35,6 +36,7 @@ func bucketPolicyResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/s3outposts/bucket_resource_gen.go b/internal/aws/s3outposts/bucket_resource_gen.go index cd37c5757e..d32c4d49bb 100644 --- a/internal/aws/s3outposts/bucket_resource_gen.go +++ b/internal/aws/s3outposts/bucket_resource_gen.go @@ -4,6 +4,7 @@ package s3outposts import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the specified bucket.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:[^:]+:s3-outposts:[a-zA-Z0-9\\-]+:\\d{12}:outpost\\/[^:]+\\/bucket\\/[^:]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the specified bucket.", @@ -108,7 +109,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "ExpirationDate": { // "description": "Indicates when objects are deleted from Amazon S3Outposts. The date value must be in ISO 8601 format. The time is always midnight UTC.", - // "pattern": "", + // "pattern": "^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$", // "type": "string" // }, // "ExpirationInDays": { @@ -154,13 +155,13 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Key": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$", // "type": "string" // }, // "Value": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$", // "type": "string" // } // }, @@ -188,13 +189,13 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Key": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$", // "type": "string" // }, // "Value": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$", // "type": "string" // } // }, @@ -262,6 +263,9 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "Indicates when objects are deleted from Amazon S3Outposts. The date value must be in ISO 8601 format. The time is always midnight UTC.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([0-2]\\d{3})-(0[0-9]|1[0-2])-([0-2]\\d|3[01])T([01]\\d|2[0-4]):([0-5]\\d):([0-6]\\d)((\\.\\d{3})?)Z$"), ""), + }, }, "expiration_in_days": { // Property: ExpirationInDays @@ -299,6 +303,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$"), ""), }, }, "value": { @@ -307,6 +312,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$"), ""), }, }, }, @@ -338,6 +344,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$"), ""), }, }, "value": { @@ -346,6 +353,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$"), ""), }, }, }, @@ -423,12 +431,15 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The id of the customer outpost on which the bucket resides.", - // "pattern": "", + // "pattern": "^(op-[a-f0-9]{17}|\\d{12}|ec2)$", // "type": "string" // } Description: "The id of the customer outpost on which the bucket resides.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^(op-[a-f0-9]{17}|\\d{12}|ec2)$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -451,7 +462,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Value": { // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$", // "type": "string" // } // }, @@ -481,6 +492,7 @@ func bucketResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:=+\\/\\-@%]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/app_image_config_resource_gen.go b/internal/aws/sagemaker/app_image_config_resource_gen.go index d3b06eea26..9c57674edc 100644 --- a/internal/aws/sagemaker/app_image_config_resource_gen.go +++ b/internal/aws/sagemaker/app_image_config_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func appImageConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The Amazon Resource Name (ARN) of the AppImageConfig.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:app-image-config/.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the AppImageConfig.", @@ -44,7 +45,7 @@ func appImageConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The Name of the AppImageConfig.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}", // "type": "string" // } Description: "The Name of the AppImageConfig.", @@ -52,6 +53,7 @@ func appImageConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -84,7 +86,7 @@ func appImageConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The path within the image to mount the user's EFS home directory. The directory should be empty. If not specified, defaults to /home/sagemaker-user.", // "maxLength": 1024, // "minLength": 1, - // "pattern": "", + // "pattern": "^/.*", // "type": "string" // } // }, @@ -156,6 +158,7 @@ func appImageConfigResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1024), + validate.StringMatch(regexp.MustCompile("^/.*"), ""), }, }, }, diff --git a/internal/aws/sagemaker/app_resource_gen.go b/internal/aws/sagemaker/app_resource_gen.go index 9fb79ddc06..a81cca4a16 100644 --- a/internal/aws/sagemaker/app_resource_gen.go +++ b/internal/aws/sagemaker/app_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the app.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:app/.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the app.", @@ -44,7 +45,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the app.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}", // "type": "string" // } Description: "The name of the app.", @@ -52,6 +53,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -149,14 +151,14 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The ARN of the SageMaker image that the image version belongs to.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // }, // "SageMakerImageVersionArn": { // "description": "The ARN of the image version created on the instance.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$", // "type": "string" // } // }, @@ -214,6 +216,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$"), ""), }, }, "sage_maker_image_version_arn": { @@ -223,6 +226,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$"), ""), }, }, }, @@ -299,7 +303,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The user profile name.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}", // "type": "string" // } Description: "The user profile name.", @@ -307,6 +311,7 @@ func appResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/sagemaker/data_quality_job_definition_resource_gen.go b/internal/aws/sagemaker/data_quality_job_definition_resource_gen.go index 8f9f313314..96f9bf3d55 100644 --- a/internal/aws/sagemaker/data_quality_job_definition_resource_gen.go +++ b/internal/aws/sagemaker/data_quality_job_definition_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -80,19 +81,19 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "ImageUri": { // "description": "The container image to be run by the monitoring job.", // "maxLength": 255, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "PostAnalyticsProcessorSourceUri": { // "description": "An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the built-in (first party) containers.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // }, // "RecordPreprocessorSourceUri": { // "description": "An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode the payload and convert it into a flatted json so that the built-in container can use the converted data. Applicable only for the built-in (first party) containers", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -139,6 +140,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "post_analytics_processor_source_uri": { @@ -148,6 +150,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, "record_preprocessor_source_uri": { @@ -157,6 +160,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -177,7 +181,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "description": "The name of a processing job", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ConstraintsResource": { @@ -187,7 +191,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "S3Uri": { // "description": "The Amazon S3 URI for baseline constraint file in Amazon S3 that the current monitoring job should validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -200,7 +204,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "S3Uri": { // "description": "The Amazon S3 URI for the baseline statistics file in Amazon S3 that the current monitoring job should be validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -219,6 +223,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "constraints_resource": { @@ -233,6 +238,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -251,6 +257,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -280,13 +287,13 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "EndpointName": { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // }, // "LocalPath": { // "description": "Path to the filesystem where the endpoint data is available to the container.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3DataDistributionType": { @@ -333,6 +340,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "local_path": { @@ -342,6 +350,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_data_distribution_type": { @@ -389,7 +398,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "KmsKeyId": { // "description": "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "MonitoringOutputs": { @@ -405,7 +414,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "LocalPath": { // "description": "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3UploadMode": { @@ -419,7 +428,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -455,6 +464,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "monitoring_outputs": { @@ -474,6 +484,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_upload_mode": { @@ -495,6 +506,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -535,7 +547,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // { // "description": "The name of the job definition.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the job definition.", @@ -544,6 +556,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -669,7 +682,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "description": "The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -680,7 +693,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "description": "The ID of the subnets in the VPC to which you want to connect to your monitoring jobs.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 16, @@ -725,6 +738,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnets": { @@ -735,6 +749,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 16), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, }, @@ -757,7 +772,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", @@ -765,6 +780,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -823,13 +839,13 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -852,6 +868,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -861,6 +878,7 @@ func dataQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceTy Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/device_fleet_resource_gen.go b/internal/aws/sagemaker/device_fleet_resource_gen.go index 4b0b4af8c5..b44d08879a 100644 --- a/internal/aws/sagemaker/device_fleet_resource_gen.go +++ b/internal/aws/sagemaker/device_fleet_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Description for the edge device fleet", // "maxLength": 800, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\S\\s]+", // "type": "string" // } Description: "Description for the edge device fleet", @@ -35,6 +36,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 800), + validate.StringMatch(regexp.MustCompile("[\\S\\s]+"), ""), }, }, "device_fleet_name": { @@ -44,7 +46,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the edge device fleet", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*_*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the edge device fleet", @@ -52,6 +54,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*_*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -68,13 +71,13 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The KMS key id used for encryption on the S3 bucket", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // }, // "S3OutputLocation": { // "description": "The Amazon Simple Storage (S3) bucket URI", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^s3://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -93,6 +96,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, "s3_output_location": { @@ -102,6 +106,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^s3://([^/]+)/?(.*)$"), ""), }, }, }, @@ -115,7 +120,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Role associated with the device fleet", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "Role associated with the device fleet", @@ -123,6 +128,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, }, "tags": { @@ -145,7 +151,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key value of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -176,6 +182,7 @@ func deviceFleetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/device_resource_gen.go b/internal/aws/sagemaker/device_resource_gen.go index 0de23937f3..dbba2c690b 100644 --- a/internal/aws/sagemaker/device_resource_gen.go +++ b/internal/aws/sagemaker/device_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -31,20 +32,20 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Description of the device", // "maxLength": 40, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\S\\s]+", // "type": "string" // }, // "DeviceName": { // "description": "The name of the device", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "IotThingName": { // "description": "AWS Internet of Things (IoT) object name.", // "maxLength": 128, - // "pattern": "", + // "pattern": "[a-zA-Z0-9:_-]+", // "type": "string" // } // }, @@ -63,6 +64,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 40), + validate.StringMatch(regexp.MustCompile("[\\S\\s]+"), ""), }, }, "device_name": { @@ -72,6 +74,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "iot_thing_name": { @@ -81,6 +84,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(128), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9:_-]+"), ""), }, }, }, @@ -94,7 +98,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the edge device fleet", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*_*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the edge device fleet", @@ -102,6 +106,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*_*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -126,7 +131,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key value of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -157,6 +162,7 @@ func deviceResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/domain_resource_gen.go b/internal/aws/sagemaker/domain_resource_gen.go index 0ffd2a64ca..5dee7ac942 100644 --- a/internal/aws/sagemaker/domain_resource_gen.go +++ b/internal/aws/sagemaker/domain_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -81,7 +82,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The user profile Amazon Resource Name (ARN).", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // }, // "JupyterServerAppSettings": { @@ -132,13 +133,13 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SageMakerImageArn": { // "description": "The ARN of the SageMaker image that the image version belongs to.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // }, // "SageMakerImageVersionArn": { // "description": "The ARN of the image version created on the instance.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$", // "type": "string" // } // }, @@ -160,13 +161,13 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "AppImageConfigName": { // "description": "The Name of the AppImageConfig.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}", // "type": "string" // }, // "ImageName": { // "description": "The name of the CustomImage. Must be unique to your account.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$", // "type": "string" // }, // "ImageVersionNumber": { @@ -231,13 +232,13 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SageMakerImageArn": { // "description": "The ARN of the SageMaker image that the image version belongs to.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // }, // "SageMakerImageVersionArn": { // "description": "The ARN of the image version created on the instance.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$", // "type": "string" // } // }, @@ -250,7 +251,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The security groups for the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -273,13 +274,13 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "S3KmsKeyId": { // "description": "When NotebookOutputOption is Allowed, the AWS Key Management Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3OutputPath": { // "description": "When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the shared notebook snapshots.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -298,6 +299,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, }, "jupyter_server_app_settings": { @@ -358,6 +360,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$"), ""), }, }, "sage_maker_image_version_arn": { @@ -367,6 +370,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$"), ""), }, }, }, @@ -394,6 +398,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}"), ""), }, }, "image_name": { @@ -403,6 +408,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$"), ""), }, }, "image_version_number": { @@ -476,6 +482,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$"), ""), }, }, "sage_maker_image_version_arn": { @@ -485,6 +492,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$"), ""), }, }, }, @@ -503,6 +511,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "sharing_settings": { @@ -529,6 +538,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_output_path": { @@ -538,6 +548,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -554,7 +565,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The Amazon Resource Name (ARN) of the created domain.", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:domain/.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the created domain.", @@ -570,7 +581,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The domain name.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^d-(-*[a-z0-9])+", // "type": "string" // } Description: "The domain name.", @@ -586,7 +597,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "A name for the domain.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}", // "type": "string" // } Description: "A name for the domain.", @@ -594,6 +605,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -620,7 +632,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "SageMaker uses AWS KMS to encrypt the EFS volume attached to the domain with an AWS managed customer master key (CMK) by default.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Description: "SageMaker uses AWS KMS to encrypt the EFS volume attached to the domain with an AWS managed customer master key (CMK) by default.", @@ -629,6 +641,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -657,7 +670,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The VPC subnets that Studio uses for communication.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 16, @@ -671,6 +684,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 16), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -760,7 +774,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.", // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // } Description: "The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.", @@ -768,6 +782,7 @@ func domainResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(32), + validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/sagemaker/feature_group_resource_gen.go b/internal/aws/sagemaker/feature_group_resource_gen.go index d94a738222..8250c37280 100644 --- a/internal/aws/sagemaker/feature_group_resource_gen.go +++ b/internal/aws/sagemaker/feature_group_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -47,7 +48,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Event Time Feature Name.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}", // "type": "string" // } Description: "The Event Time Feature Name.", @@ -55,6 +56,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -71,7 +73,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "FeatureName": { // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}", // "type": "string" // }, // "FeatureType": { @@ -103,6 +105,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"), ""), }, }, "feature_type": { @@ -135,7 +138,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Name of the FeatureGroup.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}", // "type": "string" // } Description: "The Name of the FeatureGroup.", @@ -143,6 +146,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -195,7 +199,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "S3Uri": { // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -267,6 +271,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -343,7 +348,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Record Identifier Feature Name.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}", // "type": "string" // } Description: "The Record Identifier Feature Name.", @@ -351,6 +356,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -363,7 +369,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Role Arn", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "Role Arn", @@ -372,6 +378,7 @@ func featureGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/sagemaker/image_resource_gen.go b/internal/aws/sagemaker/image_resource_gen.go index 3b8f480dca..043f42c121 100644 --- a/internal/aws/sagemaker/image_resource_gen.go +++ b/internal/aws/sagemaker/image_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the image.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:image\\/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the image.", @@ -44,7 +45,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A description of the image.", // "maxLength": 512, // "minLength": 1, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } Description: "A description of the image.", @@ -52,6 +53,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), + validate.StringMatch(regexp.MustCompile(".+"), ""), }, }, "image_display_name": { @@ -61,7 +63,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The display name of the image.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Za-z0-9 -_]+$", // "type": "string" // } Description: "The display name of the image.", @@ -69,6 +71,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9 -_]+$"), ""), }, }, "image_name": { @@ -78,7 +81,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the image.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]([-.]?[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the image.", @@ -86,6 +89,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]([-.]?[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -98,7 +102,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on behalf of the customer.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on behalf of the customer.", @@ -106,6 +110,7 @@ func imageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:iam::[0-9]{12}:role/.*$"), ""), }, }, "tags": { diff --git a/internal/aws/sagemaker/image_version_resource_gen.go b/internal/aws/sagemaker/image_version_resource_gen.go index f46c9abed5..4e15fceb56 100644 --- a/internal/aws/sagemaker/image_version_resource_gen.go +++ b/internal/aws/sagemaker/image_version_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The registry path of the container image on which this image version is based.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } Description: "The registry path of the container image on which this image version is based.", @@ -35,6 +36,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile(".+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -47,7 +49,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The registry path of the container image that contains this image version.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } Description: "The registry path of the container image that contains this image version.", @@ -64,7 +66,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the parent image.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:image\\/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the parent image.", @@ -81,7 +83,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the image this version belongs to.", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[A-Za-z0-9]([-.]?[A-Za-z0-9])*$", // "type": "string" // } Description: "The name of the image this version belongs to.", @@ -89,6 +91,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]([-.]?[A-Za-z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -101,7 +104,7 @@ func imageVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the image version.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:image-version\\/[a-z0-9]([-.]?[a-z0-9])*\\/[0-9]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the image version.", diff --git a/internal/aws/sagemaker/model_bias_job_definition_resource_gen.go b/internal/aws/sagemaker/model_bias_job_definition_resource_gen.go index 1ec1dd0342..d960f3f911 100644 --- a/internal/aws/sagemaker/model_bias_job_definition_resource_gen.go +++ b/internal/aws/sagemaker/model_bias_job_definition_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -56,7 +57,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // { // "description": "The name of the job definition.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the job definition.", @@ -65,6 +66,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -177,7 +179,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "ConfigUri": { // "description": "The S3 URI to an analysis configuration file", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // }, // "Environment": { @@ -199,7 +201,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "ImageUri": { // "description": "The container image to be run by the monitoring job.", // "maxLength": 255, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -219,6 +221,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, "environment": { @@ -236,6 +239,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -256,7 +260,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "The name of a processing job", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ConstraintsResource": { @@ -266,7 +270,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "S3Uri": { // "description": "The Amazon S3 URI for baseline constraint file in Amazon S3 that the current monitoring job should validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -285,6 +289,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "constraints_resource": { @@ -299,6 +304,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -329,13 +335,13 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "Monitoring end time offset, e.g. PT0H", // "maxLength": 15, // "minLength": 1, - // "pattern": "", + // "pattern": "^.?P.*", // "type": "string" // }, // "EndpointName": { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // }, // "FeaturesAttribute": { @@ -351,7 +357,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "LocalPath": { // "description": "Path to the filesystem where the endpoint data is available to the container.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "ProbabilityAttribute": { @@ -383,7 +389,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "Monitoring start time offset, e.g. -PT1H", // "maxLength": 15, // "minLength": 1, - // "pattern": "", + // "pattern": "^.?P.*", // "type": "string" // } // }, @@ -400,7 +406,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -431,6 +437,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 15), + validate.StringMatch(regexp.MustCompile("^.?P.*"), ""), }, }, "endpoint_name": { @@ -440,6 +447,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "features_attribute": { @@ -467,6 +475,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "probability_attribute": { @@ -514,6 +523,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 15), + validate.StringMatch(regexp.MustCompile("^.?P.*"), ""), }, }, }, @@ -532,6 +542,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -555,7 +566,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "KmsKeyId": { // "description": "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "MonitoringOutputs": { @@ -571,7 +582,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "LocalPath": { // "description": "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3UploadMode": { @@ -585,7 +596,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -621,6 +632,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "monitoring_outputs": { @@ -640,6 +652,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_upload_mode": { @@ -661,6 +674,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -702,7 +716,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -713,7 +727,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "The ID of the subnets in the VPC to which you want to connect to your monitoring jobs.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 16, @@ -758,6 +772,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnets": { @@ -768,6 +783,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 16), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, }, @@ -790,7 +806,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", @@ -798,6 +814,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -856,13 +873,13 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -885,6 +902,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -894,6 +912,7 @@ func modelBiasJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceType Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/model_explainability_job_definition_resource_gen.go b/internal/aws/sagemaker/model_explainability_job_definition_resource_gen.go index 999a2fcaa1..fa209ad2f1 100644 --- a/internal/aws/sagemaker/model_explainability_job_definition_resource_gen.go +++ b/internal/aws/sagemaker/model_explainability_job_definition_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -56,7 +57,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // { // "description": "The name of the job definition.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the job definition.", @@ -65,6 +66,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -177,7 +179,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "ConfigUri": { // "description": "The S3 URI to an analysis configuration file", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // }, // "Environment": { @@ -199,7 +201,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "ImageUri": { // "description": "The container image to be run by the monitoring job.", // "maxLength": 255, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -219,6 +221,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, "environment": { @@ -236,6 +239,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -256,7 +260,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "description": "The name of a processing job", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ConstraintsResource": { @@ -266,7 +270,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "S3Uri": { // "description": "The Amazon S3 URI for baseline constraint file in Amazon S3 that the current monitoring job should validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -285,6 +289,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "constraints_resource": { @@ -299,6 +304,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -328,7 +334,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "EndpointName": { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // }, // "FeaturesAttribute": { @@ -344,7 +350,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "LocalPath": { // "description": "Path to the filesystem where the endpoint data is available to the container.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "ProbabilityAttribute": { @@ -396,6 +402,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "features_attribute": { @@ -423,6 +430,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "probability_attribute": { @@ -479,7 +487,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "KmsKeyId": { // "description": "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "MonitoringOutputs": { @@ -495,7 +503,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "LocalPath": { // "description": "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3UploadMode": { @@ -509,7 +517,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -545,6 +553,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "monitoring_outputs": { @@ -564,6 +573,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_upload_mode": { @@ -585,6 +595,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -626,7 +637,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "description": "The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -637,7 +648,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "description": "The ID of the subnets in the VPC to which you want to connect to your monitoring jobs.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 16, @@ -682,6 +693,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnets": { @@ -692,6 +704,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 16), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, }, @@ -714,7 +727,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", @@ -722,6 +735,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -780,13 +794,13 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -809,6 +823,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -818,6 +833,7 @@ func modelExplainabilityJobDefinitionResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/model_package_group_resource_gen.go b/internal/aws/sagemaker/model_package_group_resource_gen.go index 5d43edf9bc..7f0c33a7a7 100644 --- a/internal/aws/sagemaker/model_package_group_resource_gen.go +++ b/internal/aws/sagemaker/model_package_group_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The Amazon Resource Name (ARN) of the model package group.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the model package group.", @@ -57,7 +58,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err // { // "description": "The description of the model package group.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*", // "type": "string" // } Description: "The description of the model package group.", @@ -66,6 +67,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -78,7 +80,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err // { // "description": "The name of the model package group.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the model package group.", @@ -86,6 +88,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -135,13 +138,13 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -164,6 +167,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -173,6 +177,7 @@ func modelPackageGroupResourceType(ctx context.Context) (tfsdk.ResourceType, err Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/model_quality_job_definition_resource_gen.go b/internal/aws/sagemaker/model_quality_job_definition_resource_gen.go index 2972c852ae..a37e6baa0c 100644 --- a/internal/aws/sagemaker/model_quality_job_definition_resource_gen.go +++ b/internal/aws/sagemaker/model_quality_job_definition_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -56,7 +57,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // { // "description": "The name of the job definition.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the job definition.", @@ -65,6 +66,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -213,13 +215,13 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "ImageUri": { // "description": "The container image to be run by the monitoring job.", // "maxLength": 255, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "PostAnalyticsProcessorSourceUri": { // "description": "An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the built-in (first party) containers.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // }, // "ProblemType": { @@ -234,7 +236,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "RecordPreprocessorSourceUri": { // "description": "An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode the payload and convert it into a flatted json so that the built-in container can use the converted data. Applicable only for the built-in (first party) containers", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -282,6 +284,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "post_analytics_processor_source_uri": { @@ -291,6 +294,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, "problem_type": { @@ -313,6 +317,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -333,7 +338,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The name of a processing job", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ConstraintsResource": { @@ -343,7 +348,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "S3Uri": { // "description": "The Amazon S3 URI for baseline constraint file in Amazon S3 that the current monitoring job should validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -362,6 +367,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "constraints_resource": { @@ -376,6 +382,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -406,13 +413,13 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "Monitoring end time offset, e.g. PT0H", // "maxLength": 15, // "minLength": 1, - // "pattern": "", + // "pattern": "^.?P.*", // "type": "string" // }, // "EndpointName": { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // }, // "InferenceAttribute": { @@ -423,7 +430,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "LocalPath": { // "description": "Path to the filesystem where the endpoint data is available to the container.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "ProbabilityAttribute": { @@ -455,7 +462,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "Monitoring start time offset, e.g. -PT1H", // "maxLength": 15, // "minLength": 1, - // "pattern": "", + // "pattern": "^.?P.*", // "type": "string" // } // }, @@ -472,7 +479,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -503,6 +510,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 15), + validate.StringMatch(regexp.MustCompile("^.?P.*"), ""), }, }, "endpoint_name": { @@ -512,6 +520,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "inference_attribute": { @@ -530,6 +539,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "probability_attribute": { @@ -577,6 +587,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 15), + validate.StringMatch(regexp.MustCompile("^.?P.*"), ""), }, }, }, @@ -595,6 +606,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -618,7 +630,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "KmsKeyId": { // "description": "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "MonitoringOutputs": { @@ -634,7 +646,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "LocalPath": { // "description": "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3UploadMode": { @@ -648,7 +660,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -684,6 +696,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "monitoring_outputs": { @@ -703,6 +716,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_upload_mode": { @@ -724,6 +738,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -765,7 +780,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -776,7 +791,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The ID of the subnets in the VPC to which you want to connect to your monitoring jobs.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 16, @@ -821,6 +836,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnets": { @@ -831,6 +847,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 16), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, }, @@ -853,7 +870,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", @@ -861,6 +878,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -919,13 +937,13 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -948,6 +966,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -957,6 +976,7 @@ func modelQualityJobDefinitionResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/monitoring_schedule_resource_gen.go b/internal/aws/sagemaker/monitoring_schedule_resource_gen.go index 15cdf68b29..2e232fe657 100644 --- a/internal/aws/sagemaker/monitoring_schedule_resource_gen.go +++ b/internal/aws/sagemaker/monitoring_schedule_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -40,7 +41,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // } Description: "The name of the endpoint used to run the monitoring job.", @@ -48,6 +49,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "failure_reason": { @@ -93,7 +95,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "EndpointName": { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // }, // "FailureReason": { @@ -121,13 +123,13 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "MonitoringScheduleName": { // "description": "The name of the monitoring schedule.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ProcessingJobArn": { // "description": "The Amazon Resource Name (ARN) of the monitoring job.", // "maxLength": 256, - // "pattern": "", + // "pattern": "aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:processing-job/.*", // "type": "string" // }, // "ScheduledTime": { @@ -160,6 +162,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "failure_reason": { @@ -201,6 +204,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "processing_job_arn": { @@ -210,6 +214,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:processing-job/.*"), ""), }, }, "scheduled_time": { @@ -260,7 +265,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "S3Uri": { // "description": "The Amazon S3 URI for baseline constraint file in Amazon S3 that the current monitoring job should validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -273,7 +278,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "S3Uri": { // "description": "The Amazon S3 URI for the baseline statistics file in Amazon S3 that the current monitoring job should be validated against.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -326,19 +331,19 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "ImageUri": { // "description": "The container image to be run by the monitoring job.", // "maxLength": 255, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "PostAnalyticsProcessorSourceUri": { // "description": "An Amazon S3 URI to a script that is called after analysis has been performed. Applicable only for the built-in (first party) containers.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // }, // "RecordPreprocessorSourceUri": { // "description": "An Amazon S3 URI to a script that is called per row prior to running analysis. It can base64 decode the payload and convert it into a flatted json so that the built-in container can use the converted data. Applicable only for the built-in (first party) containers", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -361,13 +366,13 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "EndpointName": { // "description": "The name of the endpoint used to run the monitoring job.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // }, // "LocalPath": { // "description": "Path to the filesystem where the endpoint data is available to the container.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3DataDistributionType": { @@ -410,7 +415,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "KmsKeyId": { // "description": "The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "MonitoringOutputs": { @@ -426,7 +431,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "LocalPath": { // "description": "The local path to the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job. LocalPath is an absolute path for the output data.", // "maxLength": 256, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3UploadMode": { @@ -440,7 +445,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "S3Uri": { // "description": "A URI that identifies the Amazon S3 storage location where Amazon SageMaker saves the results of a monitoring job.", // "maxLength": 512, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -530,7 +535,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -541,7 +546,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The ID of the subnets in the VPC to which you want to connect to your monitoring jobs.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 16, @@ -562,7 +567,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // }, // "StoppingCondition": { @@ -595,7 +600,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "Name of the job definition", // "maxLength": 63, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "MonitoringType": { @@ -652,6 +657,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -670,6 +676,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -720,6 +727,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "post_analytics_processor_source_uri": { @@ -729,6 +737,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, "record_preprocessor_source_uri": { @@ -738,6 +747,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -761,6 +771,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "local_path": { @@ -770,6 +781,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_data_distribution_type": { @@ -820,6 +832,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "monitoring_outputs": { @@ -839,6 +852,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_upload_mode": { @@ -860,6 +874,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(512), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, @@ -953,6 +968,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "subnets": { @@ -963,6 +979,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 16), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, }, @@ -980,6 +997,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, }, "stopping_condition": { @@ -1011,6 +1029,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "monitoring_type": { @@ -1055,7 +1074,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // { // "description": "The name of the monitoring schedule.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the monitoring schedule.", @@ -1063,6 +1082,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -1105,13 +1125,13 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -1134,6 +1154,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -1143,6 +1164,7 @@ func monitoringScheduleResourceType(ctx context.Context) (tfsdk.ResourceType, er Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/pipeline_resource_gen.go b/internal/aws/sagemaker/pipeline_resource_gen.go index 4a0bc649e2..ab4f29d689 100644 --- a/internal/aws/sagemaker/pipeline_resource_gen.go +++ b/internal/aws/sagemaker/pipeline_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -157,7 +158,7 @@ func pipelineResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The display name of the Pipeline.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // } Description: "The display name of the Pipeline.", @@ -165,6 +166,7 @@ func pipelineResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, }, "pipeline_name": { @@ -174,7 +176,7 @@ func pipelineResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the Pipeline.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // } Description: "The name of the Pipeline.", @@ -182,6 +184,7 @@ func pipelineResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -194,7 +197,7 @@ func pipelineResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Role Arn", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // } Description: "Role Arn", @@ -202,6 +205,7 @@ func pipelineResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, }, "tags": { diff --git a/internal/aws/sagemaker/project_resource_gen.go b/internal/aws/sagemaker/project_resource_gen.go index 5c5a3e98a8..88dbd044d1 100644 --- a/internal/aws/sagemaker/project_resource_gen.go +++ b/internal/aws/sagemaker/project_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -41,7 +42,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The Amazon Resource Name (ARN) of the Project.", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:project.*", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the Project.", @@ -57,7 +58,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The description of the project.", // "maxLength": 1024, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } Description: "The description of the project.", @@ -66,6 +67,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -78,7 +80,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "Project Id.", // "maxLength": 20, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*", // "type": "string" // } Description: "Project Id.", @@ -95,7 +97,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the project.", // "maxLength": 32, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // } Description: "The name of the project.", @@ -103,6 +105,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 32), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -141,7 +144,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "ProvisionedProductId": { // "description": "The identifier of the provisioning artifact (also known as a version).", // "maxLength": 100, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ProvisionedProductStatusMessage": { @@ -161,6 +164,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "provisioned_product_status_message": { @@ -186,19 +190,19 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "PathId": { // "description": "The path identifier of the product.", // "maxLength": 100, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ProductId": { // "description": "Service Catalog product identifier.", // "maxLength": 100, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ProvisioningArtifactId": { // "description": "The identifier of the provisioning artifact (also known as a version).", // "maxLength": 100, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9])*$", // "type": "string" // }, // "ProvisioningParameters": { @@ -211,13 +215,13 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The parameter key.", // "maxLength": 1000, // "minLength": 1, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "Value": { // "description": "The parameter value.", // "maxLength": 4096, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -245,6 +249,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "product_id": { @@ -254,6 +259,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "provisioning_artifact_id": { @@ -263,6 +269,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(100), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9])*$"), ""), }, }, "provisioning_parameters": { @@ -277,6 +284,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1000), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "value": { @@ -286,6 +294,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -313,13 +322,13 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ", // "maxLength": 256, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -342,6 +351,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -351,6 +361,7 @@ func projectResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/sagemaker/user_profile_resource_gen.go b/internal/aws/sagemaker/user_profile_resource_gen.go index 9265d8537e..1404763e0a 100644 --- a/internal/aws/sagemaker/user_profile_resource_gen.go +++ b/internal/aws/sagemaker/user_profile_resource_gen.go @@ -4,6 +4,7 @@ package sagemaker import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -44,13 +45,16 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "A specifier for the type of value specified in SingleSignOnUserValue. Currently, the only supported value is \"UserName\". If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.", - // "pattern": "", + // "pattern": "UserName", // "type": "string" // } Description: "A specifier for the type of value specified in SingleSignOnUserValue. Currently, the only supported value is \"UserName\". If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("UserName"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -146,7 +150,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The user profile Amazon Resource Name (ARN).", // "maxLength": 256, - // "pattern": "", + // "pattern": "arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:user-profile/.*", // "type": "string" // } Description: "The user profile Amazon Resource Name (ARN).", @@ -186,7 +190,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The user profile Amazon Resource Name (ARN).", // "maxLength": 2048, // "minLength": 20, - // "pattern": "", + // "pattern": "^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$", // "type": "string" // }, // "JupyterServerAppSettings": { @@ -237,13 +241,13 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SageMakerImageArn": { // "description": "The ARN of the SageMaker image that the image version belongs to.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // }, // "SageMakerImageVersionArn": { // "description": "The ARN of the image version created on the instance.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$", // "type": "string" // } // }, @@ -265,13 +269,13 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "AppImageConfigName": { // "description": "The Name of the AppImageConfig.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}", // "type": "string" // }, // "ImageName": { // "description": "The name of the CustomImage. Must be unique to your account.", // "maxLength": 63, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$", // "type": "string" // }, // "ImageVersionNumber": { @@ -336,13 +340,13 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SageMakerImageArn": { // "description": "The ARN of the SageMaker image that the image version belongs to.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$", // "type": "string" // }, // "SageMakerImageVersionArn": { // "description": "The ARN of the image version created on the instance.", // "maxLength": 256, - // "pattern": "", + // "pattern": "^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$", // "type": "string" // } // }, @@ -355,7 +359,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The security groups for the Amazon Virtual Private Cloud (VPC) that Studio uses for communication.", // "items": { // "maxLength": 32, - // "pattern": "", + // "pattern": "[-0-9a-zA-Z]+", // "type": "string" // }, // "maxItems": 5, @@ -378,13 +382,13 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "S3KmsKeyId": { // "description": "When NotebookOutputOption is Allowed, the AWS Key Management Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket.", // "maxLength": 2048, - // "pattern": "", + // "pattern": ".*", // "type": "string" // }, // "S3OutputPath": { // "description": "When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the shared notebook snapshots.", // "maxLength": 1024, - // "pattern": "", + // "pattern": "^(https|s3)://([^/]+)/?(.*)$", // "type": "string" // } // }, @@ -403,6 +407,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(20, 2048), + validate.StringMatch(regexp.MustCompile("^arn:aws[a-z\\-]*:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$"), ""), }, }, "jupyter_server_app_settings": { @@ -463,6 +468,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$"), ""), }, }, "sage_maker_image_version_arn": { @@ -472,6 +478,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$"), ""), }, }, }, @@ -499,6 +506,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}"), ""), }, }, "image_name": { @@ -508,6 +516,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(63), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$"), ""), }, }, "image_version_number": { @@ -581,6 +590,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$"), ""), }, }, "sage_maker_image_version_arn": { @@ -590,6 +600,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), + validate.StringMatch(regexp.MustCompile("^arn:aws(-[\\w]+)*:sagemaker:.+:[0-9]{12}:image-version/[a-z0-9]([-.]?[a-z0-9])*/[0-9]+$"), ""), }, }, }, @@ -608,6 +619,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 5), validate.ArrayForEach(validate.StringLenAtMost(32)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[-0-9a-zA-Z]+"), "")), }, }, "sharing_settings": { @@ -634,6 +646,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(2048), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, "s3_output_path": { @@ -643,6 +656,7 @@ func userProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), + validate.StringMatch(regexp.MustCompile("^(https|s3)://([^/]+)/?(.*)$"), ""), }, }, }, diff --git a/internal/aws/servicecatalog/cloudformation_provisioned_product_resource_gen.go b/internal/aws/servicecatalog/cloudformation_provisioned_product_resource_gen.go index 055220981f..7c91ac3908 100644 --- a/internal/aws/servicecatalog/cloudformation_provisioned_product_resource_gen.go +++ b/internal/aws/servicecatalog/cloudformation_provisioned_product_resource_gen.go @@ -4,6 +4,7 @@ package servicecatalog import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -267,7 +268,7 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re // "properties": { // "StackSetAccounts": { // "items": { - // "pattern": "", + // "pattern": "^[0-9]{12}$", // "type": "string" // }, // "type": "array", @@ -301,7 +302,7 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re // }, // "StackSetRegions": { // "items": { - // "pattern": "", + // "pattern": "^[a-z]{2}-([a-z]+-)+[1-9]", // "type": "string" // }, // "type": "array", @@ -318,6 +319,7 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re Optional: true, Validators: []tfsdk.AttributeValidator{ validate.UniqueItems(), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[0-9]{12}$"), "")), }, }, "stack_set_failure_tolerance_count": { @@ -370,6 +372,7 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re Optional: true, Validators: []tfsdk.AttributeValidator{ validate.UniqueItems(), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^[a-z]{2}-([a-z]+-)+[1-9]"), "")), }, }, }, @@ -400,13 +403,13 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -426,6 +429,7 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -434,6 +438,7 @@ func cloudFormationProvisionedProductResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, diff --git a/internal/aws/servicecatalogappregistry/application_resource_gen.go b/internal/aws/servicecatalogappregistry/application_resource_gen.go index 61e0eb2d21..bf28112355 100644 --- a/internal/aws/servicecatalogappregistry/application_resource_gen.go +++ b/internal/aws/servicecatalogappregistry/application_resource_gen.go @@ -4,6 +4,7 @@ package servicecatalogappregistry import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[a-z0-9]+", // "type": "string" // } Type: types.StringType, @@ -52,7 +53,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Id // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "[a-z0-9]{26}", // "type": "string" // } Type: types.StringType, @@ -68,7 +69,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the application. ", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "\\w+", // "type": "string" // } Description: "The name of the application. ", @@ -76,6 +77,7 @@ func applicationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("\\w+"), ""), }, }, "tags": { diff --git a/internal/aws/servicecatalogappregistry/attribute_group_association_resource_gen.go b/internal/aws/servicecatalogappregistry/attribute_group_association_resource_gen.go index 425d9301b6..c226b4c816 100644 --- a/internal/aws/servicecatalogappregistry/attribute_group_association_resource_gen.go +++ b/internal/aws/servicecatalogappregistry/attribute_group_association_resource_gen.go @@ -4,6 +4,7 @@ package servicecatalogappregistry import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func attributeGroupAssociationResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The name or the Id of the Application.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "\\w+|[a-z0-9]{12}", // "type": "string" // } Description: "The name or the Id of the Application.", @@ -35,13 +36,14 @@ func attributeGroupAssociationResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("\\w+|[a-z0-9]{12}"), ""), }, }, "application_arn": { // Property: ApplicationArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[a-z0-9]+", // "type": "string" // } Type: types.StringType, @@ -57,7 +59,7 @@ func attributeGroupAssociationResourceType(ctx context.Context) (tfsdk.ResourceT // "description": "The name or the Id of the AttributeGroup.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "\\w+|[a-z0-9]{12}", // "type": "string" // } Description: "The name or the Id of the AttributeGroup.", @@ -65,13 +67,14 @@ func attributeGroupAssociationResourceType(ctx context.Context) (tfsdk.ResourceT Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("\\w+|[a-z0-9]{12}"), ""), }, }, "attribute_group_arn": { // Property: AttributeGroupArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[a-z0-9]+", // "type": "string" // } Type: types.StringType, diff --git a/internal/aws/servicecatalogappregistry/attribute_group_resource_gen.go b/internal/aws/servicecatalogappregistry/attribute_group_resource_gen.go index 1c9803e131..c25a1b408e 100644 --- a/internal/aws/servicecatalogappregistry/attribute_group_resource_gen.go +++ b/internal/aws/servicecatalogappregistry/attribute_group_resource_gen.go @@ -4,6 +4,7 @@ package servicecatalogappregistry import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func attributeGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: Arn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[a-z0-9]+", // "type": "string" // } Type: types.StringType, @@ -61,7 +62,7 @@ func attributeGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: Id // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "[a-z0-9]{12}", // "type": "string" // } Type: types.StringType, @@ -77,7 +78,7 @@ func attributeGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the attribute group. ", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "\\w+", // "type": "string" // } Description: "The name of the attribute group. ", @@ -85,6 +86,7 @@ func attributeGroupResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("\\w+"), ""), }, }, "tags": { diff --git a/internal/aws/servicecatalogappregistry/resource_association_resource_gen.go b/internal/aws/servicecatalogappregistry/resource_association_resource_gen.go index 1356bccb98..9d5636d16a 100644 --- a/internal/aws/servicecatalogappregistry/resource_association_resource_gen.go +++ b/internal/aws/servicecatalogappregistry/resource_association_resource_gen.go @@ -4,6 +4,7 @@ package servicecatalogappregistry import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func resourceAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, e // "description": "The name or the Id of the Application.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "\\w+|[a-z0-9]{12}", // "type": "string" // } Description: "The name or the Id of the Application.", @@ -35,13 +36,14 @@ func resourceAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, e Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("\\w+|[a-z0-9]{12}"), ""), }, }, "application_arn": { // Property: ApplicationArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[a-z0-9]+", // "type": "string" // } Type: types.StringType, @@ -67,18 +69,21 @@ func resourceAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, e // CloudFormation resource type schema: // { // "description": "The name or the Id of the Resource.", - // "pattern": "", + // "pattern": "\\w+|arn:aws[-a-z]*:cloudformation:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:stack/[a-zA-Z][-A-Za-z0-9]{0,127}/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}", // "type": "string" // } Description: "The name or the Id of the Resource.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("\\w+|arn:aws[-a-z]*:cloudformation:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:stack/[a-zA-Z][-A-Za-z0-9]{0,127}/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}"), ""), + }, }, "resource_arn": { // Property: ResourceArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "arn:aws[-a-z]*:cloudformation:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:stack/[a-zA-Z][-A-Za-z0-9]{0,127}/[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}", // "type": "string" // } Type: types.StringType, diff --git a/internal/aws/ses/configuration_set_event_destination_resource_gen.go b/internal/aws/ses/configuration_set_event_destination_resource_gen.go index 02dcc2ddf8..b0f0937f8d 100644 --- a/internal/aws/ses/configuration_set_event_destination_resource_gen.go +++ b/internal/aws/ses/configuration_set_event_destination_resource_gen.go @@ -4,6 +4,7 @@ package ses import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -56,14 +57,14 @@ func configurationSetEventDestinationResourceType(ctx context.Context) (tfsdk.Re // "description": "The default value of the dimension that is published to Amazon CloudWatch if you do not provide the value of the dimension when you send an email.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{1,256}$", // "type": "string" // }, // "DimensionName": { // "description": "The name of an Amazon CloudWatch dimension associated with an email sending metric.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{1,256}$", // "type": "string" // }, // "DimensionValueSource": { @@ -118,7 +119,7 @@ func configurationSetEventDestinationResourceType(ctx context.Context) (tfsdk.Re // }, // "Name": { // "description": "The name of the event destination set.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{0,64}$", // "type": "string" // } // }, @@ -147,6 +148,7 @@ func configurationSetEventDestinationResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{1,256}$"), ""), }, }, "dimension_name": { @@ -156,6 +158,7 @@ func configurationSetEventDestinationResourceType(ctx context.Context) (tfsdk.Re Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{1,256}$"), ""), }, }, "dimension_value_source": { @@ -217,6 +220,9 @@ func configurationSetEventDestinationResourceType(ctx context.Context) (tfsdk.Re Description: "The name of the event destination set.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{0,64}$"), ""), + }, }, }, ), diff --git a/internal/aws/ses/configuration_set_resource_gen.go b/internal/aws/ses/configuration_set_resource_gen.go index 94baef1cd8..f103d4bea9 100644 --- a/internal/aws/ses/configuration_set_resource_gen.go +++ b/internal/aws/ses/configuration_set_resource_gen.go @@ -4,11 +4,13 @@ package ses import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -24,13 +26,16 @@ func configurationSetResourceType(ctx context.Context) (tfsdk.ResourceType, erro // CloudFormation resource type schema: // { // "description": "The name of the configuration set.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{1,64}$", // "type": "string" // } Description: "The name of the configuration set.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{1,64}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/ses/contact_list_resource_gen.go b/internal/aws/ses/contact_list_resource_gen.go index a2e1be59c9..0b6064799f 100644 --- a/internal/aws/ses/contact_list_resource_gen.go +++ b/internal/aws/ses/contact_list_resource_gen.go @@ -4,6 +4,7 @@ package ses import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -25,13 +26,16 @@ func contactListResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the contact list.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{1,64}$", // "type": "string" // } Description: "The name of the contact list.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{1,64}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -138,7 +142,7 @@ func contactListResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // }, // "TopicName": { // "description": "The name of the topic.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{1,64}$", // "type": "string" // } // }, @@ -184,6 +188,9 @@ func contactListResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Description: "The name of the topic.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{1,64}$"), ""), + }, }, }, tfsdk.ListNestedAttributesOptions{}, diff --git a/internal/aws/ses/template_resource_gen.go b/internal/aws/ses/template_resource_gen.go index c75aadea5d..ec25bbd179 100644 --- a/internal/aws/ses/template_resource_gen.go +++ b/internal/aws/ses/template_resource_gen.go @@ -4,6 +4,7 @@ package ses import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -51,7 +52,7 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the template.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]{1,64}$", // "type": "string" // }, // "TextPart": { @@ -87,6 +88,7 @@ func templateResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{1,64}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/signer/profile_permission_resource_gen.go b/internal/aws/signer/profile_permission_resource_gen.go index ab426b6eb1..7f9d3c3140 100644 --- a/internal/aws/signer/profile_permission_resource_gen.go +++ b/internal/aws/signer/profile_permission_resource_gen.go @@ -4,11 +4,13 @@ package signer import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" + "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { @@ -59,12 +61,15 @@ func profilePermissionResourceType(ctx context.Context) (tfsdk.ResourceType, err // Property: ProfileVersion // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^[0-9a-zA-Z]{10}$", // "type": "string" // } Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9a-zA-Z]{10}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/signer/signing_profile_resource_gen.go b/internal/aws/signer/signing_profile_resource_gen.go index 411c8685eb..1425e8a5fd 100644 --- a/internal/aws/signer/signing_profile_resource_gen.go +++ b/internal/aws/signer/signing_profile_resource_gen.go @@ -25,7 +25,7 @@ func signingProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the specified signing profile.", - // "pattern": "", + // "pattern": "^arn:aws(-(cn|gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the specified signing profile.", @@ -76,7 +76,7 @@ func signingProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "A version for the signing profile. AWS Signer generates a unique version for each profile of the same profile name.", - // "pattern": "", + // "pattern": "^[0-9a-zA-Z]{10}$", // "type": "string" // } Description: "A version for the signing profile. AWS Signer generates a unique version for each profile of the same profile name.", @@ -91,7 +91,7 @@ func signingProfileResourceType(ctx context.Context) (tfsdk.ResourceType, error) // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the specified signing profile version.", - // "pattern": "", + // "pattern": "^arn:aws(-(cn|gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the specified signing profile version.", diff --git a/internal/aws/ssm/association_resource_gen.go b/internal/aws/ssm/association_resource_gen.go index ca25e6c13a..80fef27eb2 100644 --- a/internal/aws/ssm/association_resource_gen.go +++ b/internal/aws/ssm/association_resource_gen.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -38,7 +39,7 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "88df7b09-95e8-48c4-a3cb-08c2c20d5110", // "203dd0ec-0055-4bf0-a872-707f72ef06aa" // ], - // "pattern": "", + // "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", // "type": "string" // } Description: "Unique identifier of the association.", @@ -53,12 +54,15 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name of the association.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-.]{3,128}$", // "type": "string" // } Description: "The name of the association.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-.]{3,128}$"), ""), + }, }, "automation_target_parameter_name": { // Property: AutomationTargetParameterName @@ -125,12 +129,15 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The version of the SSM document to associate with the target.", - // "pattern": "", + // "pattern": "([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)", // "type": "string" // } Description: "The version of the SSM document to associate with the target.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)"), ""), + }, }, "instance_id": { // Property: InstanceId @@ -141,12 +148,15 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "i-0e60836d21cf313c4", // "mi-0532c22e49636ee13" // ], - // "pattern": "", + // "pattern": "(^i-(\\w{8}|\\w{17})$)|(^mi-\\w{17}$)", // "type": "string" // } Description: "The ID of the instance that the SSM document is associated with.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("(^i-(\\w{8}|\\w{17})$)|(^mi-\\w{17}$)"), ""), + }, }, "max_concurrency": { // Property: MaxConcurrency @@ -158,11 +168,14 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "50%", // "1" // ], - // "pattern": "", + // "pattern": "^([1-9][0-9]{0,6}|[1-9][0-9]%|[1-9]%|100%)$", // "type": "string" // } Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([1-9][0-9]{0,6}|[1-9][0-9]%|[1-9]%|100%)$"), ""), + }, }, "max_errors": { // Property: MaxErrors @@ -174,11 +187,14 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "50%", // "1" // ], - // "pattern": "", + // "pattern": "^([1-9][0-9]{0,6}|[0]|[1-9][0-9]%|[0-9]%|100%)$", // "type": "string" // } Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^([1-9][0-9]{0,6}|[0]|[1-9][0-9]%|[0-9]%|100%)$"), ""), + }, }, "name": { // Property: Name @@ -189,12 +205,15 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "AWS-GatherSoftwareInventory", // "MyCustomSSMDocument" // ], - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-.:/]{3,200}$", // "type": "string" // } Description: "The name of the SSM document.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-.:/]{3,200}$"), ""), + }, }, "output_location": { // Property: OutputLocation @@ -334,7 +353,7 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "additionalProperties": false, // "properties": { // "Key": { - // "pattern": "", + // "pattern": "^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]{1,128}$|resource-groups:Name", // "type": "string" // }, // "Values": { @@ -363,6 +382,9 @@ func associationResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: Key Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]{1,128}$|resource-groups:Name"), ""), + }, }, "values": { // Property: Values diff --git a/internal/aws/ssm/document_resource_gen.go b/internal/aws/ssm/document_resource_gen.go index 4093e053d9..2d17e73626 100644 --- a/internal/aws/ssm/document_resource_gen.go +++ b/internal/aws/ssm/document_resource_gen.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -42,7 +43,7 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the document attachment file.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Values": { @@ -87,6 +88,7 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "values": { @@ -213,13 +215,16 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "A name for the Systems Manager document.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-.]{3,128}$", // "type": "string" // } Description: "A name for the Systems Manager document.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-.]{3,128}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -237,13 +242,13 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "Name": { // "description": "The name of the required SSM document. The name can be an Amazon Resource Name (ARN).", // "maxLength": 200, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-.:/]{3,200}$", // "type": "string" // }, // "Version": { // "description": "The document version required by the current document.", // "maxLength": 8, - // "pattern": "", + // "pattern": "([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)", // "type": "string" // } // }, @@ -262,6 +267,7 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(200), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-.:/]{3,200}$"), ""), }, }, "version": { @@ -271,6 +277,7 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(8), + validate.StringMatch(regexp.MustCompile("([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)"), ""), }, }, }, @@ -300,14 +307,14 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the tag.", // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // }, // "Value": { // "description": "The value of the tag.", // "maxLength": 256, // "minLength": 1, - // "pattern": "", + // "pattern": "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$", // "type": "string" // } // }, @@ -326,6 +333,7 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, "value": { @@ -335,6 +343,7 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), + validate.StringMatch(regexp.MustCompile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"), ""), }, }, }, @@ -353,13 +362,16 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Specify a target type to define the kinds of resources the document can run on.", - // "pattern": "", + // "pattern": "^\\/[\\w\\.\\-\\:\\/]*$", // "type": "string" // } Description: "Specify a target type to define the kinds of resources the document can run on.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^\\/[\\w\\.\\-\\:\\/]*$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), @@ -370,13 +382,16 @@ func documentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "An optional field specifying the version of the artifact you are creating with the document. This value is unique across all versions of a document, and cannot be changed.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-.]{1,128}$", // "type": "string" // } Description: "An optional field specifying the version of the artifact you are creating with the document. This value is unique across all versions of a document, and cannot be changed.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-.]{1,128}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/ssmcontacts/contact_channel_resource_gen.go b/internal/aws/ssmcontacts/contact_channel_resource_gen.go index 2820110414..6dfd804c18 100644 --- a/internal/aws/ssmcontacts/contact_channel_resource_gen.go +++ b/internal/aws/ssmcontacts/contact_channel_resource_gen.go @@ -4,6 +4,7 @@ package ssmcontacts import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -97,7 +98,7 @@ func contactChannelResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "ARN of the contact resource", // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "arn:[-\\w+=\\/,.@]+:[-\\w+=\\/,.@]+:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*", // "type": "string" // } Description: "ARN of the contact resource", @@ -106,6 +107,7 @@ func contactChannelResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("arn:[-\\w+=\\/,.@]+:[-\\w+=\\/,.@]+:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/ssmcontacts/contact_resource_gen.go b/internal/aws/ssmcontacts/contact_resource_gen.go index ce97cddfdf..dbad53cdae 100644 --- a/internal/aws/ssmcontacts/contact_resource_gen.go +++ b/internal/aws/ssmcontacts/contact_resource_gen.go @@ -4,6 +4,7 @@ package ssmcontacts import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func contactResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Alias of the contact. String value with 20 to 256 characters. Only alphabetical, numeric characters, dash, or underscore allowed.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-z0-9_\\-\\.]*$", // "type": "string" // } Description: "Alias of the contact. String value with 20 to 256 characters. Only alphabetical, numeric characters, dash, or underscore allowed.", @@ -35,6 +36,7 @@ func contactResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-z0-9_\\-\\.]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -61,7 +63,7 @@ func contactResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Name of the contact. String value with 3 to 256 characters. Only alphabetical, space, numeric characters, dash, or underscore allowed.", // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_\\-\\s]*$", // "type": "string" // } Description: "Name of the contact. String value with 3 to 256 characters. Only alphabetical, space, numeric characters, dash, or underscore allowed.", @@ -69,6 +71,7 @@ func contactResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\s]*$"), ""), }, }, "plan": { diff --git a/internal/aws/ssmincidents/replication_set_resource_gen.go b/internal/aws/ssmincidents/replication_set_resource_gen.go index 6cacb954f8..526cf43c4c 100644 --- a/internal/aws/ssmincidents/replication_set_resource_gen.go +++ b/internal/aws/ssmincidents/replication_set_resource_gen.go @@ -4,6 +4,7 @@ package ssmincidents import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func replicationSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // { // "description": "The ARN of the ReplicationSet.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov|iso(-b)?))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The ARN of the ReplicationSet.", @@ -70,7 +71,7 @@ func replicationSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "SseKmsKeyId": { // "description": "The ARN of the ReplicationSet.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov|iso(-b)?))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } // }, @@ -107,6 +108,7 @@ func replicationSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov|iso(-b)?))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), }, }, }, diff --git a/internal/aws/ssmincidents/response_plan_resource_gen.go b/internal/aws/ssmincidents/response_plan_resource_gen.go index 18bfbf641d..b661279595 100644 --- a/internal/aws/ssmincidents/response_plan_resource_gen.go +++ b/internal/aws/ssmincidents/response_plan_resource_gen.go @@ -4,6 +4,7 @@ package ssmincidents import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/tfsdk" @@ -84,7 +85,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "RoleArn": { // "description": "The role ARN to use when starting the SSM automation document.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // }, // "TargetAccount": { @@ -173,6 +174,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), }, }, "target_account": { @@ -211,7 +213,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // { // "description": "The ARN of the response plan.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } Description: "The ARN of the response plan.", @@ -233,7 +235,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "description": "The ARN of the Chatbot SNS topic.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:sns:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // }, // "type": "array", @@ -252,6 +254,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.UniqueItems(), validate.ArrayForEach(validate.StringLenAtMost(1000)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:sns:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), "")), }, }, }, @@ -284,7 +287,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "items": { // "description": "The ARN of the contact.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:ssm-contacts:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // }, // "maxItems": 5, @@ -299,6 +302,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 5), validate.ArrayForEach(validate.StringLenAtMost(1000)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:ssm-contacts:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.Set{ElemType: types.StringType, Elems: []attr.Value{}}), @@ -334,7 +338,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "SnsTopicArn": { // "description": "The ARN of the Chatbot SNS topic.", // "maxLength": 1000, - // "pattern": "", + // "pattern": "^arn:aws(-(cn|us-gov))?:sns:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$", // "type": "string" // } // }, @@ -394,6 +398,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1000), + validate.StringMatch(regexp.MustCompile("^arn:aws(-(cn|us-gov))?:sns:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"), ""), }, }, }, @@ -436,7 +441,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the response plan.", // "maxLength": 200, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_-]*$", // "type": "string" // } Description: "The name of the response plan.", @@ -444,6 +449,7 @@ func responsePlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 200), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/sso/assignment_resource_gen.go b/internal/aws/sso/assignment_resource_gen.go index 30e38fd0a9..feaadc1afc 100644 --- a/internal/aws/sso/assignment_resource_gen.go +++ b/internal/aws/sso/assignment_resource_gen.go @@ -4,6 +4,7 @@ package sso import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The sso instance that the permission set is owned.", // "maxLength": 1224, // "minLength": 10, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", // "type": "string" // } Description: "The sso instance that the permission set is owned.", @@ -35,6 +36,7 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 1224), + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -47,7 +49,7 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The permission set that the assignemt will be assigned", // "maxLength": 1224, // "minLength": 10, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::permissionSet/(sso)?ins-[a-zA-Z0-9-.]{16}/ps-[a-zA-Z0-9-./]{16}", // "type": "string" // } Description: "The permission set that the assignemt will be assigned", @@ -55,6 +57,7 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 1224), + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::permissionSet/(sso)?ins-[a-zA-Z0-9-.]{16}/ps-[a-zA-Z0-9-./]{16}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -67,7 +70,7 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The assignee's identifier, user id/group id", // "maxLength": 47, // "minLength": 1, - // "pattern": "", + // "pattern": "^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$", // "type": "string" // } Description: "The assignee's identifier, user id/group id", @@ -75,6 +78,7 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 47), + validate.StringMatch(regexp.MustCompile("^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -109,12 +113,15 @@ func assignmentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The account id to be provisioned.", - // "pattern": "", + // "pattern": "\\d{12}", // "type": "string" // } Description: "The account id to be provisioned.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("\\d{12}"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, diff --git a/internal/aws/sso/instance_access_control_attribute_configuration_resource_gen.go b/internal/aws/sso/instance_access_control_attribute_configuration_resource_gen.go index cc2475fe85..9d486e973e 100644 --- a/internal/aws/sso/instance_access_control_attribute_configuration_resource_gen.go +++ b/internal/aws/sso/instance_access_control_attribute_configuration_resource_gen.go @@ -4,6 +4,7 @@ package sso import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -31,7 +32,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]+", // "type": "string" // }, // "Value": { @@ -42,7 +43,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context // "items": { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@\\[\\]\\{\\}\\$\\\\\"]*", // "type": "string" // }, // "maxItems": 1, @@ -72,6 +73,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]+"), ""), }, }, "value": { @@ -85,6 +87,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(1), validate.ArrayForEach(validate.StringLenBetween(0, 256)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@\\[\\]\\{\\}\\$\\\\\"]*"), "")), }, }, }, @@ -117,7 +120,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]+", // "type": "string" // }, // "Value": { @@ -128,7 +131,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context // "items": { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@\\[\\]\\{\\}\\$\\\\\"]*", // "type": "string" // }, // "maxItems": 1, @@ -169,6 +172,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]+"), ""), }, }, "value": { @@ -182,6 +186,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(1), validate.ArrayForEach(validate.StringLenBetween(0, 256)), + validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@\\[\\]\\{\\}\\$\\\\\"]*"), "")), }, }, }, @@ -210,7 +215,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context // "description": "The ARN of the AWS SSO instance under which the operation will be executed.", // "maxLength": 1224, // "minLength": 10, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", // "type": "string" // } Description: "The ARN of the AWS SSO instance under which the operation will be executed.", @@ -218,6 +223,7 @@ func instanceAccessControlAttributeConfigurationResourceType(ctx context.Context Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 1224), + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), diff --git a/internal/aws/sso/permission_set_resource_gen.go b/internal/aws/sso/permission_set_resource_gen.go index 339eafa619..fe7bf7b98a 100644 --- a/internal/aws/sso/permission_set_resource_gen.go +++ b/internal/aws/sso/permission_set_resource_gen.go @@ -4,6 +4,7 @@ package sso import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The permission set description.", // "maxLength": 700, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*", // "type": "string" // } Description: "The permission set description.", @@ -35,6 +36,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 700), + validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*"), ""), }, }, "inline_policy": { @@ -55,7 +57,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The sso instance arn that the permission set is owned.", // "maxLength": 1224, // "minLength": 10, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", // "type": "string" // } Description: "The sso instance arn that the permission set is owned.", @@ -63,6 +65,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 1224), + validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -99,7 +102,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name you want to assign to this permission set.", // "maxLength": 32, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w+=,.@-]+", // "type": "string" // } Description: "The name you want to assign to this permission set.", @@ -107,6 +110,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 32), + validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), @@ -119,7 +123,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The permission set that the policy will be attached to", // "maxLength": 1224, // "minLength": 10, - // "pattern": "", + // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::permissionSet/(sso)?ins-[a-zA-Z0-9-.]{16}/ps-[a-zA-Z0-9-./]{16}", // "type": "string" // } Description: "The permission set that the policy will be attached to", @@ -136,7 +140,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The relay state URL that redirect links to any service in the AWS Management Console.", // "maxLength": 240, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9\u0026amp;$@#\\/%?=~\\-_'\u0026quot;|!:,.;*+\\[\\]\\ \\(\\)\\{\\}]+", // "type": "string" // } Description: "The relay state URL that redirect links to any service in the AWS Management Console.", @@ -144,6 +148,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 240), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9&$@#\\/%?=~\\-_'"|!:,.;*+\\[\\]\\ \\(\\)\\{\\}]+"), ""), }, }, "session_duration": { @@ -175,13 +180,13 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "Key": { // "maxLength": 128, // "minLength": 1, - // "pattern": "", + // "pattern": "[\\w+=,.@-]+", // "type": "string" // }, // "Value": { // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "[\\w+=,.@-]+", // "type": "string" // } // }, @@ -202,6 +207,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), + validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, }, "value": { @@ -210,6 +216,7 @@ func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, }, }, diff --git a/internal/aws/timestream/database_resource_gen.go b/internal/aws/timestream/database_resource_gen.go index f0a4d767c8..7248ff8069 100644 --- a/internal/aws/timestream/database_resource_gen.go +++ b/internal/aws/timestream/database_resource_gen.go @@ -4,6 +4,7 @@ package timestream import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -37,13 +38,16 @@ func databaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name for the database. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the database name.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_.-]{3,256}$", // "type": "string" // } Description: "The name for the database. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the database name.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_.-]{3,256}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/timestream/scheduled_query_resource_gen.go b/internal/aws/timestream/scheduled_query_resource_gen.go index 80f0311626..52a663f3af 100644 --- a/internal/aws/timestream/scheduled_query_resource_gen.go +++ b/internal/aws/timestream/scheduled_query_resource_gen.go @@ -4,6 +4,7 @@ package timestream import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -72,7 +73,7 @@ func scheduledQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "Name of the S3 bucket under which error reports will be created.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]", // "type": "string" // }, // "EncryptionOption": { @@ -87,7 +88,7 @@ func scheduledQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "Prefix for error report keys.", // "maxLength": 896, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9|!\\-_*'\\(\\)]([a-zA-Z0-9]|[!\\-_*'\\(\\)\\/.])+", // "type": "string" // } // }, @@ -117,6 +118,7 @@ func scheduledQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]"), ""), }, }, "encryption_option": { @@ -138,6 +140,7 @@ func scheduledQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 896), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9|!\\-_*'\\(\\)]([a-zA-Z0-9]|[!\\-_*'\\(\\)\\/.])+"), ""), }, }, }, @@ -424,7 +427,7 @@ func scheduledQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "description": "The name of the scheduled query. Scheduled query names must be unique within each Region.", // "maxLength": 64, // "minLength": 1, - // "pattern": "", + // "pattern": "[a-zA-Z0-9_.-]+", // "type": "string" // } Description: "The name of the scheduled query. Scheduled query names must be unique within each Region.", @@ -433,6 +436,7 @@ func scheduledQueryResourceType(ctx context.Context) (tfsdk.ResourceType, error) Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), + validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_.-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), diff --git a/internal/aws/timestream/table_resource_gen.go b/internal/aws/timestream/table_resource_gen.go index da278b248a..6c3270ae78 100644 --- a/internal/aws/timestream/table_resource_gen.go +++ b/internal/aws/timestream/table_resource_gen.go @@ -4,6 +4,7 @@ package timestream import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -37,12 +38,15 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name for the database which the table to be created belongs to.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_.-]{3,256}$", // "type": "string" // } Description: "The name for the database which the table to be created belongs to.", Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_.-]{3,256}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -209,13 +213,16 @@ func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9_.-]{3,256}$", // "type": "string" // } Description: "The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_.-]{3,256}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/transfer/workflow_resource_gen.go b/internal/aws/transfer/workflow_resource_gen.go index 42bb83a276..d60f8baf21 100644 --- a/internal/aws/transfer/workflow_resource_gen.go +++ b/internal/aws/transfer/workflow_resource_gen.go @@ -4,6 +4,7 @@ package transfer import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -27,7 +28,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Specifies the unique Amazon Resource Name (ARN) for the workflow.", // "maxLength": 1600, // "minLength": 20, - // "pattern": "", + // "pattern": "arn:.*", // "type": "string" // } Description: "Specifies the unique Amazon Resource Name (ARN) for the workflow.", @@ -44,7 +45,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A textual description for the workflow.", // "maxLength": 256, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w\\- ]*$", // "type": "string" // } Description: "A textual description for the workflow.", @@ -53,6 +54,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), + validate.StringMatch(regexp.MustCompile("^[\\w\\- ]*$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), @@ -85,14 +87,14 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Specifies the S3 bucket that contains the file being copied.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // }, // "Key": { // "description": "The name assigned to the file when it was created in S3. You use the object key to retrieve the object.", // "maxLength": 1024, // "minLength": 0, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -105,7 +107,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // }, // "OverwriteExisting": { @@ -127,14 +129,14 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // }, // "Target": { // "description": "The ARN for the lambda function that is being called.", // "maxLength": 170, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:[a-z-]+:lambda:.*$", // "type": "string" // }, // "TimeoutSeconds": { @@ -154,7 +156,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // } // }, @@ -168,7 +170,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // }, // "Tags": { @@ -245,6 +247,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, "key": { @@ -254,6 +257,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 1024), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -271,6 +275,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, "overwrite_existing": { @@ -301,6 +306,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, "target": { @@ -310,6 +316,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 170), + validate.StringMatch(regexp.MustCompile("arn:[a-z-]+:lambda:.*$"), ""), }, }, "timeout_seconds": { @@ -337,6 +344,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, }, @@ -355,6 +363,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, "tags": { @@ -445,14 +454,14 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "Specifies the S3 bucket that contains the file being copied.", // "maxLength": 63, // "minLength": 3, - // "pattern": "", + // "pattern": "^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$", // "type": "string" // }, // "Key": { // "description": "The name assigned to the file when it was created in S3. You use the object key to retrieve the object.", // "maxLength": 1024, // "minLength": 0, - // "pattern": "", + // "pattern": ".*", // "type": "string" // } // }, @@ -465,7 +474,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // }, // "OverwriteExisting": { @@ -487,14 +496,14 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // }, // "Target": { // "description": "The ARN for the lambda function that is being called.", // "maxLength": 170, // "minLength": 0, - // "pattern": "", + // "pattern": "arn:[a-z-]+:lambda:.*$", // "type": "string" // }, // "TimeoutSeconds": { @@ -514,7 +523,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // } // }, @@ -528,7 +537,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "The name of the step, used as an identifier.", // "maxLength": 30, // "minLength": 0, - // "pattern": "", + // "pattern": "^[\\w-]*$", // "type": "string" // }, // "Tags": { @@ -605,6 +614,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), + validate.StringMatch(regexp.MustCompile("^[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9]$"), ""), }, }, "key": { @@ -614,6 +624,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 1024), + validate.StringMatch(regexp.MustCompile(".*"), ""), }, }, }, @@ -631,6 +642,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, "overwrite_existing": { @@ -661,6 +673,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, "target": { @@ -670,6 +683,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 170), + validate.StringMatch(regexp.MustCompile("arn:[a-z-]+:lambda:.*$"), ""), }, }, "timeout_seconds": { @@ -697,6 +711,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, }, @@ -715,6 +730,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 30), + validate.StringMatch(regexp.MustCompile("^[\\w-]*$"), ""), }, }, "tags": { @@ -846,7 +862,7 @@ func workflowResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // "description": "A unique identifier for the workflow.", // "maxLength": 19, // "minLength": 19, - // "pattern": "", + // "pattern": "^w-([a-z0-9]{17})$", // "type": "string" // } Description: "A unique identifier for the workflow.", diff --git a/internal/aws/wafv2/ip_set_resource_gen.go b/internal/aws/wafv2/ip_set_resource_gen.go index d719506fe4..f05e5c6d52 100644 --- a/internal/aws/wafv2/ip_set_resource_gen.go +++ b/internal/aws/wafv2/ip_set_resource_gen.go @@ -4,6 +4,7 @@ package wafv2 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -59,12 +60,15 @@ func iPSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Description of the entity.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$", // "type": "string" // } Description: "Description of the entity.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$"), ""), + }, }, "ip_address_version": { // Property: IPAddressVersion @@ -92,7 +96,7 @@ func iPSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Id of the IPSet", - // "pattern": "", + // "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$", // "type": "string" // } Description: "Id of the IPSet", @@ -107,13 +111,16 @@ func iPSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // CloudFormation resource type schema: // { // "description": "Name of the IPSet.", - // "pattern": "", + // "pattern": "^[0-9A-Za-z_-]{1,128}$", // "type": "string" // } Description: "Name of the IPSet.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9A-Za-z_-]{1,128}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/wafv2/regex_pattern_set_resource_gen.go b/internal/aws/wafv2/regex_pattern_set_resource_gen.go index d9f4d07002..2bc214d13e 100644 --- a/internal/aws/wafv2/regex_pattern_set_resource_gen.go +++ b/internal/aws/wafv2/regex_pattern_set_resource_gen.go @@ -4,6 +4,7 @@ package wafv2 import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -39,19 +40,22 @@ func regexPatternSetResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "Description of the entity.", - // "pattern": "", + // "pattern": "^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$", // "type": "string" // } Description: "Description of the entity.", Type: types.StringType, Optional: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9=:#@/\\-,.][a-zA-Z0-9+=:#@/\\-,.\\s]+[a-zA-Z0-9+=:#@/\\-,.]{1,256}$"), ""), + }, }, "id": { // Property: Id // CloudFormation resource type schema: // { // "description": "Id of the RegexPatternSet", - // "pattern": "", + // "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$", // "type": "string" // } Description: "Id of the RegexPatternSet", @@ -66,13 +70,16 @@ func regexPatternSetResourceType(ctx context.Context) (tfsdk.ResourceType, error // CloudFormation resource type schema: // { // "description": "Name of the RegexPatternSet.", - // "pattern": "", + // "pattern": "^[0-9A-Za-z_-]{1,128}$", // "type": "string" // } Description: "Name of the RegexPatternSet.", Type: types.StringType, Optional: true, Computed: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[0-9A-Za-z_-]{1,128}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), diff --git a/internal/aws/wisdom/assistant_association_resource_gen.go b/internal/aws/wisdom/assistant_association_resource_gen.go index 0393f4027b..72126d1f4c 100644 --- a/internal/aws/wisdom/assistant_association_resource_gen.go +++ b/internal/aws/wisdom/assistant_association_resource_gen.go @@ -4,6 +4,7 @@ package wisdom import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -24,7 +25,7 @@ func assistantAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: AssistantArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$", // "type": "string" // } Type: types.StringType, @@ -37,7 +38,7 @@ func assistantAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: AssistantAssociationArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$", // "type": "string" // } Type: types.StringType, @@ -50,7 +51,7 @@ func assistantAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: AssistantAssociationId // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } Type: types.StringType, @@ -63,11 +64,14 @@ func assistantAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: AssistantId // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"), ""), + }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, @@ -79,7 +83,7 @@ func assistantAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // "additionalProperties": false, // "properties": { // "KnowledgeBaseId": { - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } // }, @@ -94,6 +98,9 @@ func assistantAssociationResourceType(ctx context.Context) (tfsdk.ResourceType, // Property: KnowledgeBaseId Type: types.StringType, Required: true, + Validators: []tfsdk.AttributeValidator{ + validate.StringMatch(regexp.MustCompile("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"), ""), + }, }, }, ), diff --git a/internal/aws/wisdom/assistant_resource_gen.go b/internal/aws/wisdom/assistant_resource_gen.go index ce2eba45c6..3d3751bf51 100644 --- a/internal/aws/wisdom/assistant_resource_gen.go +++ b/internal/aws/wisdom/assistant_resource_gen.go @@ -24,7 +24,7 @@ func assistantResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: AssistantArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$", // "type": "string" // } Type: types.StringType, @@ -37,7 +37,7 @@ func assistantResourceType(ctx context.Context) (tfsdk.ResourceType, error) { // Property: AssistantId // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } Type: types.StringType, diff --git a/internal/aws/wisdom/knowledge_base_resource_gen.go b/internal/aws/wisdom/knowledge_base_resource_gen.go index 663efe33b5..f6da6bbaa4 100644 --- a/internal/aws/wisdom/knowledge_base_resource_gen.go +++ b/internal/aws/wisdom/knowledge_base_resource_gen.go @@ -4,6 +4,7 @@ package wisdom import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -43,7 +44,7 @@ func knowledgeBaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: KnowledgeBaseArn // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^arn:[a-z-]*?:wisdom:[a-z0-9-]*?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$", // "type": "string" // } Type: types.StringType, @@ -56,7 +57,7 @@ func knowledgeBaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) // Property: KnowledgeBaseId // CloudFormation resource type schema: // { - // "pattern": "", + // "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", // "type": "string" // } Type: types.StringType, @@ -184,7 +185,7 @@ func knowledgeBaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) // "AppIntegrationArn": { // "maxLength": 2048, // "minLength": 1, - // "pattern": "", + // "pattern": "^arn:[a-z-]+?:[a-z-]+?:[a-z0-9-]*?:([0-9]{12})?:[a-zA-Z0-9-:/]+$", // "type": "string" // }, // "ObjectFields": { @@ -220,6 +221,7 @@ func knowledgeBaseResourceType(ctx context.Context) (tfsdk.ResourceType, error) Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 2048), + validate.StringMatch(regexp.MustCompile("^arn:[a-z-]+?:[a-z-]+?:[a-z0-9-]*?:([0-9]{12})?:[a-zA-Z0-9-:/]+$"), ""), }, }, "object_fields": { diff --git a/internal/aws/workspaces/connection_alias_resource_gen.go b/internal/aws/workspaces/connection_alias_resource_gen.go index 662f897c93..8819002bca 100644 --- a/internal/aws/workspaces/connection_alias_resource_gen.go +++ b/internal/aws/workspaces/connection_alias_resource_gen.go @@ -4,6 +4,7 @@ package workspaces import ( "context" + "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" @@ -26,7 +27,7 @@ func connectionAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "maxLength": 68, // "minLength": 13, - // "pattern": "", + // "pattern": "^wsca-[0-9a-z]{8,63}$", // "type": "string" // } Type: types.StringType, @@ -58,13 +59,13 @@ func connectionAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error // "ConnectionIdentifier": { // "maxLength": 20, // "minLength": 1, - // "pattern": "", + // "pattern": "^[a-zA-Z0-9]+$", // "type": "string" // }, // "ResourceId": { // "maxLength": 1000, // "minLength": 1, - // "pattern": "", + // "pattern": ".+", // "type": "string" // } // }, @@ -101,6 +102,7 @@ func connectionAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 20), + validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9]+$"), ""), }, }, "resource_id": { @@ -109,6 +111,7 @@ func connectionAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 1000), + validate.StringMatch(regexp.MustCompile(".+"), ""), }, }, }, @@ -142,13 +145,14 @@ func connectionAliasResourceType(ctx context.Context) (tfsdk.ResourceType, error // { // "maxLength": 255, // "minLength": 1, - // "pattern": "", + // "pattern": "^[.0-9a-zA-Z\\-]{1,255}$", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), + validate.StringMatch(regexp.MustCompile("^[.0-9a-zA-Z\\-]{1,255}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), From 33179a61fbfebd7a8a9199e0c735040ca6087fa0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 16:18:59 -0500 Subject: [PATCH 16/19] r/awscc_logs_query_definition: Add hand-written acceptance test. Doesn't currently work. --- .../logs/query_definition_resource_test.go | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 internal/aws/logs/query_definition_resource_test.go diff --git a/internal/aws/logs/query_definition_resource_test.go b/internal/aws/logs/query_definition_resource_test.go new file mode 100644 index 0000000000..bc2a2b9445 --- /dev/null +++ b/internal/aws/logs/query_definition_resource_test.go @@ -0,0 +1,51 @@ +package logs_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-awscc/internal/acctest" +) + +func TestAccAWSLogsQueryDefinition_queryString(t *testing.T) { + td := acctest.NewTestData(t, "AWS::Logs::QueryDefinition", "awscc_logs_query_definition", "test") + resourceName := td.ResourceName + rName := td.RandomName() + expectedQueryString := `fields @timestamp, @message +| sort @timestamp desc +| limit 20 +` + + td.ResourceTest(t, []resource.TestStep{ + { + Config: testAccAWSLogsQueryDefinitionConfig(&td, rName), + Check: resource.ComposeTestCheckFunc( + td.CheckExistsInAWS(), + resource.TestCheckResourceAttr(resourceName, "log_group_names.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "query_definition_id"), + resource.TestCheckResourceAttr(resourceName, "query_string", expectedQueryString), + ), + }, + { + ResourceName: td.ResourceName, + ImportState: true, + ImportStateVerify: true, + }, + }) +} + +func testAccAWSLogsQueryDefinitionConfig(td *acctest.TestData, rName string) string { + return fmt.Sprintf(` +resource %[1]q %[2]q { + name = %[3]q + + query_string = < Date: Sun, 20 Feb 2022 16:20:20 -0500 Subject: [PATCH 17/19] Ensure that the CFN type is logged correctly. --- internal/generic/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/generic/resource.go b/internal/generic/resource.go index 2ef4d2c8a1..05c40d55fb 100644 --- a/internal/generic/resource.go +++ b/internal/generic/resource.go @@ -802,7 +802,7 @@ func (r *resource) populateUnknownValues(ctx context.Context, id string, state * // cfnTypeContext injects the CloudFormation type name into logger contexts. func (r *resource) cfnTypeContext(ctx context.Context) context.Context { - ctx = tflog.With(ctx, LoggingKeyCFNType, r.resourceType.tfTypeName) + ctx = tflog.With(ctx, LoggingKeyCFNType, r.resourceType.cfTypeName) return ctx } From 6985a4d0d1f3f55448f786b24ffc95a38d4e714d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 16:42:22 -0500 Subject: [PATCH 18/19] Add CHANGELOG entry. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ad0e3a1d..cf2dff5bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ ## 0.13.0 (Unreleased) + +FEATURES: + +Support property `pattern` validation ([#88](https://github.com/hashicorp/terraform-provider-awscc/issues/88)) + ## [0.12.0](https://github.com/hashicorp/terraform-provider-awscc/releases/tag/v0.12.0) (February 17, 2022) BREAKING CHANGES: From 4e8ca4e71eda895adb74fe5eebd08284155b6a41 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 20 Feb 2022 16:42:37 -0500 Subject: [PATCH 19/19] Run 'go get github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go@v0.16.0'. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8255a5c0dc..fb425f8062 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/smithy-go v1.10.0 github.com/evanphx/json-patch v0.5.2 // indirect github.com/google/go-cmp v0.5.7 - github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218205657-286a497ed650 + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.16.0 github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 github.com/hashicorp/go-hclog v1.0.0 github.com/hashicorp/go-multierror v1.1.1 diff --git a/go.sum b/go.sum index e3d3f2e129..6e07fb3972 100644 --- a/go.sum +++ b/go.sum @@ -207,6 +207,8 @@ github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.2022021 github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218201529-42afe5eba878/go.mod h1:Vh1zhjMM0j3Dr+dFkR5BC+ZTvvruJrSY1PMRkMkMNYg= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218205657-286a497ed650 h1:hdNk4xkrnQjpU4zR8p1zdsfycays6yvYruUs+2+WezI= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.15.1-0.20220218205657-286a497ed650/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.16.0 h1:r2RUzeK2gAitl0HY9SLH1axAEu+6aPBY20g1jOoBepM= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.16.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 h1:fw9FTvekjXAQrHwkYwEBnesZS/lb/XZsV/5hqA1lxqA= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3/go.mod h1:mt5V7NshmBoY+q96yicADdPd/Eu2AyNXVdzlO4LqFM8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=