[Bug]: IPAM - The request can only contain PubliclyAdvertisable if the AddressFamily is IPv6 and PublicIpSource is byoip. #39967
Labels
bug
Addresses a defect in current functionality.
prioritized
Part of the maintainer teams immediate focus. To be addressed within the current quarter.
regression
Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.
service/ipam
Issues and PRs that pertain to the ipam service.
Terraform Core Version
1.9.8
AWS Provider Version
5.72.x
Affected Resource(s)
aws_vpc_ipam_pool
Expected Behavior
with following parameters:
public_ip_source = amazon
ip_scope_type = public
address_family = ipv6
aws_service = ec2
"publicly_advertisable" parameter should not be passed in this case
I expect to be able to create an IPAM pool that allocates an AWS generated CIDR block.
Actual Behavior
publicly_advertisable parameter is passed, doesn't matter which value it has.
you get the error 'The request can only contain PubliclyAdvertisable if the AddressFamily is IPv6 and PublicIpSource is byoip.'
seems like the wrong checks are done here:
terraform-provider-aws/internal/service/ec2/ipam_pool.go
Line 207 in ce1c31d
a check should be done on PublicIpSource instead of IpamScopeType?
Relevant Error/Panic Output Snippet
Error: creating IPAM Pool: operation error EC2: CreateIpamPool, https response error StatusCode: 400, RequestID: blabla, api error InvalidParameterCombination: The request can only contain PubliclyAdvertisable if the AddressFamily is IPv6 and PublicIpSource is byoip.
Terraform Configuration Files
Steps to Reproduce
run this code with the AWS provider on ~> 5.0 and with provider version 5.56.1 for example (I used this version because it was in my local .terraform providers and I knew at some point my configuration worked)
Debug Output
#failing request: it has PubliclyAdvertisable passed.
#working request (provider 5.56.1): PubliclyAdvertisable is not passed, however in my TF configuration I didn't change anything
Panic Output
No response
Important Factoids
you probably need to decrease the CIDR sizes in order to run this, I had my quote increased by AWS. (default limit is /52)
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: