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

Tech debt: Reduce tags boilerplate code - Use createTags; IAM #31341

Merged
merged 30 commits into from
May 11, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented May 11, 2023

Description

Continues on from #31142 by considering IAM resources, where tagging functions are hand maintained.

Relations

Relates #29747.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccIAMInstanceProfile_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMInstanceProfile_ -timeout 180m
=== RUN   TestAccIAMInstanceProfile_basic
=== PAUSE TestAccIAMInstanceProfile_basic
=== RUN   TestAccIAMInstanceProfile_withoutRole
=== PAUSE TestAccIAMInstanceProfile_withoutRole
=== RUN   TestAccIAMInstanceProfile_tags
=== PAUSE TestAccIAMInstanceProfile_tags
=== RUN   TestAccIAMInstanceProfile_nameGenerated
=== PAUSE TestAccIAMInstanceProfile_nameGenerated
=== RUN   TestAccIAMInstanceProfile_namePrefix
=== PAUSE TestAccIAMInstanceProfile_namePrefix
=== RUN   TestAccIAMInstanceProfile_disappears
=== PAUSE TestAccIAMInstanceProfile_disappears
=== RUN   TestAccIAMInstanceProfile_Disappears_role
=== PAUSE TestAccIAMInstanceProfile_Disappears_role
=== CONT  TestAccIAMInstanceProfile_basic
=== CONT  TestAccIAMInstanceProfile_namePrefix
--- PASS: TestAccIAMInstanceProfile_namePrefix (18.58s)
=== CONT  TestAccIAMInstanceProfile_tags
--- PASS: TestAccIAMInstanceProfile_basic (18.59s)
=== CONT  TestAccIAMInstanceProfile_nameGenerated
--- PASS: TestAccIAMInstanceProfile_nameGenerated (17.13s)
=== CONT  TestAccIAMInstanceProfile_withoutRole
--- PASS: TestAccIAMInstanceProfile_withoutRole (16.40s)
=== CONT  TestAccIAMInstanceProfile_Disappears_role
--- PASS: TestAccIAMInstanceProfile_tags (40.99s)
=== CONT  TestAccIAMInstanceProfile_disappears
--- PASS: TestAccIAMInstanceProfile_Disappears_role (14.65s)
--- PASS: TestAccIAMInstanceProfile_disappears (14.45s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	79.191s
% make testacc TESTARGS='-run=TestAccIAMInstanceProfileDataSource_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMInstanceProfileDataSource_ -timeout 180m
=== RUN   TestAccIAMInstanceProfileDataSource_basic
=== PAUSE TestAccIAMInstanceProfileDataSource_basic
=== CONT  TestAccIAMInstanceProfileDataSource_basic
--- PASS: TestAccIAMInstanceProfileDataSource_basic (14.58s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	19.995s
% make testacc TESTARGS='-run=TestAccIAMOpenIDConnectProvider_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMOpenIDConnectProvider_ -timeout 180m
=== RUN   TestAccIAMOpenIDConnectProvider_basic
=== PAUSE TestAccIAMOpenIDConnectProvider_basic
=== RUN   TestAccIAMOpenIDConnectProvider_tags
=== PAUSE TestAccIAMOpenIDConnectProvider_tags
=== RUN   TestAccIAMOpenIDConnectProvider_disappears
=== PAUSE TestAccIAMOpenIDConnectProvider_disappears
=== RUN   TestAccIAMOpenIDConnectProvider_clientIDListOrder
=== PAUSE TestAccIAMOpenIDConnectProvider_clientIDListOrder
=== CONT  TestAccIAMOpenIDConnectProvider_basic
=== CONT  TestAccIAMOpenIDConnectProvider_disappears
--- PASS: TestAccIAMOpenIDConnectProvider_disappears (16.56s)
=== CONT  TestAccIAMOpenIDConnectProvider_clientIDListOrder
--- PASS: TestAccIAMOpenIDConnectProvider_basic (33.46s)
=== CONT  TestAccIAMOpenIDConnectProvider_tags
--- PASS: TestAccIAMOpenIDConnectProvider_clientIDListOrder (22.78s)
--- PASS: TestAccIAMOpenIDConnectProvider_tags (37.89s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	76.732s
% make testacc TESTARGS='-run=TestAccIAMPolicy_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMPolicy_ -timeout 180m
=== RUN   TestAccIAMPolicy_basic
=== PAUSE TestAccIAMPolicy_basic
=== RUN   TestAccIAMPolicy_description
=== PAUSE TestAccIAMPolicy_description
=== RUN   TestAccIAMPolicy_tags
=== PAUSE TestAccIAMPolicy_tags
=== RUN   TestAccIAMPolicy_disappears
=== PAUSE TestAccIAMPolicy_disappears
=== RUN   TestAccIAMPolicy_namePrefix
=== PAUSE TestAccIAMPolicy_namePrefix
=== RUN   TestAccIAMPolicy_path
=== PAUSE TestAccIAMPolicy_path
=== RUN   TestAccIAMPolicy_policy
=== PAUSE TestAccIAMPolicy_policy
=== RUN   TestAccIAMPolicy_diffs
=== PAUSE TestAccIAMPolicy_diffs
=== CONT  TestAccIAMPolicy_basic
=== CONT  TestAccIAMPolicy_namePrefix
--- PASS: TestAccIAMPolicy_namePrefix (17.99s)
=== CONT  TestAccIAMPolicy_tags
--- PASS: TestAccIAMPolicy_basic (18.00s)
=== CONT  TestAccIAMPolicy_disappears
--- PASS: TestAccIAMPolicy_disappears (13.27s)
=== CONT  TestAccIAMPolicy_policy
--- PASS: TestAccIAMPolicy_tags (41.10s)
=== CONT  TestAccIAMPolicy_diffs
--- PASS: TestAccIAMPolicy_policy (30.06s)
=== CONT  TestAccIAMPolicy_description
--- PASS: TestAccIAMPolicy_description (16.83s)
=== CONT  TestAccIAMPolicy_path
--- PASS: TestAccIAMPolicy_path (17.14s)
--- PASS: TestAccIAMPolicy_diffs (109.85s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	174.381s
% make testacc TESTARGS='-run=TestAccIAMPolicyDataSource_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMPolicyDataSource_ -timeout 180m
=== RUN   TestAccIAMPolicyDataSource_arn
=== PAUSE TestAccIAMPolicyDataSource_arn
=== RUN   TestAccIAMPolicyDataSource_arnTags
=== PAUSE TestAccIAMPolicyDataSource_arnTags
=== RUN   TestAccIAMPolicyDataSource_name
=== PAUSE TestAccIAMPolicyDataSource_name
=== RUN   TestAccIAMPolicyDataSource_nameTags
=== PAUSE TestAccIAMPolicyDataSource_nameTags
=== RUN   TestAccIAMPolicyDataSource_nameAndPathPrefix
=== PAUSE TestAccIAMPolicyDataSource_nameAndPathPrefix
=== RUN   TestAccIAMPolicyDataSource_nameAndPathPrefixTags
=== PAUSE TestAccIAMPolicyDataSource_nameAndPathPrefixTags
=== RUN   TestAccIAMPolicyDataSource_nonExistent
=== PAUSE TestAccIAMPolicyDataSource_nonExistent
=== CONT  TestAccIAMPolicyDataSource_arn
=== CONT  TestAccIAMPolicyDataSource_nameAndPathPrefix
--- PASS: TestAccIAMPolicyDataSource_arn (15.22s)
=== CONT  TestAccIAMPolicyDataSource_nonExistent
--- PASS: TestAccIAMPolicyDataSource_nameAndPathPrefix (15.52s)
=== CONT  TestAccIAMPolicyDataSource_name
--- PASS: TestAccIAMPolicyDataSource_name (19.39s)
=== CONT  TestAccIAMPolicyDataSource_nameTags
--- PASS: TestAccIAMPolicyDataSource_nameTags (18.64s)
=== CONT  TestAccIAMPolicyDataSource_nameAndPathPrefixTags
--- PASS: TestAccIAMPolicyDataSource_nameAndPathPrefixTags (14.35s)
=== CONT  TestAccIAMPolicyDataSource_arnTags
--- PASS: TestAccIAMPolicyDataSource_arnTags (18.91s)
--- PASS: TestAccIAMPolicyDataSource_nonExistent (122.28s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	143.342s
% make testacc TESTARGS='-run=TestAccIAMSAMLProvider_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMSAMLProvider_ -timeout 180m
=== RUN   TestAccIAMSAMLProvider_basic
=== PAUSE TestAccIAMSAMLProvider_basic
=== RUN   TestAccIAMSAMLProvider_tags
=== PAUSE TestAccIAMSAMLProvider_tags
=== RUN   TestAccIAMSAMLProvider_disappears
=== PAUSE TestAccIAMSAMLProvider_disappears
=== CONT  TestAccIAMSAMLProvider_basic
=== CONT  TestAccIAMSAMLProvider_disappears
--- PASS: TestAccIAMSAMLProvider_disappears (13.87s)
=== CONT  TestAccIAMSAMLProvider_tags
--- PASS: TestAccIAMSAMLProvider_basic (29.79s)
--- PASS: TestAccIAMSAMLProvider_tags (38.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	57.909s
% make testacc TESTARGS='-run=TestAccIAMServerCertificate_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMServerCertificate_ -timeout 180m
=== RUN   TestAccIAMServerCertificate_basic
=== PAUSE TestAccIAMServerCertificate_basic
=== RUN   TestAccIAMServerCertificate_nameGenerated
=== PAUSE TestAccIAMServerCertificate_nameGenerated
=== RUN   TestAccIAMServerCertificate_namePrefix
=== PAUSE TestAccIAMServerCertificate_namePrefix
=== RUN   TestAccIAMServerCertificate_disappears
=== PAUSE TestAccIAMServerCertificate_disappears
=== RUN   TestAccIAMServerCertificate_tags
=== PAUSE TestAccIAMServerCertificate_tags
=== RUN   TestAccIAMServerCertificate_file
=== PAUSE TestAccIAMServerCertificate_file
=== RUN   TestAccIAMServerCertificate_path
=== PAUSE TestAccIAMServerCertificate_path
=== CONT  TestAccIAMServerCertificate_basic
=== CONT  TestAccIAMServerCertificate_tags
=== CONT  TestAccIAMServerCertificate_path
=== CONT  TestAccIAMServerCertificate_nameGenerated
=== CONT  TestAccIAMServerCertificate_disappears
=== CONT  TestAccIAMServerCertificate_file
=== CONT  TestAccIAMServerCertificate_namePrefix
--- PASS: TestAccIAMServerCertificate_disappears (44.41s)
--- PASS: TestAccIAMServerCertificate_nameGenerated (48.46s)
--- PASS: TestAccIAMServerCertificate_namePrefix (49.21s)
--- PASS: TestAccIAMServerCertificate_basic (56.60s)
--- PASS: TestAccIAMServerCertificate_path (57.41s)
--- PASS: TestAccIAMServerCertificate_file (70.75s)
--- PASS: TestAccIAMServerCertificate_tags (84.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	91.213s
% make testacc TESTARGS='-run=TestAccIAMUser_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMUser_ -timeout 180m
=== RUN   TestAccIAMUser_basic
=== PAUSE TestAccIAMUser_basic
=== RUN   TestAccIAMUser_disappears
=== PAUSE TestAccIAMUser_disappears
=== RUN   TestAccIAMUser_ForceDestroy_accessKey
=== PAUSE TestAccIAMUser_ForceDestroy_accessKey
=== RUN   TestAccIAMUser_ForceDestroy_loginProfile
=== PAUSE TestAccIAMUser_ForceDestroy_loginProfile
=== RUN   TestAccIAMUser_ForceDestroy_mfaDevice
=== PAUSE TestAccIAMUser_ForceDestroy_mfaDevice
=== RUN   TestAccIAMUser_ForceDestroy_sshKey
=== PAUSE TestAccIAMUser_ForceDestroy_sshKey
=== RUN   TestAccIAMUser_ForceDestroy_serviceSpecificCred
=== PAUSE TestAccIAMUser_ForceDestroy_serviceSpecificCred
=== RUN   TestAccIAMUser_ForceDestroy_signingCertificate
=== PAUSE TestAccIAMUser_ForceDestroy_signingCertificate
=== RUN   TestAccIAMUser_nameChange
=== PAUSE TestAccIAMUser_nameChange
=== RUN   TestAccIAMUser_pathChange
=== PAUSE TestAccIAMUser_pathChange
=== RUN   TestAccIAMUser_permissionsBoundary
=== PAUSE TestAccIAMUser_permissionsBoundary
=== RUN   TestAccIAMUser_tags
=== PAUSE TestAccIAMUser_tags
=== CONT  TestAccIAMUser_basic
=== CONT  TestAccIAMUser_ForceDestroy_serviceSpecificCred
=== CONT  TestAccIAMUser_pathChange
=== CONT  TestAccIAMUser_tags
=== CONT  TestAccIAMUser_nameChange
=== CONT  TestAccIAMUser_ForceDestroy_loginProfile
=== CONT  TestAccIAMUser_ForceDestroy_signingCertificate
=== CONT  TestAccIAMUser_ForceDestroy_sshKey
=== CONT  TestAccIAMUser_ForceDestroy_mfaDevice
=== CONT  TestAccIAMUser_permissionsBoundary
=== CONT  TestAccIAMUser_ForceDestroy_accessKey
=== CONT  TestAccIAMUser_disappears
--- PASS: TestAccIAMUser_disappears (57.15s)
--- PASS: TestAccIAMUser_ForceDestroy_accessKey (79.38s)
--- PASS: TestAccIAMUser_ForceDestroy_loginProfile (81.05s)
--- PASS: TestAccIAMUser_ForceDestroy_mfaDevice (81.11s)
--- PASS: TestAccIAMUser_ForceDestroy_serviceSpecificCred (81.13s)
--- PASS: TestAccIAMUser_ForceDestroy_signingCertificate (84.15s)
--- PASS: TestAccIAMUser_ForceDestroy_sshKey (84.21s)
--- PASS: TestAccIAMUser_pathChange (107.19s)
--- PASS: TestAccIAMUser_tags (108.56s)
--- PASS: TestAccIAMUser_nameChange (108.62s)
--- PASS: TestAccIAMUser_basic (109.29s)
--- PASS: TestAccIAMUser_permissionsBoundary (149.28s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	155.781s
% make testacc TESTARGS='-run=TestAccIAMVirtualMFADevice_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMVirtualMFADevice_ -timeout 180m
=== RUN   TestAccIAMVirtualMFADevice_basic
=== PAUSE TestAccIAMVirtualMFADevice_basic
=== RUN   TestAccIAMVirtualMFADevice_tags
=== PAUSE TestAccIAMVirtualMFADevice_tags
=== RUN   TestAccIAMVirtualMFADevice_disappears
=== PAUSE TestAccIAMVirtualMFADevice_disappears
=== CONT  TestAccIAMVirtualMFADevice_basic
=== CONT  TestAccIAMVirtualMFADevice_disappears
=== CONT  TestAccIAMVirtualMFADevice_tags
--- PASS: TestAccIAMVirtualMFADevice_disappears (15.03s)
--- PASS: TestAccIAMVirtualMFADevice_basic (19.12s)
--- PASS: TestAccIAMVirtualMFADevice_tags (40.54s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	45.706s
% make testacc TESTARGS='-run=TestAccIAMServiceLinkedRole_' PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20  -run=TestAccIAMServiceLinkedRole_ -timeout 180m
=== RUN   TestAccIAMServiceLinkedRole_basic
=== PAUSE TestAccIAMServiceLinkedRole_basic
=== RUN   TestAccIAMServiceLinkedRole_customSuffix
=== PAUSE TestAccIAMServiceLinkedRole_customSuffix
=== RUN   TestAccIAMServiceLinkedRole_CustomSuffix_diffSuppressFunc
=== PAUSE TestAccIAMServiceLinkedRole_CustomSuffix_diffSuppressFunc
=== RUN   TestAccIAMServiceLinkedRole_description
=== PAUSE TestAccIAMServiceLinkedRole_description
=== RUN   TestAccIAMServiceLinkedRole_tags
=== PAUSE TestAccIAMServiceLinkedRole_tags
=== RUN   TestAccIAMServiceLinkedRole_disappears
=== PAUSE TestAccIAMServiceLinkedRole_disappears
=== CONT  TestAccIAMServiceLinkedRole_basic
=== CONT  TestAccIAMServiceLinkedRole_description
=== CONT  TestAccIAMServiceLinkedRole_CustomSuffix_diffSuppressFunc
=== CONT  TestAccIAMServiceLinkedRole_disappears
=== CONT  TestAccIAMServiceLinkedRole_customSuffix
=== CONT  TestAccIAMServiceLinkedRole_tags
--- PASS: TestAccIAMServiceLinkedRole_disappears (30.66s)
--- PASS: TestAccIAMServiceLinkedRole_customSuffix (36.92s)
--- PASS: TestAccIAMServiceLinkedRole_CustomSuffix_diffSuppressFunc (38.15s)
--- PASS: TestAccIAMServiceLinkedRole_basic (38.67s)
--- PASS: TestAccIAMServiceLinkedRole_description (50.14s)
--- PASS: TestAccIAMServiceLinkedRole_tags (60.88s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	66.190s

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/iam Issues and PRs that pertain to the iam service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels May 11, 2023
@ewbankkit ewbankkit added technical-debt Addresses areas of the codebase that need refactoring or redesign. tags Pertains to resource tagging. labels May 11, 2023
@github-actions github-actions bot added sweeper Pertains to changes to or issues with the sweeper. and removed sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. labels May 11, 2023
@github-actions github-actions bot added the sweeper Pertains to changes to or issues with the sweeper. label May 11, 2023
@ewbankkit ewbankkit merged commit f73a6d7 into main May 11, 2023
@ewbankkit ewbankkit deleted the td-iam-createTags branch May 11, 2023 18:12
@github-actions github-actions bot added this to the v4.67.0 milestone May 11, 2023
github-actions bot pushed a commit that referenced this pull request May 11, 2023
@github-actions
Copy link

This functionality has been released in v4.67.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!

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/iam Issues and PRs that pertain to the iam service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant