-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Allow specifying ARN as sns_topic_name if region/account is different for aws_cloudtrail #41279
fix: Allow specifying ARN as sns_topic_name if region/account is different for aws_cloudtrail #41279
Conversation
Community NoteVoting for Prioritization
For Submitters
|
7d9101e
to
892e8ea
Compare
…erent for aws_cloudtrail
892e8ea
to
6b4acf9
Compare
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 for this fix!
% make testacc TESTS="TestAccCloudTrail_serial/Trail/" PKG=cloudtrail
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/cloudtrail/... -v -count 1 -parallel 20 -run='TestAccCloudTrail_serial/Trail/' -timeout 360m -vet=off
2025/02/07 14:20:36 Initializing Terraform AWS Provider...
=== RUN TestAccCloudTrail_serial
=== PAUSE TestAccCloudTrail_serial
=== CONT TestAccCloudTrail_serial
=== RUN TestAccCloudTrail_serial/Trail
=== RUN TestAccCloudTrail_serial/Trail/enableLogging
=== RUN TestAccCloudTrail_serial/Trail/globalServiceEvents
=== RUN TestAccCloudTrail_serial/Trail/kmsKey
=== RUN TestAccCloudTrail_serial/Trail/tags
=== RUN TestAccCloudTrail_serial/Trail/advancedEventSelector
=== RUN TestAccCloudTrail_serial/Trail/migrateV0
=== RUN TestAccCloudTrail_serial/Trail/multiRegion
=== RUN TestAccCloudTrail_serial/Trail/organization
trail_test.go:230: this AWS account must be the management account of an AWS Organization
=== RUN TestAccCloudTrail_serial/Trail/insightSelector
=== RUN TestAccCloudTrail_serial/Trail/cloudwatch
=== RUN TestAccCloudTrail_serial/Trail/snsTopicNameBasic
=== RUN TestAccCloudTrail_serial/Trail/eventSelectorDynamoDB
=== RUN TestAccCloudTrail_serial/Trail/eventSelectorExclude
=== RUN TestAccCloudTrail_serial/Trail/basic
=== RUN TestAccCloudTrail_serial/Trail/logValidation
=== RUN TestAccCloudTrail_serial/Trail/snsTopicNameAlternateRegion
=== RUN TestAccCloudTrail_serial/Trail/eventSelector
=== RUN TestAccCloudTrail_serial/Trail/disappears
--- PASS: TestAccCloudTrail_serial (626.32s)
--- PASS: TestAccCloudTrail_serial/Trail (626.32s)
--- SKIP: TestAccCloudTrail_serial/Trail/enableLogging (27.13s)
--- PASS: TestAccCloudTrail_serial/Trail/globalServiceEvents (20.39s)
--- PASS: TestAccCloudTrail_serial/Trail/kmsKey (22.63s)
--- PASS: TestAccCloudTrail_serial/Trail/tags (44.54s)
--- PASS: TestAccCloudTrail_serial/Trail/advancedEventSelector (20.98s)
--- PASS: TestAccCloudTrail_serial/Trail/migrateV0 (35.94s)
--- PASS: TestAccCloudTrail_serial/Trail/multiRegion (44.79s)
--- SKIP: TestAccCloudTrail_serial/Trail/organization (0.69s)
--- PASS: TestAccCloudTrail_serial/Trail/insightSelector (57.13s)
--- PASS: TestAccCloudTrail_serial/Trail/cloudwatch (49.07s)
--- PASS: TestAccCloudTrail_serial/Trail/snsTopicNameBasic (35.39s)
--- PASS: TestAccCloudTrail_serial/Trail/eventSelectorDynamoDB (31.27s)
--- PASS: TestAccCloudTrail_serial/Trail/eventSelectorExclude (48.29s)
--- PASS: TestAccCloudTrail_serial/Trail/basic (35.28s)
--- PASS: TestAccCloudTrail_serial/Trail/logValidation (33.14s)
--- PASS: TestAccCloudTrail_serial/Trail/snsTopicNameAlternateRegion (24.50s)
--- PASS: TestAccCloudTrail_serial/Trail/eventSelector (74.55s)
--- PASS: TestAccCloudTrail_serial/Trail/disappears (20.60s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail 630.606s
This functionality has been released in v5.86.1 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Description
This PR is to fix an issue introduced by #41168 where
sns_topic_name
is always read as the name instead of ARN, even for an SNS topic in another region or account, for theaws_cloudtrail
resource.The documentation is NOT specify that one can specify an SNS topic ARN as
sns_topic_name
, nor does it specify that the the SNS topic can be in a different region (and presumably different account). I will open an AWS support case separately to seek clarification, but for now we need to fix the regression.If you think think we should simply roll back the change and fix it again for 6.x for better compatibility, let me know.
Relations
Closes #41262
References
n/a - documentation is wrong anyway...
Output from Acceptance Testing
Note: I am not sure why
TestAccCloudTrail_serial/Trail/migrateV0
always fail in my environment.