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 - Plugin SDK resources o* (Phase 3c) #30484

Merged
merged 6 commits into from
Apr 5, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 5, 2023

Description

Extends the work done in Phase 2 to the remaining resources implemented using Terraform Plugin SDK.

Relations

Relates #30280.
Relates #29747.
Relates #30417.
Relates #30421.
Relates #30430.
Relates #30449.
Relates #30454.
Relates #30461.
Relates #30463.
Relates #30476.
Relates #30477.
Relates #30478.
Relates #30483.

Output from Acceptance Testing

% make testacc TESTARGS='-run=_basic$$\|_tags$$' PKG=oam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/oam/... -v -count 1 -parallel 2  -run=_basic$\|_tags$ -timeout 180m
=== RUN   TestAccObservabilityAccessManagerLinkDataSource_basic
    acctest.go:772: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccObservabilityAccessManagerLinkDataSource_basic (0.46s)
=== RUN   TestAccObservabilityAccessManagerLink_basic
    acctest.go:772: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccObservabilityAccessManagerLink_basic (0.00s)
=== RUN   TestAccObservabilityAccessManagerLink_tags
    acctest.go:772: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccObservabilityAccessManagerLink_tags (0.00s)
=== RUN   TestAccObservabilityAccessManagerLinksDataSource_basic
    acctest.go:772: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccObservabilityAccessManagerLinksDataSource_basic (0.00s)
=== RUN   TestAccObservabilityAccessManagerSinkDataSource_basic
--- PASS: TestAccObservabilityAccessManagerSinkDataSource_basic (23.78s)
=== RUN   TestAccObservabilityAccessManagerSinkPolicy_basic
--- PASS: TestAccObservabilityAccessManagerSinkPolicy_basic (27.18s)
=== RUN   TestAccObservabilityAccessManagerSink_basic
--- PASS: TestAccObservabilityAccessManagerSink_basic (30.49s)
=== RUN   TestAccObservabilityAccessManagerSink_tags
--- PASS: TestAccObservabilityAccessManagerSink_tags (60.23s)
=== RUN   TestAccObservabilityAccessManagerSinksDataSource_basic
--- PASS: TestAccObservabilityAccessManagerSinksDataSource_basic (21.38s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/oam	176.243s
% make testacc TESTARGS='-run=_basic$$\|_tags$$' PKG=opsworks ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/opsworks/... -v -count 1 -parallel 2  -run=_basic$\|_tags$ -timeout 180m
=== RUN   TestAccOpsWorksApplication_basic
=== PAUSE TestAccOpsWorksApplication_basic
=== RUN   TestAccOpsWorksCustomLayer_basic
=== PAUSE TestAccOpsWorksCustomLayer_basic
=== RUN   TestAccOpsWorksECSClusterLayer_basic
=== PAUSE TestAccOpsWorksECSClusterLayer_basic
=== RUN   TestAccOpsWorksGangliaLayer_basic
=== PAUSE TestAccOpsWorksGangliaLayer_basic
=== RUN   TestAccOpsWorksHAProxyLayer_basic
=== PAUSE TestAccOpsWorksHAProxyLayer_basic
=== RUN   TestAccOpsWorksInstance_basic
=== PAUSE TestAccOpsWorksInstance_basic
=== RUN   TestAccOpsWorksJavaAppLayer_basic
=== PAUSE TestAccOpsWorksJavaAppLayer_basic
=== RUN   TestAccOpsWorksMemcachedLayer_basic
=== PAUSE TestAccOpsWorksMemcachedLayer_basic
=== RUN   TestAccOpsWorksMySQLLayer_basic
=== PAUSE TestAccOpsWorksMySQLLayer_basic
=== RUN   TestAccOpsWorksNodejsAppLayer_basic
=== PAUSE TestAccOpsWorksNodejsAppLayer_basic
=== RUN   TestAccOpsWorksPermission_basic
=== PAUSE TestAccOpsWorksPermission_basic
=== RUN   TestAccOpsWorksPHPAppLayer_basic
=== PAUSE TestAccOpsWorksPHPAppLayer_basic
=== RUN   TestAccOpsWorksRailsAppLayer_basic
=== PAUSE TestAccOpsWorksRailsAppLayer_basic
=== RUN   TestAccOpsWorksRailsAppLayer_tags
=== PAUSE TestAccOpsWorksRailsAppLayer_tags
=== RUN   TestAccOpsWorksRDSDBInstance_basic
=== PAUSE TestAccOpsWorksRDSDBInstance_basic
=== RUN   TestAccOpsWorksStack_basic
=== PAUSE TestAccOpsWorksStack_basic
=== RUN   TestAccOpsWorksStack_noVPC_basic
=== PAUSE TestAccOpsWorksStack_noVPC_basic
=== RUN   TestAccOpsWorksStack_tags
=== PAUSE TestAccOpsWorksStack_tags
=== RUN   TestAccOpsWorksStaticWebLayer_basic
=== PAUSE TestAccOpsWorksStaticWebLayer_basic
=== RUN   TestAccOpsWorksUserProfile_basic
=== PAUSE TestAccOpsWorksUserProfile_basic
=== CONT  TestAccOpsWorksApplication_basic
=== CONT  TestAccOpsWorksPermission_basic
    permission_test.go:23: Step 1/4 error: Error running apply: exit status 1
        
        Error: creating IAM User (tf-acc-test-3337797677205488215): AccessDenied: User: arn:aws:sts::123456789012:assumed-role/terraform_team1_dev-developer/kewbank@hashicorp.com is not authorized to perform: iam:CreateUser on resource: arn:aws:iam::123456789012:user/tf-acc-test-3337797677205488215 because no identity-based policy allows the iam:CreateUser action
        	status code: 403, request id: ad0356da-b2c0-47f6-b519-92d7950c9665
        
          with aws_iam_user.user,
          on terraform_plugin_test.tf line 138, in resource "aws_iam_user" "user":
         138: resource "aws_iam_user" "user" {
        
--- FAIL: TestAccOpsWorksPermission_basic (35.72s)
=== CONT  TestAccOpsWorksStack_basic
    stack_test.go:27: Step 1/2 error: Check failed: 1 error occurred:
        	* Check 9/25 error: aws_opsworks_stack.test: Attribute 'custom_json' found when not expected
        
--- FAIL: TestAccOpsWorksStack_basic (27.75s)
=== CONT  TestAccOpsWorksUserProfile_basic
    user_profile_test.go:24: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating IAM User (tf-acc-test-7907551987342756527): AccessDenied: User: arn:aws:sts::123456789012:assumed-role/terraform_team1_dev-developer/kewbank@hashicorp.com is not authorized to perform: iam:CreateUser on resource: arn:aws:iam::123456789012:user/tf-acc-test-7907551987342756527 because no identity-based policy allows the iam:CreateUser action
        	status code: 403, request id: 607801f8-11a0-4d7b-b106-72ec613d89f5
        
          with aws_iam_user.test1,
          on terraform_plugin_test.tf line 7, in resource "aws_iam_user" "test1":
           7: resource "aws_iam_user" "test1" {
        
--- FAIL: TestAccOpsWorksUserProfile_basic (8.45s)
=== CONT  TestAccOpsWorksStaticWebLayer_basic
--- PASS: TestAccOpsWorksApplication_basic (75.25s)
=== CONT  TestAccOpsWorksStack_tags
    stack_test.go:186: Step 1/4 error: Check failed: Check 2/3 error: aws_opsworks_stack.test: Attribute 'tags.%' expected "1", got "0"
--- FAIL: TestAccOpsWorksStack_tags (28.02s)
=== CONT  TestAccOpsWorksStack_noVPC_basic
--- PASS: TestAccOpsWorksStaticWebLayer_basic (46.54s)
=== CONT  TestAccOpsWorksInstance_basic
--- PASS: TestAccOpsWorksStack_noVPC_basic (69.56s)
=== CONT  TestAccOpsWorksNodejsAppLayer_basic
--- PASS: TestAccOpsWorksInstance_basic (95.44s)
=== CONT  TestAccOpsWorksMySQLLayer_basic
--- PASS: TestAccOpsWorksNodejsAppLayer_basic (41.42s)
=== CONT  TestAccOpsWorksMemcachedLayer_basic
--- PASS: TestAccOpsWorksMemcachedLayer_basic (41.34s)
=== CONT  TestAccOpsWorksJavaAppLayer_basic
--- PASS: TestAccOpsWorksMySQLLayer_basic (41.84s)
=== CONT  TestAccOpsWorksRailsAppLayer_tags
--- PASS: TestAccOpsWorksJavaAppLayer_basic (40.41s)
=== CONT  TestAccOpsWorksRDSDBInstance_basic
--- PASS: TestAccOpsWorksRailsAppLayer_tags (89.86s)
=== CONT  TestAccOpsWorksRailsAppLayer_basic
--- PASS: TestAccOpsWorksRailsAppLayer_basic (45.28s)
=== CONT  TestAccOpsWorksGangliaLayer_basic
--- PASS: TestAccOpsWorksGangliaLayer_basic (38.97s)
=== CONT  TestAccOpsWorksHAProxyLayer_basic
--- PASS: TestAccOpsWorksHAProxyLayer_basic (41.58s)
=== CONT  TestAccOpsWorksECSClusterLayer_basic
--- PASS: TestAccOpsWorksECSClusterLayer_basic (33.32s)
=== CONT  TestAccOpsWorksCustomLayer_basic
--- PASS: TestAccOpsWorksCustomLayer_basic (36.95s)
=== CONT  TestAccOpsWorksPHPAppLayer_basic
--- PASS: TestAccOpsWorksPHPAppLayer_basic (37.55s)
--- PASS: TestAccOpsWorksRDSDBInstance_basic (984.95s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/opsworks	1292.341s
FAIL
make: *** [testacc] Error 1
% make testacc TESTARGS='-run=TestAccOpsWorksStack_tags\|TestAccOpsWorksStack_basic' PKG=opsworks ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/opsworks/... -v -count 1 -parallel 2  -run=TestAccOpsWorksStack_tags\|TestAccOpsWorksStack_basic -timeout 180m
=== RUN   TestAccOpsWorksStack_basic
=== PAUSE TestAccOpsWorksStack_basic
=== RUN   TestAccOpsWorksStack_tags
=== PAUSE TestAccOpsWorksStack_tags
=== RUN   TestAccOpsWorksStack_tagsAlternateRegion
=== PAUSE TestAccOpsWorksStack_tagsAlternateRegion
=== CONT  TestAccOpsWorksStack_basic
=== CONT  TestAccOpsWorksStack_tagsAlternateRegion
    acctest.go:834: skipping tests; AWS_DEFAULT_REGION (us-west-2) not supported. Supported: [us-east-1]
--- SKIP: TestAccOpsWorksStack_tagsAlternateRegion (0.90s)
=== CONT  TestAccOpsWorksStack_tags
--- PASS: TestAccOpsWorksStack_basic (37.11s)
--- PASS: TestAccOpsWorksStack_tags (69.99s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/opsworks	78.237s
% make testacc TESTARGS='-run=TestAccOpenSearchDomain_tags\|TestAccOpenSearchDomain_basic' PKG=opensearch ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/opensearch/... -v -count 1 -parallel 2  -run=TestAccOpenSearchDomain_tags\|TestAccOpenSearchDomain_basic -timeout 180m
=== RUN   TestAccOpenSearchDomain_basic
=== PAUSE TestAccOpenSearchDomain_basic
=== RUN   TestAccOpenSearchDomain_tags
=== PAUSE TestAccOpenSearchDomain_tags
=== CONT  TestAccOpenSearchDomain_basic
=== CONT  TestAccOpenSearchDomain_tags
--- PASS: TestAccOpenSearchDomain_basic (1598.01s)
--- PASS: TestAccOpenSearchDomain_tags (1636.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/opensearch	1642.208s

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

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 size/XL Managed by automation to categorize the size of a PR. generators Relates to code generators. service/oam Issues and PRs that pertain to the oam service. service/opensearch Issues and PRs that pertain to the opensearch service. service/opsworks Issues and PRs that pertain to the opsworks service. service/organizations Issues and PRs that pertain to the organizations service. labels Apr 5, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

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

github-actions bot commented May 9, 2023

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 May 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
generators Relates to code generators. service/oam Issues and PRs that pertain to the oam service. service/opensearch Issues and PRs that pertain to the opensearch service. service/opsworks Issues and PRs that pertain to the opsworks service. service/organizations Issues and PRs that pertain to the organizations service. size/XL Managed by automation to categorize the size of a PR. 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.

None yet

1 participant