How do I specify dual-stack IP address type for AWS Elasticsearch in Terraform

165 Views Asked by At

I've created a Terraform file for creating Elasticsearch ie.Amazon OpenSearch Service domain. In the Management console, for Elasticsearch domain you can see in Cluster Configuration tab there are Network options. The IP address type there can be specified as IPv4 only or Dual-Stack mode(recommended). Info says "Select the type of IP address that your subnets use". By default the domain that gets created using my Teraform shows the network type as IPv4, but I would like to specify it to be dual-stack. I searched the Terraform registry but unable to find any related argument. Any idea what argument or options do we use in TF for this. I've created a module for Elasticsearch(ES) using below code and am using this module to create my ES domain:

resource "aws_elasticsearch_domain" "elasticsearch" {
  domain_name           = "es-${var.app_name}-domain"
  elasticsearch_version = var.elasticsearch_version
  ...

As part of this terraform I am also creating a Security group for the ES which has ingress rules for allowing both IPV4 and IPV6 traffic. While using the module for domain creation I am using a VPC with 2 private subnets.

I am new to Terraform, any help is appreciated! Thanks.

0

There are 0 best solutions below