Skip to content

Commit c30323c

Browse files
committed
CCM-14114: set TLS version on Rest API to be 1.2, to match domain name
1 parent ae8ab44 commit c30323c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Terraform does not yet support setting the securityPolicy on aws_api_gateway_rest_api
2+
# directly. This terraform_data resource works around that by calling the AWS CLI
3+
# to enforce TLS 1.2 on the REST API after it is created or replaced.
4+
resource "terraform_data" "rest_api_tls_policy" {
5+
triggers_replace = [aws_api_gateway_rest_api.main.id]
6+
7+
provisioner "local-exec" {
8+
command = <<-EOT
9+
aws apigateway update-rest-api \
10+
--region ${var.region} \
11+
--rest-api-id ${aws_api_gateway_rest_api.main.id} \
12+
--patch-operations op=replace,path=/securityPolicy,value=TLS_1_2
13+
EOT
14+
}
15+
}

0 commit comments

Comments
 (0)