Improve aws_api_gateway_domain_name acceptance tests #14664
Labels
service/apigateway
Issues and PRs that pertain to the apigateway service.
technical-debt
Addresses areas of the codebase that need refactoring or redesign.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone
Community Note
Description
The basic acceptance test cases should verify all fields have expected values, including that values expected to be empty are empty. For example, when using
EDGE
endpoints,regional_domain_name
should be empty, and when usingREGIONAL
endpoints,cloudfront_domain_name
should be empty.Typically, uses of
resource.TestCheckResourceAttrSet()
should be avoided, and replaced with more specific tests. For example,cloudfront_domain_name
should match[a-z0-9]+.cloudfront.net
andregional_domain_name
should usetestAccMatchResourceAttrRegionalHostname()
with the patternd-[a-z0-9]+
.Rather than using environment variables to specify existing certificates, in many cases creating a certificate in the test using DNS validation can be used so that the test can be run consistently.
Affected Resource
The text was updated successfully, but these errors were encountered: