Skip to content

Commit

Permalink
Fix fmt + add non OSS version
Browse files Browse the repository at this point in the history
  • Loading branch information
grem11n committed Feb 13, 2024
1 parent 1eeca19 commit c9fad77
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: ['1.5.7']
terraform: ['1.5.7', '1.7.3']
steps:
- uses: actions/checkout@master
- uses: hashicorp/setup-terraform@v1
Expand All @@ -38,7 +38,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
terraform: ['1.5.7']
terraform: ['1.5.7', '1.7.3']
steps:
- name: Set up Go
uses: actions/setup-go@v2
Expand Down
16 changes: 8 additions & 8 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ data "aws_subnet" "peer" {

# this vpc main route table
data "aws_route_table" "this_main_route_table" {
provider = aws.this
provider = aws.this
vpc_id = var.this_vpc_id
filter {
name = "association.main"
values = ["true"]
}
}
}

# this subnets
data "aws_subnets" "this" {
provider = aws.this
provider = aws.this
filter {
name = "vpc-id"
values = [var.this_vpc_id]
Expand All @@ -58,7 +58,7 @@ data "aws_subnets" "this" {

# get route tables associated with subnets
data "aws_route_tables" "this_associated_route_tables" {
for_each = { for subnet in data.aws_subnets.this.ids: subnet => subnet }
for_each = { for subnet in data.aws_subnets.this.ids : subnet => subnet }
provider = aws.this
vpc_id = var.this_vpc_id
filter {
Expand All @@ -72,17 +72,17 @@ data "aws_route_tables" "this_associated_route_tables" {

# peer vpc main route table
data "aws_route_table" "peer_main_route_table" {
provider = aws.peer
provider = aws.peer
vpc_id = var.peer_vpc_id
filter {
name = "association.main"
values = ["true"]
}
}
}

# peer subnets
data "aws_subnets" "peer" {
provider = aws.peer
provider = aws.peer
filter {
name = "vpc-id"
values = [var.peer_vpc_id]
Expand All @@ -91,7 +91,7 @@ data "aws_subnets" "peer" {

# get route tables associated with subnets
data "aws_route_tables" "peer_associated_route_tables" {
for_each = { for subnet in data.aws_subnets.peer.ids: subnet => subnet }
for_each = { for subnet in data.aws_subnets.peer.ids : subnet => subnet }
provider = aws.peer
vpc_id = var.peer_vpc_id
filter {
Expand Down
24 changes: 12 additions & 12 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ locals {

# Rout table should either be the one for the vpc, or the ones associated to the subnets if subnets are given
this_subnet_route_table_map = {
for subnet in data.aws_subnets.this.ids:
subnet => concat(
data.aws_route_tables.this_associated_route_tables[subnet].ids,
[data.aws_route_table.this_main_route_table.id]
)[0]
for subnet in data.aws_subnets.this.ids :
subnet => concat(
data.aws_route_tables.this_associated_route_tables[subnet].ids,
[data.aws_route_table.this_main_route_table.id]
)[0]
}

peer_subnet_route_table_map = {
for subnet in data.aws_subnets.peer.ids:
subnet => concat(
data.aws_route_tables.peer_associated_route_tables[subnet].ids,
[data.aws_route_table.peer_main_route_table.id]
)[0]
for subnet in data.aws_subnets.peer.ids :
subnet => concat(
data.aws_route_tables.peer_associated_route_tables[subnet].ids,
[data.aws_route_table.peer_main_route_table.id]
)[0]
}

this_rts_ids = length(var.this_subnets_ids) == 0 ? distinct(values(local.this_subnet_route_table_map)) : distinct([
for subnet_id in var.this_subnets_ids : local.this_subnet_route_table_map[subnet_id]
])

peer_rts_ids = length(var.peer_subnets_ids) == 0 ? distinct(values(local.peer_subnet_route_table_map)) : distinct([
for subnet_id in var.peer_subnets_ids : local.peer_subnet_route_table_map[subnet_id]
])
Expand Down Expand Up @@ -61,7 +61,7 @@ locals {
}
]



# Routes for associated subnets
this_associated_routes = [
Expand Down

0 comments on commit c9fad77

Please sign in to comment.