rhythmic-lamp-79430
12/30/2021, 4:01 AMresource_vpc = aws.ec2.Vpc(
resource_name=vars['vpc_name'],
cidr_block=vars['cidr'],
enable_classiclink_dns_support=True,
enable_dns_hostnames=True,
assign_generated_ipv6_cidr_block=True,
tags={
"Name": vars['vpc_name'],
}
)
and then would like to use the resource_vpc.ipv6_cidr_block
attribute to assign IPv6 CIDRs to subnets.
However, the representation of this attribute is required as string to the network IPNetwork function I am using to create IPv6 Subnets…
Any idea how I can obtain the string value? Thanks in advancebillowy-army-68599
rhythmic-lamp-79430
12/30/2021, 4:14 AMget_vpc = aws.ec2.get_vpc(id=resource_vpc.id)
ipv6_network = IPNetwork(get_vpc.ipv6_cidr_block)
ipv6_subnets = list(ipv6_network.subnet(64))
for idx, name in enumerate(subnet_names):
aws.ec2.Subnet(
resource_name=name,
vpc_id=resource_vpc.id,
cidr_block=str(ipv4_subnets[idx]),
availability_zone_id=az.zone_ids[idx],
ipv6_cidr_block=str(ipv6_subnets[idx]),
tags={
"Name": name,
})
depends_on
but no luck…
vpc_info = aws.ec2.get_vpc(id=resource_vpc.id, opts=ResourceOptions(depends_on=[resource_vpc]))
any suggestion?