Skip to content

Commit 74dc087

Browse files
authored
Merge pull request #18 from egarbi/automated_testing
Adds example to be used as an input for testing
2 parents fa44d9e + 285c44f commit 74dc087

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

example/main.tf

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Configure the AWS Provider
2+
provider "aws" {
3+
version = "~> 2.0"
4+
region = "eu-central-1"
5+
}
6+
7+
data "aws_vpc" "default" {
8+
default = true
9+
}
10+
11+
data "aws_subnet_ids" "default" {
12+
vpc_id = "${data.aws_vpc.default.id}"
13+
}
14+
15+
data "aws_subnet" "default" {
16+
count = "${length(data.aws_subnet_ids.default.ids)}"
17+
id = "${tolist(data.aws_subnet_ids.default.ids)[count.index]}"
18+
}
19+
20+
data "aws_route53_zone" "selected" {
21+
name = "qndesign.studio"
22+
}
23+
24+
module "es-cluster" {
25+
source = "../"
26+
27+
name = "example"
28+
vpc_id = "${data.aws_vpc.default.id}"
29+
subnet_ids = "${tolist(data.aws_subnet_ids.default.ids)}"
30+
zone_id = "${data.aws_route53_zone.selected.zone_id}"
31+
itype = "m4.large.elasticsearch"
32+
ingress_allow_cidr_blocks = "${tolist(data.aws_subnet.default.*.cidr_block)}"
33+
access_policies = <<CONFIG
34+
{
35+
"Version": "2012-10-17",
36+
"Statement": [
37+
{
38+
"Action": "es:*",
39+
"Principal": "*",
40+
"Effect": "Allow",
41+
"Condition": {
42+
"IpAddress": {"aws:SourceIp": ["156.114.160.31/32"]}
43+
}
44+
}
45+
]
46+
}
47+
CONFIG
48+
49+
}

0 commit comments

Comments
 (0)