-
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
Migrate macie2
service to AWS SDK for Go v2
#37999
Conversation
See docs/aws-go-sdk-migrations.md.
Run `PKG=macie2 make awssdkpatch-apply`
Community NoteVoting for Prioritization
For Submitters
|
Thank you for your contribution! 🚀 Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the Additional details:
|
Interesting baseline test results: 😏 $ git describe --always --dirty
b3e80bab10
$ make testacc PKG=macie2 TESTS=TestAccMacie2_serial/FindingsFilter
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/macie2/... -v -count 1 -parallel 20 -run='TestAccMacie2_serial/FindingsFilter' -timeout 360m
=== RUN TestAccMacie2_serial
=== PAUSE TestAccMacie2_serial
=== CONT TestAccMacie2_serial
=== RUN TestAccMacie2_serial/FindingsFilter
=== RUN TestAccMacie2_serial/FindingsFilter/tags
=== RUN TestAccMacie2_serial/FindingsFilter/basic
=== RUN TestAccMacie2_serial/FindingsFilter/name_generated
=== RUN TestAccMacie2_serial/FindingsFilter/name_prefix
=== RUN TestAccMacie2_serial/FindingsFilter/disappears
=== RUN TestAccMacie2_serial/FindingsFilter/complete
=== RUN TestAccMacie2_serial/FindingsFilter/date
findings_filter_test.go:226: Step 3/3 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.
map[string]string{
+ "finding_criteria.0.criterion.0.gt": "",
+ "finding_criteria.0.criterion.0.gte": "",
+ "finding_criteria.0.criterion.0.lt": "",
+ "finding_criteria.0.criterion.0.lte": "",
}
=== RUN TestAccMacie2_serial/FindingsFilter/number
findings_filter_test.go:303: Step 3/3 error running import: ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.
map[string]string{
+ "finding_criteria.0.criterion.0.gt": "",
+ "finding_criteria.0.criterion.0.gte": "",
+ "finding_criteria.0.criterion.0.lt": "",
+ "finding_criteria.0.criterion.0.lte": "",
}
--- FAIL: TestAccMacie2_serial (117.87s)
--- FAIL: TestAccMacie2_serial/FindingsFilter (117.87s)
--- PASS: TestAccMacie2_serial/FindingsFilter/tags (12.00s)
--- PASS: TestAccMacie2_serial/FindingsFilter/basic (11.69s)
--- PASS: TestAccMacie2_serial/FindingsFilter/name_generated (11.70s)
--- PASS: TestAccMacie2_serial/FindingsFilter/name_prefix (11.74s)
--- PASS: TestAccMacie2_serial/FindingsFilter/disappears (9.95s)
--- PASS: TestAccMacie2_serial/FindingsFilter/complete (23.98s)
--- FAIL: TestAccMacie2_serial/FindingsFilter/date (18.47s)
--- FAIL: TestAccMacie2_serial/FindingsFilter/number (18.33s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/macie2 117.962s
FAIL
make: *** [GNUmakefile:626: testacc] Error 1
Technically, this patch would "solve" the failing tests: diff --git a/internal/service/macie2/findings_filter_test.go b/internal/service/macie2/findings_filter_test.go
index 088f1ebaf5..737b54efaf 100644
--- a/internal/service/macie2/findings_filter_test.go
+++ b/internal/service/macie2/findings_filter_test.go
@@ -285,6 +285,12 @@ func testAccFindingsFilter_WithDate(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
+ ImportStateVerifyIgnore: []string{
+ "finding_criteria.0.criterion.0.gt",
+ "finding_criteria.0.criterion.0.gte",
+ "finding_criteria.0.criterion.0.lt",
+ "finding_criteria.0.criterion.0.lte",
+ },
},
},
})
@@ -357,6 +363,12 @@ func testAccFindingsFilter_WithNumber(t *testing.T) {
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
+ ImportStateVerifyIgnore: []string{
+ "finding_criteria.0.criterion.0.gt",
+ "finding_criteria.0.criterion.0.gte",
+ "finding_criteria.0.criterion.0.lt",
+ "finding_criteria.0.criterion.0.lte",
+ },
},
},
}) |
# Conflicts: # go.mod # go.sum # internal/conns/awsclient_gen.go # internal/service/macie2/service_endpoints_gen_test.go # internal/service/macie2/service_package_gen.go # names/data/names_data.csv # names/names.go # tools/awssdkpatch/patch.tmpl
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=TestAccMacie2_serial' PKG=macie2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/macie2/... -v -count 1 -parallel 20 -run=TestAccMacie2_serial -timeout 360m
=== RUN TestAccMacie2_serial
=== PAUSE TestAccMacie2_serial
=== CONT TestAccMacie2_serial
=== RUN TestAccMacie2_serial/Account
=== RUN TestAccMacie2_serial/Account/finding_publishing_frequency
=== RUN TestAccMacie2_serial/Account/status
=== RUN TestAccMacie2_serial/Account/finding_and_status
=== RUN TestAccMacie2_serial/Account/disappears
=== RUN TestAccMacie2_serial/Account/basic
=== RUN TestAccMacie2_serial/ClassificationExportConfiguration
=== RUN TestAccMacie2_serial/ClassificationExportConfiguration/basic
=== RUN TestAccMacie2_serial/ClassificationJob
=== RUN TestAccMacie2_serial/ClassificationJob/name_prefix
=== RUN TestAccMacie2_serial/ClassificationJob/disappears
=== RUN TestAccMacie2_serial/ClassificationJob/status
=== RUN TestAccMacie2_serial/ClassificationJob/complete
=== RUN TestAccMacie2_serial/ClassificationJob/tags
=== RUN TestAccMacie2_serial/ClassificationJob/bucket_criteria
=== RUN TestAccMacie2_serial/ClassificationJob/basic
=== RUN TestAccMacie2_serial/ClassificationJob/name_generated
=== RUN TestAccMacie2_serial/CustomDataIdentifier
=== RUN TestAccMacie2_serial/CustomDataIdentifier/tags
=== RUN TestAccMacie2_serial/CustomDataIdentifier/basic
=== RUN TestAccMacie2_serial/CustomDataIdentifier/name_generated
=== RUN TestAccMacie2_serial/CustomDataIdentifier/disappears
=== RUN TestAccMacie2_serial/CustomDataIdentifier/name_prefix
=== RUN TestAccMacie2_serial/CustomDataIdentifier/classification_job
=== RUN TestAccMacie2_serial/FindingsFilter
=== RUN TestAccMacie2_serial/FindingsFilter/date
=== RUN TestAccMacie2_serial/FindingsFilter/number
=== RUN TestAccMacie2_serial/FindingsFilter/tags
=== RUN TestAccMacie2_serial/FindingsFilter/basic
=== RUN TestAccMacie2_serial/FindingsFilter/name_generated
=== RUN TestAccMacie2_serial/FindingsFilter/name_prefix
=== RUN TestAccMacie2_serial/FindingsFilter/disappears
=== RUN TestAccMacie2_serial/FindingsFilter/complete
=== RUN TestAccMacie2_serial/OrganizationAdminAccount
=== RUN TestAccMacie2_serial/OrganizationAdminAccount/basic
organization_admin_account_test.go:27: skipping tests; this AWS account must not be an existing member of an AWS Organization
=== RUN TestAccMacie2_serial/OrganizationAdminAccount/disappears
organization_admin_account_test.go:56: skipping tests; this AWS account must not be an existing member of an AWS Organization
=== RUN TestAccMacie2_serial/Member
=== RUN TestAccMacie2_serial/Member/invitation_disable_email_notification
member_test.go:101: skipping test; environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL must be set. Usage: Environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL is not set. To properly test inviting Macie member account must be provided.
=== RUN TestAccMacie2_serial/Member/invite
member_test.go:143: skipping test; environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL must be set. Usage: Environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL is not set. To properly test inviting Macie member account must be provided.
=== RUN TestAccMacie2_serial/Member/invite_removed
member_test.go:198: skipping test; environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL must be set. Usage: Environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL is not set. To properly test inviting Macie member account must be provided.
=== RUN TestAccMacie2_serial/Member/status
member_test.go:253: skipping test; environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL must be set. Usage: Environment variable AWS_MACIE2_ALTERNATE_ACCOUNT_EMAIL is not set. To properly test inviting Macie member account must be provided.
=== RUN TestAccMacie2_serial/Member/basic
=== RUN TestAccMacie2_serial/Member/disappears
=== RUN TestAccMacie2_serial/Member/tags
=== RUN TestAccMacie2_serial/InvitationAccepter
=== RUN TestAccMacie2_serial/InvitationAccepter/basic
invitation_accepter_test.go:26: skipping test; environment variable AWS_MACIE2_ACCOUNT_EMAIL must be set. Usage: Environment variable AWS_MACIE2_ACCOUNT_EMAIL is not set. To properly test inviting Macie member account must be provided.
--- PASS: TestAccMacie2_serial (545.02s)
--- PASS: TestAccMacie2_serial/Account (78.11s)
--- PASS: TestAccMacie2_serial/Account/finding_publishing_frequency (18.62s)
--- PASS: TestAccMacie2_serial/Account/status (17.02s)
--- PASS: TestAccMacie2_serial/Account/finding_and_status (17.81s)
--- PASS: TestAccMacie2_serial/Account/disappears (11.58s)
--- PASS: TestAccMacie2_serial/Account/basic (13.09s)
--- PASS: TestAccMacie2_serial/ClassificationExportConfiguration (30.21s)
--- PASS: TestAccMacie2_serial/ClassificationExportConfiguration/basic (30.21s)
--- PASS: TestAccMacie2_serial/ClassificationJob (173.34s)
--- PASS: TestAccMacie2_serial/ClassificationJob/name_prefix (17.41s)
--- PASS: TestAccMacie2_serial/ClassificationJob/disappears (13.97s)
--- PASS: TestAccMacie2_serial/ClassificationJob/status (31.51s)
--- PASS: TestAccMacie2_serial/ClassificationJob/complete (27.60s)
--- PASS: TestAccMacie2_serial/ClassificationJob/tags (27.24s)
--- PASS: TestAccMacie2_serial/ClassificationJob/bucket_criteria (18.75s)
--- PASS: TestAccMacie2_serial/ClassificationJob/basic (17.19s)
--- PASS: TestAccMacie2_serial/ClassificationJob/name_generated (19.68s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier (101.16s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier/tags (22.57s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier/basic (12.41s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier/name_generated (13.86s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier/disappears (11.24s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier/name_prefix (11.58s)
--- PASS: TestAccMacie2_serial/CustomDataIdentifier/classification_job (29.50s)
--- PASS: TestAccMacie2_serial/FindingsFilter (117.08s)
--- PASS: TestAccMacie2_serial/FindingsFilter/date (18.58s)
--- PASS: TestAccMacie2_serial/FindingsFilter/number (18.90s)
--- PASS: TestAccMacie2_serial/FindingsFilter/tags (13.03s)
--- PASS: TestAccMacie2_serial/FindingsFilter/basic (11.98s)
--- PASS: TestAccMacie2_serial/FindingsFilter/name_generated (11.21s)
--- PASS: TestAccMacie2_serial/FindingsFilter/name_prefix (11.11s)
--- PASS: TestAccMacie2_serial/FindingsFilter/disappears (9.34s)
--- PASS: TestAccMacie2_serial/FindingsFilter/complete (22.93s)
--- PASS: TestAccMacie2_serial/OrganizationAdminAccount (0.31s)
--- SKIP: TestAccMacie2_serial/OrganizationAdminAccount/basic (0.21s)
--- SKIP: TestAccMacie2_serial/OrganizationAdminAccount/disappears (0.11s)
--- PASS: TestAccMacie2_serial/Member (44.80s)
--- SKIP: TestAccMacie2_serial/Member/invitation_disable_email_notification (0.00s)
--- SKIP: TestAccMacie2_serial/Member/invite (0.00s)
--- SKIP: TestAccMacie2_serial/Member/invite_removed (0.00s)
--- SKIP: TestAccMacie2_serial/Member/status (0.00s)
--- PASS: TestAccMacie2_serial/Member/basic (16.01s)
--- PASS: TestAccMacie2_serial/Member/disappears (14.41s)
--- PASS: TestAccMacie2_serial/Member/tags (16.43s)
--- PASS: TestAccMacie2_serial/InvitationAccepter (0.00s)
--- SKIP: TestAccMacie2_serial/InvitationAccepter/basic (0.00s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/macie2 549.827s
@theipster Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.64.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
As per the title, this PR migrates the
macie2
service to AWS SDK for Go v2.Additionally, this PR adds some fixes / improvements to the
awssdkpatch
tool to make the generated patch more accurate. (I'm happy to split theseawssdkpatch
changes into a separate PR if necessary.)Relations
Relates to #32976
Closes #36184
Unblocks #26762 (new resource)
Unblocks #34938 (new resource)
References
Output from Acceptance Testing
Note to reviewers: this is as far as I can get without hitting multi-account errors, as well as the pre-existing errors described below. Can someone with a fully working environment please verify the tests again! 🙂