Skip to content

Commit a64b6dd

Browse files
authored
Merge pull request #42740 from drewtul/b-webacl-update-lots-of-rules
Use HasChanges over HasChangesExcept for performnce
2 parents 0487ad2 + d4cb9d1 commit a64b6dd

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.changelog/42740.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_wafv2_web_acl: Fix performance of update when the WebACL has a large number of rules
3+
```

internal/service/wafv2/web_acl.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,21 @@ func resourceWebACLUpdate(ctx context.Context, d *schema.ResourceData, meta any)
384384
var diags diag.Diagnostics
385385
conn := meta.(*conns.AWSClient).WAFV2Client(ctx)
386386

387-
if d.HasChangesExcept(names.AttrTags, names.AttrTagsAll) {
387+
// https://github.com/hashicorp/terraform-provider-aws/pull/42740.
388+
// if d.HasChangesExcept(names.AttrTags, names.AttrTagsAll) {
389+
if d.HasChanges(
390+
"association_config",
391+
"captcha_config",
392+
"challenge_config",
393+
"custom_response_body",
394+
"data_protection_config",
395+
names.AttrDefaultAction,
396+
names.AttrDescription,
397+
"rule_json",
398+
names.AttrRule,
399+
"token_domains",
400+
"visibility_config",
401+
) {
388402
aclName := d.Get(names.AttrName).(string)
389403
aclScope := d.Get(names.AttrScope).(string)
390404
aclLockToken := d.Get("lock_token").(string)

0 commit comments

Comments
 (0)