{"id":14957961,"url":"https://github.com/terraform-community-modules/tf_aws_elasticsearch","last_synced_at":"2025-10-16T16:09:21.771Z","repository":{"id":21150712,"uuid":"91842980","full_name":"terraform-community-modules/tf_aws_elasticsearch","owner":"terraform-community-modules","description":"[DEPRECATED] Use https://github.com/terraform-aws-modules/terraform-aws-opensearch","archived":false,"fork":false,"pushed_at":"2024-01-12T08:34:02.000Z","size":54,"stargazers_count":78,"open_issues_count":12,"forks_count":95,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-05T16:28:57.706Z","etag":null,"topics":["aws","elasticsearch","opensearch","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-community-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-19T20:29:01.000Z","updated_at":"2025-03-04T19:19:51.000Z","dependencies_parsed_at":"2024-09-24T13:24:08.545Z","dependency_job_id":null,"html_url":"https://github.com/terraform-community-modules/tf_aws_elasticsearch","commit_stats":{"total_commits":50,"total_committers":12,"mean_commits":4.166666666666667,"dds":0.62,"last_synced_commit":"a4217c08891051b0e09a56ec00eadcf176c794c8"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/terraform-community-modules/tf_aws_elasticsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-community-modules%2Ftf_aws_elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-community-modules%2Ftf_aws_elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-community-modules%2Ftf_aws_elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-community-modules%2Ftf_aws_elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-community-modules","download_url":"https://codeload.github.com/terraform-community-modules/tf_aws_elasticsearch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-community-modules%2Ftf_aws_elasticsearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273595442,"owners_count":25134257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","elasticsearch","opensearch","terraform","terraform-modules"],"created_at":"2024-09-24T13:15:54.379Z","updated_at":"2025-10-16T16:09:21.705Z","avatar_url":"https://github.com/terraform-community-modules.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf_aws_elasticsearch\n\nTerraform module for deploying and managing [Amazon Elasticsearch Service](https://aws.amazon.com/documentation/elasticsearch-service/).\n\nThis module has two options for creating an Elasticsearch domain:\n  1) Create an Elasticsearch domain with a public endpoint. Access policy is then based on the intersection of the following two criteria\n     * source IP address\n     * client IAM role\n\n     See [this Stack Overflow post](http://stackoverflow.com/questions/32978026/proper-access-policy-for-amazon-elastic-search-cluster) for further discussion of access policies for Elasticsearch.\n  2) Create an Elasticsearch domain and join it to a VPC. Access policy is then based on the intersection of the following two criteria:\n     * security groups applied to Elasticsearch domain\n     * client IAM role\n\nIf `vpc_options` option is set, Elasticsearch domain is created within a VPC. If not, Elasticsearch domain is created with a public endpoint\n\nNOTE: **You can either launch your domain within a VPC or use a public endpoint, but you can't do both.** Considering this, adding or removing `vpc_options` will force **DESTRUCTION** of the old Elasticsearch domain and **CREATION** of a new one. More INFO - [VPC support](http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html)\n\nSeveral options affect the resilience and scalability of your Elasticsearch domain.  For a production deployment:\n\n- set `instance_count` to an even number (default: `6`) greater than or equal to the `dedicated_master_threshold` (default: `10`)\n- choose an `instance_type` that is not in the T2 family\n- set `es_zone_awareness` to `true`.\n\nThis will result in a cluster with three dedicated master nodes, balanced across two availability zones.\n\nFor a production deployment it may also make sense to use EBS volumes rather that instance storage; to do so, set `ebs_volume_size` greater than 0 and optionally specify a value for `ebs_volume_type` (right now the only supported values are `gp2` and `magnetic`).\n\n\n## Terraform versions\n\nTerraform 0.12. Pin module version to `~\u003e v1.0`. Submit pull-requests to `master` branch.\n\nTerraform 0.11. Pin module version to `~\u003e v0.0`. Submit pull-requests to `terraform011` branch.\n\n# Usage\n\nCreate Elasticsearch domain with public endpoint\n\n```hcl\nmodule \"es\" {\n  source  = \"git::https://github.com/terraform-community-modules/tf_aws_elasticsearch.git?ref=v1.1.0\"\n\n  domain_name                    = \"my-elasticsearch-domain\"\n  management_public_ip_addresses = [\"34.203.XXX.YYY\"]\n  instance_count                 = 16\n  instance_type                  = \"m4.2xlarge.elasticsearch\"\n  dedicated_master_type          = \"m4.large.elasticsearch\"\n  es_zone_awareness              = true\n  ebs_volume_size                = 100\n}\n```\n\nCreate Elasticsearch domain within a VPC and CloudWatch logs\n\n```hcl\nmodule \"es\" {\n  source  = \"git::https://github.com/terraform-community-modules/tf_aws_elasticsearch.git?ref=v1.1.0\"\n\n  domain_name                    = \"my-elasticsearch-domain\"\n  vpc_options                    = {\n    security_group_ids = [\"sg-XXXXXXXX\"]\n    subnet_ids         = [\"subnet-YYYYYYYY\"]\n  }\n  instance_count                 = 1\n  instance_type                  = \"t2.medium.elasticsearch\"\n  dedicated_master_type          = \"t2.medium.elasticsearch\"\n  es_zone_awareness              = false\n  ebs_volume_size                = 35\n  \n  advanced_options = {\n    \"rest.action.multi.allow_explicit_index\" = \"true\"   # double quotes are required here\n  }\n\n  log_publishing_options = [\n    {\n      cloudwatch_log_group_arn = \"arn:aws:logs:eu-central-1:604506250243:log-group:es:*\"\n      log_type                 = \"INDEX_SLOW_LOGS\"\n      enabled                  = true\n    },\n    {\n      cloudwatch_log_group_arn = \"arn:aws:logs:eu-central-1:604506250243:log-group:es:*\"\n      log_type                 = \"SEARCH_SLOW_LOGS\"\n      enabled                  = true\n    },\n    {\n      cloudwatch_log_group_arn = \"arn:aws:logs:eu-central-1:604506250243:log-group:es:*\"\n      log_type                 = \"ES_APPLICATION_LOGS\"\n      enabled                  = true\n    }\n  ]\n}\n```\n\nCreate small (4-node) Elasticsearch domain in a VPC with dedicated master nodes\n\n```hcl\nmodule \"es\" {\n  source  = \"git::https://github.com/terraform-community-modules/tf_aws_elasticsearch.git?ref=v1.1.0\"\n\n  domain_name                    = \"my-elasticsearch-domain\"\n  vpc_options                    = {\n    security_group_ids = [\"sg-XXXXXXXX\"]\n    subnet_ids         = [\"subnet-YYYYYYYY\"]\n  }\n  instance_count                 = 4\n  instance_type                  = \"m4.2xlarge.elasticsearch\"\n  dedicated_master_threshold     = 4\n  dedicated_master_type          = \"m4.large.elasticsearch\"\n  es_zone_awareness              = true\n  ebs_volume_size                = 100\n}\n```\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|:----:|:-----:|:-----:|\n| advanced\\_options | Map of key-value string pairs to specify advanced configuration options. Note that the values for these configuration options must be strings (wrapped in quotes) or they may be wrong and cause a perpetual diff, causing Terraform to want to recreate your Elasticsearch domain on every apply. | map(string) | `{}` | no |\n| create\\_iam\\_service\\_linked\\_role | Whether to create IAM service linked role for AWS ElasticSearch service. Can be only one per AWS account. | bool | `\"true\"` | no |\n| dedicated\\_master\\_threshold | The number of instances above which dedicated master nodes will be used. Default: 10 | number | `\"10\"` | no |\n| dedicated\\_master\\_type | ES instance type to be used for dedicated masters (default same as instance_type) | string | `\"false\"` | no |\n| domain\\_name | Domain name for Elasticsearch cluster | string | `\"es-domain\"` | no |\n| domain\\_prefix | String to be prefixed to search domain. Default: tf- | string | `\"tf-\"` | no |\n| ebs\\_volume\\_size | Optionally use EBS volumes for data storage by specifying volume size in GB (default 0) | number | `\"0\"` | no |\n| ebs\\_volume\\_type | Storage type of EBS volumes, if used (default gp2) | string | `\"gp2\"` | no |\n| encrypt\\_at\\_rest | Enable encrption at rest (only specific instance family types support it: m4, c4, r4, i2, i3 default: false) | bool | `\"false\"` | no |\n| enforce\\_https | Whether or not to require HTTPS. | bool | `\"false\"` | no |\n| es\\_version | Version of Elasticsearch to deploy (default 5.1) | string | `\"5.1\"` | no |\n| es\\_zone\\_awareness | Enable zone awareness for Elasticsearch cluster (default false) | bool | `\"false\"` | no |\n| es\\_zone\\_awareness\\_count | Number of availability zones used for data nodes (default 2) | number | `\"2\"` | no |\n| instance\\_count | Number of data nodes in the cluster (default 6) | number | `\"6\"` | no |\n| instance\\_type | ES instance type for data nodes in the cluster (default t2.small.elasticsearch) | string | `\"t2.small.elasticsearch\"` | no |\n| kms\\_key\\_id | KMS key used for elasticsearch | string | `\"\"` | no |\n| log\\_publishing\\_options | List of maps of options for publishing slow logs to CloudWatch Logs. | list(map(string)) | `[]` | no |\n| management\\_iam\\_roles | List of IAM role ARNs from which to permit management traffic (default ['*']).  Note that a client must match both the IP address and the IAM role patterns in order to be permitted access. | list(string) | `[ \"*\" ]` | no |\n| management\\_public\\_ip\\_addresses | List of IP addresses from which to permit management traffic (default []).  Note that a client must match both the IP address and the IAM role patterns in order to be permitted access. | list(string) | `[]` | no |\n| node\\_to\\_node\\_encryption\\_enabled | Whether to enable node-to-node encryption. | bool | `\"false\"` | no |\n| snapshot\\_start\\_hour | Hour at which automated snapshots are taken, in UTC (default 0) | number | `\"0\"` | no |\n| tags | tags to apply to all resources | map(string) | `{}` | no |\n| tls\\_security\\_policy | The name of the TLS security policy that needs to be applied to the HTTPS endpoint. Example values: Policy-Min-TLS-1-0-2019-07 and Policy-Min-TLS-1-2-2019-07. Terraform will only perform drift detection if a configuration value is provided. | string | `\"null\"` | no |\n| use\\_prefix | Flag indicating whether or not to use the domain_prefix. Default: true | bool | `\"true\"` | no |\n| vpc\\_options | A map of supported vpc options | map(list(string)) | `{ \"security_group_ids\": [], \"subnet_ids\": [] }` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| arn | Amazon Resource Name (ARN) of the domain |\n| domain\\_id | Unique identifier for the domain |\n| domain\\_name | The name of the Elasticsearch domain |\n| endpoint | Domain-specific endpoint used to submit index, search, and data upload requests |\n| kibana\\_endpoint | Domain-specific endpoint for kibana without https scheme |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Authors\n\nOriginally created by [Steve Huff](https://github.com/hakamadare), [Alexander Gramovich](https://github.com/ggramal) and [these awesome contributors](https://github.com/terraform-community-modules/tf_aws_elasticsearch/graphs/contributors).\n\nModule managed by [Anton Babenko](https://github.com/antonbabenko).\n\n## License\n\nMIT licensed. See `LICENSE.md` for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-community-modules%2Ftf_aws_elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-community-modules%2Ftf_aws_elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-community-modules%2Ftf_aws_elasticsearch/lists"}