-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/aws_wafv2: Add missing values to text_transformation
argument
#20564
r/aws_wafv2: Add missing values to text_transformation
argument
#20564
Conversation
text_transformation
values
text_transformation
valuestext_transformation
argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Brunhil! Thanks for the contribution, just a couple of small changes and it LGTM!
aws/wafv2_helper.go
Outdated
@@ -382,6 +382,21 @@ func wafv2TextTransformationSchema() *schema.Schema { | |||
wafv2.TextTransformationTypeLowercase, | |||
wafv2.TextTransformationTypeNone, | |||
wafv2.TextTransformationTypeUrlDecode, | |||
wafv2.TextTransformationTypeBase64Decode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in (#14601) the aws-go-sdk
has added _Values()
suffixed const arrays so we can actually replace this whole statement with:
validation.StringInSlice(wafv2.TextTransformationType_Values(), false),
This way the validation will automatically update as we update aws-go-sdk
versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! Thanks for this tidbit of info, super slick. Will get this updated shortly!
* `type` - (Required) The transformation to apply, you can specify the following types: `NONE`, `COMPRESS_WHITE_SPACE`, `HTML_ENTITY_DECODE`, `LOWERCASE`, `CMD_LINE`, `URL_DECODE`, `BASE64_DECODE`, `HEX_DECODE`, `MD5`, `REPLACE_COMMENTS`, | ||
`ESCAPE_SEQ_DECODE`, `SQL_HEX_DECODE`, `CSS_DECODE`, `JS_DECODE`, `NORMALIZE_PATH`, `NORMALIZE_PATH_WIN`, `REMOVE_NULLS`, `REPLACE_NULLS`, `BASE64_DECODE_EXT`, `URL_DECODE_UNI`, `UTF8_TO_UNICODE`. | ||
See the [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_TextTransformation.html) for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are now using on the TextTransformation_Values()
function, we should link to the TextTransformation documentation for specific values.
* `type` - (Required) The transformation to apply, you can specify the following types: `NONE`, `COMPRESS_WHITE_SPACE`, `HTML_ENTITY_DECODE`, `LOWERCASE`, `CMD_LINE`, `URL_DECODE`, `BASE64_DECODE`, `HEX_DECODE`, `MD5`, `REPLACE_COMMENTS`, | |
`ESCAPE_SEQ_DECODE`, `SQL_HEX_DECODE`, `CSS_DECODE`, `JS_DECODE`, `NORMALIZE_PATH`, `NORMALIZE_PATH_WIN`, `REMOVE_NULLS`, `REPLACE_NULLS`, `BASE64_DECODE_EXT`, `URL_DECODE_UNI`, `UTF8_TO_UNICODE`. | |
See the [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_TextTransformation.html) for more details. | |
* `type` - (Required) The transformation to apply, please refer to the Text Transformation [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_TextTransformation.html) for more details. |
LGTM 🚀 Verified Acceptance Tests in us-west-2 make testacc TESTARGS='-run=TestAccAwsWafv2WebACL_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsWafv2WebACL_ -timeout 180m
--- PASS: TestAccAwsWafv2WebACL_minimal (32.46s)
--- PASS: TestAccAwsWafv2WebACL_disappears (36.71s)
--- PASS: TestAccAwsWafv2WebACL_Update_rule (70.53s)
--- PASS: TestAccAwsWafv2WebACL_RateBased_maxNested (70.73s)
--- PASS: TestAccAwsWafv2WebACL_IPSetReference_basic (81.35s)
--- PASS: TestAccAwsWafv2WebACL_tags (84.90s)
--- PASS: TestAccAwsWafv2WebACL_ManagedRuleGroup_basic (87.94s)
--- PASS: TestAccAwsWafv2WebACL_RateBased_forwardedIPConfig (90.28s)
--- PASS: TestAccAwsWafv2WebACL_RateBased_basic (95.37s)
--- PASS: TestAccAwsWafv2WebACL_Update_nameForceNew (99.56s)
--- PASS: TestAccAwsWafv2WebACL_GeoMatch_forwardedIPConfig (101.44s)
--- PASS: TestAccAwsWafv2WebACL_Custom_requestHandling (109.64s)
--- PASS: TestAccAwsWafv2WebACL_Custom_response (111.87s)
--- PASS: TestAccAwsWafv2WebACL_RuleGroupReference_basic (121.12s)
--- PASS: TestAccAwsWafv2WebACL_GeoMatch_basic (134.42s)
--- PASS: TestAccAwsWafv2WebACL_Operators_maxNested (137.16s)
--- PASS: TestAccAwsWafv2WebACL_Update_ruleProperties (138.10s)
--- PASS: TestAccAwsWafv2WebACL_basic (146.87s)
--- PASS: TestAccAwsWafv2WebACL_IPSetReference_forwardedIPConfig (152.73s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 156.462s
make testacc TESTARGS='-run=TestAccAwsWafv2RuleGroup_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsWafv2RuleGroup_ -timeout 180m
--- PASS: TestAccAwsWafv2RuleGroup_GeoMatchStatement (66.88s)
--- PASS: TestAccAwsWafv2RuleGroup_SizeConstraintStatement (72.83s)
--- PASS: TestAccAwsWafv2RuleGroup_GeoMatchStatement_ForwardedIPConfig (82.54s)
--- PASS: TestAccAwsWafv2RuleGroup_RuleAction (82.85s)
--- PASS: TestAccAwsWafv2RuleGroup_Disappears (19.80s)
--- PASS: TestAccAwsWafv2RuleGroup_ByteMatchStatement (90.30s)
--- PASS: TestAccAwsWafv2RuleGroup_RegexPatternSetReferenceStatement (91.64s)
--- PASS: TestAccAwsWafv2RuleGroup_RuleAction_CustomResponse (95.92s)
--- PASS: TestAccAwsWafv2RuleGroup_RuleAction_CustomRequestHandling (98.03s)
--- PASS: TestAccAwsWafv2RuleGroup_ChangeCapacityForceNew (98.13s)
--- PASS: TestAccAwsWafv2RuleGroup_basic (103.31s)
--- PASS: TestAccAwsWafv2RuleGroup_ChangeMetricNameForceNew (35.36s)
--- PASS: TestAccAwsWafv2RuleGroup_updateRuleProperties (110.51s)
--- PASS: TestAccAwsWafv2RuleGroup_updateRule (36.78s)
--- PASS: TestAccAwsWafv2RuleGroup_XssMatchStatement (121.14s)
--- PASS: TestAccAwsWafv2RuleGroup_IpSetReferenceStatement (125.86s)
--- PASS: TestAccAwsWafv2RuleGroup_LogicalRuleStatements (133.49s)
--- PASS: TestAccAwsWafv2RuleGroup_Tags (138.62s)
--- PASS: TestAccAwsWafv2RuleGroup_ChangeNameForceNew (156.07s)
--- PASS: TestAccAwsWafv2RuleGroup_IpSetReferenceStatement_IPSetForwardedIPConfig (177.77s)
--- PASS: TestAccAwsWafv2RuleGroup_ByteMatchStatement_FieldToMatch (187.36s)
--- PASS: TestAccAwsWafv2RuleGroup_SqliMatchStatement (231.49s)
--- PASS: TestAccAwsWafv2RuleGroup_Minimal (237.17s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 240.339s |
This functionality has been released in v3.55.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Closes #20545. Add missing values to
text_transformation
argument foraws_wafv2_web_acl
andaws_wafv2_rule_group
resources