Closed yannickvranckx closed 1 year ago
The module has outputs for this purpose. See https://github.com/terraform-aws-modules/terraform-aws-vpc#output_private_subnets and https://github.com/terraform-aws-modules/terraform-aws-vpc#output_private_subnets etc. etc.
All the outputs are documented in the README file.
I'm using cdktf
and I'm getting an error - instead of the subnetIds
(e.g., subnet-00XXXX
) the outputs are the IPv4 CIDRs (e.g., 10.0.1.0/24
)
Edit: I'm working around this by creating a new data_aws_subnets
/DataAwsSubnets
resource to look up by vpc-id
and my tags, but just an FYI!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
Is there a possibility to extract the subnet-ids from the module when it is being deployed? For example: To create a Transit Gateway attachment to an existing Transit Gateway for example, as that resource needs subnet-ids to operate.
Versions
Module version [Required]: 5.0
Terraform version: 1.5.2 - darwin_amd64
Provider version(s): Installing hashicorp/aws v5.7.0...
Reproduction Code [Required]
` module "vpc" { source = "terraform-aws-modules/vpc/aws" #Source of the module
name = var.name cidr = var.cidr
azs = var.azs private_subnets = var.private_subnets public_subnets = var.public_subnets
enable_nat_gateway = false #Disable the NAT GW single_nat_gateway = false #NAT not HA enable_vpn_gateway = false enable_flow_log = true #Enable flow logs flow_log_destination_type = "s3" # Set the destination flow_log_destination_arn = resource.aws_s3_bucket.flow_logs.arn enable_dns_hostnames = true enable_dns_support = true } `