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

[Bug]: data.aws_vpc_ipam_pools lacks ipam_pool_id and/or id values #32106

Closed
trc-ikeskin opened this issue Jun 20, 2023 · 4 comments · Fixed by #32133
Closed

[Bug]: data.aws_vpc_ipam_pools lacks ipam_pool_id and/or id values #32106

trc-ikeskin opened this issue Jun 20, 2023 · 4 comments · Fixed by #32133
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/ipam Issues and PRs that pertain to the ipam service.
Milestone

Comments

@trc-ikeskin
Copy link
Contributor

trc-ikeskin commented Jun 20, 2023

Terraform Core Version

1.3.9

AWS Provider Version

5.4.0

Affected Resource(s)

  • data.aws_vpc_ipam_pools

Expected Behavior

Data source should return a full list of all IPAM pools available in the targeted account, containing information of each pool.
The ipam_pool_id and/or id fields of an individual pool map should be populated with the value retrieved from the AWS API.

Actual Behavior

The ipam_pool_id and/or id fields of an individual pool are not populated by the data source:

  + ipam_pools = [
      + {
          + address_family                    = "ipv4"
          + allocation_default_netmask_length = 0
          + allocation_max_netmask_length     = 0
          + allocation_min_netmask_length     = 0
          + allocation_resource_tags          = {}
          + arn                               = "arn:aws:ec2::xxxxxxxxx:ipam-pool/ipam-pool-0440f4xxxxxxxxx"
          + auto_import                       = false
          + aws_service                       = ""
          + description                       = "xxxxxxxxx"
          + id                                = ""
          + ipam_pool_id                      = ""
          + ipam_scope_id                     = "ipam-scope-0c1b9exxxxxxxxx"
          + ipam_scope_type                   = "private"
          + locale                            = "None"
          + pool_depth                        = 1
          + publicly_advertisable             = false
          + source_ipam_pool_id               = ""
          + state                             = "create-complete"
          + tags                              = {
              + "Name"       = "regions"
              + "managed_by" = "AFT"
            }
        },
      + {
          + address_family                    = "ipv4"
          + allocation_default_netmask_length = 0
          + allocation_max_netmask_length     = 0
          + allocation_min_netmask_length     = 0
          + allocation_resource_tags          = {}
          + arn                               = "arn:aws:ec2::xxxxxxxxx:ipam-pool/ipam-pool-0938263xxxxxxxxx"
          + auto_import                       = false
          + aws_service                       = ""
          + description                       = "xxxxxxxxx"
          + id                                = ""
          + ipam_pool_id                      = ""
          + ipam_scope_id                     = "ipam-scope-0d6b751xxxxxxxxx"
          + ipam_scope_type                   = "private"
          + locale                            = "None"
          + pool_depth                        = 1
          + publicly_advertisable             = false
          + source_ipam_pool_id               = ""
          + state                             = "create-complete"
          + tags                              = {
              + "Name"       = "intra"
              + "managed_by" = "AFT"
            }
        },
        ...

The actual API response however contains all relevant information:

2023-06-20T15:33:03.458+0200 [DEBUG] provider.terraform-provider-aws_v5.4.0_x5: HTTP Response Received: http.status_code=200 @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.30/logger.go:144 aws.service=EC2 http.response.body="<?xml version="1.0" encoding="UTF-8"?>
<DescribeIpamPoolsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>a402aae5-5f34-4b0b-94ce-75182b57375b</requestId>
    <ipamPoolSet>
        <item>
            <addressFamily>ipv4</addressFamily>
            <autoImport>false</autoImport>
            <description>xxxxxxxxxx</description>
            <ipamArn>arn:aws:ec2::xxxxxxxxxx:ipam/ipam-044f7b68xxxxxxxxxx</ipamArn>
            <ipamPoolArn>arn:aws:ec2::xxxxxxxxxx:ipam-pool/ipam-pool-0440f45xxxxxxxxxx</ipamPoolArn>
            <ipamPoolId>ipam-pool-0440f45136xxxxxxxxxx</ipamPoolId>
            <ipamRegion>eu-central-1</ipamRegion>
            <ipamScopeArn>arn:aws:ec2::xxxxxxxxxx:ipam-scope/ipam-scope-0c1b9e62xxxxxxxxxx</ipamScopeArn>
            <ipamScopeType>private</ipamScopeType>
            <locale>None</locale>
            <ownerId>xxxxxxxxxx</ownerId>
            <poolDepth>1</poolDepth>
            <state>create-complete</state>
            <tagSet>
                <item>
                    <key>managed_by</key>
                    <value>AFT</value>
                </item>
                <item>
                    <key>Name</key>
                    <value>regions</value>
                </item>
            </tagSet>
        </item>
        <item>
            <addressFamily>ipv4</addressFamily>
            <allocationDefaultNetmaskLength>25</allocationDefaultNetmaskLength>
            <allocationMaxNetmaskLength>25</allocationMaxNetmaskLength>
            <allocationMinNetmaskLength>25</allocationMinNetmaskLength>
            <autoImport>false</autoImport>
            <description>xxxxxxxxxx</description>
            <ipamArn>arn:aws:ec2::xxxxxxxxxx:ipam/ipam-044f7bxxxxxxxxxx</ipamArn>
            <ipamPoolArn>arn:aws:ec2::xxxxxxxxxx:ipam-pool/ipam-pool-05e2f5xxxxxxxxxx</ipamPoolArn>
            <ipamPoolId>ipam-pool-05e2f5dxxxxxxxxxx</ipamPoolId>
            <ipamRegion>eu-central-1</ipamRegion>
            <ipamScopeArn>arn:aws:ec2::xxxxxxxxxx:ipam-scope/ipam-scope-0d6b751xxxxxxxxxx</ipamScopeArn>
            <ipamScopeType>private</ipamScopeType>
            <locale>eu-central-1</locale>
            <ownerId>xxxxxxxxxx</ownerId>
            <poolDepth>2</poolDepth>
            <sourceIpamPoolId>ipam-pool-09382634dxxxxxxxxxx</sourceIpamPoolId>
            <state>create-complete</state>
            <tagSet>
                <item>
                    <key>managed_by</key>
                    <value>AFT</value>
                </item>
                <item>
                    <key>Name</key>
                    <value>eu-central-1</value>
                </item>
            </tagSet>
        </item>
        <item>
            <addressFamily>ipv4</addressFamily>
            <allocationDefaultNetmaskLength>22</allocationDefaultNetmaskLength>
            <allocationMaxNetmaskLength>22</allocationMaxNetmaskLength>
            <allocationMinNetmaskLength>22</allocationMinNetmaskLength>
            <autoImport>false</autoImport>
            <description>xxxxxxxxxx</description>
            <ipamArn>arn:aws:ec2::xxxxxxxxxx:ipam/ipam-044f7b681xxxxxxxxxx</ipamArn>
            <ipamPoolArn>arn:aws:ec2::xxxxxxxxxx:ipam-pool/ipam-pool-08f567c03xxxxxxxxxx</ipamPoolArn>
            <ipamPoolId>ipam-pool-08f567c03xxxxxxxxxx</ipamPoolId>
            <ipamRegion>eu-central-1</ipamRegion>
            <ipamScopeArn>arn:aws:ec2::xxxxxxxxxx:ipam-scope/ipam-scope-0c1b9xxxxxxxxxx</ipamScopeArn>
            <ipamScopeType>private</ipamScopeType>
            <locale>eu-central-1</locale>
            <ownerId>xxxxxxxxxx</ownerId>
            <poolDepth>2</poolDepth>
            <sourceIpamPoolId>ipam-pool-0440f4513xxxxxxxxxx</sourceIpamPoolId>
            <state>create-complete</state>
            <tagSet>
                <item>
                    <key>managed_by</key>
                    <value>AFT</value>
                </item>
                <item>
[truncated...]"

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  region = "eu-central-1"
}

data "aws_vpc_ipam_pools" "test" {
  filter {
    name   = "address-family"
    values = ["ipv4"]
  }
}

output "ipam_pools" {
  value = data.aws_vpc_ipam_pools.test.ipam_pools
}

Steps to Reproduce

  • Create IPAM pools in the target account
  • Query the information via the following data source:
data "aws_vpc_ipam_pools" "test" {
  filter {
    name   = "address-family"
    values = ["ipv4"]
  }
}
  • Output the result using an ouput:
output "ipam_pools" {
  value = data.aws_vpc_ipam_pools.test.ipam_pools
}`

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

Yes

@trc-ikeskin trc-ikeskin added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 20, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/ipam Issues and PRs that pertain to the ipam service. label Jun 20, 2023
@justinretzolk justinretzolk added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 20, 2023
@aryangupta701
Copy link

Hello I want to work on this issue

ewbankkit added a commit that referenced this issue Oct 30, 2023
…missing_ids

fix: add missing 'id' values in pool map (#32106)
@github-actions github-actions bot added this to the v5.24.0 milestone Oct 30, 2023
Copy link

github-actions bot commented Nov 2, 2023

This functionality has been released in v5.24.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Dec 3, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/ipam Issues and PRs that pertain to the ipam service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants