issue with referencing ipv6 cidr block in subnet #3603
Labels
bug
Something isn't working
new
Un-triaged issue
pre-built providers
Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager
Expected Behavior
I am trying to create a vpc and subnet and assign amazon-provided ipv6 to vpc.
The second resource is subnet which uses the ipv6 cidr_block of vpc but has smaller subnet ("/64").
I assumed this should have worked, since subnet is dependent on vpc,
it should be able to read the ipv6 cidr block of vpc and truncate to /64.
class DbVpcStack(TerraformStack):
def init(
self,
scope: Construct,
stack_id: str,
region: str,
dbvpc_cidr_block: str,
):
super().init(scope, stack_id)
test_vpc = Vpc(
self,
"cmc-vpc",
cidr_block="10.10.0.0/16",
enable_dns_hostnames=True,
tags={**DEFAULT_TAGS, "Name": f"{stack_id}-test"},
assign_generated_ipv6_cidr_block=true
)
test_subnet = Subnet(
self,
"test-subnet-external",
tags={**DEFAULT_TAGS_CMC, "Name": f"{stack_id}-test-external"},
cidr_block="10.10.0.0/16",
availability_zone=REGION_AZ_MAPPING[region][0],
vpc_id=test_vpc.id,
map_public_ip_on_launch=False,
depends_on =[cmc_vpc],
ipv6_cidr_block = test_vpc.ipv6_cidr_block.split("/")[0] + "/64"
)
The text was updated successfully, but these errors were encountered: