Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_servicequotas_service_quota: Remove resource from Terraf…
…orm state on NoSuchResourceException error (#10735) 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) ```
- Loading branch information