File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments