Code Monkey home page Code Monkey logo

tf_aws_elasticsearch's Introduction

tf_aws_elasticsearch

Terraform module for deploying and managing Amazon Elasticsearch Service.

This module creates an Elasticsearch domain and applies an access policy which permits unlimited access based on the intersection of the following two criteria:

  • source IP address
  • client IAM role

See this Stack Overflow post for further discussion of access policies for Elasticsearch.

Several options affect the resilience and scalability of your Elasticsearch domain. For a production deployment, set instance_count to an even number greater than or equal to 10 (the default is 6), choose an instance_type that is not in the T2 family, and set es_zone_awareness to true. This will result in a cluster with three dedicated master nodes, balanced across two availability zones.

For a production deployment it may also make sense to use EBS volumes rather that instance storage; to do so, set ebs_volume_size greater than 0 and optionally specify a value for ebs_volume_type (right now the only supported values are gp2 and magnetic).


Required

None (but domain_name and management_public_ip_addresses are strongly recommended).

Optional

  • domain_name - unique identifier for the domain. The module will prefix it with tf-. e.g. domain_name = foo will result in a domain called tf-foo.
  • es_version - Elasticsearch version.
  • instance_type - Elasticsearch instance type to use for data nodes (and dedicated master nodes unless otherwise specified).
  • instance_count - Number of instances in the cluster.
  • dedicated_master_type - Elasticsearch instance type to use for dedicated master nodes.
  • management_iam_roles - List of ARNs of IAM roles to be granted full access to the domain.
  • management_public_ip_addresses - List of IP addresses or CIDR blocks from which to permit full access to the domain. Remember that for hosts inside a VPC, you'll want to specify the Elastic IP(s) of any relevant NAT Gateway(s).
  • es_zone_awareness - Enable or disable zone awareness (balancing instances across multiple availability zones). Note that setting this parameter to true and then requesting an odd number of nodes will result in an invalid cluster configuration.
  • ebs_volume_size - Size in GB of EBS volume to attach to each node and use for data storage. If this parameter is set to 0 (the default), nodes will use instance storage.
  • ebs_volume_type - Storage class for EBS volumes. Just use gp2.
  • snapshot_start_hour - Hour of the day (in UTC) at which to begin daily snapshots.

Usage

module "es" {
  source                         = "github.com/terraform-community-modules/tf_aws_elasticsearch?ref=0.0.1"
  domain_name                    = "my-elasticsearch-domain"
  management_public_ip_addresses = ["34.203.XXX.YYY"]
  instance_count                 = 16
  instance_type                  = "m4.2xlarge.elasticsearch"
  dedicated_master_type          = "m4.large.elasticsearch"
  es_zone_awareness              = true
  ebs_volume_size                = 100
  ...
}

Outputs

  • arn - ARN of the created Elasticsearch domain.
  • domain_id - Unique identifier for the domain.
  • endpoint - Domain-specific endpoint used to submit index, search, and data upload requests. Kibana is available at https://${endpoint}/_plugin/kibana/.

Authors

Steve Huff

Changelog

0.0.2 - Bugfix (#1) which prevented module from executing correctly with variable defaults.

0.0.1 - Initial release.

License

This software is released under the MIT License (see LICENSE.md).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.