-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arunsai14
committed
Nov 6, 2024
1 parent
bf5e171
commit beb39cd
Showing
14 changed files
with
324 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
region = "us-east-2" | ||
engine_version = "OpenSearch_2.15" | ||
instance_type = "m5.large.search" | ||
instance_count = 2 | ||
|
||
# # Access policy as a Heredoc block | ||
# access_policy = <<POLICY | ||
# { | ||
# "Version": "2012-10-17", | ||
# "Statement": [ | ||
# { | ||
# "Effect": "Allow", | ||
# "Principal": { | ||
# "AWS": "*" | ||
# }, | ||
# "Action": "es:*", | ||
# "Resource": "arn:aws:es:us-east-2:804295906245:domain/arc-opensearch-domain/*" | ||
# } | ||
# ] | ||
# } | ||
# POLICY | ||
region = "us-east-2" | ||
project_name = "arc" | ||
engine_version = "OpenSearch_2.15" | ||
instance_type = "m5.large.search" | ||
instance_count = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
data "aws_vpc" "default" { | ||
filter { | ||
name = "tag:Name" | ||
values = var.vpc_name != null ? [var.vpc_name] : ["${var.namespace}-${var.environment}-vpc"] | ||
} | ||
} | ||
|
||
# network | ||
data "aws_subnets" "private" { | ||
filter { | ||
name = "tag:Name" | ||
|
||
## try the created subnets from the upstream network module, or override with custom names | ||
values = length(var.subnet_names) > 0 ? var.subnet_names : [ | ||
"${var.namespace}-${var.environment}-private-subnet-private-${var.region}a", | ||
"${var.namespace}-${var.environment}-private-subnet-private-${var.region}b" | ||
] | ||
} | ||
|
||
filter { | ||
name = "vpc-id" | ||
values = [data.aws_vpc.default.id] | ||
} | ||
} | ||
|
||
data "aws_subnet" "private" { | ||
for_each = toset(data.aws_subnets.private.ids) | ||
id = each.value | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,5 @@ | ||
region = "us-east-2" | ||
domain_name = "arc-opensearch-domain" | ||
project_name = "arc" | ||
engine_version = "OpenSearch_2.15" | ||
instance_type = "m5.large.search" | ||
instance_count = 2 | ||
|
||
# Access policy as a Heredoc block | ||
access_policy = <<POLICY | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": "*" | ||
}, | ||
"Action": "es:*", | ||
"Resource": "arn:aws:es:us-east-2:804295906245:domain/arc-opensearch-domain/*" | ||
} | ||
] | ||
} | ||
POLICY | ||
|
||
ingress_rules = [ | ||
{ | ||
from_port = 80 | ||
to_port = 80 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
}, | ||
{ | ||
from_port = 443 | ||
to_port = 443 | ||
protocol = "tcp" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
] | ||
|
||
egress_rules = [ | ||
{ | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" # "-1" allows all protocols | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,27 @@ | ||
locals { | ||
private_subnet_ids = [for s in data.aws_subnet.private : s.id] | ||
private_subnet_azs = [for s in data.aws_subnet.private : s.availability_zone] | ||
|
||
ingress_rules = [ | ||
{ | ||
from_port = 80 | ||
to_port = 80 | ||
protocol = "tcp" | ||
cidr_blocks = [data.aws_vpc.default.cidr_block] | ||
}, | ||
{ | ||
from_port = 443 | ||
to_port = 443 | ||
protocol = "tcp" | ||
cidr_blocks = [data.aws_vpc.default.cidr_block] | ||
} | ||
] | ||
|
||
egress_rules = [ | ||
{ | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
] | ||
} |
Oops, something went wrong.