elasticsearch
This component is responsible for provisioning an Elasticsearch cluster with built-in integrations with Kibana and Logstash.
Usage
Stack Level: Regional
Here's an example snippet for how to use this component.
components:
terraform:
elasticsearch:
vars:
enabled: true
name: foobar
instance_type: "t3.medium.elasticsearch"
elasticsearch_version: "7.9"
encrypt_at_rest_enabled: true
dedicated_master_enabled: false
elasticsearch_subdomain_name: "es"
kibana_subdomain_name: "kibana"
ebs_volume_size: 40
create_iam_service_linked_role: true
kibana_hostname_enabled: true
domain_hostname_enabled: true
Variables
Required Variables
create_iam_service_linked_role
(bool
) requiredWhether to create
AWSServiceRoleForAmazonElasticsearchService
service-linked role.
Set this tofalse
if you already have an ElasticSearch cluster created in the AWS account andAWSServiceRoleForAmazonElasticsearchService
already exists.
See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more information.dedicated_master_enabled
(bool
) requiredIndicates whether dedicated master nodes are enabled for the cluster
domain_hostname_enabled
(bool
) requiredExplicit flag to enable creating a DNS hostname for ES. If
true
, thenvar.dns_zone_id
is required.ebs_volume_size
(number
) requiredEBS volumes for data storage in GB
elasticsearch_subdomain_name
(string
) requiredThe name of the subdomain for Elasticsearch in the DNS zone (e.g.
elasticsearch
,ui
,ui-es
,search-ui
)elasticsearch_version
(string
) requiredVersion 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
encrypt_at_rest_enabled
(bool
) requiredWhether to enable encryption at rest
instance_type
(string
) requiredThe type of the instance
kibana_hostname_enabled
(bool
) requiredExplicit flag to enable creating a DNS hostname for Kibana. If
true
, thenvar.dns_zone_id
is required.kibana_subdomain_name
(string
) requiredThe name of the subdomain for Kibana in the DNS zone (e.g.
kibana
,ui
,ui-es
,search-ui
,kibana.elasticsearch
)region
(string
) requiredAWS region
Optional Variables
dedicated_master_count
(number
) optionalNumber of dedicated master nodes in the cluster
Default value:
0
dedicated_master_type
(string
) optionalInstance type of the dedicated master nodes in the cluster
Default value:
"t2.small.elasticsearch"
dns_delegated_environment_name
(string
) optionalThe name of the environment where the
dns-delegated
component is deployedDefault value:
"gbl"
elasticsearch_iam_actions
(list(string)
) optionalList of actions to allow for the IAM roles, e.g.
es:ESHttpGet
,es:ESHttpPut
,es:ESHttpPost
Default value:
[
"es:ESHttpGet",
"es:ESHttpPut",
"es:ESHttpPost",
"es:ESHttpHead",
"es:Describe*",
"es:List*"
]elasticsearch_iam_role_arns
(list(string)
) optionalList of additional IAM role ARNs to permit access to the Elasticsearch domain
Default value:
[ ]
elasticsearch_password
(string
) optionalPassword for the elasticsearch user
Default value:
""
Context Variables
The following variables are defined in the context.tf
file of this module and part of the terraform-null-label pattern.
context.tf
file of this module and part of the terraform-null-label pattern.Outputs
domain_arn
ARN of the Elasticsearch domain
domain_endpoint
Domain-specific endpoint used to submit index, search, and data upload requests
domain_hostname
Elasticsearch domain hostname to submit index, search, and data upload requests
domain_id
Unique identifier for the Elasticsearch domain
elasticsearch_user_iam_role_arn
The ARN of the IAM role to allow access to Elasticsearch cluster
elasticsearch_user_iam_role_name
The name of the IAM role to allow access to Elasticsearch cluster
kibana_endpoint
Domain-specific endpoint for Kibana without https scheme
kibana_hostname
Kibana hostname
master_password_ssm_key
SSM key of Elasticsearch master password
security_group_id
Security Group ID to control access to the Elasticsearch domain
Dependencies
Requirements
terraform
, version:>= 1.0.0
aws
, version:>= 4.9.0
random
, version:>= 3.0
Providers
aws
, version:>= 4.9.0
random
, version:>= 3.0
Modules
Name | Version | Source | Description |
---|---|---|---|
dns_delegated | 1.8.0 | cloudposse/stack-config/yaml//modules/remote-state | n/a |
elasticsearch | 0.48.0 | cloudposse/elasticsearch/aws | n/a |
elasticsearch_log_cleanup | 0.14.1 | cloudposse/lambda-elasticsearch-cleanup/aws | n/a |
iam_roles | latest | ../account-map/modules/iam-roles | n/a |
this | 0.25.0 | cloudposse/label/null | n/a |
vpc | 1.8.0 | cloudposse/stack-config/yaml//modules/remote-state | n/a |
Resources
The following resources are used by this module:
aws_ssm_parameter.admin_password
(resource)aws_ssm_parameter.elasticsearch_domain_endpoint
(resource)aws_ssm_parameter.elasticsearch_kibana_endpoint
(resource)random_password.elasticsearch_password
(resource)
Data Sources
The following data sources are used by this module:
References
- cloudposse/terraform-aws-components - Cloud Posse's upstream component