-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
New Resource: aws_servicequotas_service_quota #9192
Conversation
Reference: #9118 Output from acceptance testing (requesting increase of t3.nano and t3.micro limits in testing account): ``` export SERVICEQUOTAS_INCREASE_ON_CREATE_QUOTA_CODE=L-55EB784E export SERVICEQUOTAS_INCREASE_ON_CREATE_SERVICE_CODE=ec2 export SERVICEQUOTAS_INCREASE_ON_CREATE_VALUE=25 export SERVICEQUOTAS_INCREASE_ON_UPDATE_QUOTA_CODE=L-0F0ED007 export SERVICEQUOTAS_INCREASE_ON_UPDATE_SERVICE_CODE=ec2 export SERVICEQUOTAS_INCREASE_ON_UPDATE_VALUE=25 --- PASS: TestAccAwsServiceQuotasServiceQuota_basic (13.83s) --- PASS: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate (12.52s) --- PASS: TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate (20.00s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- SKIP: TestAccAwsServiceQuotasServiceQuota_basic (2.51s) resource_aws_servicequotas_service_quota_test.go:138: skipping acceptance testing: RequestError: send request failed caused by: Post https://servicequotas.us-gov-west-1.amazonaws.com/: dial tcp: lookup servicequotas.us-gov-west-1.amazonaws.com: no such host ```
@@ -681,6 +681,7 @@ func Provider() terraform.ResourceProvider { | |||
"aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), | |||
"aws_service_discovery_public_dns_namespace": resourceAwsServiceDiscoveryPublicDnsNamespace(), | |||
"aws_service_discovery_service": resourceAwsServiceDiscoveryService(), | |||
"aws_servicequotas_service_quota": resourceAwsServiceQuotasServiceQuota(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we generally use the AWS service name for the resource name, but this name has a bit of a stutter. What do you about just using aws_service_quotas
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is noted in the Contributing Guide with the following item:
Naming: Resources should be named
aws_<service>_<name>
whereservice
is the AWS short service name andname
is a short, preferably single word, description of the resource. Use_
as a separator.
What isn't included in the guide is the reasoning:
- It helps operators and maintainers easier find resources by AWS service or configure Customized Endpoints using the service name that is part of the resource name. There will be other resources with this service: Support Managing Service Quotas Templates #9119
- Prevents conflicting naming issues should AWS release other "quota" related services/resources in the future
- Potentially sets up the resources for easier auto-generation in the future
We likely should include some/all of this rationale either in the contributing or maintaining guides for easier reference. I'll raise a PR for the contributing guide to start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also: #9347 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Thanks for rationale. I found the existing data sources after leaving the comment and quickly thought to rescind this comment. Especially, after thinking more about "Prevents conflicting naming issues should AWS release other "quota" related services/resources in the future". The contributing guide update looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Nicely done. I left a nit and a couple of questions. Nothing that would prevent this from being merged so I am going to approve the PR as it is.
|
||
## Import | ||
|
||
~> *NOTE* This resource does not require explicit import and will assume management of an existing service quota on Terraform resource creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
return fmt.Errorf("error getting Service Quotas Service Quota (%s): empty result", d.Id()) | ||
} | ||
|
||
if value > aws.Float64Value(output.Quota.Value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Providing a value less than the current quota value would result in a noop and exit successfully, correct? If so should there be an error message to the operator that the provided value is less than the currently set quota?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Terraform should show automatically show perpetual difference in this case. 😄 Correction! The call to the API will fail, which is no different than us providing our own error message. 👍
Co-Authored-By: Wilken Rivera <[email protected]>
…ID variable in Read function Reference: https://github.com/terraform-providers/terraform-provider-aws/pull/9192/files#r303913660
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! |
Community Note
Replacing #9121 due to bad rebase...
Closes #9118
Release note for CHANGELOG:
Output from acceptance testing (requesting increase of t3.nano and t3.micro limits in testing account):
Output from acceptance testing in AWS GovCloud (US):