-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
r/aws_api_gateway_domain_name: Support mutual TLS authentication #15258
r/aws_api_gateway_domain_name: Support mutual TLS authentication #15258
Conversation
86bb3ff
to
4593244
Compare
4593244
to
2faf8e7
Compare
Mutual TLS requires that the API Gateway domain name be configured with an Amazon Issued ACM certificate. $ AWS_API_GATEWAY_CERTIFICATE_DOMAIN_NAME=<domain name> make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication -timeout 120m
=== RUN TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== PAUSE TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== CONT TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
--- PASS: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (87.75s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 87.797s |
90dc01b
to
4a7197b
Compare
Refactored acceptance test to create a public ACM certificate (similar to #16139). $ ACM_CERTIFICATE_ROOT_DOMAIN=<domain name> make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayDomainName_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayDomainName_ -timeout 120m
=== RUN TestAccAWSAPIGatewayDomainName_CertificateArn
resource_aws_api_gateway_domain_name_test.go:19: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_ARN is not set. This environment variable must be set to the ARN of an ISSUED ACM certificate in us-east-1 to enable this test.
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateArn (0.00s)
=== RUN TestAccAWSAPIGatewayDomainName_CertificateName
resource_aws_api_gateway_domain_name_test.go:57: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY is not set. This environment variable must be set to any non-empty value with a publicly trusted certificate body to enable the test.
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateName (0.00s)
=== RUN TestAccAWSAPIGatewayDomainName_RegionalCertificateArn
=== PAUSE TestAccAWSAPIGatewayDomainName_RegionalCertificateArn
=== RUN TestAccAWSAPIGatewayDomainName_RegionalCertificateName
resource_aws_api_gateway_domain_name_test.go:151: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_REGIONAL_CERTIFICATE_NAME_ENABLED is not set. This environment variable must be set to any non-empty value in a region where uploading REGIONAL certificates is allowed to enable the test.
--- SKIP: TestAccAWSAPIGatewayDomainName_RegionalCertificateName (0.00s)
=== RUN TestAccAWSAPIGatewayDomainName_SecurityPolicy
=== PAUSE TestAccAWSAPIGatewayDomainName_SecurityPolicy
=== RUN TestAccAWSAPIGatewayDomainName_Tags
=== PAUSE TestAccAWSAPIGatewayDomainName_Tags
=== RUN TestAccAWSAPIGatewayDomainName_disappears
=== PAUSE TestAccAWSAPIGatewayDomainName_disappears
=== RUN TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== PAUSE TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== CONT TestAccAWSAPIGatewayDomainName_RegionalCertificateArn
=== CONT TestAccAWSAPIGatewayDomainName_disappears
=== CONT TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== CONT TestAccAWSAPIGatewayDomainName_Tags
=== CONT TestAccAWSAPIGatewayDomainName_SecurityPolicy
=== CONT TestAccAWSAPIGatewayDomainName_disappears
--- PASS: TestAccAWSAPIGatewayDomainName_disappears (24.99s)
--- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (88.53s)
--- PASS: TestAccAWSAPIGatewayDomainName_Tags (124.71s)
--- PASS: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (193.38s)
--- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (358.53s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 359.309s |
…ute. Acceptance test output: $ make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication -timeout 120m === RUN TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication === PAUSE TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication === CONT TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication resource_aws_api_gateway_domain_name_test.go:305: Step 1/4 error: terraform failed: exit status 1 stderr: Error: Error creating API Gateway Domain Name: BadRequestException: The certificate provided must be issued by ACM and not imported. (Service: APIGateway; Status Code: 400; Error Code: BadRequestException; Request ID: TYsupAJTvHcEJbQ=; Proxy: null) --- FAIL: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (17.49s) FAIL FAIL github.com/terraform-providers/terraform-provider-aws/aws 17.528s FAIL GNUmakefile:27: recipe for target 'testacc' failed make: *** [testacc] Error 1
…mutual TLS acceptance test.
…ing mutual TLS (relates: hashicorp#16139). Acceptance test output: $ ACM_CERTIFICATE_ROOT_DOMAIN=<domain name> make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication -timeout 120m === RUN TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication === PAUSE TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication === CONT TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication --- PASS: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (151.06s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 151.102s
…IGatewayDomainNameConfig_CertificateArn'.
4a7197b
to
14682e6
Compare
$ ACM_CERTIFICATE_ROOT_DOMAIN=<domain name> make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication -timeout 120m
=== RUN TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== PAUSE TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
=== CONT TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication
--- PASS: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (132.05s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 132.107s
$ ACM_CERTIFICATE_ROOT_DOMAIN=<domain name> make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayDomainName_CertificateArn'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayDomainName_CertificateArn -timeout 120m
=== RUN TestAccAWSAPIGatewayDomainName_CertificateArn
=== PAUSE TestAccAWSAPIGatewayDomainName_CertificateArn
=== CONT TestAccAWSAPIGatewayDomainName_CertificateArn
--- PASS: TestAccAWSAPIGatewayDomainName_CertificateArn (968.53s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 968.599s |
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.
LGTM
--- PASS: TestAccAWSAPIGatewayDomainName_disappears (135.09s)
--- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (141.36s)
--- PASS: TestAccAWSAPIGatewayDomainName_Tags (146.63s)
--- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (223.05s)
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.
Looks great, thanks, @ewbankkit 🚀
Output from acceptance testing:
--- PASS: TestAccAWSAPIGatewayDomainName_CertificateArn (965.23s)
--- PASS: TestAccAWSAPIGatewayDomainName_disappears (198.12s)
--- PASS: TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication (160.02s)
--- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (364.00s)
--- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (58.65s)
--- PASS: TestAccAWSAPIGatewayDomainName_Tags (151.50s)
This has been released in version 3.24.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! |
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
Relates #15220.
Release note for CHANGELOG:
Output from acceptance testing: