Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocp maps/pen 40 #4

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .spacelift/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version: 1
module_version: 0.1.0
module_version: 0.2.0
22 changes: 16 additions & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,24 @@ output "public_subnets_az_ids" {
value = aws_subnet.public[*].availability_zone_id
}

output "database_subnets_az_names" {
description = "List of AZ names of database subnets"
value = aws_subnet.database[*].availability_zone
output "intra_subnets_az_names" {
description = "List of AZ names of intra subnets"
value = aws_subnet.intra[*].availability_zone
}

output "database_subnets_az_ids" {
description = "List of AZ IDs of database subnets"
value = aws_subnet.database[*].availability_zone_id
output "intra_subnets_az_ids" {
description = "List of AZ IDs of intra subnets"
value = aws_subnet.intra[*].availability_zone_id
}

output "tgw_subnets_az_names" {
description = "List of AZ names of tgw subnets"
value = aws_subnet.tgw[*].availability_zone
}

output "tgw_subnets_az_ids" {
description = "List of AZ IDs of tgw subnets"
value = aws_subnet.tgw[*].availability_zone_id
}

################################################################################
Expand Down
8 changes: 4 additions & 4 deletions tgw.tf
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ locals {
create_public_to_tgw = (local.create_public_subnets && contains(local.subnets_tgw_routed, "public"))
public_to_tgw_cidr_pairs = local.create_public_to_tgw ? flatten([
for public_rtb in aws_route_table.public : [
for cidr in var.transit_gateway_routes["public"]: {
for cidr in var.transit_gateway_routes["public"] : {
rtb_id = public_rtb.id
cidr = cidr
}
Expand All @@ -192,7 +192,7 @@ locals {
}

resource "aws_route" "public_to_tgw" {
for_each = local.create_public_to_tgw ? {for i, v in local.public_to_tgw_cidr_pairs : "${i}-${v.cidr}" => v} : {}
for_each = local.create_public_to_tgw ? { for i, v in local.public_to_tgw_cidr_pairs : "${i}-${v.cidr}" => v } : {}

destination_cidr_block = can(regex("^pl-", each.value.cidr)) ? null : each.value.cidr
destination_prefix_list_id = can(regex("^pl-", each.value.cidr)) ? each.value.cidr : null
Expand All @@ -208,7 +208,7 @@ locals {
create_private_to_tgw = (local.create_private_subnets && contains(local.subnets_tgw_routed, "private"))
private_to_tgw_cidr_pairs = local.create_private_to_tgw ? flatten([
for private_rtb in aws_route_table.private : [
for cidr in var.transit_gateway_routes["private"]: {
for cidr in var.transit_gateway_routes["private"] : {
rtb_id = private_rtb.id
cidr = cidr
}
Expand All @@ -217,7 +217,7 @@ locals {
}

resource "aws_route" "private_to_tgw" {
for_each = local.create_private_to_tgw ? {for i, v in local.private_to_tgw_cidr_pairs : "${i}-${v.cidr}" => v} : {}
for_each = local.create_private_to_tgw ? { for i, v in local.private_to_tgw_cidr_pairs : "${i}-${v.cidr}" => v } : {}

destination_cidr_block = can(regex("^pl-", each.value.cidr)) ? null : each.value.cidr
destination_prefix_list_id = can(regex("^pl-", each.value.cidr)) ? each.value.cidr : null
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ variable "name_prefix" {
}

variable "short_aws_region" {
type = string
description = "The AWS region code where the VPC will be created"
type = string
}

variable "vpc_name_suffix" {
Expand Down
Loading