Skip to content
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

fix: aws_cloudwatch_event_rule update with tags #39648

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/39648.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_cloudwatch_event_rule: Add tags to AWS API request on Update to support [ABAC `aws:RequestTag` conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html#access_tags_control-requests)
```
8 changes: 8 additions & 0 deletions internal/service/events/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,17 @@ func resourceRuleUpdate(ctx context.Context, d *schema.ResourceData, meta interf
}

input := expandPutRuleInput(d, ruleName)
input.Tags = getTagsIn(ctx) // For ABAC aws:RequestTag condition.

_, err = retryPutRule(ctx, conn, input)

// Some partitions (e.g. ISO) may not support tag-on-update.
if input.Tags != nil && errs.IsUnsupportedOperationInPartitionError(meta.(*conns.AWSClient).Partition, err) {
input.Tags = nil

_, err = retryPutRule(ctx, conn, input)
}

if err != nil {
return sdkdiag.AppendErrorf(diags, "updating EventBridge Rule (%s): %s", d.Id(), err)
}
Expand Down
Loading