-
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
Add tags to WAF WebACL, Rule & Rule Group Resources #10408
Conversation
aws_waf_rate_based_rule aws_waf_rule aws_waf_rule_group and add create logic for these resources
aws_waf_rate_based_rule aws_waf_rule aws_waf_rule_group
aws_wafregional_rate_based_rule aws_wafregional_rule aws_wafregional_rule_group aws_wafregional_web_acl
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.
Thanks again for submitting this, @DrFaust92 -- please reach out if you have any questions or do not have time to implement the feedback items. 😄
hey @bflad, any idea what needs to change in the project settings? (i guess that is the issue and not the package itself) |
@DrFaust92 hmm, since the Also please note that if these tag additions are done in separate PRs per-resource, we can merge them immediately once the resource code, acceptance testing, and documentation is ready for that one resource (rather than waiting for everything to be done). 😄 |
* aws_waf_rate_based_rule * aws_waf_rule_group * aws_waf_rule refactored tests a bit to not repeat resource name
@bflad,
this is unrelated to the change im adding as it fails on master as well. |
…ed_rule aws_wafregional_rule aws_wafregional_rule_group aws_wafregional_web_acl" This reverts commit 34a3e53
@DrFaust92 thanks for bringing that up. Yeah, that one is indeed flakey/failing on master. You can ignore that in your testing. 👍 |
@bflad, i realised my mistake too late. descoping this to only a few resources and i'll open other PRs for other resources (or related tasks) i think this is ready now. thanks for the support on this! |
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.
Looks great, @DrFaust92, thanks so much for your work here! 🚀
--- PASS: TestAccAWSWafRuleGroup_noActivatedRules (15.91s)
--- PASS: TestAccAWSWafRuleGroup_Tags (39.80s)
--- PASS: TestAccAWSWafRule_Tags (70.48s)
--- PASS: TestAccAWSWafRule_changeNameForceNew (74.99s)
--- PASS: TestAccAWSWafRule_noPredicates (76.48s)
--- PASS: TestAccAWSWafWebAcl_DefaultAction (91.12s)
--- PASS: TestAccAWSWafWebAcl_Tags (93.10s)
--- PASS: TestAccAWSWafRuleGroup_basic (108.74s)
--- PASS: TestAccAWSWafWebAcl_disappears (109.73s)
--- PASS: TestAccAWSWafWebAcl_LoggingConfiguration (127.80s)
--- PASS: TestAccAWSWafWebAcl_basic (129.29s)
--- PASS: TestAccAWSWafRule_basic (141.68s)
--- PASS: TestAccAWSWafRule_geoMatchSetPredicate (142.90s)
--- PASS: TestAccAWSWafRuleGroup_changeActivatedRules (151.86s)
--- PASS: TestAccAWSWafRule_changePredicates (161.65s)
--- PASS: TestAccAWSWafWebAcl_changeNameForceNew (174.97s)
--- PASS: TestAccAWSWafRuleGroup_changeNameForceNew (181.00s)
--- PASS: TestAccAWSWafRule_disappears (192.69s)
--- PASS: TestAccAWSWafRuleGroup_disappears (205.69s)
@@ -109,6 +117,23 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { | |||
predicates = append(predicates, predicate) | |||
} | |||
|
|||
arn := arn.ARN{ |
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.
Nit: For the future, it might be nice to expose the ARN as an attribute as well if folks need it for other reasons (and we can also use d.Get("arn").(string)
in the Update
function as well) 👍
In the resource code:
// Resource schema
"arn": {
Type: schema.TypeString,
Computed: true,
}
// Read function (or Create function if needed in there first)
arn := arn.ARN{/* ... */}.String()
d.Set("arn", arn)
// Update function can access via
d.Get("arn").(string)
Acceptance testing:
// In the _basic test, one of the following
// Depending on global/regional ARN and known resource value (Check) or regex (Match)
testAccCheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("policy/%s", rName)),
testAccMatchResourceAttrGlobalARN(resourceName, "arn", "organizations", regexp.MustCompile(`organization/o-.+`)),
testAccCheckResourceAttrRegionalARN(resourceName, "arn", "athena", fmt.Sprintf("workgroup/%s", rName)),
testAccMatchResourceAttrRegionalARN(resourceName, "arn", "acm", regexp.MustCompile(`certificate/.+`)),
Resource documentation (attributes section):
* `arn` - Amazon Resource Name (ARN)
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Relates to #9289
Release note for CHANGELOG:
Output from acceptance testing: