We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae8ab44 commit c30323cCopy full SHA for c30323c
1 file changed
infrastructure/terraform/components/api/api_gateway_rest_api_tls.tf
@@ -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