Skip to content

Commit

Permalink
Merge pull request #18 from egarbi/automated_testing
Browse files Browse the repository at this point in the history
Adds example to be used as an input for testing
  • Loading branch information
egarbi authored Oct 31, 2019
2 parents fa44d9e + 285c44f commit 74dc087
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions example/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Configure the AWS Provider
provider "aws" {
version = "~> 2.0"
region = "eu-central-1"
}

data "aws_vpc" "default" {
default = true
}

data "aws_subnet_ids" "default" {
vpc_id = "${data.aws_vpc.default.id}"
}

data "aws_subnet" "default" {
count = "${length(data.aws_subnet_ids.default.ids)}"
id = "${tolist(data.aws_subnet_ids.default.ids)[count.index]}"
}

data "aws_route53_zone" "selected" {
name = "qndesign.studio"
}

module "es-cluster" {
source = "../"

name = "example"
vpc_id = "${data.aws_vpc.default.id}"
subnet_ids = "${tolist(data.aws_subnet_ids.default.ids)}"
zone_id = "${data.aws_route53_zone.selected.zone_id}"
itype = "m4.large.elasticsearch"
ingress_allow_cidr_blocks = "${tolist(data.aws_subnet.default.*.cidr_block)}"
access_policies = <<CONFIG
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "es:*",
"Principal": "*",
"Effect": "Allow",
"Condition": {
"IpAddress": {"aws:SourceIp": ["156.114.160.31/32"]}
}
}
]
}
CONFIG

}

0 comments on commit 74dc087

Please sign in to comment.