Skip to content

Commit

Permalink
Add working example usage
Browse files Browse the repository at this point in the history
This creates all the base resources necessary to test the
elasticsearch-cleanup module. Unfortunately this requires a two stage
apply as the `aws_route53_zone` resource fails to compute ID when
passed into other modules. See: cloudposse/terraform-aws-elasticsearch#13
  • Loading branch information
joshmyers committed Dec 14, 2018
1 parent 062d463 commit 19b899e
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions example/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module "vpc" {
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=master"
namespace = "example"
stage = "dev"
name = "app"
}

module "subnets" {
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=master"
namespace = "example"
stage = "dev"
name = "app"
region = "us-west-2"
vpc_id = "${module.vpc.vpc_id}"
igw_id = "${module.vpc.igw_id}"
cidr_block = "10.0.0.0/16"
availability_zones = ["us-west-2a", "us-west-2b"]
}

module "elasticsearch" {
source = "git::https://github.com/cloudposse/terraform-aws-elasticsearch.git?ref=tags/0.1.5"
namespace = "example"
stage = "dev"
name = "es"
dns_zone_id = "Z3SO0TKDDQ0RGG"
security_groups = []
vpc_id = "${module.vpc.vpc_id}"
subnet_ids = ["${module.subnets.public_subnet_ids}"]
zone_awareness_enabled = "true"
elasticsearch_version = "6.2"
instance_type = "t2.small.elasticsearch"
instance_count = 4
kibana_subdomain_name = "example-kibana-es"
encrypt_at_rest_enabled = "false"
ebs_volume_size = 10
iam_actions = ["es:*"]
iam_role_arns = ["*"]
create_iam_service_linked_role = "false"
}

module "elasticsearch-cleanup" {
source = "../"
es_endpoint = "${module.elasticsearch.domain_endpoint}"
es_domain_arn = "${module.elasticsearch.domain_arn}"
es_security_group_id = "${module.elasticsearch.security_group_id}"
vpc_id = "${module.vpc.vpc_id}"
enabled = "true"
namespace = "example"
stage = "dev"
schedule = "rate(5 minutes)"
}

0 comments on commit 19b899e

Please sign in to comment.