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

resource,data_source/aws_servicequotas_service_quota: Handle embedded error in ServiceQuota struct #19722

Merged
merged 3 commits into from
Jun 9, 2021

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Jun 8, 2021

Handles errors embedded errors in ServiceQuota struct instead of being returned as an API error code.

Closes #19719

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAwsServiceQuotasServiceQuotaDataSource\|TestAccAwsServiceQuotasServiceQuota'

--- SKIP: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate (0.00s)
--- SKIP: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate (0.00s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode (5.28s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName (5.52s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_PermissionError (9.46s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode (16.47s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName (16.54s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_basic (18.61s)

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Jun 8, 2021
@github-actions github-actions bot added service/servicequotas Issues and PRs that pertain to the servicequotas service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 8, 2021
@gdavison gdavison marked this pull request as ready for review June 8, 2021 23:47
@gdavison gdavison requested a review from a team as a code owner June 8, 2021 23:47
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAwsServiceQuotasServiceQuotaDataSource\|TestAccAwsServiceQuotasServiceQuota'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsServiceQuotasServiceQuotaDataSource\|TestAccAwsServiceQuotasServiceQuota -timeout 180m
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
=== RUN   TestAccAwsServiceQuotasServiceQuota_basic
=== PAUSE TestAccAwsServiceQuotasServiceQuota_basic
=== RUN   TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate
    resource_aws_servicequotas_service_quota_test.go:52: Environment variable SERVICEQUOTAS_INCREASE_ON_CREATE_QUOTA_CODE is not set. WARNING: This test will submit a real service quota increase!
--- SKIP: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate (0.00s)
=== RUN   TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate
    resource_aws_servicequotas_service_quota_test.go:94: Environment variable SERVICEQUOTAS_INCREASE_ON_UPDATE_QUOTA_CODE is not set. WARNING: This test will submit a real service quota increase!
--- SKIP: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate (0.00s)
=== RUN   TestAccAwsServiceQuotasServiceQuota_PermissionError
=== PAUSE TestAccAwsServiceQuotasServiceQuota_PermissionError
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode
=== CONT  TestAccAwsServiceQuotasServiceQuota_basic
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
=== CONT  TestAccAwsServiceQuotasServiceQuota_PermissionError
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
    provider_test.go:2222: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName (1.33s)
=== CONT  TestAccAwsServiceQuotasServiceQuota_PermissionError
    provider_test.go:2222: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAwsServiceQuotasServiceQuota_PermissionError (1.37s)
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
    provider_test.go:2222: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode (1.38s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode (11.48s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName (12.28s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_basic (15.84s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	19.013s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAwsServiceQuotasServiceQuotaDataSource\|TestAccAwsServiceQuotasServiceQuota'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsServiceQuotasServiceQuotaDataSource\|TestAccAwsServiceQuotasServiceQuota -timeout 180m
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName
=== RUN   TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
=== PAUSE TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
=== RUN   TestAccAwsServiceQuotasServiceQuota_basic
=== PAUSE TestAccAwsServiceQuotasServiceQuota_basic
=== RUN   TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate
    resource_aws_servicequotas_service_quota_test.go:52: Environment variable SERVICEQUOTAS_INCREASE_ON_CREATE_QUOTA_CODE is not set. WARNING: This test will submit a real service quota increase!
--- SKIP: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate (0.00s)
=== RUN   TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate
    resource_aws_servicequotas_service_quota_test.go:94: Environment variable SERVICEQUOTAS_INCREASE_ON_UPDATE_QUOTA_CODE is not set. WARNING: This test will submit a real service quota increase!
--- SKIP: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate (0.00s)
=== RUN   TestAccAwsServiceQuotasServiceQuota_PermissionError
=== PAUSE TestAccAwsServiceQuotasServiceQuota_PermissionError
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode
=== CONT  TestAccAwsServiceQuotasServiceQuota_basic
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName
=== CONT  TestAccAwsServiceQuotasServiceQuota_PermissionError
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode
    provider_test.go:2222: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaCode (1.86s)
=== CONT  TestAccAwsServiceQuotasServiceQuota_PermissionError
    provider_test.go:2222: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAwsServiceQuotasServiceQuota_PermissionError (1.99s)
=== CONT  TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName
    provider_test.go:2222: skipping test; environment variable TF_ACC_ASSUME_ROLE_ARN must be set. Usage: Amazon Resource Name (ARN) of existing IAM Role to assume for testing restricted permissions
--- SKIP: TestAccAwsServiceQuotasServiceQuotaDataSource_PermissionError_QuotaName (2.00s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode (14.89s)
--- PASS: TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName (16.24s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_basic (20.45s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	23.376s

@gdavison gdavison merged commit bdd7068 into main Jun 9, 2021
@gdavison gdavison deleted the fix-quotas branch June 9, 2021 21:00
@github-actions github-actions bot added this to the v3.45.0 milestone Jun 9, 2021
github-actions bot pushed a commit that referenced this pull request Jun 9, 2021
@github-actions
Copy link

This functionality has been released in v3.45.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 Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/servicequotas Issues and PRs that pertain to the servicequotas service. size/L 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
2 participants