Skip to content

Commit f2acb85

Browse files
committed
Use HasChanges over HasChangesExcept which performs badly with large numbers of ignored attributes
1 parent 8906067 commit f2acb85

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

internal/service/wafv2/web_acl.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,27 @@ 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+
// HasChangesExcept can perform _very_ slowly when presented with a large number of unchanged (or ignored)
388+
// attributes e.g. rule blocks in this case
389+
if d.HasChanges(
390+
"application_integration_url",
391+
"association_config",
392+
"capacity",
393+
"captcha_config",
394+
"challenge_config",
395+
"custom_response_body",
396+
"data_protection_config",
397+
names.AttrDefaultAction,
398+
names.AttrDescription,
399+
"lock_token",
400+
names.AttrName,
401+
names.AttrNamePrefix,
402+
"rule_json",
403+
names.AttrRule,
404+
names.AttrScope,
405+
"token_domains",
406+
"visibility_config",
407+
) {
388408
aclName := d.Get(names.AttrName).(string)
389409
aclScope := d.Get(names.AttrScope).(string)
390410
aclLockToken := d.Get("lock_token").(string)

0 commit comments

Comments
 (0)