-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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: convert insight_type to set type to address element order issue in aws_cloudtrail #37591
fix: convert insight_type to set type to address element order issue in aws_cloudtrail #37591
Conversation
Community NoteVoting for Prioritization
For Submitters
|
…in aws_cloudtrail
735b84f
to
533228a
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.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccCloudTrail_serial' PKG=cloudtrail
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/cloudtrail/... -v -count 1 -parallel 20 -run=TestAccCloudTrail_serial -timeout 360m
=== RUN TestAccCloudTrail_serial
=== PAUSE TestAccCloudTrail_serial
=== CONT TestAccCloudTrail_serial
=== RUN TestAccCloudTrail_serial/Trail
=== RUN TestAccCloudTrail_serial/Trail/kmsKey
=== RUN TestAccCloudTrail_serial/Trail/eventSelectorDynamoDB
=== RUN TestAccCloudTrail_serial/Trail/disappears
=== RUN TestAccCloudTrail_serial/Trail/multiRegion
=== RUN TestAccCloudTrail_serial/Trail/organization
cloudtrail_test.go:262: this AWS account must be the management account of an AWS Organization
=== RUN TestAccCloudTrail_serial/Trail/logValidation
=== RUN TestAccCloudTrail_serial/Trail/eventSelector
=== RUN TestAccCloudTrail_serial/Trail/insightSelector
=== RUN TestAccCloudTrail_serial/Trail/advancedEventSelector
=== RUN TestAccCloudTrail_serial/Trail/basic
=== RUN TestAccCloudTrail_serial/Trail/tags
=== RUN TestAccCloudTrail_serial/Trail/cloudwatch
=== RUN TestAccCloudTrail_serial/Trail/enableLogging
acctest.go:1617: skipping test for aws/us-west-2: Error running apply: exit status 1
Error: stopping CloudTrail Trail (arn:aws:cloudtrail:us-west-2:123456789012:trail/tf-acc-test-4360788095264194152) logging: operation error CloudTrail: StopLogging, https response error StatusCode: 400, RequestID: f397adaf-6c4c-4006-9814-c6b89536a32d, api error AccessDeniedException: User: arn:aws:sts::123456789012:assumed-role/terraform_team1_dev-developer/kewbank@hashicorp.com is not authorized to perform: cloudtrail:StopLogging on resource: arn:aws:cloudtrail:us-west-2:123456789012:trail/tf-acc-test-4360788095264194152 with an explicit deny in a service control policy
with aws_cloudtrail.test,
on terraform_plugin_test.tf line 61, in resource "aws_cloudtrail" "test":
61: resource "aws_cloudtrail" "test" {
=== RUN TestAccCloudTrail_serial/Trail/globalServiceEvents
=== RUN TestAccCloudTrail_serial/Trail/eventSelectorExclude
=== RUN TestAccCloudTrail_serial/Trail/migrateV0
--- PASS: TestAccCloudTrail_serial (525.19s)
--- PASS: TestAccCloudTrail_serial/Trail (525.19s)
--- PASS: TestAccCloudTrail_serial/Trail/kmsKey (21.60s)
--- PASS: TestAccCloudTrail_serial/Trail/eventSelectorDynamoDB (22.89s)
--- PASS: TestAccCloudTrail_serial/Trail/disappears (18.21s)
--- PASS: TestAccCloudTrail_serial/Trail/multiRegion (40.53s)
--- SKIP: TestAccCloudTrail_serial/Trail/organization (0.63s)
--- PASS: TestAccCloudTrail_serial/Trail/logValidation (29.78s)
--- PASS: TestAccCloudTrail_serial/Trail/eventSelector (68.24s)
--- PASS: TestAccCloudTrail_serial/Trail/insightSelector (52.06s)
--- PASS: TestAccCloudTrail_serial/Trail/advancedEventSelector (19.12s)
--- PASS: TestAccCloudTrail_serial/Trail/basic (32.76s)
--- PASS: TestAccCloudTrail_serial/Trail/tags (40.36s)
--- PASS: TestAccCloudTrail_serial/Trail/cloudwatch (47.70s)
--- SKIP: TestAccCloudTrail_serial/Trail/enableLogging (24.69s)
--- PASS: TestAccCloudTrail_serial/Trail/globalServiceEvents (19.05s)
--- PASS: TestAccCloudTrail_serial/Trail/eventSelectorExclude (42.92s)
--- PASS: TestAccCloudTrail_serial/Trail/migrateV0 (44.66s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail 530.191s
@acwwat Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.59.0 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! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
This PR is to convert the
insight_selector
argument type fromList
toSet
for theaws_cloudtrail
resource, so that it accounts for the unordered nature of this element in the AWS API response.Note that in the acceptance case,
TestAccCloudTrail_serial/Trail/migrateV0
is failing because the ID is set to the ARN and not the name. I am not sure if it's due to my development environment having the override to use a compiled version of the provider or something else. Since it's unrelated to the changes in the PR, I will still check in the code as-is.Relations
Closes #37525
References
Referred to PR #33040 for similar fix.
Output from Acceptance Testing