Skip to content

TPT-4479: Added support for Configurable VPC IPv4 Prefixes#2402

Open
ezilber-akamai wants to merge 4 commits into
linode:proj/configurable-vpc-ipv4-preifxesfrom
ezilber-akamai:TPT-4479-configurable-vpc-ipv4-prefixes
Open

TPT-4479: Added support for Configurable VPC IPv4 Prefixes#2402
ezilber-akamai wants to merge 4 commits into
linode:proj/configurable-vpc-ipv4-preifxesfrom
ezilber-akamai:TPT-4479-configurable-vpc-ipv4-prefixes

Conversation

@ezilber-akamai

@ezilber-akamai ezilber-akamai commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Added support for the new ipv4 field in the VPC resource/datasource and the VPCs datasource. Also added a new datasource for the new GET vpcs/default_ranges endpoint.

✔️ How to Test

make test-int PKG_NAME="vpc" TEST_CASE="TestAccDataSourceVPC_ipv4"
make test-int PKG_NAME="vpc" TEST_CASE="TestAccResourceVPC_ipv4"
make test-int PKG_NAME="vpcdefaultranges" TEST_CASE="TestAccDataSourceVPCDefaultRanges_basic"
make test-int PKG_NAME="vpcs" TEST_CASE="TestAccDataSourceVPCs_ipv4"

I also fixed an unrelated LKE test that was failing:
make test-int PKG_NAME="lke" TEST_CASE="TestAccDataSourceLKECluster_enterprise"

@ezilber-akamai ezilber-akamai requested review from a team as code owners July 2, 2026 15:43
@ezilber-akamai ezilber-akamai added the new-feature for new features in the changelog. label Jul 2, 2026
@ezilber-akamai ezilber-akamai requested review from psnoch-akamai and yec-akamai and removed request for a team July 2, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Terraform support for configurable VPC IPv4 prefixes across the VPC resource and related data sources, and introduces a new data source for the GET /vpcs/default_ranges endpoint to expose default/forbidden IPv4 ranges.

Changes:

  • Added ipv4 to the VPC framework resource/schema/models and implemented create/update handling for IPv4 ranges.
  • Extended VPC/VPCs data source coverage and acceptance test templates to validate the new ipv4 field.
  • Added a new linode_vpc_default_ranges framework data source, docs, and CI integration-test suite coverage.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
linode/vpcs/tmpl/template.go Extends VPCs test template data to include IPv4 range inputs.
linode/vpcs/tmpl/data_ipv4.gotf Adds VPCs data source acceptance template exercising IPv4 output.
linode/vpcs/datasource_test.go Adds acceptance coverage for linode_vpcs returning ipv4.
linode/vpcdefaultranges/tmpl/template.go Adds helper to render the new default-ranges data source template.
linode/vpcdefaultranges/tmpl/data_basic.gotf Adds basic HCL template for linode_vpc_default_ranges.
linode/vpcdefaultranges/framework_schema_datasource.go Defines schema for default/forbidden IPv4 range sets.
linode/vpcdefaultranges/framework_models.go Implements state model parsing for default/forbidden ranges.
linode/vpcdefaultranges/framework_datasource.go Implements the new framework data source Read calling GetVPCDefaultRanges.
linode/vpcdefaultranges/datasource_test.go Adds acceptance test for the new data source.
linode/vpc/tmpl/template.go Adds VPC resource/data source templates for IPv4 range configs.
linode/vpc/tmpl/ipv4.gotf Adds VPC resource template configuring a single IPv4 range.
linode/vpc/tmpl/ipv4_update.gotf Adds VPC resource template configuring multiple IPv4 ranges (update scenario).
linode/vpc/tmpl/data_ipv4.gotf Adds VPC data source template validating IPv4 output.
linode/vpc/resource_test.go Adds acceptance coverage for VPC IPv4 create/update/import flows.
linode/vpc/framework_schema_resource.go Adds ipv4 list nested attribute to the VPC resource schema.
linode/vpc/framework_schema_datasource.go Adds ipv4 list nested attribute to the VPC data source schema attrs.
linode/vpc/framework_resource.go Adds IPv4 create/update request mapping and mismatch validation.
linode/vpc/framework_models.go Adds IPv4 flatten/copy logic for resource and data source models.
linode/vpc/datasource_test.go Adds acceptance coverage for linode_vpc returning ipv4.
linode/lke/framework_datasource_test.go Adjusts enterprise LKE data source test region selection logic.
linode/framework_provider.go Registers the new linode_vpc_default_ranges framework data source.
docs/resources/vpc.md Documents the new ipv4 argument and provides an example.
docs/data-sources/vpcs.md Documents ipv4 output for the VPCs data source.
docs/data-sources/vpc.md Documents ipv4 output for the VPC data source.
docs/data-sources/vpc_default_ranges.md Adds documentation for the new default-ranges data source.
.github/workflows/integration_tests.yml Adds vpcdefaultranges to the integration test suite list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode/vpcdefaultranges/framework_datasource.go Outdated
Comment thread linode/vpcdefaultranges/datasource_test.go
Comment on lines +164 to +169
//enterpriseRegion, err := acceptance.GetRandomRegionWithCaps([]linodego.RegionCapability{"Kubernetes Enterprise", "VPCs"}, "core")
//if err != nil {
// t.Fatal(err)
//}
// TODO: Remove hard-coded region and replace with enterpriseRegion once capability filtering works properly
enterpriseRegionWithACLP := "us-lax"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it commented out intentionally so we can easily add it back later.

@mawilk90 mawilk90 self-requested a review July 3, 2026 12:50
knownvalue.StringExact("10.0.0.0/8"),
),
},
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this TestStep? Isn't it a duplicate of the 1st one?

@mawilk90

mawilk90 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The test TestAccDataSourceLKECluster_enterprise fails for me on Prod with "provider produced inconsistent result" error. I guess that the cause may lie in frameworkResourceSchema in linode/vpc/framework_schema_resource.go - there is a new ipv4 attribute without Computed: true but it may be auto-populated with default ranges in some regions after apply . Does it make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants