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/aws_servicequotas_service_quota: Remove resource from Terraform state on NoSuchResourceException error #10735

Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Nov 4, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Reference: https://aws.amazon.com/blogs/compute/preview-vcpu-based-instance-limits/

Release note for CHANGELOG:

* resource/aws_servicequotas_service_quota: Remove resource from Terraform state on `NoSuchResourceException` error

Recently, AWS EC2 removed certain instance service quotas:

Beginning October 24, 2019, all accounts will switch to vCPU-based instance limits, and the current count-based instance limits will no longer be supported.

These may have been managed previously by Terraform configurations, however they now return the following error (as would any other quotas removed in the future):

Error: error getting Service Quotas Service Quota (ec2/L-F26B0BF2): NoSuchResourceException:
	status code: 400, request id: d37df234-c1eb-420e-abce-a73c6cde2999

Given this error, it is not possible to remove the problematic resource without manually calling terraform state rm. The correct behavior in this case is for the Terraform resource to remove itself from the state and propose recreation, which would allow operators to successfully remove the missing quotas from their configurations.

This particular change cannot be directly acceptance tested since the availability of quotas is managed by AWS, not a managable resource.

Output from acceptance testing (requesting increase of VPC internet gateways and VPCs limits in a personal testing account):

export SERVICEQUOTAS_INCREASE_ON_CREATE_QUOTA_CODE=L-A4707A72
export SERVICEQUOTAS_INCREASE_ON_CREATE_SERVICE_CODE=vpc
export SERVICEQUOTAS_INCREASE_ON_CREATE_VALUE=6
export SERVICEQUOTAS_INCREASE_ON_UPDATE_QUOTA_CODE=L-F678F1CE
export SERVICEQUOTAS_INCREASE_ON_UPDATE_SERVICE_CODE=vpc
export SERVICEQUOTAS_INCREASE_ON_UPDATE_VALUE=6

--- PASS: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate (13.62s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_basic (15.23s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate (23.09s)

…orm state on NoSuchResourceException error

Reference: https://aws.amazon.com/blogs/compute/preview-vcpu-based-instance-limits/

Recently, AWS EC2 removed certain instance service quotas:

> Beginning October 24, 2019, all accounts will switch to vCPU-based instance limits, and the current count-based instance limits will no longer be supported.

These may have been managed previously by Terraform configurations, however they now return the following error (as would any other quotas removed in the future):

```
Error: error getting Service Quotas Service Quota (ec2/L-F26B0BF2): NoSuchResourceException:
	status code: 400, request id: d37df234-c1eb-420e-abce-a73c6cde2999
```

Given this error, it is not possible to remove the problematic resource without manually calling `terraform state rm`. The correct behavior in this case is for the Terraform resource to remove itself from the state and propose recreation, which would allow operators to successfully remove the missing quotas from their configurations.

This particular change cannot be directly acceptance tested since the availability of quotas is managed by AWS, not a managable resource.

Output from acceptance testing (requesting increase of VPC internet gateways and VPCs limits in a personal testing account):

```
export SERVICEQUOTAS_INCREASE_ON_CREATE_QUOTA_CODE=L-A4707A72
export SERVICEQUOTAS_INCREASE_ON_CREATE_SERVICE_CODE=vpc
export SERVICEQUOTAS_INCREASE_ON_CREATE_VALUE=6
export SERVICEQUOTAS_INCREASE_ON_UPDATE_QUOTA_CODE=L-F678F1CE
export SERVICEQUOTAS_INCREASE_ON_UPDATE_SERVICE_CODE=vpc
export SERVICEQUOTAS_INCREASE_ON_UPDATE_VALUE=6

--- PASS: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate (13.62s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_basic (15.23s)
--- PASS: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate (23.09s)
```
@bflad bflad requested a review from a team November 4, 2019 20:33
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/servicequotas Issues and PRs that pertain to the servicequotas service. labels Nov 4, 2019
@bflad bflad added the bug Addresses a defect in current functionality. label Nov 4, 2019
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

LGTM

@bflad bflad added this to the v2.37.0 milestone Nov 15, 2019
@bflad bflad merged commit e2fb5cc into master Nov 15, 2019
@bflad bflad deleted the b-aws_servicequotas_service_quota-NoSuchResourceException branch November 15, 2019 00:07
bflad added a commit that referenced this pull request Nov 15, 2019
@ghost
Copy link

ghost commented Nov 18, 2019

This has been released in version 2.37.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 for triage. Thanks!

@ghost
Copy link

ghost commented Dec 15, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Dec 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/servicequotas Issues and PRs that pertain to the servicequotas service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants