Skip to content

Instantly share code, notes, and snippets.

@nmarchini
Created January 15, 2021 16:29
Show Gist options
  • Save nmarchini/60b0ea1e508b59f7fee8b596786a3f7b to your computer and use it in GitHub Desktop.
Save nmarchini/60b0ea1e508b59f7fee8b596786a3f7b to your computer and use it in GitHub Desktop.
null_resource for adding custom domain to AWS Elasticsearch with Terraform
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