diff --git a/.changelog/35974.txt b/.changelog/35974.txt new file mode 100644 index 00000000000..90514f2abc4 --- /dev/null +++ b/.changelog/35974.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_wafv2_web_acl: Add `application_integration_url` attribute +``` \ No newline at end of file diff --git a/internal/service/wafv2/web_acl.go b/internal/service/wafv2/web_acl.go index 0b2155da157..b94466147d4 100644 --- a/internal/service/wafv2/web_acl.go +++ b/internal/service/wafv2/web_acl.go @@ -63,6 +63,10 @@ func ResourceWebACL() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "application_integration_url": { + Type: schema.TypeString, + Computed: true, + }, "association_config": associationConfigSchema(), "capacity": { Type: schema.TypeInt, @@ -232,8 +236,8 @@ func resourceWebACLRead(ctx context.Context, d *schema.ResourceData, meta interf } webACL := output.WebACL - arn := aws.StringValue(webACL.ARN) - d.Set("arn", arn) + d.Set("application_integration_url", output.ApplicationIntegrationURL) + d.Set("arn", webACL.ARN) d.Set("capacity", webACL.Capacity) if err := d.Set("association_config", flattenAssociationConfig(webACL.AssociationConfig)); err != nil { return diag.Errorf("setting association_config: %s", err) diff --git a/internal/service/wafv2/web_acl_test.go b/internal/service/wafv2/web_acl_test.go index af403a0fa6a..e9a786b0820 100644 --- a/internal/service/wafv2/web_acl_test.go +++ b/internal/service/wafv2/web_acl_test.go @@ -51,6 +51,7 @@ func TestAccWAFV2WebACL_basic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckWebACLExists(ctx, resourceName, &v), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "wafv2", regexache.MustCompile(`regional/webacl/.+$`)), + resource.TestCheckResourceAttr(resourceName, "application_integration_url", ""), resource.TestCheckResourceAttr(resourceName, "association_config.#", "0"), resource.TestCheckResourceAttr(resourceName, "captcha_config.#", "0"), resource.TestCheckResourceAttr(resourceName, "challenge_config.#", "0"), @@ -523,6 +524,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckWebACLExists(ctx, resourceName, &v), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "wafv2", regexache.MustCompile(`regional/webacl/.+$`)), + resource.TestCheckResourceAttr(resourceName, "application_integration_url", ""), resource.TestCheckResourceAttr(resourceName, "name", webACLName), resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "rule.*", map[string]string{ @@ -731,6 +733,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_ACFPRuleSet(t *t Check: resource.ComposeTestCheckFunc( testAccCheckWebACLExists(ctx, resourceName, &v), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "wafv2", regexache.MustCompile(`regional/webacl/.+$`)), + resource.TestMatchResourceAttr(resourceName, "application_integration_url", regexache.MustCompile(`https:\/\/.*\.sdk\.awswaf\.com.*`)), resource.TestCheckResourceAttr(resourceName, "name", webACLName), resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "rule.*", map[string]string{ @@ -823,6 +826,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_ATPRuleSet(t *te Check: resource.ComposeTestCheckFunc( testAccCheckWebACLExists(ctx, resourceName, &v), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "wafv2", regexache.MustCompile(`regional/webacl/.+$`)), + resource.TestMatchResourceAttr(resourceName, "application_integration_url", regexache.MustCompile(`https:\/\/.*\.sdk\.awswaf\.com.*`)), resource.TestCheckResourceAttr(resourceName, "name", webACLName), resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "rule.*", map[string]string{ @@ -909,6 +913,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_BotControl(t *te Check: resource.ComposeTestCheckFunc( testAccCheckWebACLExists(ctx, resourceName, &v), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "wafv2", regexache.MustCompile(`regional/webacl/.+$`)), + resource.TestMatchResourceAttr(resourceName, "application_integration_url", regexache.MustCompile(`https:\/\/.*\.sdk\.awswaf\.com.*`)), resource.TestCheckResourceAttr(resourceName, "name", webACLName), resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "rule.*", map[string]string{ diff --git a/website/docs/r/wafv2_web_acl.html.markdown b/website/docs/r/wafv2_web_acl.html.markdown index ea811ee5a3b..b80fe049431 100644 --- a/website/docs/r/wafv2_web_acl.html.markdown +++ b/website/docs/r/wafv2_web_acl.html.markdown @@ -1052,6 +1052,7 @@ The `uri_path` block supports the following arguments: This resource exports the following attributes in addition to the arguments above: +* `application_integration_url` - The URL to use in SDK integrations with managed rule groups. * `arn` - The ARN of the WAF WebACL. * `capacity` - Web ACL capacity units (WCUs) currently being used by this web ACL. * `id` - The ID of the WAF WebACL.