1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
Hello.
I think the following blogs will be helpful.
You need to associate IPv6 with the subnet as shown below.
https://medium.com/@mattias.holmlund/setting-up-ipv6-on-amazon-with-terraform-e14b3bfef577
resource "aws_vpc" "eu-central-1" {
provider = "aws.eu-central-1"
enable_dns_support = true
enable_dns_hostnames = true
assign_generated_ipv6_cidr_block = true
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "eu-central-1" {
provider = "aws.eu-central-1"
vpc_id = "${aws_vpc.eu-central-1.id}"
cidr_block = "${cidrsubnet(aws_vpc.eu-central-1.cidr_block, 4, 1)}"
map_public_ip_on_launch = true
ipv6_cidr_block = "${cidrsubnet(aws_vpc.eu-central-1.ipv6_cidr_block, 8, 1)}"
assign_ipv6_address_on_creation = true
}
So in your case, wouldn't you need to set the subnet part as follows?
resource "aws_subnet" "public" {
assign_ipv6_address_on_creation = true
vpc_id = aws_vpc.testvpc.id
count = length(var.ipv4_cidrs)
availability_zone = var.azs
tags = {
name = "${aws_vpc.testvpc.tags.Name}-public-subnet-${count.index}"
}
cidr_block = element(var.ipv4_cidrs, count.index)
ipv6_cidr_block = "${cidrsubnet(aws_vpc.testvpc.ipv6_cidr_block, 8, 1)}"
}
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 4 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 10 Monaten