Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/aws_vpc_ipam_pool: set publicly_advertisable only if public_ip_source = byoip and address_family = ipv6 #39600

Merged
merged 15 commits into from
Oct 8, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions internal/service/ec2/ipam_pool_test.go
Original file line number Diff line number Diff line change
@@ -234,6 +234,27 @@ func TestAccIPAMPool_tags(t *testing.T) {
})
}

func TestAccIPAMPool_ipv6PrivateScope(t *testing.T) {
ctx := acctest.Context(t)
var pool awstypes.IpamPool
resourceName := "aws_vpc_ipam_pool.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckIPAMPoolDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccIPAMPoolConfig_ipv6PrivateScope,
Check: resource.ComposeTestCheckFunc(
testAccCheckIPAMPoolExists(ctx, resourceName, &pool),
),
},
},
})
}

func testAccCheckIPAMPoolExists(ctx context.Context, n string, v *awstypes.IpamPool) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
@@ -384,3 +405,15 @@ resource "aws_vpc_ipam_pool" "test" {
}
`, tagKey1, tagValue1, tagKey2, tagValue2))
}

var testAccIPAMPoolConfig_ipv6PrivateScope = acctest.ConfigCompose(testAccIPAMScopeConfig_base, `
resource "aws_vpc_ipam_scope" "test" {
ipam_id = aws_vpc_ipam.test.id
}

resource "aws_vpc_ipam_pool" "test" {
address_family = "ipv6"
ipam_scope_id = aws_vpc_ipam_scope.test.id
locale = data.aws_region.current.name
}
`)
Loading