Last active
August 12, 2022 21:11
-
-
Save jritsema/5e73be8a86b347a67a2f2e6a84d332ec to your computer and use it in GitHub Desktop.
Using a Terraform Module Both Inside and Outside of Proton
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
resource "aws_alb" "main" { | |
name = local.name | |
internal = local.internal | |
subnets = split(",", local.internal == true ? local.private_subnets : local.public_subnets) | |
} |
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
locals { | |
# inside of proton | |
# (from proton.service_instance.variables.tf at runtime) | |
name = var.service_instance.inputs.name | |
vpc = var.service_instance.inputs.vpc | |
private_subnets = var.service_instance.inputs.private_subnets | |
public_subnets = var.service_instance.inputs.public_subnets | |
internal = var.service_instance.inputs.internal | |
} |
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
locals { | |
# outside of Proton | |
# (from variables.tf) | |
name = var.name | |
vpc = var.vpc | |
private_subnets = var.private_subnets | |
public_subnets = var.public_subnets | |
internal = var.internal | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment