Created
January 15, 2021 16:29
-
-
Save nmarchini/60b0ea1e508b59f7fee8b596786a3f7b to your computer and use it in GitHub Desktop.
null_resource for adding custom domain to AWS Elasticsearch with Terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "null_resource" "domain_custom_endpoint" { | |
triggers = { | |
associations = module.elasticsearch-cluster.domain_hostname | |
} | |
provisioner "local-exec" { | |
interpreter = ["/bin/bash", "-c"] | |
command = <<EOF | |
aws es update-elasticsearch-domain-config --domain-name ${local.domain-name} --domain-endpoint-options EnforceHTTPS=true,TLSSecurityPolicy=Policy-Min-TLS-1-0-2019-07,CustomEndpointEnabled=true,CustomEndpoint=${local.cust_domain_name}.,CustomEndpointCertificateArn=${local.cert_arn} | |
EOF | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment