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 6f338f9 commit 4abdf35
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 4abdf35

Please sign in to comment.