├── test ├── .gitignore ├── src │ ├── .gitignore │ ├── go.mod │ ├── Makefile │ └── examples_complete_test.go ├── Makefile.alpine └── Makefile ├── .github ├── ISSUE_TEMPLATE │ ├── question.md │ ├── config.yml │ ├── bug_report.md │ ├── feature_request.md │ ├── bug_report.yml │ └── feature_request.yml ├── mergify.yml ├── banner.png ├── workflows │ ├── release.yml │ ├── scheduled.yml │ ├── chatops.yml │ └── branch.yml ├── renovate.json ├── settings.yml ├── PULL_REQUEST_TEMPLATE.md └── CODEOWNERS ├── versions.tf ├── examples ├── docs │ ├── versions.tf │ ├── targets.md │ └── terraform.md ├── basic │ ├── versions.tf │ └── main.tf ├── non_vpc │ ├── versions.tf │ └── main.tf ├── opensearch_basic │ ├── versions.tf │ └── main.tf └── complete │ ├── versions.tf │ ├── fixtures.us-east-2.tfvars │ ├── main.tf │ ├── outputs.tf │ ├── variables.tf │ └── context.tf ├── .gitignore ├── .dockerignore ├── .editorconfig ├── atmos.yaml ├── outputs.tf ├── opensearch_domain.tf ├── elasticsearch_domain.tf ├── README.yaml ├── main.tf ├── context.tf ├── LICENSE ├── variables.tf └── README.md /test/.gitignore: -------------------------------------------------------------------------------- 1 | .test-harness 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/mergify.yml: -------------------------------------------------------------------------------- 1 | extends: .github 2 | -------------------------------------------------------------------------------- /test/src/.gitignore: -------------------------------------------------------------------------------- 1 | .gopath 2 | vendor/ 3 | -------------------------------------------------------------------------------- /.github/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudposse/terraform-aws-elasticsearch/HEAD/.github/banner.png -------------------------------------------------------------------------------- /test/Makefile.alpine: -------------------------------------------------------------------------------- 1 | ifneq (,$(wildcard /sbin/apk)) 2 | ## Install all dependencies for alpine 3 | deps:: init 4 | @apk add --update terraform-docs@cloudposse json2hcl@cloudposse 5 | endif 6 | -------------------------------------------------------------------------------- /versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.3" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 5.15.0" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/docs/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.3" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 4.0" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/basic/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.3" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 4.0" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/non_vpc/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.3" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 4.0" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled files 2 | *.tfstate 3 | *.tfstate.backup 4 | 5 | # Module directory 6 | .terraform 7 | .idea 8 | *.iml 9 | **/.terraform.lock.hcl 10 | test.log 11 | 12 | **/.build-harness 13 | **/build-harness 14 | -------------------------------------------------------------------------------- /examples/opensearch_basic/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.3" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 4.0" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.terraform 2 | .git 3 | .gitignore 4 | .editorconfig 5 | 6 | # Compiled files 7 | *.tfstate 8 | *.tfstate.backup 9 | .terraform.tfstate.lock.info 10 | 11 | # Module directory 12 | .terraform/ 13 | .idea 14 | *.iml 15 | 16 | # Build Harness 17 | .build-harness 18 | build-harness/ 19 | -------------------------------------------------------------------------------- /examples/complete/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.3" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 2.0" 8 | } 9 | null = { 10 | source = "hashicorp/null" 11 | version = ">= 2.0" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: release 3 | on: 4 | release: 5 | types: 6 | - published 7 | 8 | permissions: 9 | id-token: write 10 | contents: write 11 | pull-requests: write 12 | 13 | jobs: 14 | terraform-module: 15 | uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base", 4 | ":preserveSemverRanges", 5 | ":rebaseStalePrs" 6 | ], 7 | "baseBranches": ["main"], 8 | "labels": ["auto-update"], 9 | "dependencyDashboardAutoclose": true, 10 | "enabledManagers": ["terraform"], 11 | "terraform": { 12 | "ignorePaths": ["**/context.tf"] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/scheduled.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: scheduled 3 | on: 4 | workflow_dispatch: { } # Allows manually trigger this workflow 5 | schedule: 6 | - cron: "0 3 * * *" 7 | 8 | permissions: 9 | pull-requests: write 10 | id-token: write 11 | contents: write 12 | 13 | jobs: 14 | scheduled: 15 | uses: cloudposse/.github/.github/workflows/shared-terraform-scheduled.yml@main 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /examples/docs/targets.md: -------------------------------------------------------------------------------- 1 | 2 | ## Makefile Targets 3 | ```text 4 | Available targets: 5 | 6 | help Help screen 7 | help/all Display help for all targets 8 | help/short This help short screen 9 | lint Lint terraform code 10 | 11 | ``` 12 | 13 | -------------------------------------------------------------------------------- /.github/workflows/chatops.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: chatops 3 | on: 4 | issue_comment: 5 | types: [created] 6 | 7 | permissions: 8 | pull-requests: write 9 | id-token: write 10 | contents: write 11 | statuses: write 12 | 13 | jobs: 14 | test: 15 | uses: cloudposse/.github/.github/workflows/shared-terraform-chatops.yml@main 16 | if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/terratest') }} 17 | secrets: inherit 18 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | 9 | # Override for Makefile 10 | [{Makefile, makefile, GNUmakefile}] 11 | indent_style = tab 12 | indent_size = 4 13 | 14 | [Makefile.*] 15 | indent_style = tab 16 | indent_size = 4 17 | 18 | [shell] 19 | indent_style = tab 20 | indent_size = 4 21 | 22 | [*.sh] 23 | indent_style = tab 24 | indent_size = 4 25 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | # Upstream changes from _extends are only recognized when modifications are made to this file in the default branch. 2 | _extends: .github 3 | repository: 4 | name: terraform-aws-elasticsearch 5 | description: Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash. 6 | homepage: https://cloudposse.com/accelerate 7 | topics: aws, terraform, terraform-module, elasticsearch, kibana, elk, efk, fluentd, hcl2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /atmos.yaml: -------------------------------------------------------------------------------- 1 | # Atmos Configuration — powered by https://atmos.tools 2 | # 3 | # This configuration enables centralized, DRY, and consistent project scaffolding using Atmos. 4 | # 5 | # Included features: 6 | # - Organizational custom commands: https://atmos.tools/core-concepts/custom-commands 7 | # - Automated README generation: https://atmos.tools/cli/commands/docs/generate 8 | # 9 | 10 | # Import shared configuration used by all modules 11 | import: 12 | - https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/terraform-module.yaml 13 | -------------------------------------------------------------------------------- /.github/workflows/branch.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Branch 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | - release/** 8 | types: [opened, synchronize, reopened, labeled, unlabeled] 9 | push: 10 | branches: 11 | - main 12 | - release/v* 13 | paths-ignore: 14 | - '.github/**' 15 | - 'docs/**' 16 | - 'examples/**' 17 | - 'test/**' 18 | - 'README.md' 19 | 20 | permissions: {} 21 | 22 | jobs: 23 | terraform-module: 24 | uses: cloudposse/.github/.github/workflows/shared-terraform-module.yml@main 25 | secrets: inherit 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | 3 | contact_links: 4 | 5 | - name: Community Slack Team 6 | url: https://cloudposse.com/slack/ 7 | about: |- 8 | Please ask and answer questions here. 9 | 10 | - name: Office Hours 11 | url: https://cloudposse.com/office-hours/ 12 | about: |- 13 | Join us every Wednesday for FREE Office Hours (lunch & learn). 14 | 15 | - name: DevOps Accelerator Program 16 | url: https://cloudposse.com/accelerate/ 17 | about: |- 18 | Own your infrastructure in record time. We build it. You drive it. 19 | -------------------------------------------------------------------------------- /test/src/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/cloudposse/terraform-aws-elasticsearch 2 | 3 | go 1.24 4 | 5 | toolchain go1.24.0 6 | 7 | require ( 8 | github.com/gruntwork-io/terratest v0.31.4 9 | github.com/stretchr/testify v1.6.1 10 | ) 11 | 12 | require ( 13 | github.com/davecgh/go-spew v1.1.1 // indirect 14 | github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect 15 | github.com/pmezard/go-difflib v1.0.0 // indirect 16 | golang.org/x/crypto v0.36.0 // indirect 17 | golang.org/x/net v0.38.0 // indirect 18 | golang.org/x/sys v0.31.0 // indirect 19 | gopkg.in/yaml.v3 v3.0.0 // indirect 20 | ) 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## what 2 | 3 | 7 | 8 | ## why 9 | 10 | 15 | 16 | ## references 17 | 18 | 22 | -------------------------------------------------------------------------------- /examples/complete/fixtures.us-east-2.tfvars: -------------------------------------------------------------------------------- 1 | enabled = true 2 | 3 | region = "us-east-2" 4 | 5 | namespace = "eg" 6 | 7 | stage = "test" 8 | 9 | name = "es-test" 10 | 11 | availability_zones = ["us-east-2a", "us-east-2b"] 12 | 13 | instance_type = "t3.small.elasticsearch" 14 | 15 | elasticsearch_version = "7.10" 16 | 17 | instance_count = 2 18 | 19 | zone_awareness_enabled = true 20 | 21 | encrypt_at_rest_enabled = false 22 | 23 | dedicated_master_enabled = false 24 | 25 | elasticsearch_subdomain_name = "" 26 | 27 | kibana_subdomain_name = "" 28 | 29 | ebs_volume_size = 20 30 | 31 | create_iam_service_linked_role = false 32 | 33 | dns_zone_id = "Z0880904EUMUUAAGCA17" 34 | 35 | kibana_hostname_enabled = true 36 | 37 | domain_hostname_enabled = true 38 | -------------------------------------------------------------------------------- /examples/non_vpc/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-east-2" 3 | } 4 | 5 | module "elasticsearch" { 6 | source = "../../" 7 | namespace = "eg" 8 | stage = "dev" 9 | name = "es" 10 | dns_zone_id = "Z14EN2YD427LRQ" 11 | security_groups = ["sg-XXXXXXXXX", "sg-YYYYYYYY"] 12 | vpc_enabled = false 13 | zone_awareness_enabled = "true" 14 | elasticsearch_version = "7.10" 15 | instance_type = "t2.small.elasticsearch" 16 | instance_count = 4 17 | iam_role_arns = ["arn:aws:iam::XXXXXXXXX:role/ops", "arn:aws:iam::XXXXXXXXX:role/dev"] 18 | iam_actions = ["es:ESHttpGet", "es:ESHttpPut", "es:ESHttpPost"] 19 | encrypt_at_rest_enabled = "true" 20 | kibana_subdomain_name = "kibana-es" 21 | 22 | advanced_options = { 23 | "rest.action.multi.allow_explicit_index" = "true" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/src/Makefile: -------------------------------------------------------------------------------- 1 | export TF_CLI_ARGS_init ?= -get-plugins=true 2 | export TERRAFORM_VERSION ?= $(shell curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version' | cut -d. -f1-2) 3 | 4 | .DEFAULT_GOAL : all 5 | 6 | .PHONY: all 7 | ## Default target 8 | all: test 9 | 10 | .PHONY : init 11 | ## Initialize tests 12 | init: 13 | @exit 0 14 | 15 | .PHONY : test 16 | ## Run tests 17 | test: init 18 | go mod download 19 | go test -v -timeout 60m -run TestExamplesComplete 20 | 21 | ## Run tests in docker container 22 | docker/test: 23 | docker run --name terratest --rm -it -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e GITHUB_TOKEN \ 24 | -e PATH="/usr/local/terraform/$(TERRAFORM_VERSION)/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \ 25 | -v $(CURDIR)/../../:/module/ cloudposse/test-harness:latest -C /module/test/src test 26 | 27 | .PHONY : clean 28 | ## Clean up files 29 | clean: 30 | rm -rf ../../examples/complete/*.tfstate* 31 | -------------------------------------------------------------------------------- /examples/basic/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-east-2" 3 | } 4 | 5 | module "elasticsearch" { 6 | source = "../../" 7 | namespace = "eg" 8 | stage = "dev" 9 | name = "es" 10 | dns_zone_id = "Z14EN2YD427LRQ" 11 | security_groups = ["sg-XXXXXXXXX", "sg-YYYYYYYY"] 12 | vpc_id = "vpc-XXXXXXXXX" 13 | subnet_ids = ["subnet-XXXXXXXXX", "subnet-YYYYYYYY"] 14 | zone_awareness_enabled = "true" 15 | elasticsearch_version = "7.10" 16 | instance_type = "t2.small.elasticsearch" 17 | instance_count = 4 18 | ebs_volume_size = 10 19 | iam_role_arns = ["arn:aws:iam::XXXXXXXXX:role/ops", "arn:aws:iam::XXXXXXXXX:role/dev"] 20 | iam_actions = ["es:ESHttpGet", "es:ESHttpPut", "es:ESHttpPost"] 21 | encrypt_at_rest_enabled = "true" 22 | kibana_subdomain_name = "kibana-es" 23 | 24 | advanced_options = { 25 | "rest.action.multi.allow_explicit_index" = "true" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help. 11 | 12 | [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) 13 | 14 | ## Describe the Bug 15 | A clear and concise description of what the bug is. 16 | 17 | ## Expected Behavior 18 | A clear and concise description of what you expected to happen. 19 | 20 | ## Steps to Reproduce 21 | Steps to reproduce the behavior: 22 | 1. Go to '...' 23 | 2. Run '....' 24 | 3. Enter '....' 25 | 4. See error 26 | 27 | ## Screenshots 28 | If applicable, add screenshots or logs to help explain your problem. 29 | 30 | ## Environment (please complete the following information): 31 | 32 | Anything that will help us triage the bug will help. Here are some ideas: 33 | - OS: [e.g. Linux, OSX, WSL, etc] 34 | - Version [e.g. 10.15] 35 | 36 | ## Additional Context 37 | Add any other context about the problem here. -------------------------------------------------------------------------------- /examples/opensearch_basic/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "us-east-2" 3 | } 4 | 5 | module "opensearch" { 6 | source = "../../" 7 | namespace = "eg" 8 | stage = "dev" 9 | name = "es" 10 | dns_zone_id = "Z14EN2YD427LRQ" 11 | security_groups = ["sg-XXXXXXXXX", "sg-YYYYYYYY"] 12 | vpc_id = "vpc-XXXXXXXXX" 13 | subnet_ids = ["subnet-XXXXXXXXX", "subnet-YYYYYYYY"] 14 | zone_awareness_enabled = "true" 15 | aws_service_type = "opensearch" 16 | elasticsearch_version = "OpenSearch_3.1" 17 | instance_type = "t3.small.search" 18 | instance_count = 4 19 | ebs_volume_size = 10 20 | iam_role_arns = ["arn:aws:iam::XXXXXXXXX:role/ops", "arn:aws:iam::XXXXXXXXX:role/dev"] 21 | iam_actions = ["es:ESHttpGet", "es:ESHttpPut", "es:ESHttpPost"] 22 | encrypt_at_rest_enabled = "true" 23 | kibana_subdomain_name = "kibana-es" 24 | 25 | advanced_options = { 26 | "rest.action.multi.allow_explicit_index" = "true" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'feature request' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/). 11 | 12 | [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) 13 | 14 | ## Describe the Feature 15 | 16 | A clear and concise description of what the bug is. 17 | 18 | ## Expected Behavior 19 | 20 | A clear and concise description of what you expected to happen. 21 | 22 | ## Use Case 23 | 24 | Is your feature request related to a problem/challenge you are trying to solve? Please provide some additional context of why this feature or capability will be valuable. 25 | 26 | ## Describe Ideal Solution 27 | 28 | A clear and concise description of what you want to happen. If you don't know, that's okay. 29 | 30 | ## Alternatives Considered 31 | 32 | Explain what alternative solutions or features you've considered. 33 | 34 | ## Additional Context 35 | 36 | Add any other context or screenshots about the feature request here. 37 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Use this file to define individuals or teams that are responsible for code in a repository. 2 | # Read more: 3 | # 4 | # Order is important: the last matching pattern has the highest precedence 5 | 6 | # These owners will be the default owners for everything 7 | * @cloudposse/engineering @cloudposse/contributors 8 | 9 | # Cloud Posse must review any changes to Makefiles 10 | **/Makefile @cloudposse/engineering 11 | **/Makefile.* @cloudposse/engineering 12 | 13 | # Cloud Posse must review any changes to GitHub actions 14 | .github/* @cloudposse/engineering 15 | 16 | # Cloud Posse must review any changes to standard context definition, 17 | # but some changes can be rubber-stamped. 18 | **/*.tf @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers 19 | README.yaml @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers 20 | README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers 21 | docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers 22 | 23 | # Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration 24 | .github/mergify.yml @cloudposse/admins 25 | .github/CODEOWNERS @cloudposse/admins 26 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | TEST_HARNESS ?= https://github.com/cloudposse/test-harness.git 2 | TEST_HARNESS_BRANCH ?= master 3 | TEST_HARNESS_PATH = $(realpath .test-harness) 4 | BATS_ARGS ?= --tap 5 | BATS_LOG ?= test.log 6 | 7 | # Define a macro to run the tests 8 | define RUN_TESTS 9 | @echo "Running tests in $(1)" 10 | @cd $(1) && bats $(BATS_ARGS) $(addsuffix .bats,$(addprefix $(TEST_HARNESS_PATH)/test/terraform/,$(TESTS))) 11 | endef 12 | 13 | default: all 14 | 15 | -include Makefile.* 16 | 17 | ## Provision the test-harnesss 18 | .test-harness: 19 | [ -d $@ ] || git clone --depth=1 -b $(TEST_HARNESS_BRANCH) $(TEST_HARNESS) $@ 20 | 21 | ## Initialize the tests 22 | init: .test-harness 23 | 24 | ## Install all dependencies (OS specific) 25 | deps:: 26 | @exit 0 27 | 28 | ## Clean up the test harness 29 | clean: 30 | [ "$(TEST_HARNESS_PATH)" == "/" ] || rm -rf $(TEST_HARNESS_PATH) 31 | 32 | ## Run all tests 33 | all: module examples/complete 34 | 35 | ## Run basic sanity checks against the module itself 36 | module: export TESTS ?= installed lint get-modules module-pinning get-plugins provider-pinning validate terraform-docs input-descriptions output-descriptions 37 | module: deps 38 | $(call RUN_TESTS, ../) 39 | 40 | ## Run tests against example 41 | examples/complete: export TESTS ?= installed lint get-modules get-plugins validate 42 | examples/complete: deps 43 | $(call RUN_TESTS, ../$@) 44 | -------------------------------------------------------------------------------- /outputs.tf: -------------------------------------------------------------------------------- 1 | output "security_group_id" { 2 | value = join("", aws_security_group.default[*].id) 3 | description = "Security Group ID to control access to the Elasticsearch domain" 4 | } 5 | 6 | output "domain_arn" { 7 | value = local.aws_service_domain_arn 8 | description = "ARN of the Elasticsearch domain" 9 | } 10 | 11 | output "domain_id" { 12 | value = local.aws_service_domain_id 13 | description = "Unique identifier for the Elasticsearch domain" 14 | } 15 | 16 | output "domain_name" { 17 | value = local.aws_service_domain_name 18 | description = "Name of the Elasticsearch domain" 19 | } 20 | 21 | output "domain_endpoint" { 22 | value = local.aws_service_domain_endpoint 23 | description = "Domain-specific endpoint used to submit index, search, and data upload requests" 24 | } 25 | 26 | output "kibana_endpoint" { 27 | value = local.aws_service_domain_kibana_endpoint 28 | description = "Domain-specific endpoint for Kibana without https scheme" 29 | } 30 | 31 | output "domain_hostname" { 32 | value = module.domain_hostname.hostname 33 | description = "Elasticsearch domain hostname to submit index, search, and data upload requests" 34 | } 35 | 36 | output "kibana_hostname" { 37 | value = module.kibana_hostname.hostname 38 | description = "Kibana hostname" 39 | } 40 | 41 | output "elasticsearch_user_iam_role_name" { 42 | value = join(",", aws_iam_role.elasticsearch_user[*].name) 43 | description = "The name of the IAM role to allow access to Elasticsearch cluster" 44 | } 45 | 46 | output "elasticsearch_user_iam_role_arn" { 47 | value = join(",", aws_iam_role.elasticsearch_user[*].arn) 48 | description = "The ARN of the IAM role to allow access to Elasticsearch cluster" 49 | } 50 | -------------------------------------------------------------------------------- /examples/complete/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = var.region 3 | } 4 | 5 | module "vpc" { 6 | source = "cloudposse/vpc/aws" 7 | version = "2.2.0" 8 | 9 | ipv4_primary_cidr_block = "172.16.0.0/16" 10 | 11 | context = module.this.context 12 | } 13 | 14 | module "subnets" { 15 | source = "cloudposse/dynamic-subnets/aws" 16 | version = "2.4.2" 17 | 18 | availability_zones = var.availability_zones 19 | vpc_id = module.vpc.vpc_id 20 | igw_id = [module.vpc.igw_id] 21 | ipv4_cidr_block = [module.vpc.vpc_cidr_block] 22 | nat_gateway_enabled = false 23 | nat_instance_enabled = false 24 | 25 | context = module.this.context 26 | } 27 | 28 | module "elasticsearch" { 29 | source = "../../" 30 | 31 | security_groups = [module.vpc.vpc_default_security_group_id] 32 | vpc_id = module.vpc.vpc_id 33 | subnet_ids = module.subnets.private_subnet_ids 34 | zone_awareness_enabled = var.zone_awareness_enabled 35 | elasticsearch_version = var.elasticsearch_version 36 | instance_type = var.instance_type 37 | instance_count = var.instance_count 38 | encrypt_at_rest_enabled = var.encrypt_at_rest_enabled 39 | dedicated_master_enabled = var.dedicated_master_enabled 40 | create_iam_service_linked_role = var.create_iam_service_linked_role 41 | kibana_subdomain_name = var.kibana_subdomain_name 42 | ebs_volume_size = var.ebs_volume_size 43 | dns_zone_id = var.dns_zone_id 44 | kibana_hostname_enabled = var.kibana_hostname_enabled 45 | domain_hostname_enabled = var.domain_hostname_enabled 46 | 47 | advanced_options = { 48 | "rest.action.multi.allow_explicit_index" = "true" 49 | } 50 | 51 | context = module.this.context 52 | } 53 | -------------------------------------------------------------------------------- /examples/complete/outputs.tf: -------------------------------------------------------------------------------- 1 | output "public_subnet_cidrs" { 2 | value = module.subnets.public_subnet_cidrs 3 | description = "Public subnet CIDRs" 4 | } 5 | 6 | output "private_subnet_cidrs" { 7 | value = module.subnets.private_subnet_cidrs 8 | description = "Private subnet CIDRs" 9 | } 10 | 11 | output "vpc_cidr" { 12 | value = module.vpc.vpc_cidr_block 13 | description = "VPC CIDR" 14 | } 15 | 16 | output "security_group_id" { 17 | value = module.elasticsearch.security_group_id 18 | description = "Security Group ID to control access to the Elasticsearch domain" 19 | } 20 | 21 | output "domain_arn" { 22 | value = module.elasticsearch.domain_arn 23 | description = "ARN of the Elasticsearch domain" 24 | } 25 | 26 | output "domain_id" { 27 | value = module.elasticsearch.domain_id 28 | description = "Unique identifier for the Elasticsearch domain" 29 | } 30 | 31 | output "domain_endpoint" { 32 | value = module.elasticsearch.domain_endpoint 33 | description = "Domain-specific endpoint used to submit index, search, and data upload requests" 34 | } 35 | 36 | output "kibana_endpoint" { 37 | value = module.elasticsearch.kibana_endpoint 38 | description = "Domain-specific endpoint for Kibana without https scheme" 39 | } 40 | 41 | output "domain_hostname" { 42 | value = module.elasticsearch.domain_hostname 43 | description = "Elasticsearch domain hostname to submit index, search, and data upload requests" 44 | } 45 | 46 | output "kibana_hostname" { 47 | value = module.elasticsearch.kibana_hostname 48 | description = "Kibana hostname" 49 | } 50 | 51 | output "elasticsearch_user_iam_role_name" { 52 | value = module.elasticsearch.elasticsearch_user_iam_role_name 53 | description = "The name of the IAM role to allow access to Elasticsearch cluster" 54 | } 55 | 56 | output "elasticsearch_user_iam_role_arn" { 57 | value = module.elasticsearch.elasticsearch_user_iam_role_arn 58 | description = "The ARN of the IAM role to allow access to Elasticsearch cluster" 59 | } 60 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | description: Create a report to help us improve 4 | labels: ["bug"] 5 | assignees: [""] 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Found a bug? 11 | 12 | Please checkout our [Slack Community](https://slack.cloudposse.com) 13 | or visit our [Slack Archive](https://archive.sweetops.com/). 14 | 15 | [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) 16 | 17 | - type: textarea 18 | id: concise-description 19 | attributes: 20 | label: Describe the Bug 21 | description: A clear and concise description of what the bug is. 22 | placeholder: What is the bug about? 23 | validations: 24 | required: true 25 | 26 | - type: textarea 27 | id: expected 28 | attributes: 29 | label: Expected Behavior 30 | description: A clear and concise description of what you expected. 31 | placeholder: What happened? 32 | validations: 33 | required: true 34 | 35 | - type: textarea 36 | id: reproduction-steps 37 | attributes: 38 | label: Steps to Reproduce 39 | description: Steps to reproduce the behavior. 40 | placeholder: How do we reproduce it? 41 | validations: 42 | required: true 43 | 44 | - type: textarea 45 | id: screenshots 46 | attributes: 47 | label: Screenshots 48 | description: If applicable, add screenshots or logs to help explain. 49 | validations: 50 | required: false 51 | 52 | - type: textarea 53 | id: environment 54 | attributes: 55 | label: Environment 56 | description: Anything that will help us triage the bug. 57 | placeholder: | 58 | - OS: [e.g. Linux, OSX, WSL, etc] 59 | - Version [e.g. 10.15] 60 | - Module version 61 | - Terraform version 62 | validations: 63 | required: false 64 | 65 | - type: textarea 66 | id: additional 67 | attributes: 68 | label: Additional Context 69 | description: | 70 | Add any other context about the problem here. 71 | validations: 72 | required: false 73 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | description: Suggest an idea for this project 4 | labels: ["feature request"] 5 | assignees: [""] 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Have a question? 11 | 12 | Please checkout our [Slack Community](https://slack.cloudposse.com) 13 | or visit our [Slack Archive](https://archive.sweetops.com/). 14 | 15 | [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) 16 | 17 | - type: textarea 18 | id: concise-description 19 | attributes: 20 | label: Describe the Feature 21 | description: A clear and concise description of what the feature is. 22 | placeholder: What is the feature about? 23 | validations: 24 | required: true 25 | 26 | - type: textarea 27 | id: expected 28 | attributes: 29 | label: Expected Behavior 30 | description: A clear and concise description of what you expected. 31 | placeholder: What happened? 32 | validations: 33 | required: true 34 | 35 | - type: textarea 36 | id: use-case 37 | attributes: 38 | label: Use Case 39 | description: | 40 | Is your feature request related to a problem/challenge you are trying 41 | to solve? 42 | 43 | Please provide some additional context of why this feature or 44 | capability will be valuable. 45 | validations: 46 | required: true 47 | 48 | - type: textarea 49 | id: ideal-solution 50 | attributes: 51 | label: Describe Ideal Solution 52 | description: A clear and concise description of what you want to happen. 53 | validations: 54 | required: true 55 | 56 | - type: textarea 57 | id: alternatives-considered 58 | attributes: 59 | label: Alternatives Considered 60 | description: Explain alternative solutions or features considered. 61 | validations: 62 | required: false 63 | 64 | - type: textarea 65 | id: additional 66 | attributes: 67 | label: Additional Context 68 | description: | 69 | Add any other context about the problem here. 70 | validations: 71 | required: false 72 | -------------------------------------------------------------------------------- /examples/complete/variables.tf: -------------------------------------------------------------------------------- 1 | variable "region" { 2 | type = string 3 | description = "AWS region" 4 | } 5 | 6 | variable "availability_zones" { 7 | type = list(string) 8 | description = "List of availability zones" 9 | } 10 | 11 | variable "instance_type" { 12 | type = string 13 | description = "The type of the instance" 14 | } 15 | 16 | variable "elasticsearch_version" { 17 | type = string 18 | description = "Version of Elasticsearch to deploy (_e.g._ `7.1`, `6.8`, `6.7`, `6.5`, `6.4`, `6.3`, `6.2`, `6.0`, `5.6`, `5.5`, `5.3`, `5.1`, `2.3`, `1.5`" 19 | } 20 | 21 | variable "instance_count" { 22 | type = number 23 | description = "Number of data nodes in the cluster" 24 | } 25 | 26 | variable "zone_awareness_enabled" { 27 | type = bool 28 | description = "Enable zone awareness for Elasticsearch cluster" 29 | } 30 | 31 | variable "encrypt_at_rest_enabled" { 32 | type = bool 33 | description = "Whether to enable encryption at rest" 34 | } 35 | 36 | variable "dedicated_master_enabled" { 37 | type = bool 38 | description = "Indicates whether dedicated master nodes are enabled for the cluster" 39 | } 40 | 41 | variable "elasticsearch_subdomain_name" { 42 | type = string 43 | description = "The name of the subdomain for Elasticsearch in the DNS zone (_e.g._ `elasticsearch`, `ui`, `ui-es`, `search-ui`)" 44 | } 45 | 46 | variable "kibana_subdomain_name" { 47 | type = string 48 | description = "The name of the subdomain for Kibana in the DNS zone (_e.g._ `kibana`, `ui`, `ui-es`, `search-ui`, `kibana.elasticsearch`)" 49 | } 50 | 51 | variable "create_iam_service_linked_role" { 52 | type = bool 53 | description = "Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info" 54 | } 55 | 56 | variable "ebs_volume_size" { 57 | type = number 58 | description = "EBS volumes for data storage in GB" 59 | } 60 | 61 | variable "dns_zone_id" { 62 | type = string 63 | description = "Route53 DNS Zone ID to add hostname records for Elasticsearch domain and Kibana" 64 | } 65 | 66 | variable "domain_hostname_enabled" { 67 | type = bool 68 | description = "Explicit flag to enable creating a DNS hostname for ES. If `true`, then `var.dns_zone_id` is required." 69 | } 70 | 71 | variable "kibana_hostname_enabled" { 72 | type = bool 73 | description = "Explicit flag to enable creating a DNS hostname for Kibana. If `true`, then `var.dns_zone_id` is required." 74 | } 75 | -------------------------------------------------------------------------------- /test/src/examples_complete_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "math/rand" 5 | "strconv" 6 | "testing" 7 | "time" 8 | 9 | "github.com/gruntwork-io/terratest/modules/terraform" 10 | "github.com/stretchr/testify/assert" 11 | ) 12 | 13 | // Test the Terraform module in examples/complete using Terratest. 14 | func TestExamplesComplete(t *testing.T) { 15 | t.Parallel() 16 | 17 | rand.Seed(time.Now().UnixNano()) 18 | 19 | randId := strconv.Itoa(rand.Intn(100000)) 20 | attributes := []string{randId} 21 | 22 | terraformOptions := &terraform.Options{ 23 | // The path to where our Terraform code is located 24 | TerraformDir: "../../examples/complete", 25 | Upgrade: true, 26 | // Variables to pass to our Terraform code using -var-file options 27 | VarFiles: []string{"fixtures.us-east-2.tfvars"}, 28 | Vars: map[string]interface{}{ 29 | "attributes": attributes, 30 | }, 31 | } 32 | 33 | // At the end of the test, run `terraform destroy` to clean up any resources that were created 34 | defer terraform.Destroy(t, terraformOptions) 35 | 36 | // This will run `terraform init` and `terraform apply` and fail the test if there are any errors 37 | terraform.InitAndApply(t, terraformOptions) 38 | 39 | // Run `terraform output` to get the value of an output variable 40 | vpcCidr := terraform.Output(t, terraformOptions, "vpc_cidr") 41 | // Verify we're getting back the outputs we expect 42 | assert.Equal(t, "172.16.0.0/16", vpcCidr) 43 | 44 | // Run `terraform output` to get the value of an output variable 45 | privateSubnetCidrs := terraform.OutputList(t, terraformOptions, "private_subnet_cidrs") 46 | // Verify we're getting back the outputs we expect 47 | assert.Equal(t, []string{"172.16.0.0/19", "172.16.32.0/19"}, privateSubnetCidrs) 48 | 49 | // Run `terraform output` to get the value of an output variable 50 | publicSubnetCidrs := terraform.OutputList(t, terraformOptions, "public_subnet_cidrs") 51 | // Verify we're getting back the outputs we expect 52 | assert.Equal(t, []string{"172.16.96.0/19", "172.16.128.0/19"}, publicSubnetCidrs) 53 | 54 | // Run `terraform output` to get the value of an output variable 55 | domainHostname := terraform.Output(t, terraformOptions, "domain_hostname") 56 | // Verify we're getting back the outputs we expect 57 | assert.Equal(t, "eg-test-es-test-"+randId+".modules.cptest.test-automation.app", domainHostname) 58 | 59 | // Run `terraform output` to get the value of an output variable 60 | kibanaHostname := terraform.Output(t, terraformOptions, "kibana_hostname") 61 | // Verify we're getting back the outputs we expect 62 | assert.Equal(t, "eg-test-es-test-"+randId+"-kibana.modules.cptest.test-automation.app", kibanaHostname) 63 | 64 | // Run `terraform output` to get the value of an output variable 65 | domainEndpoint := terraform.Output(t, terraformOptions, "domain_endpoint") 66 | // Verify we're getting back the outputs we expect 67 | assert.Contains(t, domainEndpoint, "vpc-eg-test-es-test-"+randId) 68 | 69 | // Run `terraform output` to get the value of an output variable 70 | kibanaEndpoint := terraform.Output(t, terraformOptions, "kibana_endpoint") 71 | // Verify we're getting back the outputs we expect 72 | assert.Contains(t, kibanaEndpoint, "vpc-eg-test-es-test-"+randId) 73 | assert.Contains(t, kibanaEndpoint, "us-east-2.es.amazonaws.com/_plugin/kibana") 74 | } 75 | -------------------------------------------------------------------------------- /opensearch_domain.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Opensearch Domain 3 | # 4 | 5 | resource "aws_opensearch_domain_policy" "default" { 6 | count = local.opensearch_enabled && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0) ? 1 : 0 7 | domain_name = length(var.elasticsearch_domain_name) > 0 ? var.elasticsearch_domain_name : module.this.id 8 | access_policies = join("", data.aws_iam_policy_document.default[*].json) 9 | } 10 | 11 | resource "aws_opensearch_domain" "default" { 12 | count = local.opensearch_enabled ? 1 : 0 13 | domain_name = length(var.elasticsearch_domain_name) > 0 ? var.elasticsearch_domain_name : module.this.id 14 | engine_version = var.elasticsearch_version 15 | 16 | advanced_options = var.advanced_options 17 | 18 | advanced_security_options { 19 | enabled = var.advanced_security_options_enabled 20 | internal_user_database_enabled = var.advanced_security_options_internal_user_database_enabled 21 | anonymous_auth_enabled = var.advanced_security_options_anonymous_auth_enabled 22 | master_user_options { 23 | master_user_arn = var.advanced_security_options_master_user_arn 24 | master_user_name = var.advanced_security_options_master_user_name 25 | master_user_password = var.advanced_security_options_master_user_password 26 | } 27 | } 28 | 29 | ebs_options { 30 | ebs_enabled = var.ebs_volume_size > 0 ? true : false 31 | volume_size = var.ebs_volume_size 32 | volume_type = var.ebs_volume_type 33 | iops = var.ebs_iops 34 | throughput = var.ebs_throughput 35 | } 36 | 37 | encrypt_at_rest { 38 | enabled = var.encrypt_at_rest_enabled 39 | kms_key_id = var.encrypt_at_rest_kms_key_id 40 | } 41 | 42 | domain_endpoint_options { 43 | enforce_https = var.domain_endpoint_options_enforce_https 44 | tls_security_policy = var.domain_endpoint_options_tls_security_policy 45 | custom_endpoint_enabled = var.custom_endpoint_enabled 46 | custom_endpoint = var.custom_endpoint_enabled ? var.custom_endpoint : null 47 | custom_endpoint_certificate_arn = var.custom_endpoint_enabled ? var.custom_endpoint_certificate_arn : null 48 | } 49 | 50 | cluster_config { 51 | instance_count = var.instance_count 52 | instance_type = var.instance_type 53 | dedicated_master_enabled = var.dedicated_master_enabled 54 | dedicated_master_count = var.dedicated_master_count 55 | dedicated_master_type = var.dedicated_master_type 56 | multi_az_with_standby_enabled = var.multi_az_with_standby_enabled 57 | zone_awareness_enabled = var.zone_awareness_enabled 58 | warm_enabled = var.warm_enabled 59 | warm_count = var.warm_enabled ? var.warm_count : null 60 | warm_type = var.warm_enabled ? var.warm_type : null 61 | 62 | dynamic "zone_awareness_config" { 63 | for_each = var.availability_zone_count > 1 && var.zone_awareness_enabled ? [true] : [] 64 | content { 65 | availability_zone_count = var.availability_zone_count 66 | } 67 | } 68 | } 69 | 70 | node_to_node_encryption { 71 | enabled = var.node_to_node_encryption_enabled 72 | } 73 | 74 | dynamic "vpc_options" { 75 | for_each = var.vpc_enabled ? [true] : [] 76 | 77 | content { 78 | security_group_ids = var.create_security_group ? [join("", aws_security_group.default[*].id)] : var.security_groups 79 | subnet_ids = var.subnet_ids 80 | } 81 | } 82 | 83 | snapshot_options { 84 | automated_snapshot_start_hour = var.automated_snapshot_start_hour 85 | } 86 | 87 | dynamic "cognito_options" { 88 | for_each = var.cognito_authentication_enabled ? [true] : [] 89 | content { 90 | enabled = true 91 | user_pool_id = var.cognito_user_pool_id 92 | identity_pool_id = var.cognito_identity_pool_id 93 | role_arn = var.cognito_iam_role_arn 94 | } 95 | } 96 | 97 | # Converted `log_publishing_options` to dynamic blocks due to the follow errors 98 | # │ Error: Error creating OpenSearch domain: InvalidParameter: 4 validation error(s) found. 99 | # │ - minimum field size of 20, CreateDomainInput.LogPublishingOptions[ES_APPLICATION_LOGS].CloudWatchLogsLogGroupArn. 100 | # │ - minimum field size of 20, CreateDomainInput.LogPublishingOptions[AUDIT_LOGS].CloudWatchLogsLogGroupArn. 101 | # │ - minimum field size of 20, CreateDomainInput.LogPublishingOptions[SEARCH_SLOW_LOGS].CloudWatchLogsLogGroupArn. 102 | # │ - minimum field size of 20, CreateDomainInput.LogPublishingOptions[INDEX_SLOW_LOGS].CloudWatchLogsLogGroupArn. 103 | 104 | dynamic "log_publishing_options" { 105 | for_each = var.log_publishing_index_enabled ? [true] : [] 106 | content { 107 | log_type = "INDEX_SLOW_LOGS" 108 | cloudwatch_log_group_arn = var.log_publishing_index_cloudwatch_log_group_arn 109 | } 110 | } 111 | 112 | dynamic "log_publishing_options" { 113 | for_each = var.log_publishing_search_enabled ? [true] : [] 114 | content { 115 | log_type = "SEARCH_SLOW_LOGS" 116 | cloudwatch_log_group_arn = var.log_publishing_search_cloudwatch_log_group_arn 117 | } 118 | } 119 | 120 | dynamic "log_publishing_options" { 121 | for_each = var.log_publishing_audit_enabled ? [true] : [] 122 | content { 123 | log_type = "AUDIT_LOGS" 124 | cloudwatch_log_group_arn = var.log_publishing_audit_cloudwatch_log_group_arn 125 | } 126 | } 127 | 128 | dynamic "log_publishing_options" { 129 | for_each = var.log_publishing_application_enabled ? [true] : [] 130 | content { 131 | log_type = "ES_APPLICATION_LOGS" 132 | cloudwatch_log_group_arn = var.log_publishing_application_cloudwatch_log_group_arn 133 | } 134 | } 135 | 136 | tags = module.this.tags 137 | 138 | depends_on = [aws_iam_service_linked_role.default] 139 | } 140 | -------------------------------------------------------------------------------- /elasticsearch_domain.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Elasticsearch Domain 3 | # 4 | 5 | resource "aws_elasticsearch_domain_policy" "default" { 6 | count = local.elasticsearch_enabled && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0 || length(var.access_policies) > 0) ? 1 : 0 7 | domain_name = length(var.elasticsearch_domain_name) > 0 ? var.elasticsearch_domain_name : module.this.id 8 | access_policies = coalesce(var.access_policies, join("", data.aws_iam_policy_document.default[*].json)) 9 | } 10 | 11 | resource "aws_elasticsearch_domain" "default" { 12 | count = local.elasticsearch_enabled ? 1 : 0 13 | domain_name = length(var.elasticsearch_domain_name) > 0 ? var.elasticsearch_domain_name : module.this.id 14 | elasticsearch_version = var.elasticsearch_version 15 | 16 | advanced_options = var.advanced_options 17 | 18 | advanced_security_options { 19 | enabled = var.advanced_security_options_enabled 20 | internal_user_database_enabled = var.advanced_security_options_internal_user_database_enabled 21 | master_user_options { 22 | master_user_arn = var.advanced_security_options_master_user_arn 23 | master_user_name = var.advanced_security_options_master_user_name 24 | master_user_password = var.advanced_security_options_master_user_password 25 | } 26 | } 27 | 28 | ebs_options { 29 | ebs_enabled = var.ebs_volume_size > 0 ? true : false 30 | volume_size = var.ebs_volume_size 31 | volume_type = var.ebs_volume_type 32 | iops = var.ebs_iops 33 | throughput = var.ebs_throughput 34 | } 35 | 36 | encrypt_at_rest { 37 | enabled = var.encrypt_at_rest_enabled 38 | kms_key_id = var.encrypt_at_rest_kms_key_id 39 | } 40 | 41 | domain_endpoint_options { 42 | enforce_https = var.domain_endpoint_options_enforce_https 43 | tls_security_policy = var.domain_endpoint_options_tls_security_policy 44 | custom_endpoint_enabled = var.custom_endpoint_enabled 45 | custom_endpoint = var.custom_endpoint_enabled ? var.custom_endpoint : null 46 | custom_endpoint_certificate_arn = var.custom_endpoint_enabled ? var.custom_endpoint_certificate_arn : null 47 | } 48 | 49 | cluster_config { 50 | instance_count = var.instance_count 51 | instance_type = var.instance_type 52 | dedicated_master_enabled = var.dedicated_master_enabled 53 | dedicated_master_count = var.dedicated_master_enabled ? var.dedicated_master_count : null 54 | dedicated_master_type = var.dedicated_master_enabled ? var.dedicated_master_type : null 55 | zone_awareness_enabled = var.zone_awareness_enabled 56 | warm_enabled = var.warm_enabled 57 | warm_count = var.warm_enabled ? var.warm_count : null 58 | warm_type = var.warm_enabled ? var.warm_type : null 59 | 60 | dynamic "zone_awareness_config" { 61 | for_each = var.availability_zone_count > 1 && var.zone_awareness_enabled ? [true] : [] 62 | content { 63 | availability_zone_count = var.availability_zone_count 64 | } 65 | } 66 | 67 | dynamic "cold_storage_options" { 68 | for_each = var.cold_storage_enabled ? [true] : [] 69 | content { 70 | enabled = var.cold_storage_enabled 71 | } 72 | } 73 | } 74 | 75 | dynamic "auto_tune_options" { 76 | for_each = var.auto_tune.enabled ? [true] : [] 77 | content { 78 | desired_state = "ENABLED" 79 | rollback_on_disable = var.auto_tune.rollback_on_disable 80 | maintenance_schedule { 81 | # Required until https://github.com/hashicorp/terraform-provider-aws/issues/22239 would be resolved 82 | start_at = var.auto_tune.starting_time == null ? timeadd(timestamp(), "1h") : var.auto_tune.starting_time 83 | duration { 84 | value = var.auto_tune.duration 85 | unit = "HOURS" 86 | } 87 | cron_expression_for_recurrence = var.auto_tune.cron_schedule 88 | } 89 | } 90 | } 91 | 92 | node_to_node_encryption { 93 | enabled = var.node_to_node_encryption_enabled 94 | } 95 | 96 | dynamic "vpc_options" { 97 | for_each = var.vpc_enabled ? [true] : [] 98 | 99 | content { 100 | security_group_ids = var.create_security_group ? [join("", aws_security_group.default[*].id)] : var.security_groups 101 | subnet_ids = var.subnet_ids 102 | } 103 | } 104 | 105 | snapshot_options { 106 | automated_snapshot_start_hour = var.automated_snapshot_start_hour 107 | } 108 | 109 | dynamic "cognito_options" { 110 | for_each = var.cognito_authentication_enabled ? [true] : [] 111 | content { 112 | enabled = true 113 | user_pool_id = var.cognito_user_pool_id 114 | identity_pool_id = var.cognito_identity_pool_id 115 | role_arn = var.cognito_iam_role_arn 116 | } 117 | } 118 | 119 | log_publishing_options { 120 | enabled = var.log_publishing_index_enabled 121 | log_type = "INDEX_SLOW_LOGS" 122 | cloudwatch_log_group_arn = var.log_publishing_index_cloudwatch_log_group_arn 123 | } 124 | 125 | log_publishing_options { 126 | enabled = var.log_publishing_search_enabled 127 | log_type = "SEARCH_SLOW_LOGS" 128 | cloudwatch_log_group_arn = var.log_publishing_search_cloudwatch_log_group_arn 129 | } 130 | 131 | log_publishing_options { 132 | enabled = var.log_publishing_audit_enabled 133 | log_type = "AUDIT_LOGS" 134 | cloudwatch_log_group_arn = var.log_publishing_audit_cloudwatch_log_group_arn 135 | } 136 | 137 | log_publishing_options { 138 | enabled = var.log_publishing_application_enabled 139 | log_type = "ES_APPLICATION_LOGS" 140 | cloudwatch_log_group_arn = var.log_publishing_application_cloudwatch_log_group_arn 141 | } 142 | 143 | tags = module.this.tags 144 | 145 | depends_on = [aws_iam_service_linked_role.default] 146 | } 147 | -------------------------------------------------------------------------------- /README.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # This is the canonical configuration for the `README.md` 3 | # Run `make readme` to rebuild the `README.md` 4 | # 5 | 6 | # Name of this project 7 | name: terraform-aws-elasticsearch 8 | 9 | # Logo for this project 10 | #logo: docs/logo.png 11 | 12 | # License of this project 13 | license: "APACHE2" 14 | 15 | # Canonical GitHub repo 16 | github_repo: cloudposse/terraform-aws-elasticsearch 17 | 18 | # Badges to display 19 | badges: 20 | - name: Latest Release 21 | image: https://img.shields.io/github/release/cloudposse/terraform-aws-elasticsearch.svg?style=for-the-badge 22 | url: https://github.com/cloudposse/terraform-aws-elasticsearch/releases/latest 23 | - name: Last Updated 24 | image: https://img.shields.io/github/last-commit/cloudposse/terraform-aws-elasticsearch.svg?style=for-the-badge 25 | url: https://github.com/cloudposse/terraform-aws-elasticsearch/commits 26 | - name: Slack Community 27 | image: https://slack.cloudposse.com/for-the-badge.svg 28 | url: https://cloudposse.com/slack 29 | description: |- 30 | Terraform module to provision an [`Elasticsearch`](https://aws.amazon.com/elasticsearch-service/) cluster with built-in integrations with [Kibana](https://aws.amazon.com/elasticsearch-service/kibana/) and [Logstash](https://aws.amazon.com/elasticsearch-service/logstash/). 31 | 32 | introduction: |- 33 | This module will create: 34 | - Elasticsearch cluster with the specified node count in the provided subnets in a VPC 35 | - Elasticsearch domain policy that accepts a list of IAM role ARNs from which to permit management traffic to the cluster 36 | - Security Group to control access to the Elasticsearch domain (inputs to the Security Group are other Security Groups or CIDRs blocks to be allowed to connect to the cluster) 37 | - DNS hostname record for Elasticsearch cluster (if DNS Zone ID is provided) 38 | - DNS hostname record for Kibana (if DNS Zone ID is provided) 39 | 40 | __NOTE:__ To enable [zone awareness](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness) to deploy Elasticsearch nodes into two different Availability Zones, you need to set `zone_awareness_enabled` to `true` and provide two different subnets in `subnet_ids`. 41 | If you enable zone awareness for your domain, Amazon ES places an endpoint into two subnets. 42 | The subnets must be in different Availability Zones in the same region. 43 | If you don't enable zone awareness, Amazon ES places an endpoint into only one subnet. You also need to set `availability_zone_count` to `1`. 44 | 45 | examples: |- 46 | Here is a working example of using this module: 47 | - [`examples/complete`](examples/complete) 48 | 49 | Here are automated tests for the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS): 50 | - [`test`](test) 51 | 52 | # How to use this project 53 | usage: |2- 54 | 55 | ```hcl 56 | module "elasticsearch" { 57 | source = "cloudposse/elasticsearch/aws" 58 | # Cloud Posse recommends pinning every module to a specific version 59 | # version = "x.x.x" 60 | namespace = "eg" 61 | stage = "dev" 62 | name = "es" 63 | dns_zone_id = "Z14EN2YD427LRQ" 64 | security_groups = ["sg-XXXXXXXXX", "sg-YYYYYYYY"] 65 | vpc_id = "vpc-XXXXXXXXX" 66 | subnet_ids = ["subnet-XXXXXXXXX", "subnet-YYYYYYYY"] 67 | zone_awareness_enabled = true 68 | elasticsearch_version = "6.5" 69 | instance_type = "t2.small.elasticsearch" 70 | instance_count = 4 71 | ebs_volume_size = 10 72 | iam_role_arns = ["arn:aws:iam::XXXXXXXXX:role/ops", "arn:aws:iam::XXXXXXXXX:role/dev"] 73 | iam_actions = ["es:ESHttpGet", "es:ESHttpPut", "es:ESHttpPost"] 74 | encrypt_at_rest_enabled = true 75 | kibana_subdomain_name = "kibana-es" 76 | 77 | advanced_options = { 78 | "rest.action.multi.allow_explicit_index" = "true" 79 | } 80 | } 81 | ``` 82 | 83 | include: [] 84 | references: 85 | - name: "What is Amazon Elasticsearch Service" 86 | description: "Complete description of Amazon Elasticsearch Service" 87 | url: "https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/what-is-amazon-elasticsearch-service.html" 88 | - name: "Amazon Elasticsearch Service Access Control" 89 | description: "Describes several ways of controlling access to Elasticsearch domains" 90 | url: "https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html" 91 | - name: "VPC Support for Amazon Elasticsearch Service Domains" 92 | description: "Describes Elasticsearch Service VPC Support and VPC architectures with and without zone awareness" 93 | url: "https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html" 94 | - name: "Creating and Configuring Amazon Elasticsearch Service Domains" 95 | description: "Provides a complete description on how to create and configure Amazon Elasticsearch Service (Amazon ES) domains" 96 | url: "https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html" 97 | - name: "Kibana and Logstash" 98 | description: "Describes some considerations for using Kibana and Logstash with Amazon Elasticsearch Service" 99 | url: "https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-kibana.html" 100 | - name: "Amazon Cognito Authentication for Kibana" 101 | description: "Amazon Elasticsearch Service uses Amazon Cognito to offer user name and password protection for Kibana" 102 | url: "https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html" 103 | - name: "Control Access to Amazon Elasticsearch Service Domain" 104 | description: "Describes how to Control Access to Amazon Elasticsearch Service Domain" 105 | url: "https://aws.amazon.com/blogs/security/how-to-control-access-to-your-amazon-elasticsearch-service-domain/" 106 | - name: "elasticsearch_domain" 107 | description: "Terraform reference documentation for the `elasticsearch_domain` resource" 108 | url: "https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain.html" 109 | - name: "elasticsearch_domain_policy" 110 | description: "Terraform reference documentation for the `elasticsearch_domain_policy` resource" 111 | url: "https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain_policy.html" 112 | - name: "AWS IAM roles for service accounts" 113 | description: "Associate an IAM role with a Kubernetes service account" 114 | url: "https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html" 115 | 116 | # Contributors to this project 117 | contributors: [] 118 | -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | elasticsearch_enabled = module.this.enabled && var.aws_service_type == "elasticsearch" ? true : false 3 | opensearch_enabled = module.this.enabled && var.aws_service_type == "opensearch" ? true : false 4 | 5 | service_linked_role_name = local.elasticsearch_enabled ? "AWSServiceRoleForAmazonElasticsearchService" : "AWSServiceRoleForAmazonOpenSearchService" 6 | 7 | aws_service_domain_arn = module.this.enabled ? coalesce(join("", aws_elasticsearch_domain.default[*].arn), join("", aws_opensearch_domain.default[*].arn)) : null 8 | aws_service_domain_endpoint = module.this.enabled ? coalesce(join("", aws_elasticsearch_domain.default[*].endpoint), join("", aws_opensearch_domain.default[*].endpoint)) : null 9 | aws_service_domain_id = module.this.enabled ? coalesce(join("", aws_elasticsearch_domain.default[*].domain_id), join("", aws_opensearch_domain.default[*].domain_id)) : null 10 | aws_service_domain_name = module.this.enabled ? coalesce(join("", aws_elasticsearch_domain.default[*].domain_name), join("", aws_opensearch_domain.default[*].domain_name)) : null 11 | aws_service_domain_kibana_endpoint = module.this.enabled ? coalesce(join("", aws_elasticsearch_domain.default[*].kibana_endpoint), join("", aws_opensearch_domain.default[*].dashboard_endpoint)) : null 12 | } 13 | 14 | module "user_label" { 15 | source = "cloudposse/label/null" 16 | version = "0.25.0" 17 | 18 | attributes = ["user"] 19 | 20 | context = module.this.context 21 | } 22 | 23 | module "kibana_label" { 24 | source = "cloudposse/label/null" 25 | version = "0.25.0" 26 | 27 | attributes = ["kibana"] 28 | 29 | context = module.this.context 30 | } 31 | 32 | resource "aws_security_group" "default" { 33 | count = module.this.enabled && var.vpc_enabled && var.create_security_group ? 1 : 0 34 | vpc_id = var.vpc_id 35 | name = module.this.id 36 | description = "Allow inbound traffic from Security Groups and CIDRs. Allow all outbound traffic" 37 | tags = module.this.tags 38 | 39 | lifecycle { 40 | create_before_destroy = true 41 | } 42 | } 43 | 44 | resource "aws_security_group_rule" "ingress_security_groups" { 45 | count = module.this.enabled && var.vpc_enabled && var.create_security_group ? length(var.security_groups) : 0 46 | description = "Allow inbound traffic from Security Groups" 47 | type = "ingress" 48 | from_port = var.ingress_port_range_start 49 | to_port = var.ingress_port_range_end 50 | protocol = "tcp" 51 | source_security_group_id = var.security_groups[count.index] 52 | security_group_id = join("", aws_security_group.default[*].id) 53 | } 54 | 55 | resource "aws_security_group_rule" "ingress_cidr_blocks" { 56 | count = module.this.enabled && var.vpc_enabled && var.create_security_group && length(var.allowed_cidr_blocks) > 0 ? 1 : 0 57 | description = "Allow inbound traffic from CIDR blocks" 58 | type = "ingress" 59 | from_port = var.ingress_port_range_start 60 | to_port = var.ingress_port_range_end 61 | protocol = "tcp" 62 | cidr_blocks = var.allowed_cidr_blocks 63 | security_group_id = join("", aws_security_group.default[*].id) 64 | } 65 | 66 | resource "aws_security_group_rule" "egress" { 67 | count = module.this.enabled && var.vpc_enabled && var.create_security_group ? 1 : 0 68 | description = "Allow all egress traffic" 69 | type = "egress" 70 | from_port = 0 71 | to_port = 65535 72 | protocol = "tcp" 73 | cidr_blocks = ["0.0.0.0/0"] 74 | security_group_id = join("", aws_security_group.default[*].id) 75 | } 76 | 77 | # https://github.com/terraform-providers/terraform-provider-aws/issues/5218 78 | resource "aws_iam_service_linked_role" "default" { 79 | count = module.this.enabled && var.create_iam_service_linked_role ? 1 : 0 80 | aws_service_name = "es.amazonaws.com" 81 | description = "${local.service_linked_role_name} Service-Linked Role" 82 | } 83 | 84 | # Role that pods can assume for access to elasticsearch and kibana 85 | resource "aws_iam_role" "elasticsearch_user" { 86 | count = module.this.enabled && var.create_elasticsearch_user_role && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0) ? 1 : 0 87 | name = module.user_label.id 88 | assume_role_policy = join("", data.aws_iam_policy_document.assume_role[*].json) 89 | description = "IAM Role to assume to access the Elasticsearch ${module.this.id} cluster" 90 | tags = module.user_label.tags 91 | 92 | max_session_duration = var.iam_role_max_session_duration 93 | 94 | permissions_boundary = var.iam_role_permissions_boundary 95 | } 96 | 97 | data "aws_iam_policy_document" "assume_role" { 98 | count = module.this.enabled && var.create_elasticsearch_user_role && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0) ? 1 : 0 99 | 100 | statement { 101 | actions = [ 102 | "sts:AssumeRole" 103 | ] 104 | 105 | principals { 106 | type = "Service" 107 | identifiers = var.aws_ec2_service_name 108 | } 109 | 110 | effect = "Allow" 111 | } 112 | 113 | dynamic "statement" { 114 | for_each = length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0 ? [true] : [] 115 | 116 | content { 117 | effect = "Allow" 118 | 119 | actions = [ 120 | "sts:AssumeRole" 121 | ] 122 | 123 | principals { 124 | type = "AWS" 125 | identifiers = compact(concat(var.iam_authorizing_role_arns, var.iam_role_arns)) 126 | } 127 | } 128 | } 129 | 130 | dynamic "statement" { 131 | for_each = var.iam_irsa_openid_connect_provider_arn != "" ? [true] : [] 132 | content { 133 | effect = "Allow" 134 | 135 | actions = [ 136 | "sts:AssumeRoleWithWebIdentity" 137 | ] 138 | 139 | principals { 140 | type = "Federated" 141 | identifiers = [var.iam_irsa_openid_connect_provider_arn] 142 | } 143 | 144 | condition { 145 | test = "StringLike" 146 | variable = join(":", [var.iam_irsa_openid_connect_provider_url, "sub"]) 147 | values = compact(concat([var.iam_irsa_service_account], var.iam_irsa_service_accounts)) 148 | } 149 | } 150 | } 151 | } 152 | 153 | data "aws_iam_policy_document" "default" { 154 | count = module.this.enabled && (length(var.iam_authorizing_role_arns) > 0 || length(var.iam_role_arns) > 0) ? 1 : 0 155 | 156 | statement { 157 | sid = "User" 158 | 159 | effect = "Allow" 160 | 161 | actions = distinct(compact(var.iam_actions)) 162 | 163 | resources = [ 164 | local.aws_service_domain_arn, 165 | "${local.aws_service_domain_arn}/*" 166 | ] 167 | 168 | principals { 169 | type = "AWS" 170 | identifiers = distinct(compact(concat(var.iam_role_arns, aws_iam_role.elasticsearch_user[*].arn))) 171 | } 172 | } 173 | 174 | # This statement is for non VPC ES to allow anonymous access from whitelisted IP ranges without requests signing 175 | # https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html#es-ac-types-ip 176 | # https://aws.amazon.com/premiumsupport/knowledge-center/anonymous-not-authorized-elasticsearch/ 177 | dynamic "statement" { 178 | for_each = length(var.allowed_cidr_blocks) > 0 && !var.vpc_enabled ? [true] : [] 179 | content { 180 | sid = "Anonymous" 181 | 182 | effect = "Allow" 183 | 184 | actions = distinct(compact(var.anonymous_iam_actions)) 185 | 186 | resources = [ 187 | local.aws_service_domain_arn, 188 | "${local.aws_service_domain_arn}/*" 189 | ] 190 | 191 | principals { 192 | type = "AWS" 193 | identifiers = ["*"] 194 | } 195 | 196 | condition { 197 | test = "IpAddress" 198 | values = var.allowed_cidr_blocks 199 | variable = "aws:SourceIp" 200 | } 201 | } 202 | } 203 | } 204 | 205 | module "domain_hostname" { 206 | source = "cloudposse/route53-cluster-hostname/aws" 207 | version = "0.13.0" 208 | 209 | enabled = module.this.enabled && var.domain_hostname_enabled 210 | dns_name = var.elasticsearch_subdomain_name == "" ? module.this.id : var.elasticsearch_subdomain_name 211 | ttl = 60 212 | zone_id = var.dns_zone_id 213 | records = [local.aws_service_domain_endpoint] 214 | 215 | context = module.this.context 216 | } 217 | 218 | module "kibana_hostname" { 219 | source = "cloudposse/route53-cluster-hostname/aws" 220 | version = "0.13.0" 221 | 222 | enabled = module.this.enabled && var.kibana_hostname_enabled 223 | dns_name = var.kibana_subdomain_name == "" ? module.kibana_label.id : var.kibana_subdomain_name 224 | ttl = 60 225 | zone_id = var.dns_zone_id 226 | # Note: kibana_endpoint is not just a domain name, it includes a path component, 227 | # and as such is not suitable for a DNS record. The plain endpoint is the 228 | # hostname portion and should be used for DNS. 229 | records = [local.aws_service_domain_endpoint] 230 | 231 | context = module.this.context 232 | } 233 | -------------------------------------------------------------------------------- /context.tf: -------------------------------------------------------------------------------- 1 | # 2 | # ONLY EDIT THIS FILE IN github.com/cloudposse/terraform-null-label 3 | # All other instances of this file should be a copy of that one 4 | # 5 | # 6 | # Copy this file from https://github.com/cloudposse/terraform-null-label/blob/master/exports/context.tf 7 | # and then place it in your Terraform module to automatically get 8 | # Cloud Posse's standard configuration inputs suitable for passing 9 | # to Cloud Posse modules. 10 | # 11 | # curl -sL https://raw.githubusercontent.com/cloudposse/terraform-null-label/master/exports/context.tf -o context.tf 12 | # 13 | # Modules should access the whole context as `module.this.context` 14 | # to get the input variables with nulls for defaults, 15 | # for example `context = module.this.context`, 16 | # and access individual variables as `module.this.`, 17 | # with final values filled in. 18 | # 19 | # For example, when using defaults, `module.this.context.delimiter` 20 | # will be null, and `module.this.delimiter` will be `-` (hyphen). 21 | # 22 | 23 | module "this" { 24 | source = "cloudposse/label/null" 25 | version = "0.25.0" # requires Terraform >= 0.13.0 26 | 27 | enabled = var.enabled 28 | namespace = var.namespace 29 | tenant = var.tenant 30 | environment = var.environment 31 | stage = var.stage 32 | name = var.name 33 | delimiter = var.delimiter 34 | attributes = var.attributes 35 | tags = var.tags 36 | additional_tag_map = var.additional_tag_map 37 | label_order = var.label_order 38 | regex_replace_chars = var.regex_replace_chars 39 | id_length_limit = var.id_length_limit 40 | label_key_case = var.label_key_case 41 | label_value_case = var.label_value_case 42 | descriptor_formats = var.descriptor_formats 43 | labels_as_tags = var.labels_as_tags 44 | 45 | context = var.context 46 | } 47 | 48 | # Copy contents of cloudposse/terraform-null-label/variables.tf here 49 | 50 | variable "context" { 51 | type = any 52 | default = { 53 | enabled = true 54 | namespace = null 55 | tenant = null 56 | environment = null 57 | stage = null 58 | name = null 59 | delimiter = null 60 | attributes = [] 61 | tags = {} 62 | additional_tag_map = {} 63 | regex_replace_chars = null 64 | label_order = [] 65 | id_length_limit = null 66 | label_key_case = null 67 | label_value_case = null 68 | descriptor_formats = {} 69 | # Note: we have to use [] instead of null for unset lists due to 70 | # https://github.com/hashicorp/terraform/issues/28137 71 | # which was not fixed until Terraform 1.0.0, 72 | # but we want the default to be all the labels in `label_order` 73 | # and we want users to be able to prevent all tag generation 74 | # by setting `labels_as_tags` to `[]`, so we need 75 | # a different sentinel to indicate "default" 76 | labels_as_tags = ["unset"] 77 | } 78 | description = <<-EOT 79 | Single object for setting entire context at once. 80 | See description of individual variables for details. 81 | Leave string and numeric variables as `null` to use default value. 82 | Individual variable settings (non-null) override settings in context object, 83 | except for attributes, tags, and additional_tag_map, which are merged. 84 | EOT 85 | 86 | validation { 87 | condition = lookup(var.context, "label_key_case", null) == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"]) 88 | error_message = "Allowed values: `lower`, `title`, `upper`." 89 | } 90 | 91 | validation { 92 | condition = lookup(var.context, "label_value_case", null) == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"]) 93 | error_message = "Allowed values: `lower`, `title`, `upper`, `none`." 94 | } 95 | } 96 | 97 | variable "enabled" { 98 | type = bool 99 | default = null 100 | description = "Set to false to prevent the module from creating any resources" 101 | } 102 | 103 | variable "namespace" { 104 | type = string 105 | default = null 106 | description = "ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique" 107 | } 108 | 109 | variable "tenant" { 110 | type = string 111 | default = null 112 | description = "ID element _(Rarely used, not included by default)_. A customer identifier, indicating who this instance of a resource is for" 113 | } 114 | 115 | variable "environment" { 116 | type = string 117 | default = null 118 | description = "ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT'" 119 | } 120 | 121 | variable "stage" { 122 | type = string 123 | default = null 124 | description = "ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release'" 125 | } 126 | 127 | variable "name" { 128 | type = string 129 | default = null 130 | description = <<-EOT 131 | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. 132 | This is the only ID element not also included as a `tag`. 133 | The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. 134 | EOT 135 | } 136 | 137 | variable "delimiter" { 138 | type = string 139 | default = null 140 | description = <<-EOT 141 | Delimiter to be used between ID elements. 142 | Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. 143 | EOT 144 | } 145 | 146 | variable "attributes" { 147 | type = list(string) 148 | default = [] 149 | description = <<-EOT 150 | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, 151 | in the order they appear in the list. New attributes are appended to the 152 | end of the list. The elements of the list are joined by the `delimiter` 153 | and treated as a single ID element. 154 | EOT 155 | } 156 | 157 | variable "labels_as_tags" { 158 | type = set(string) 159 | default = ["default"] 160 | description = <<-EOT 161 | Set of labels (ID elements) to include as tags in the `tags` output. 162 | Default is to include all labels. 163 | Tags with empty values will not be included in the `tags` output. 164 | Set to `[]` to suppress all generated tags. 165 | **Notes:** 166 | The value of the `name` tag, if included, will be the `id`, not the `name`. 167 | Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be 168 | changed in later chained modules. Attempts to change it will be silently ignored. 169 | EOT 170 | } 171 | 172 | variable "tags" { 173 | type = map(string) 174 | default = {} 175 | description = <<-EOT 176 | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`). 177 | Neither the tag keys nor the tag values will be modified by this module. 178 | EOT 179 | } 180 | 181 | variable "additional_tag_map" { 182 | type = map(string) 183 | default = {} 184 | description = <<-EOT 185 | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`. 186 | This is for some rare cases where resources want additional configuration of tags 187 | and therefore take a list of maps with tag key, value, and additional configuration. 188 | EOT 189 | } 190 | 191 | variable "label_order" { 192 | type = list(string) 193 | default = null 194 | description = <<-EOT 195 | The order in which the labels (ID elements) appear in the `id`. 196 | Defaults to ["namespace", "environment", "stage", "name", "attributes"]. 197 | You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. 198 | EOT 199 | } 200 | 201 | variable "regex_replace_chars" { 202 | type = string 203 | default = null 204 | description = <<-EOT 205 | Terraform regular expression (regex) string. 206 | Characters matching the regex will be removed from the ID elements. 207 | If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. 208 | EOT 209 | } 210 | 211 | variable "id_length_limit" { 212 | type = number 213 | default = null 214 | description = <<-EOT 215 | Limit `id` to this many characters (minimum 6). 216 | Set to `0` for unlimited length. 217 | Set to `null` for keep the existing setting, which defaults to `0`. 218 | Does not affect `id_full`. 219 | EOT 220 | validation { 221 | condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0 222 | error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length." 223 | } 224 | } 225 | 226 | variable "label_key_case" { 227 | type = string 228 | default = null 229 | description = <<-EOT 230 | Controls the letter case of the `tags` keys (label names) for tags generated by this module. 231 | Does not affect keys of tags passed in via the `tags` input. 232 | Possible values: `lower`, `title`, `upper`. 233 | Default value: `title`. 234 | EOT 235 | 236 | validation { 237 | condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case) 238 | error_message = "Allowed values: `lower`, `title`, `upper`." 239 | } 240 | } 241 | 242 | variable "label_value_case" { 243 | type = string 244 | default = null 245 | description = <<-EOT 246 | Controls the letter case of ID elements (labels) as included in `id`, 247 | set as tag values, and output by this module individually. 248 | Does not affect values of tags passed in via the `tags` input. 249 | Possible values: `lower`, `title`, `upper` and `none` (no transformation). 250 | Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs. 251 | Default value: `lower`. 252 | EOT 253 | 254 | validation { 255 | condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case) 256 | error_message = "Allowed values: `lower`, `title`, `upper`, `none`." 257 | } 258 | } 259 | 260 | variable "descriptor_formats" { 261 | type = any 262 | default = {} 263 | description = <<-EOT 264 | Describe additional descriptors to be output in the `descriptors` output map. 265 | Map of maps. Keys are names of descriptors. Values are maps of the form 266 | `{ 267 | format = string 268 | labels = list(string) 269 | }` 270 | (Type is `any` so the map values can later be enhanced to provide additional options.) 271 | `format` is a Terraform format string to be passed to the `format()` function. 272 | `labels` is a list of labels, in order, to pass to `format()` function. 273 | Label values will be normalized before being passed to `format()` so they will be 274 | identical to how they appear in `id`. 275 | Default is `{}` (`descriptors` output will be empty). 276 | EOT 277 | } 278 | 279 | #### End of copy of cloudposse/terraform-null-label/variables.tf 280 | -------------------------------------------------------------------------------- /examples/complete/context.tf: -------------------------------------------------------------------------------- 1 | # 2 | # ONLY EDIT THIS FILE IN github.com/cloudposse/terraform-null-label 3 | # All other instances of this file should be a copy of that one 4 | # 5 | # 6 | # Copy this file from https://github.com/cloudposse/terraform-null-label/blob/master/exports/context.tf 7 | # and then place it in your Terraform module to automatically get 8 | # Cloud Posse's standard configuration inputs suitable for passing 9 | # to Cloud Posse modules. 10 | # 11 | # curl -sL https://raw.githubusercontent.com/cloudposse/terraform-null-label/master/exports/context.tf -o context.tf 12 | # 13 | # Modules should access the whole context as `module.this.context` 14 | # to get the input variables with nulls for defaults, 15 | # for example `context = module.this.context`, 16 | # and access individual variables as `module.this.`, 17 | # with final values filled in. 18 | # 19 | # For example, when using defaults, `module.this.context.delimiter` 20 | # will be null, and `module.this.delimiter` will be `-` (hyphen). 21 | # 22 | 23 | module "this" { 24 | source = "cloudposse/label/null" 25 | version = "0.25.0" # requires Terraform >= 0.13.0 26 | 27 | enabled = var.enabled 28 | namespace = var.namespace 29 | tenant = var.tenant 30 | environment = var.environment 31 | stage = var.stage 32 | name = var.name 33 | delimiter = var.delimiter 34 | attributes = var.attributes 35 | tags = var.tags 36 | additional_tag_map = var.additional_tag_map 37 | label_order = var.label_order 38 | regex_replace_chars = var.regex_replace_chars 39 | id_length_limit = var.id_length_limit 40 | label_key_case = var.label_key_case 41 | label_value_case = var.label_value_case 42 | descriptor_formats = var.descriptor_formats 43 | labels_as_tags = var.labels_as_tags 44 | 45 | context = var.context 46 | } 47 | 48 | # Copy contents of cloudposse/terraform-null-label/variables.tf here 49 | 50 | variable "context" { 51 | type = any 52 | default = { 53 | enabled = true 54 | namespace = null 55 | tenant = null 56 | environment = null 57 | stage = null 58 | name = null 59 | delimiter = null 60 | attributes = [] 61 | tags = {} 62 | additional_tag_map = {} 63 | regex_replace_chars = null 64 | label_order = [] 65 | id_length_limit = null 66 | label_key_case = null 67 | label_value_case = null 68 | descriptor_formats = {} 69 | # Note: we have to use [] instead of null for unset lists due to 70 | # https://github.com/hashicorp/terraform/issues/28137 71 | # which was not fixed until Terraform 1.0.0, 72 | # but we want the default to be all the labels in `label_order` 73 | # and we want users to be able to prevent all tag generation 74 | # by setting `labels_as_tags` to `[]`, so we need 75 | # a different sentinel to indicate "default" 76 | labels_as_tags = ["unset"] 77 | } 78 | description = <<-EOT 79 | Single object for setting entire context at once. 80 | See description of individual variables for details. 81 | Leave string and numeric variables as `null` to use default value. 82 | Individual variable settings (non-null) override settings in context object, 83 | except for attributes, tags, and additional_tag_map, which are merged. 84 | EOT 85 | 86 | validation { 87 | condition = lookup(var.context, "label_key_case", null) == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"]) 88 | error_message = "Allowed values: `lower`, `title`, `upper`." 89 | } 90 | 91 | validation { 92 | condition = lookup(var.context, "label_value_case", null) == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"]) 93 | error_message = "Allowed values: `lower`, `title`, `upper`, `none`." 94 | } 95 | } 96 | 97 | variable "enabled" { 98 | type = bool 99 | default = null 100 | description = "Set to false to prevent the module from creating any resources" 101 | } 102 | 103 | variable "namespace" { 104 | type = string 105 | default = null 106 | description = "ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique" 107 | } 108 | 109 | variable "tenant" { 110 | type = string 111 | default = null 112 | description = "ID element _(Rarely used, not included by default)_. A customer identifier, indicating who this instance of a resource is for" 113 | } 114 | 115 | variable "environment" { 116 | type = string 117 | default = null 118 | description = "ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT'" 119 | } 120 | 121 | variable "stage" { 122 | type = string 123 | default = null 124 | description = "ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release'" 125 | } 126 | 127 | variable "name" { 128 | type = string 129 | default = null 130 | description = <<-EOT 131 | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. 132 | This is the only ID element not also included as a `tag`. 133 | The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. 134 | EOT 135 | } 136 | 137 | variable "delimiter" { 138 | type = string 139 | default = null 140 | description = <<-EOT 141 | Delimiter to be used between ID elements. 142 | Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. 143 | EOT 144 | } 145 | 146 | variable "attributes" { 147 | type = list(string) 148 | default = [] 149 | description = <<-EOT 150 | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, 151 | in the order they appear in the list. New attributes are appended to the 152 | end of the list. The elements of the list are joined by the `delimiter` 153 | and treated as a single ID element. 154 | EOT 155 | } 156 | 157 | variable "labels_as_tags" { 158 | type = set(string) 159 | default = ["default"] 160 | description = <<-EOT 161 | Set of labels (ID elements) to include as tags in the `tags` output. 162 | Default is to include all labels. 163 | Tags with empty values will not be included in the `tags` output. 164 | Set to `[]` to suppress all generated tags. 165 | **Notes:** 166 | The value of the `name` tag, if included, will be the `id`, not the `name`. 167 | Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be 168 | changed in later chained modules. Attempts to change it will be silently ignored. 169 | EOT 170 | } 171 | 172 | variable "tags" { 173 | type = map(string) 174 | default = {} 175 | description = <<-EOT 176 | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`). 177 | Neither the tag keys nor the tag values will be modified by this module. 178 | EOT 179 | } 180 | 181 | variable "additional_tag_map" { 182 | type = map(string) 183 | default = {} 184 | description = <<-EOT 185 | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`. 186 | This is for some rare cases where resources want additional configuration of tags 187 | and therefore take a list of maps with tag key, value, and additional configuration. 188 | EOT 189 | } 190 | 191 | variable "label_order" { 192 | type = list(string) 193 | default = null 194 | description = <<-EOT 195 | The order in which the labels (ID elements) appear in the `id`. 196 | Defaults to ["namespace", "environment", "stage", "name", "attributes"]. 197 | You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. 198 | EOT 199 | } 200 | 201 | variable "regex_replace_chars" { 202 | type = string 203 | default = null 204 | description = <<-EOT 205 | Terraform regular expression (regex) string. 206 | Characters matching the regex will be removed from the ID elements. 207 | If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. 208 | EOT 209 | } 210 | 211 | variable "id_length_limit" { 212 | type = number 213 | default = null 214 | description = <<-EOT 215 | Limit `id` to this many characters (minimum 6). 216 | Set to `0` for unlimited length. 217 | Set to `null` for keep the existing setting, which defaults to `0`. 218 | Does not affect `id_full`. 219 | EOT 220 | validation { 221 | condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0 222 | error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length." 223 | } 224 | } 225 | 226 | variable "label_key_case" { 227 | type = string 228 | default = null 229 | description = <<-EOT 230 | Controls the letter case of the `tags` keys (label names) for tags generated by this module. 231 | Does not affect keys of tags passed in via the `tags` input. 232 | Possible values: `lower`, `title`, `upper`. 233 | Default value: `title`. 234 | EOT 235 | 236 | validation { 237 | condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case) 238 | error_message = "Allowed values: `lower`, `title`, `upper`." 239 | } 240 | } 241 | 242 | variable "label_value_case" { 243 | type = string 244 | default = null 245 | description = <<-EOT 246 | Controls the letter case of ID elements (labels) as included in `id`, 247 | set as tag values, and output by this module individually. 248 | Does not affect values of tags passed in via the `tags` input. 249 | Possible values: `lower`, `title`, `upper` and `none` (no transformation). 250 | Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs. 251 | Default value: `lower`. 252 | EOT 253 | 254 | validation { 255 | condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case) 256 | error_message = "Allowed values: `lower`, `title`, `upper`, `none`." 257 | } 258 | } 259 | 260 | variable "descriptor_formats" { 261 | type = any 262 | default = {} 263 | description = <<-EOT 264 | Describe additional descriptors to be output in the `descriptors` output map. 265 | Map of maps. Keys are names of descriptors. Values are maps of the form 266 | `{ 267 | format = string 268 | labels = list(string) 269 | }` 270 | (Type is `any` so the map values can later be enhanced to provide additional options.) 271 | `format` is a Terraform format string to be passed to the `format()` function. 272 | `labels` is a list of labels, in order, to pass to `format()` function. 273 | Label values will be normalized before being passed to `format()` so they will be 274 | identical to how they appear in `id`. 275 | Default is `{}` (`descriptors` output will be empty). 276 | EOT 277 | } 278 | 279 | #### End of copy of cloudposse/terraform-null-label/variables.tf 280 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2018-2020 Cloud Posse, LLC 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /variables.tf: -------------------------------------------------------------------------------- 1 | variable "security_groups" { 2 | type = list(string) 3 | default = [] 4 | description = "List of security group IDs to be allowed to connect to the cluster or the security group IDs to apply to the cluster when the `create_security_group` variable is set to false." 5 | } 6 | 7 | variable "create_security_group" { 8 | type = bool 9 | default = true 10 | description = "Whether to create a dedicated security group for the Elasticsearch domain. Set it to `false` if you already have security groups that you want to attach to the domain and specify them in the `security_groups` variable." 11 | } 12 | 13 | variable "create_elasticsearch_user_role" { 14 | type = bool 15 | default = true 16 | description = "Whether to create an IAM role for Users/EC2 to assume to access the Elasticsearch domain. Set it to `false` if you already manage access through other means." 17 | } 18 | 19 | variable "ingress_port_range_start" { 20 | type = number 21 | default = 0 22 | description = "Start number for allowed port range. (e.g. `443`)" 23 | } 24 | 25 | variable "ingress_port_range_end" { 26 | type = number 27 | default = 65535 28 | description = "End number for allowed port range. (e.g. `443`)" 29 | } 30 | 31 | variable "allowed_cidr_blocks" { 32 | type = list(string) 33 | default = [] 34 | description = "List of CIDR blocks to be allowed to connect to the cluster" 35 | } 36 | 37 | variable "vpc_enabled" { 38 | type = bool 39 | description = "Set to false if ES should be deployed outside of VPC." 40 | default = true 41 | } 42 | 43 | variable "vpc_id" { 44 | type = string 45 | description = "VPC ID" 46 | default = null 47 | } 48 | 49 | variable "subnet_ids" { 50 | type = list(string) 51 | description = "VPC Subnet IDs" 52 | default = [] 53 | } 54 | 55 | variable "dns_zone_id" { 56 | type = string 57 | default = "" 58 | description = "Route53 DNS Zone ID to add hostname records for Elasticsearch domain and Kibana" 59 | } 60 | 61 | variable "elasticsearch_version" { 62 | type = string 63 | default = "7.10" 64 | description = "Version of Elasticsearch to deploy (_e.g._ `7.4`, `7.1`, `6.8`, `6.7`, `6.5`, `6.4`, `6.3`, `6.2`, `6.0`, `5.6`, `5.5`, `5.3`, `5.1`, `2.3`, `1.5`" 65 | } 66 | 67 | variable "instance_type" { 68 | type = string 69 | default = "t2.small.elasticsearch" 70 | description = "Elasticsearch instance type for data nodes in the cluster" 71 | } 72 | 73 | variable "instance_count" { 74 | type = number 75 | description = "Number of data nodes in the cluster" 76 | default = 4 77 | } 78 | 79 | variable "warm_enabled" { 80 | type = bool 81 | default = false 82 | description = "Whether AWS UltraWarm is enabled" 83 | } 84 | 85 | variable "warm_count" { 86 | type = number 87 | default = 2 88 | description = "Number of UltraWarm nodes" 89 | } 90 | 91 | variable "warm_type" { 92 | type = string 93 | default = "ultrawarm1.medium.elasticsearch" 94 | description = "Type of UltraWarm nodes" 95 | } 96 | 97 | variable "iam_role_arns" { 98 | type = list(string) 99 | default = [] 100 | description = "List of IAM role ARNs to permit access to the Elasticsearch domain" 101 | } 102 | 103 | variable "iam_role_permissions_boundary" { 104 | type = string 105 | default = null 106 | description = "The ARN of the permissions boundary policy which will be attached to the Elasticsearch user role" 107 | } 108 | 109 | variable "iam_authorizing_role_arns" { 110 | type = list(string) 111 | default = [] 112 | description = "List of IAM role ARNs to permit to assume the Elasticsearch user role" 113 | } 114 | 115 | variable "iam_actions" { 116 | type = list(string) 117 | default = [] 118 | description = "List of actions to allow for the user IAM roles, _e.g._ `es:ESHttpGet`, `es:ESHttpPut`, `es:ESHttpPost`" 119 | } 120 | 121 | variable "anonymous_iam_actions" { 122 | type = list(string) 123 | default = [] 124 | description = "List of actions to allow for the anonymous (`*`) IAM roles, _e.g._ `es:ESHttpGet`, `es:ESHttpPut`, `es:ESHttpPost`" 125 | } 126 | 127 | variable "iam_irsa_openid_connect_provider_arn" { 128 | type = string 129 | default = "" 130 | description = "ARN of the OpenID connect provider to allow usage of IRSA" 131 | } 132 | 133 | variable "iam_irsa_openid_connect_provider_url" { 134 | type = string 135 | default = "" 136 | description = "URL of the OpenID connect provider to allow usage of IRSA" 137 | } 138 | 139 | variable "iam_irsa_service_account" { 140 | type = string 141 | default = "system:serviceaccount:default:*" 142 | description = "Kubernetes ServiceAccount to allow to access the Elastic Domain via IRSA" 143 | } 144 | 145 | variable "iam_irsa_service_accounts" { 146 | type = list(string) 147 | default = [] 148 | description = "Kubernetes ServiceAccounts to allow to access the Elastic Domain via IRSA" 149 | } 150 | 151 | variable "zone_awareness_enabled" { 152 | type = bool 153 | default = true 154 | description = "Enable zone awareness for Elasticsearch cluster" 155 | } 156 | 157 | variable "availability_zone_count" { 158 | type = number 159 | default = 2 160 | description = "Number of Availability Zones for the domain to use." 161 | 162 | validation { 163 | condition = contains([2, 3], var.availability_zone_count) 164 | error_message = "The availability zone count must be 2 or 3." 165 | } 166 | } 167 | 168 | variable "multi_az_with_standby_enabled" { 169 | type = bool 170 | default = false 171 | description = "Enable domain with standby for OpenSearch cluster" 172 | } 173 | 174 | variable "ebs_volume_size" { 175 | type = number 176 | description = "EBS volumes for data storage in GB" 177 | default = 0 178 | } 179 | 180 | variable "ebs_volume_type" { 181 | type = string 182 | default = "gp2" 183 | description = "Storage type of EBS volumes" 184 | } 185 | 186 | variable "ebs_iops" { 187 | type = number 188 | default = 0 189 | description = "The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type" 190 | } 191 | 192 | variable "ebs_throughput" { 193 | type = number 194 | default = null 195 | description = "Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. Valid values are between 125 and 1000." 196 | } 197 | 198 | variable "encrypt_at_rest_enabled" { 199 | type = bool 200 | default = true 201 | description = "Whether to enable encryption at rest" 202 | } 203 | 204 | variable "encrypt_at_rest_kms_key_id" { 205 | type = string 206 | default = "" 207 | description = "The KMS key ID to encrypt the Elasticsearch domain with. If not specified, then it defaults to using the AWS/Elasticsearch service KMS key" 208 | } 209 | 210 | variable "domain_endpoint_options_enforce_https" { 211 | type = bool 212 | default = true 213 | description = "Whether or not to require HTTPS" 214 | } 215 | 216 | variable "domain_endpoint_options_tls_security_policy" { 217 | type = string 218 | default = "Policy-Min-TLS-1-2-2019-07" 219 | description = "The name of the TLS security policy that needs to be applied to the HTTPS endpoint" 220 | } 221 | 222 | 223 | variable "log_publishing_index_enabled" { 224 | type = bool 225 | default = false 226 | description = "Specifies whether log publishing option for INDEX_SLOW_LOGS is enabled or not" 227 | } 228 | 229 | variable "log_publishing_search_enabled" { 230 | type = bool 231 | default = false 232 | description = "Specifies whether log publishing option for SEARCH_SLOW_LOGS is enabled or not" 233 | } 234 | 235 | variable "log_publishing_audit_enabled" { 236 | type = bool 237 | default = false 238 | description = "Specifies whether log publishing option for AUDIT_LOGS is enabled or not" 239 | } 240 | 241 | variable "log_publishing_application_enabled" { 242 | type = bool 243 | default = false 244 | description = "Specifies whether log publishing option for ES_APPLICATION_LOGS is enabled or not" 245 | } 246 | 247 | variable "log_publishing_index_cloudwatch_log_group_arn" { 248 | type = string 249 | default = "" 250 | description = "ARN of the CloudWatch log group to which log for INDEX_SLOW_LOGS needs to be published" 251 | } 252 | 253 | variable "log_publishing_search_cloudwatch_log_group_arn" { 254 | type = string 255 | default = "" 256 | description = "ARN of the CloudWatch log group to which log for SEARCH_SLOW_LOGS needs to be published" 257 | } 258 | 259 | variable "log_publishing_audit_cloudwatch_log_group_arn" { 260 | type = string 261 | default = "" 262 | description = "ARN of the CloudWatch log group to which log for AUDIT_LOGS needs to be published" 263 | } 264 | 265 | variable "log_publishing_application_cloudwatch_log_group_arn" { 266 | type = string 267 | default = "" 268 | description = "ARN of the CloudWatch log group to which log for ES_APPLICATION_LOGS needs to be published" 269 | } 270 | 271 | variable "automated_snapshot_start_hour" { 272 | type = number 273 | description = "Hour at which automated snapshots are taken, in UTC" 274 | default = 0 275 | } 276 | 277 | variable "dedicated_master_enabled" { 278 | type = bool 279 | default = false 280 | description = "Indicates whether dedicated master nodes are enabled for the cluster" 281 | } 282 | 283 | variable "dedicated_master_count" { 284 | type = number 285 | description = "Number of dedicated master nodes in the cluster" 286 | default = 0 287 | } 288 | 289 | variable "dedicated_master_type" { 290 | type = string 291 | default = "t2.small.elasticsearch" 292 | description = "Instance type of the dedicated master nodes in the cluster" 293 | } 294 | 295 | variable "advanced_options" { 296 | type = map(string) 297 | default = {} 298 | description = "Key-value string pairs to specify advanced configuration options" 299 | } 300 | 301 | variable "elasticsearch_domain_name" { 302 | type = string 303 | default = "" 304 | description = "The name of the Elasticsearch domain. Must be at least 3 and no more than 28 characters long. Valid characters are a-z (lowercase letters), 0-9, and - (hyphen)." 305 | 306 | validation { 307 | condition = var.elasticsearch_domain_name == "" || (length(var.elasticsearch_domain_name) >= 3 && length(var.elasticsearch_domain_name) <= 28) 308 | error_message = "The elasticsearch_domain_name must meet following conditions: 1) be empty string or 2) must start with a lowercase alphabet and be at least 3 and no more than 28 characters long. Valid characters are a-z (lowercase letters), 0-9, and - (hyphen)." 309 | } 310 | 311 | validation { 312 | condition = var.elasticsearch_domain_name == "" || can(regex("^[a-z][a-z0-9-]*$", var.elasticsearch_domain_name)) 313 | error_message = "The elasticsearch_domain_name must meet following conditions: 1) be empty string or 2) must start with a lowercase alphabet and be at least 3 and no more than 28 characters long. Valid characters are a-z (lowercase letters), 0-9, and - (hyphen)." 314 | } 315 | } 316 | 317 | variable "elasticsearch_subdomain_name" { 318 | type = string 319 | default = "" 320 | description = "The name of the subdomain for Elasticsearch in the DNS zone (_e.g._ `elasticsearch`, `ui`, `ui-es`, `search-ui`)" 321 | } 322 | 323 | variable "kibana_subdomain_name" { 324 | type = string 325 | default = "" 326 | description = "The name of the subdomain for Kibana in the DNS zone (_e.g._ `kibana`, `ui`, `ui-es`, `search-ui`, `kibana.elasticsearch`)" 327 | } 328 | 329 | variable "create_iam_service_linked_role" { 330 | type = bool 331 | default = true 332 | description = "Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info" 333 | } 334 | 335 | variable "node_to_node_encryption_enabled" { 336 | type = bool 337 | default = false 338 | description = "Whether to enable node-to-node encryption" 339 | } 340 | 341 | variable "iam_role_max_session_duration" { 342 | type = number 343 | default = 3600 344 | description = "The maximum session duration (in seconds) for the user role. Can have a value from 1 hour to 12 hours" 345 | } 346 | 347 | variable "cognito_authentication_enabled" { 348 | type = bool 349 | default = false 350 | description = "Whether to enable Amazon Cognito authentication with Kibana" 351 | } 352 | 353 | variable "cognito_user_pool_id" { 354 | type = string 355 | default = "" 356 | description = "The ID of the Cognito User Pool to use" 357 | } 358 | 359 | variable "cognito_identity_pool_id" { 360 | type = string 361 | default = "" 362 | description = "The ID of the Cognito Identity Pool to use" 363 | } 364 | 365 | variable "cognito_iam_role_arn" { 366 | type = string 367 | default = "" 368 | description = "ARN of the IAM role that has the AmazonESCognitoAccess policy attached" 369 | } 370 | 371 | variable "aws_ec2_service_name" { 372 | type = list(string) 373 | default = ["ec2.amazonaws.com"] 374 | description = "AWS EC2 Service Name" 375 | } 376 | 377 | variable "domain_hostname_enabled" { 378 | type = bool 379 | description = "Explicit flag to enable creating a DNS hostname for ES. If `true`, then `var.dns_zone_id` is required." 380 | default = false 381 | } 382 | 383 | variable "kibana_hostname_enabled" { 384 | type = bool 385 | description = "Explicit flag to enable creating a DNS hostname for Kibana. If `true`, then `var.dns_zone_id` is required." 386 | default = false 387 | } 388 | 389 | variable "advanced_security_options_enabled" { 390 | type = bool 391 | default = false 392 | description = "AWS Elasticsearch Kibana enchanced security plugin enabling (forces new resource)" 393 | } 394 | 395 | variable "advanced_security_options_internal_user_database_enabled" { 396 | type = bool 397 | default = false 398 | description = "Whether to enable or not internal Kibana user database for ELK OpenDistro security plugin" 399 | } 400 | 401 | variable "advanced_security_options_master_user_arn" { 402 | type = string 403 | default = "" 404 | description = "ARN of IAM user who is to be mapped to be Kibana master user (applicable if advanced_security_options_internal_user_database_enabled set to false)" 405 | } 406 | 407 | variable "advanced_security_options_master_user_name" { 408 | type = string 409 | default = "" 410 | description = "Master user username (applicable if advanced_security_options_internal_user_database_enabled set to true)" 411 | } 412 | 413 | variable "advanced_security_options_master_user_password" { 414 | type = string 415 | default = "" 416 | description = "Master user password (applicable if advanced_security_options_internal_user_database_enabled set to true)" 417 | } 418 | 419 | variable "custom_endpoint_enabled" { 420 | type = bool 421 | description = "Whether to enable custom endpoint for the Elasticsearch domain." 422 | default = false 423 | } 424 | 425 | variable "custom_endpoint" { 426 | type = string 427 | description = "Fully qualified domain for custom endpoint." 428 | default = "" 429 | } 430 | 431 | variable "custom_endpoint_certificate_arn" { 432 | type = string 433 | description = "ACM certificate ARN for custom endpoint." 434 | default = "" 435 | } 436 | 437 | variable "aws_service_type" { 438 | type = string 439 | description = "The type of AWS service to deploy (`elasticsearch` or `opensearch`)." 440 | # For backwards comptibility we default to elasticsearch 441 | default = "elasticsearch" 442 | 443 | validation { 444 | condition = contains(["elasticsearch", "opensearch"], var.aws_service_type) 445 | error_message = "Value can only be one of `elasticsearch` or `opensearch`." 446 | } 447 | } 448 | 449 | variable "cold_storage_enabled" { 450 | type = bool 451 | description = "Enables cold storage support." 452 | default = false 453 | } 454 | 455 | variable "auto_tune" { 456 | type = object({ 457 | enabled = bool 458 | rollback_on_disable = string 459 | starting_time = string 460 | cron_schedule = string 461 | duration = number 462 | }) 463 | 464 | default = { 465 | enabled = false 466 | rollback_on_disable = "NO_ROLLBACK" 467 | starting_time = null 468 | cron_schedule = null 469 | duration = null 470 | } 471 | 472 | description = <<-EOT 473 | This object represents the auto_tune configuration. It contains the following filed: 474 | - enabled - Whether to enable autotune. 475 | - rollback_on_disable - Whether to roll back to default Auto-Tune settings when disabling Auto-Tune. 476 | - starting_time - Date and time at which to start the Auto-Tune maintenance schedule in RFC3339 format. Time should be in the future. 477 | - cron_schedule - A cron expression specifying the recurrence pattern for an Auto-Tune maintenance schedule. 478 | - duration - Autotune maintanance window duration time in hours. 479 | EOT 480 | 481 | validation { 482 | condition = var.auto_tune.enabled == false || var.auto_tune.cron_schedule != null 483 | error_message = "Variable auto_tune.cron_schedule should be set if var.auto_tune.enabled == true." 484 | } 485 | 486 | validation { 487 | condition = var.auto_tune.enabled == false || var.auto_tune.duration != null 488 | error_message = "Variable auto_tune.duration should be set if var.auto_tune.enabled == true." 489 | } 490 | 491 | validation { 492 | condition = contains(["DEFAULT_ROLLBACK", "NO_ROLLBACK"], var.auto_tune.rollback_on_disable) 493 | error_message = "Variable auto_tune.rollback_on_disable valid values: DEFAULT_ROLLBACK or NO_ROLLBACK." 494 | } 495 | } 496 | 497 | variable "advanced_security_options_anonymous_auth_enabled" { 498 | type = bool 499 | default = false 500 | description = "Whether Anonymous auth is enabled. Enables fine-grained access control on an existing domain" 501 | } 502 | 503 | variable "access_policies" { 504 | description = "JSON string for the IAM policy document specifying the access policies for the domain." 505 | type = string 506 | default = "" 507 | validation { 508 | condition = var.access_policies == "" || try(jsondecode(var.access_policies), null) != null 509 | error_message = "The access_policies JSON string is not valid." 510 | } 511 | } 512 | -------------------------------------------------------------------------------- /examples/docs/terraform.md: -------------------------------------------------------------------------------- 1 | 2 | ## Requirements 3 | 4 | | Name | Version | 5 | |------|---------| 6 | | terraform | >= 0.12.0 | 7 | | aws | >= 2.0 | 8 | | null | >= 2.0 | 9 | | template | >= 2.0 | 10 | 11 | ## Providers 12 | 13 | | Name | Version | 14 | |------|---------| 15 | | aws | >= 2.0 | 16 | 17 | ## Inputs 18 | 19 | | Name | Description | Type | Default | Required | 20 | |------|-------------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:| 21 | | additional\_tag\_map | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no | 22 | | advanced\_options | Key-value string pairs to specify advanced configuration options | `map(string)` | `{}` | no | 23 | | advanced\_security\_options\_enabled | AWS Elasticsearch Kibana enchanced security plugin enabling (forces new resource) | `bool` | `false` | no | 24 | | advanced\_security\_options\_internal\_user\_database\_enabled | Whether to enable or not internal Kibana user database for ELK OpenDistro security plugin | `bool` | `false` | no | 25 | | advanced\_security\_options\_master\_user\_arn | ARN of IAM user who is to be mapped to be Kibana master user (applicable if advanced\_security\_options\_internal\_user\_database\_enabled set to false) | `string` | `""` | no | 26 | | advanced\_security\_options\_master\_user\_name | Master user username (applicable if advanced\_security\_options\_internal\_user\_database\_enabled set to true) | `string` | `""` | no | 27 | | advanced\_security\_options\_master\_user\_password | Master user password (applicable if advanced\_security\_options\_internal\_user\_database\_enabled set to true) | `string` | `""` | no | 28 | | allowed\_cidr\_blocks | List of CIDR blocks to be allowed to connect to the cluster | `list(string)` | `[]` | no | 29 | | attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | 30 | | automated\_snapshot\_start\_hour | Hour at which automated snapshots are taken, in UTC | `number` | `0` | no | 31 | | availability\_zone\_count | Number of Availability Zones for the domain to use. | `number` | `2` | no | 32 | | aws\_ec2\_service\_name | AWS EC2 Service Name | `list(string)` |
[
"ec2.amazonaws.com"
]
| no | 33 | | cognito\_authentication\_enabled | Whether to enable Amazon Cognito authentication with Kibana | `bool` | `false` | no | 34 | | cognito\_iam\_role\_arn | ARN of the IAM role that has the AmazonESCognitoAccess policy attached | `string` | `""` | no | 35 | | cognito\_identity\_pool\_id | The ID of the Cognito Identity Pool to use | `string` | `""` | no | 36 | | cognito\_user\_pool\_id | The ID of the Cognito User Pool to use | `string` | `""` | no | 37 | | context | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. |
object({
enabled = bool
namespace = string
environment = string
stage = string
name = string
delimiter = string
attributes = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
label_order = list(string)
id_length_limit = number
})
|
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_order": [],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {}
}
| no | 38 | | create\_iam\_service\_linked\_role | Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info | `bool` | `true` | no | 39 | | dedicated\_master\_count | Number of dedicated master nodes in the cluster | `number` | `0` | no | 40 | | dedicated\_master\_enabled | Indicates whether dedicated master nodes are enabled for the cluster | `bool` | `false` | no | 41 | | dedicated\_master\_type | Instance type of the dedicated master nodes in the cluster | `string` | `"t2.small.elasticsearch"` | no | 42 | | delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | 43 | | dns\_zone\_id | Route53 DNS Zone ID to add hostname records for Elasticsearch domain and Kibana | `string` | `""` | no | 44 | | domain\_endpoint\_options\_enforce\_https | Whether or not to require HTTPS | `bool` | `false` | no | 45 | | domain\_endpoint\_options\_tls\_security\_policy | The name of the TLS security policy that needs to be applied to the HTTPS endpoint | `string` | `"Policy-Min-TLS-1-2-2019-07"` | no | 46 | | domain\_hostname\_enabled | Explicit flag to enable creating a DNS hostname for ES. If `true`, then `var.dns_zone_id` is required. | `bool` | `false` | no | 47 | | ebs\_iops | The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type | `number` | `0` | no | 48 | | ebs\_volume\_size | EBS volumes for data storage in GB | `number` | `0` | no | 49 | | ebs\_volume\_type | Storage type of EBS volumes | `string` | `"gp2"` | no | 50 | | elasticsearch\_subdomain\_name | The name of the subdomain for Elasticsearch in the DNS zone (\_e.g.\_ `elasticsearch`, `ui`, `ui-es`, `search-ui`) | `string` | `""` | no | 51 | | elasticsearch\_version | Version of Elasticsearch to deploy (\_e.g.\_ `7.4`, `7.1`, `6.8`, `6.7`, `6.5`, `6.4`, `6.3`, `6.2`, `6.0`, `5.6`, `5.5`, `5.3`, `5.1`, `2.3`, `1.5` | `string` | `"7.4"` | no | 52 | | enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no | 53 | | encrypt\_at\_rest\_enabled | Whether to enable encryption at rest | `bool` | `true` | no | 54 | | encrypt\_at\_rest\_kms\_key\_id | The KMS key ID to encrypt the Elasticsearch domain with. If not specified, then it defaults to using the AWS/Elasticsearch service KMS key | `string` | `""` | no | 55 | | environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | 56 | | iam\_actions | List of actions to allow for the IAM roles, _e.g._ `es:ESHttpGet`, `es:ESHttpPut`, `es:ESHttpPost` | `list(string)` | `[]` | no | 57 | | iam\_authorizing\_role\_arns | List of IAM role ARNs to permit to assume the Elasticsearch user role | `list(string)` | `[]` | no | 58 | | iam\_role\_arns | List of IAM role ARNs to permit access to the Elasticsearch domain | `list(string)` | `[]` | no | 59 | | iam\_role\_max\_session\_duration | The maximum session duration (in seconds) for the user role. Can have a value from 1 hour to 12 hours | `number` | `3600` | no | 60 | | id\_length\_limit | Limit `id` to this many characters.
Set to `0` for unlimited length.
Set to `null` for default, which is `0`.
Does not affect `id_full`. | `number` | `null` | no | 61 | | ingress\_port\_range\_end | End number for allowed port range. (e.g. `443`) | `number` | `65535` | no | 62 | | ingress\_port\_range\_start | Start number for allowed port range. (e.g. `443`) | `number` | `0` | no | 63 | | instance\_count | Number of data nodes in the cluster | `number` | `4` | no | 64 | | instance\_type | Elasticsearch instance type for data nodes in the cluster | `string` | `"t2.small.elasticsearch"` | no | 65 | | kibana\_hostname\_enabled | Explicit flag to enable creating a DNS hostname for Kibana. If `true`, then `var.dns_zone_id` is required. | `bool` | `false` | no | 66 | | kibana\_subdomain\_name | The name of the subdomain for Kibana in the DNS zone (\_e.g.\_ `kibana`, `ui`, `ui-es`, `search-ui`, `kibana.elasticsearch`) | `string` | n/a | yes | 67 | | label\_order | The naming order of the id output and Name tag.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no | 68 | | log\_publishing\_application\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for ES\_APPLICATION\_LOGS needs to be published | `string` | `""` | no | 69 | | log\_publishing\_application\_enabled | Specifies whether log publishing option for ES\_APPLICATION\_LOGS is enabled or not | `bool` | `false` | no | 70 | | log\_publishing\_audit\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for AUDIT\_LOGS needs to be published | `string` | `""` | no | 71 | | log\_publishing\_audit\_enabled | Specifies whether log publishing option for AUDIT\_LOGS is enabled or not | `bool` | `false` | no | 72 | | log\_publishing\_index\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for INDEX\_SLOW\_LOGS needs to be published | `string` | `""` | no | 73 | | log\_publishing\_index\_enabled | Specifies whether log publishing option for INDEX\_SLOW\_LOGS is enabled or not | `bool` | `false` | no | 74 | | log\_publishing\_search\_cloudwatch\_log\_group\_arn | ARN of the CloudWatch log group to which log for SEARCH\_SLOW\_LOGS needs to be published | `string` | `""` | no | 75 | | log\_publishing\_search\_enabled | Specifies whether log publishing option for SEARCH\_SLOW\_LOGS is enabled or not | `bool` | `false` | no | 76 | | name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no | 77 | | namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no | 78 | | node\_to\_node\_encryption\_enabled | Whether to enable node-to-node encryption | `bool` | `false` | no | 79 | | regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | 80 | | security\_groups | List of security group IDs to be allowed to connect to the cluster | `list(string)` | `[]` | no | 81 | | stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | 82 | | subnet\_ids | VPC Subnet IDs | `list(string)` | `[]` | no | 83 | | tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | 84 | | vpc\_enabled | Set to false if ES should be deployed outside of VPC. | `bool` | `true` | no | 85 | | vpc\_id | VPC ID | `string` | `null` | no | 86 | | warm\_count | Number of UltraWarm nodes | `number` | `2` | no | 87 | | warm\_enabled | Whether AWS UltraWarm is enabled | `bool` | `false` | no | 88 | | warm\_type | Type of UltraWarm nodes | `string` | `"ultrawarm1.medium.elasticsearch"` | no | 89 | | zone\_awareness\_enabled | Enable zone awareness for Elasticsearch cluster | `bool` | `true` | no | 90 | 91 | ## Outputs 92 | 93 | | Name | Description | 94 | |------|-------------| 95 | | domain\_arn | ARN of the Elasticsearch domain | 96 | | domain\_endpoint | Domain-specific endpoint used to submit index, search, and data upload requests | 97 | | domain\_hostname | Elasticsearch domain hostname to submit index, search, and data upload requests | 98 | | domain\_id | Unique identifier for the Elasticsearch domain | 99 | | domain\_name | Name of the Elasticsearch domain | 100 | | elasticsearch\_user\_iam\_role\_arn | The ARN of the IAM role to allow access to Elasticsearch cluster | 101 | | elasticsearch\_user\_iam\_role\_name | The name of the IAM role to allow access to Elasticsearch cluster | 102 | | kibana\_endpoint | Domain-specific endpoint for Kibana without https scheme | 103 | | kibana\_hostname | Kibana hostname | 104 | | security\_group\_id | Security Group ID to control access to the Elasticsearch domain | 105 | 106 | 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Project Banner
5 | 6 | 7 |

Latest ReleaseLast UpdatedSlack CommunityGet Support 8 | 9 |

10 | 11 | 12 | 32 | 33 | Terraform module to provision an [`Elasticsearch`](https://aws.amazon.com/elasticsearch-service/) cluster with built-in integrations with [Kibana](https://aws.amazon.com/elasticsearch-service/kibana/) and [Logstash](https://aws.amazon.com/elasticsearch-service/logstash/). 34 | 35 | 36 | > [!TIP] 37 | > #### 👽 Use Atmos with Terraform 38 | > Cloud Posse uses [`atmos`](https://atmos.tools) to easily orchestrate multiple environments using Terraform.
39 | > Works with [Github Actions](https://atmos.tools/integrations/github-actions/), [Atlantis](https://atmos.tools/integrations/atlantis), or [Spacelift](https://atmos.tools/integrations/spacelift). 40 | > 41 | >
42 | > Watch demo of using Atmos with Terraform 43 | >
44 | > Example of running atmos to manage infrastructure from our Quick Start tutorial. 45 | > 46 | 47 | 48 | ## Introduction 49 | 50 | This module will create: 51 | - Elasticsearch cluster with the specified node count in the provided subnets in a VPC 52 | - Elasticsearch domain policy that accepts a list of IAM role ARNs from which to permit management traffic to the cluster 53 | - Security Group to control access to the Elasticsearch domain (inputs to the Security Group are other Security Groups or CIDRs blocks to be allowed to connect to the cluster) 54 | - DNS hostname record for Elasticsearch cluster (if DNS Zone ID is provided) 55 | - DNS hostname record for Kibana (if DNS Zone ID is provided) 56 | 57 | __NOTE:__ To enable [zone awareness](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-zoneawareness) to deploy Elasticsearch nodes into two different Availability Zones, you need to set `zone_awareness_enabled` to `true` and provide two different subnets in `subnet_ids`. 58 | If you enable zone awareness for your domain, Amazon ES places an endpoint into two subnets. 59 | The subnets must be in different Availability Zones in the same region. 60 | If you don't enable zone awareness, Amazon ES places an endpoint into only one subnet. You also need to set `availability_zone_count` to `1`. 61 | 62 | 63 | 64 | 65 | ## Usage 66 | 67 | 68 | ```hcl 69 | module "elasticsearch" { 70 | source = "cloudposse/elasticsearch/aws" 71 | # Cloud Posse recommends pinning every module to a specific version 72 | # version = "x.x.x" 73 | namespace = "eg" 74 | stage = "dev" 75 | name = "es" 76 | dns_zone_id = "Z14EN2YD427LRQ" 77 | security_groups = ["sg-XXXXXXXXX", "sg-YYYYYYYY"] 78 | vpc_id = "vpc-XXXXXXXXX" 79 | subnet_ids = ["subnet-XXXXXXXXX", "subnet-YYYYYYYY"] 80 | zone_awareness_enabled = true 81 | elasticsearch_version = "6.5" 82 | instance_type = "t2.small.elasticsearch" 83 | instance_count = 4 84 | ebs_volume_size = 10 85 | iam_role_arns = ["arn:aws:iam::XXXXXXXXX:role/ops", "arn:aws:iam::XXXXXXXXX:role/dev"] 86 | iam_actions = ["es:ESHttpGet", "es:ESHttpPut", "es:ESHttpPost"] 87 | encrypt_at_rest_enabled = true 88 | kibana_subdomain_name = "kibana-es" 89 | 90 | advanced_options = { 91 | "rest.action.multi.allow_explicit_index" = "true" 92 | } 93 | } 94 | ``` 95 | 96 | > [!IMPORTANT] 97 | > In Cloud Posse's examples, we avoid pinning modules to specific versions to prevent discrepancies between the documentation 98 | > and the latest released versions. However, for your own projects, we strongly advise pinning each module to the exact version 99 | > you're using. This practice ensures the stability of your infrastructure. Additionally, we recommend implementing a systematic 100 | > approach for updating versions to avoid unexpected changes. 101 | 102 | 103 | 104 | 105 | 106 | ## Examples 107 | 108 | Here is a working example of using this module: 109 | - [`examples/complete`](examples/complete) 110 | 111 | Here are automated tests for the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS): 112 | - [`test`](test) 113 | 114 | 115 | 116 | 117 | 118 | ## Requirements 119 | 120 | | Name | Version | 121 | |------|---------| 122 | | [terraform](#requirement\_terraform) | >= 1.3 | 123 | | [aws](#requirement\_aws) | >= 5.15.0 | 124 | 125 | ## Providers 126 | 127 | | Name | Version | 128 | |------|---------| 129 | | [aws](#provider\_aws) | >= 5.15.0 | 130 | 131 | ## Modules 132 | 133 | | Name | Source | Version | 134 | |------|--------|---------| 135 | | [domain\_hostname](#module\_domain\_hostname) | cloudposse/route53-cluster-hostname/aws | 0.13.0 | 136 | | [kibana\_hostname](#module\_kibana\_hostname) | cloudposse/route53-cluster-hostname/aws | 0.13.0 | 137 | | [kibana\_label](#module\_kibana\_label) | cloudposse/label/null | 0.25.0 | 138 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 | 139 | | [user\_label](#module\_user\_label) | cloudposse/label/null | 0.25.0 | 140 | 141 | ## Resources 142 | 143 | | Name | Type | 144 | |------|------| 145 | | [aws_elasticsearch_domain.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticsearch_domain) | resource | 146 | | [aws_elasticsearch_domain_policy.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticsearch_domain_policy) | resource | 147 | | [aws_iam_role.elasticsearch_user](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | 148 | | [aws_iam_service_linked_role.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_service_linked_role) | resource | 149 | | [aws_opensearch_domain.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/opensearch_domain) | resource | 150 | | [aws_opensearch_domain_policy.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/opensearch_domain_policy) | resource | 151 | | [aws_security_group.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | 152 | | [aws_security_group_rule.egress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource | 153 | | [aws_security_group_rule.ingress_cidr_blocks](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource | 154 | | [aws_security_group_rule.ingress_security_groups](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource | 155 | | [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | 156 | | [aws_iam_policy_document.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | 157 | 158 | ## Inputs 159 | 160 | | Name | Description | Type | Default | Required | 161 | |------|-------------|------|---------|:--------:| 162 | | [access\_policies](#input\_access\_policies) | JSON string for the IAM policy document specifying the access policies for the domain. | `string` | `""` | no | 163 | | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no | 164 | | [advanced\_options](#input\_advanced\_options) | Key-value string pairs to specify advanced configuration options | `map(string)` | `{}` | no | 165 | | [advanced\_security\_options\_anonymous\_auth\_enabled](#input\_advanced\_security\_options\_anonymous\_auth\_enabled) | Whether Anonymous auth is enabled. Enables fine-grained access control on an existing domain | `bool` | `false` | no | 166 | | [advanced\_security\_options\_enabled](#input\_advanced\_security\_options\_enabled) | AWS Elasticsearch Kibana enchanced security plugin enabling (forces new resource) | `bool` | `false` | no | 167 | | [advanced\_security\_options\_internal\_user\_database\_enabled](#input\_advanced\_security\_options\_internal\_user\_database\_enabled) | Whether to enable or not internal Kibana user database for ELK OpenDistro security plugin | `bool` | `false` | no | 168 | | [advanced\_security\_options\_master\_user\_arn](#input\_advanced\_security\_options\_master\_user\_arn) | ARN of IAM user who is to be mapped to be Kibana master user (applicable if advanced\_security\_options\_internal\_user\_database\_enabled set to false) | `string` | `""` | no | 169 | | [advanced\_security\_options\_master\_user\_name](#input\_advanced\_security\_options\_master\_user\_name) | Master user username (applicable if advanced\_security\_options\_internal\_user\_database\_enabled set to true) | `string` | `""` | no | 170 | | [advanced\_security\_options\_master\_user\_password](#input\_advanced\_security\_options\_master\_user\_password) | Master user password (applicable if advanced\_security\_options\_internal\_user\_database\_enabled set to true) | `string` | `""` | no | 171 | | [allowed\_cidr\_blocks](#input\_allowed\_cidr\_blocks) | List of CIDR blocks to be allowed to connect to the cluster | `list(string)` | `[]` | no | 172 | | [anonymous\_iam\_actions](#input\_anonymous\_iam\_actions) | List of actions to allow for the anonymous (`*`) IAM roles, _e.g._ `es:ESHttpGet`, `es:ESHttpPut`, `es:ESHttpPost` | `list(string)` | `[]` | no | 173 | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no | 174 | | [auto\_tune](#input\_auto\_tune) | This object represents the auto\_tune configuration. It contains the following filed:
- enabled - Whether to enable autotune.
- rollback\_on\_disable - Whether to roll back to default Auto-Tune settings when disabling Auto-Tune.
- starting\_time - Date and time at which to start the Auto-Tune maintenance schedule in RFC3339 format. Time should be in the future.
- cron\_schedule - A cron expression specifying the recurrence pattern for an Auto-Tune maintenance schedule.
- duration - Autotune maintanance window duration time in hours. |
object({
enabled = bool
rollback_on_disable = string
starting_time = string
cron_schedule = string
duration = number
})
|
{
"cron_schedule": null,
"duration": null,
"enabled": false,
"rollback_on_disable": "NO_ROLLBACK",
"starting_time": null
}
| no | 175 | | [automated\_snapshot\_start\_hour](#input\_automated\_snapshot\_start\_hour) | Hour at which automated snapshots are taken, in UTC | `number` | `0` | no | 176 | | [availability\_zone\_count](#input\_availability\_zone\_count) | Number of Availability Zones for the domain to use. | `number` | `2` | no | 177 | | [aws\_ec2\_service\_name](#input\_aws\_ec2\_service\_name) | AWS EC2 Service Name | `list(string)` |
[
"ec2.amazonaws.com"
]
| no | 178 | | [aws\_service\_type](#input\_aws\_service\_type) | The type of AWS service to deploy (`elasticsearch` or `opensearch`). | `string` | `"elasticsearch"` | no | 179 | | [cognito\_authentication\_enabled](#input\_cognito\_authentication\_enabled) | Whether to enable Amazon Cognito authentication with Kibana | `bool` | `false` | no | 180 | | [cognito\_iam\_role\_arn](#input\_cognito\_iam\_role\_arn) | ARN of the IAM role that has the AmazonESCognitoAccess policy attached | `string` | `""` | no | 181 | | [cognito\_identity\_pool\_id](#input\_cognito\_identity\_pool\_id) | The ID of the Cognito Identity Pool to use | `string` | `""` | no | 182 | | [cognito\_user\_pool\_id](#input\_cognito\_user\_pool\_id) | The ID of the Cognito User Pool to use | `string` | `""` | no | 183 | | [cold\_storage\_enabled](#input\_cold\_storage\_enabled) | Enables cold storage support. | `bool` | `false` | no | 184 | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no | 185 | | [create\_elasticsearch\_user\_role](#input\_create\_elasticsearch\_user\_role) | Whether to create an IAM role for Users/EC2 to assume to access the Elasticsearch domain. Set it to `false` if you already manage access through other means. | `bool` | `true` | no | 186 | | [create\_iam\_service\_linked\_role](#input\_create\_iam\_service\_linked\_role) | Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info | `bool` | `true` | no | 187 | | [create\_security\_group](#input\_create\_security\_group) | Whether to create a dedicated security group for the Elasticsearch domain. Set it to `false` if you already have security groups that you want to attach to the domain and specify them in the `security_groups` variable. | `bool` | `true` | no | 188 | | [custom\_endpoint](#input\_custom\_endpoint) | Fully qualified domain for custom endpoint. | `string` | `""` | no | 189 | | [custom\_endpoint\_certificate\_arn](#input\_custom\_endpoint\_certificate\_arn) | ACM certificate ARN for custom endpoint. | `string` | `""` | no | 190 | | [custom\_endpoint\_enabled](#input\_custom\_endpoint\_enabled) | Whether to enable custom endpoint for the Elasticsearch domain. | `bool` | `false` | no | 191 | | [dedicated\_master\_count](#input\_dedicated\_master\_count) | Number of dedicated master nodes in the cluster | `number` | `0` | no | 192 | | [dedicated\_master\_enabled](#input\_dedicated\_master\_enabled) | Indicates whether dedicated master nodes are enabled for the cluster | `bool` | `false` | no | 193 | | [dedicated\_master\_type](#input\_dedicated\_master\_type) | Instance type of the dedicated master nodes in the cluster | `string` | `"t2.small.elasticsearch"` | no | 194 | | [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | 195 | | [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no | 196 | | [dns\_zone\_id](#input\_dns\_zone\_id) | Route53 DNS Zone ID to add hostname records for Elasticsearch domain and Kibana | `string` | `""` | no | 197 | | [domain\_endpoint\_options\_enforce\_https](#input\_domain\_endpoint\_options\_enforce\_https) | Whether or not to require HTTPS | `bool` | `true` | no | 198 | | [domain\_endpoint\_options\_tls\_security\_policy](#input\_domain\_endpoint\_options\_tls\_security\_policy) | The name of the TLS security policy that needs to be applied to the HTTPS endpoint | `string` | `"Policy-Min-TLS-1-2-2019-07"` | no | 199 | | [domain\_hostname\_enabled](#input\_domain\_hostname\_enabled) | Explicit flag to enable creating a DNS hostname for ES. If `true`, then `var.dns_zone_id` is required. | `bool` | `false` | no | 200 | | [ebs\_iops](#input\_ebs\_iops) | The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type | `number` | `0` | no | 201 | | [ebs\_throughput](#input\_ebs\_throughput) | Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. Valid values are between 125 and 1000. | `number` | `null` | no | 202 | | [ebs\_volume\_size](#input\_ebs\_volume\_size) | EBS volumes for data storage in GB | `number` | `0` | no | 203 | | [ebs\_volume\_type](#input\_ebs\_volume\_type) | Storage type of EBS volumes | `string` | `"gp2"` | no | 204 | | [elasticsearch\_domain\_name](#input\_elasticsearch\_domain\_name) | The name of the Elasticsearch domain. Must be at least 3 and no more than 28 characters long. Valid characters are a-z (lowercase letters), 0-9, and - (hyphen). | `string` | `""` | no | 205 | | [elasticsearch\_subdomain\_name](#input\_elasticsearch\_subdomain\_name) | The name of the subdomain for Elasticsearch in the DNS zone (\_e.g.\_ `elasticsearch`, `ui`, `ui-es`, `search-ui`) | `string` | `""` | no | 206 | | [elasticsearch\_version](#input\_elasticsearch\_version) | Version of Elasticsearch to deploy (\_e.g.\_ `7.4`, `7.1`, `6.8`, `6.7`, `6.5`, `6.4`, `6.3`, `6.2`, `6.0`, `5.6`, `5.5`, `5.3`, `5.1`, `2.3`, `1.5` | `string` | `"7.10"` | no | 207 | | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no | 208 | | [encrypt\_at\_rest\_enabled](#input\_encrypt\_at\_rest\_enabled) | Whether to enable encryption at rest | `bool` | `true` | no | 209 | | [encrypt\_at\_rest\_kms\_key\_id](#input\_encrypt\_at\_rest\_kms\_key\_id) | The KMS key ID to encrypt the Elasticsearch domain with. If not specified, then it defaults to using the AWS/Elasticsearch service KMS key | `string` | `""` | no | 210 | | [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | 211 | | [iam\_actions](#input\_iam\_actions) | List of actions to allow for the user IAM roles, _e.g._ `es:ESHttpGet`, `es:ESHttpPut`, `es:ESHttpPost` | `list(string)` | `[]` | no | 212 | | [iam\_authorizing\_role\_arns](#input\_iam\_authorizing\_role\_arns) | List of IAM role ARNs to permit to assume the Elasticsearch user role | `list(string)` | `[]` | no | 213 | | [iam\_irsa\_openid\_connect\_provider\_arn](#input\_iam\_irsa\_openid\_connect\_provider\_arn) | ARN of the OpenID connect provider to allow usage of IRSA | `string` | `""` | no | 214 | | [iam\_irsa\_openid\_connect\_provider\_url](#input\_iam\_irsa\_openid\_connect\_provider\_url) | URL of the OpenID connect provider to allow usage of IRSA | `string` | `""` | no | 215 | | [iam\_irsa\_service\_account](#input\_iam\_irsa\_service\_account) | Kubernetes ServiceAccount to allow to access the Elastic Domain via IRSA | `string` | `"system:serviceaccount:default:*"` | no | 216 | | [iam\_irsa\_service\_accounts](#input\_iam\_irsa\_service\_accounts) | Kubernetes ServiceAccounts to allow to access the Elastic Domain via IRSA | `list(string)` | `[]` | no | 217 | | [iam\_role\_arns](#input\_iam\_role\_arns) | List of IAM role ARNs to permit access to the Elasticsearch domain | `list(string)` | `[]` | no | 218 | | [iam\_role\_max\_session\_duration](#input\_iam\_role\_max\_session\_duration) | The maximum session duration (in seconds) for the user role. Can have a value from 1 hour to 12 hours | `number` | `3600` | no | 219 | | [iam\_role\_permissions\_boundary](#input\_iam\_role\_permissions\_boundary) | The ARN of the permissions boundary policy which will be attached to the Elasticsearch user role | `string` | `null` | no | 220 | | [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no | 221 | | [ingress\_port\_range\_end](#input\_ingress\_port\_range\_end) | End number for allowed port range. (e.g. `443`) | `number` | `65535` | no | 222 | | [ingress\_port\_range\_start](#input\_ingress\_port\_range\_start) | Start number for allowed port range. (e.g. `443`) | `number` | `0` | no | 223 | | [instance\_count](#input\_instance\_count) | Number of data nodes in the cluster | `number` | `4` | no | 224 | | [instance\_type](#input\_instance\_type) | Elasticsearch instance type for data nodes in the cluster | `string` | `"t2.small.elasticsearch"` | no | 225 | | [kibana\_hostname\_enabled](#input\_kibana\_hostname\_enabled) | Explicit flag to enable creating a DNS hostname for Kibana. If `true`, then `var.dns_zone_id` is required. | `bool` | `false` | no | 226 | | [kibana\_subdomain\_name](#input\_kibana\_subdomain\_name) | The name of the subdomain for Kibana in the DNS zone (\_e.g.\_ `kibana`, `ui`, `ui-es`, `search-ui`, `kibana.elasticsearch`) | `string` | `""` | no | 227 | | [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no | 228 | | [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no | 229 | | [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no | 230 | | [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` |
[
"default"
]
| no | 231 | | [log\_publishing\_application\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_application\_cloudwatch\_log\_group\_arn) | ARN of the CloudWatch log group to which log for ES\_APPLICATION\_LOGS needs to be published | `string` | `""` | no | 232 | | [log\_publishing\_application\_enabled](#input\_log\_publishing\_application\_enabled) | Specifies whether log publishing option for ES\_APPLICATION\_LOGS is enabled or not | `bool` | `false` | no | 233 | | [log\_publishing\_audit\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_audit\_cloudwatch\_log\_group\_arn) | ARN of the CloudWatch log group to which log for AUDIT\_LOGS needs to be published | `string` | `""` | no | 234 | | [log\_publishing\_audit\_enabled](#input\_log\_publishing\_audit\_enabled) | Specifies whether log publishing option for AUDIT\_LOGS is enabled or not | `bool` | `false` | no | 235 | | [log\_publishing\_index\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_index\_cloudwatch\_log\_group\_arn) | ARN of the CloudWatch log group to which log for INDEX\_SLOW\_LOGS needs to be published | `string` | `""` | no | 236 | | [log\_publishing\_index\_enabled](#input\_log\_publishing\_index\_enabled) | Specifies whether log publishing option for INDEX\_SLOW\_LOGS is enabled or not | `bool` | `false` | no | 237 | | [log\_publishing\_search\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_search\_cloudwatch\_log\_group\_arn) | ARN of the CloudWatch log group to which log for SEARCH\_SLOW\_LOGS needs to be published | `string` | `""` | no | 238 | | [log\_publishing\_search\_enabled](#input\_log\_publishing\_search\_enabled) | Specifies whether log publishing option for SEARCH\_SLOW\_LOGS is enabled or not | `bool` | `false` | no | 239 | | [multi\_az\_with\_standby\_enabled](#input\_multi\_az\_with\_standby\_enabled) | Enable domain with standby for OpenSearch cluster | `bool` | `false` | no | 240 | | [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no | 241 | | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | 242 | | [node\_to\_node\_encryption\_enabled](#input\_node\_to\_node\_encryption\_enabled) | Whether to enable node-to-node encryption | `bool` | `false` | no | 243 | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | 244 | | [security\_groups](#input\_security\_groups) | List of security group IDs to be allowed to connect to the cluster or the security group IDs to apply to the cluster when the `create_security_group` variable is set to false. | `list(string)` | `[]` | no | 245 | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | 246 | | [subnet\_ids](#input\_subnet\_ids) | VPC Subnet IDs | `list(string)` | `[]` | no | 247 | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | 248 | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no | 249 | | [vpc\_enabled](#input\_vpc\_enabled) | Set to false if ES should be deployed outside of VPC. | `bool` | `true` | no | 250 | | [vpc\_id](#input\_vpc\_id) | VPC ID | `string` | `null` | no | 251 | | [warm\_count](#input\_warm\_count) | Number of UltraWarm nodes | `number` | `2` | no | 252 | | [warm\_enabled](#input\_warm\_enabled) | Whether AWS UltraWarm is enabled | `bool` | `false` | no | 253 | | [warm\_type](#input\_warm\_type) | Type of UltraWarm nodes | `string` | `"ultrawarm1.medium.elasticsearch"` | no | 254 | | [zone\_awareness\_enabled](#input\_zone\_awareness\_enabled) | Enable zone awareness for Elasticsearch cluster | `bool` | `true` | no | 255 | 256 | ## Outputs 257 | 258 | | Name | Description | 259 | |------|-------------| 260 | | [domain\_arn](#output\_domain\_arn) | ARN of the Elasticsearch domain | 261 | | [domain\_endpoint](#output\_domain\_endpoint) | Domain-specific endpoint used to submit index, search, and data upload requests | 262 | | [domain\_hostname](#output\_domain\_hostname) | Elasticsearch domain hostname to submit index, search, and data upload requests | 263 | | [domain\_id](#output\_domain\_id) | Unique identifier for the Elasticsearch domain | 264 | | [domain\_name](#output\_domain\_name) | Name of the Elasticsearch domain | 265 | | [elasticsearch\_user\_iam\_role\_arn](#output\_elasticsearch\_user\_iam\_role\_arn) | The ARN of the IAM role to allow access to Elasticsearch cluster | 266 | | [elasticsearch\_user\_iam\_role\_name](#output\_elasticsearch\_user\_iam\_role\_name) | The name of the IAM role to allow access to Elasticsearch cluster | 267 | | [kibana\_endpoint](#output\_kibana\_endpoint) | Domain-specific endpoint for Kibana without https scheme | 268 | | [kibana\_hostname](#output\_kibana\_hostname) | Kibana hostname | 269 | | [security\_group\_id](#output\_security\_group\_id) | Security Group ID to control access to the Elasticsearch domain | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | ## References 281 | 282 | For additional context, refer to some of these links. 283 | 284 | - [What is Amazon Elasticsearch Service](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/what-is-amazon-elasticsearch-service.html) - Complete description of Amazon Elasticsearch Service 285 | - [Amazon Elasticsearch Service Access Control](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html) - Describes several ways of controlling access to Elasticsearch domains 286 | - [VPC Support for Amazon Elasticsearch Service Domains](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html) - Describes Elasticsearch Service VPC Support and VPC architectures with and without zone awareness 287 | - [Creating and Configuring Amazon Elasticsearch Service Domains](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html) - Provides a complete description on how to create and configure Amazon Elasticsearch Service (Amazon ES) domains 288 | - [Kibana and Logstash](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-kibana.html) - Describes some considerations for using Kibana and Logstash with Amazon Elasticsearch Service 289 | - [Amazon Cognito Authentication for Kibana](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html) - Amazon Elasticsearch Service uses Amazon Cognito to offer user name and password protection for Kibana 290 | - [Control Access to Amazon Elasticsearch Service Domain](https://aws.amazon.com/blogs/security/how-to-control-access-to-your-amazon-elasticsearch-service-domain/) - Describes how to Control Access to Amazon Elasticsearch Service Domain 291 | - [elasticsearch_domain](https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain.html) - Terraform reference documentation for the `elasticsearch_domain` resource 292 | - [elasticsearch_domain_policy](https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain_policy.html) - Terraform reference documentation for the `elasticsearch_domain_policy` resource 293 | - [AWS IAM roles for service accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) - Associate an IAM role with a Kubernetes service account 294 | 295 | 296 | 297 | > [!TIP] 298 | > #### Use Terraform Reference Architectures for AWS 299 | > 300 | > Use Cloud Posse's ready-to-go [terraform architecture blueprints](https://cloudposse.com/reference-architecture/) for AWS to get up and running quickly. 301 | > 302 | > ✅ We build it together with your team.
303 | > ✅ Your team owns everything.
304 | > ✅ 100% Open Source and backed by fanatical support.
305 | > 306 | > Request Quote 307 | >
📚 Learn More 308 | > 309 | >
310 | > 311 | > Cloud Posse is the leading [**DevOps Accelerator**](https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=commercial_support) for funded startups and enterprises. 312 | > 313 | > *Your team can operate like a pro today.* 314 | > 315 | > Ensure that your team succeeds by using Cloud Posse's proven process and turnkey blueprints. Plus, we stick around until you succeed. 316 | > #### Day-0: Your Foundation for Success 317 | > - **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code. 318 | > - **Deployment Strategy.** Adopt a proven deployment strategy with GitHub Actions, enabling automated, repeatable, and reliable software releases. 319 | > - **Site Reliability Engineering.** Gain total visibility into your applications and services with Datadog, ensuring high availability and performance. 320 | > - **Security Baseline.** Establish a secure environment from the start, with built-in governance, accountability, and comprehensive audit logs, safeguarding your operations. 321 | > - **GitOps.** Empower your team to manage infrastructure changes confidently and efficiently through Pull Requests, leveraging the full power of GitHub Actions. 322 | > 323 | > Request Quote 324 | > 325 | > #### Day-2: Your Operational Mastery 326 | > - **Training.** Equip your team with the knowledge and skills to confidently manage the infrastructure, ensuring long-term success and self-sufficiency. 327 | > - **Support.** Benefit from a seamless communication over Slack with our experts, ensuring you have the support you need, whenever you need it. 328 | > - **Troubleshooting.** Access expert assistance to quickly resolve any operational challenges, minimizing downtime and maintaining business continuity. 329 | > - **Code Reviews.** Enhance your team’s code quality with our expert feedback, fostering continuous improvement and collaboration. 330 | > - **Bug Fixes.** Rely on our team to troubleshoot and resolve any issues, ensuring your systems run smoothly. 331 | > - **Migration Assistance.** Accelerate your migration process with our dedicated support, minimizing disruption and speeding up time-to-value. 332 | > - **Customer Workshops.** Engage with our team in weekly workshops, gaining insights and strategies to continuously improve and innovate. 333 | > 334 | > Request Quote 335 | > 336 |
337 | 338 | ## ✨ Contributing 339 | 340 | This project is under active development, and we encourage contributions from our community. 341 | 342 | 343 | 344 | Many thanks to our outstanding contributors: 345 | 346 | 347 | 348 | 349 | 350 | For 🐛 bug reports & feature requests, please use the [issue tracker](https://github.com/cloudposse/terraform-aws-elasticsearch/issues). 351 | 352 | In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. 353 | 1. Review our [Code of Conduct](https://github.com/cloudposse/terraform-aws-elasticsearch/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md). 354 | 2. **Fork** the repo on GitHub 355 | 3. **Clone** the project to your own machine 356 | 4. **Commit** changes to your own branch 357 | 5. **Push** your work back up to your fork 358 | 6. Submit a **Pull Request** so that we can review your changes 359 | 360 | **NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request! 361 | 362 | 363 | ## Running Terraform Tests 364 | 365 | We use [Atmos](https://atmos.tools) to streamline how Terraform tests are run. It centralizes configuration and wraps common test workflows with easy-to-use commands. 366 | 367 | All tests are located in the [`test/`](test) folder. 368 | 369 | Under the hood, tests are powered by Terratest together with our internal [Test Helpers](https://github.com/cloudposse/test-helpers) library, providing robust infrastructure validation. 370 | 371 | Setup dependencies: 372 | - Install Atmos ([installation guide](https://atmos.tools/install/)) 373 | - Install Go [1.24+ or newer](https://go.dev/doc/install) 374 | - Install Terraform or OpenTofu 375 | 376 | To run tests: 377 | 378 | - Run all tests: 379 | ```sh 380 | atmos test run 381 | ``` 382 | - Clean up test artifacts: 383 | ```sh 384 | atmos test clean 385 | ``` 386 | - Explore additional test options: 387 | ```sh 388 | atmos test --help 389 | ``` 390 | The configuration for test commands is centrally managed. To review what's being imported, see the [`atmos.yaml`](https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/terraform-module.yaml) file. 391 | 392 | Learn more about our [automated testing in our documentation](https://docs.cloudposse.com/community/contribute/automated-testing/) or implementing [custom commands](https://atmos.tools/core-concepts/custom-commands/) with atmos. 393 | 394 | ### 🌎 Slack Community 395 | 396 | Join our [Open Source Community](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=slack) on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure. 397 | 398 | ### 📰 Newsletter 399 | 400 | Sign up for [our newsletter](https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=newsletter) and join 3,000+ DevOps engineers, CTOs, and founders who get insider access to the latest DevOps trends, so you can always stay in the know. 401 | Dropped straight into your Inbox every week — and usually a 5-minute read. 402 | 403 | ### 📆 Office Hours 404 | 405 | [Join us every Wednesday via Zoom](https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticsearch&utm_content=office_hours) for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a _live Q&A_ that you can’t find anywhere else. 406 | It's **FREE** for everyone! 407 | ## License 408 | 409 | License 410 | 411 |
412 | Preamble to the Apache License, Version 2.0 413 |
414 |
415 | 416 | Complete license is available in the [`LICENSE`](LICENSE) file. 417 | 418 | ```text 419 | Licensed to the Apache Software Foundation (ASF) under one 420 | or more contributor license agreements. See the NOTICE file 421 | distributed with this work for additional information 422 | regarding copyright ownership. The ASF licenses this file 423 | to you under the Apache License, Version 2.0 (the 424 | "License"); you may not use this file except in compliance 425 | with the License. You may obtain a copy of the License at 426 | 427 | https://www.apache.org/licenses/LICENSE-2.0 428 | 429 | Unless required by applicable law or agreed to in writing, 430 | software distributed under the License is distributed on an 431 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 432 | KIND, either express or implied. See the License for the 433 | specific language governing permissions and limitations 434 | under the License. 435 | ``` 436 |
437 | 438 | ## Trademarks 439 | 440 | All other trademarks referenced herein are the property of their respective owners. 441 | 442 | 443 | --- 444 | Copyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright) 445 | 446 | 447 | README footer 448 | 449 | Beacon 450 | --------------------------------------------------------------------------------