-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Is your request related to a new offering from AWS?
Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.
- No 🛑: please wait to file a request until the functionality is avaialble in the AWS provider
- Yes ✅: please list the AWS provider version which introduced this functionality
N/A
Is your request related to a problem? Please describe.
No, just looking for guidance on how to use wrappers with terragrunt stacks. I've created a unit that I'd like to use to create multiple security groups, some of which will need to reference each other, e.g. creating a compute security group that will allow traffic in from an ALB security group
unit "security-groups" {
source = "${local.units_path}/security-group"
path = "security-groups"
values = {
sg_objects = {
alb_sg = {
name = "plat-infra-${local.name}-alb-sg"
description = "Security Group that allows global http/https traffic to ALB."
ingress_rules = [
"http-80-tcp",
"https-443-tcp"
]
ingress_with_cidr_blocks = [
{
from_port = 8443,
to_port = 8443,
protocol = "tcp",
description = "Allows global http traffic to secondary ALB listeners.",
cidr_blocks = "0.0.0.0/0"
}
]
egress_rules = ["all-all"]
}
base_sg = {
name = "plat-infra-${local.name}-base-sg"
description = "Base Security Group applied to all compute instances."
#ingress_rules = ["http-80-tcp"]
ingress_with_source_security_group_id = [
{
rule = "http-80-tcp",
source_security_group_id = dependency.wrapper.outputs.wrapper["alb_sg"].security_group_id
}
]
egress_rules = ["all-all"]
}
}
}
}My unit terragrunt.hcl
terraform {
source = "git::[email protected]:terraform-aws-modules/terraform-aws-security-group.git//wrappers?ref=v5.3.1"
}
include "root" {
path = find_in_parent_folders("root.hcl")
}
dependency "vpc" {
config_path = "../vpc"
mock_outputs = {
vpc_id = "mock-vpc-id"
}
}
dependency "wrapper" {
config_path = "."
mock_outputs = {
wrapper = "mock_wrapper"
}
}
inputs = {
defaults = {
vpc_id = dependency.vpc.outputs.vpc_id
}
items = values.sg_objects
}Describe the solution you'd like.
Looking for guidance on the simplest way to chain security groups.
Describe alternatives you've considered.
I've attempted a few ways to get outputs from the wrapper, but I get a no variable named error.
Additional context
None
Metadata
Metadata
Assignees
Labels
No labels