File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,12 +4,16 @@ AWS Elasticsearch Service Terraform Module
44Usage:
55
66``` hcl
7+ data "aws_region" "current" {}
8+
9+ data "aws_caller_identity" "current" {}
10+
711module "es-cluster" {
812 source = "git::https://github.com/egarbi/terraform-aws-es-cluster"
913
1014 name = "example"
1115 vpc_id = "vpc-xxxxx"
12- subnet_ids = [ "subnet-one","subnet-two" ]
16+ subnet_ids = [ "subnet-one" ]
1317 zone_id = "ZA863HSKDDD9"
1418 itype = "m4.large.elasticsearch"
1519 ingress_allow_cidr_blocks = [ "10.20.0.0/16", "10.22.0.0/16" ]
@@ -21,9 +25,7 @@ module "es-cluster" {
2125 "Action": "es:*",
2226 "Principal": "*",
2327 "Effect": "Allow",
24- "Condition": {
25- "IpAddress": {"aws:SourceIp": ["66.193.100.22/32"]}
26- }
28+ "Resource": "arn:aws:es:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:domain/example/*"
2729 }
2830 ]
2931}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ module "es-cluster" {
3535 itype = " m4.large.elasticsearch"
3636 icount = 2
3737 zone_awareness = true
38- ingress_allow_cidr_blocks = " ${ tolist ( data. aws_subnet . default . * . cidr_block ) } "
38+ ingress_allow_cidr_blocks = [ " ${ data . aws_vpc . default . cidr_block } " ]
3939 access_policies = << CONFIG
4040{
4141 "Version": "2012-10-17",
You can’t perform that action at this time.
0 commit comments