Skip to content

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

Merged
ezilber-akamai merged 12 commits into
linode:proj/configurable-vpc-ipv4-preifxesfrom
ezilber-akamai:TPT-4479-configurable-vpc-ipv4-prefixes
Jul 9, 2026
Merged

TPT-4479: Added support for Configurable VPC IPv4 Prefixes#2402
ezilber-akamai merged 12 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"
make test-int PKG_NAME="lke" TEST_CASE="TestAccResourceLKECluster_enterprise"
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 thread linode/lke/framework_datasource_test.go
@mawilk90 mawilk90 self-requested a review July 3, 2026 12:50
Comment thread linode/vpc/resource_test.go
@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?

@ezilber-akamai ezilber-akamai force-pushed the TPT-4479-configurable-vpc-ipv4-prefixes branch from cf6b836 to 0158538 Compare July 6, 2026 19:21
@mawilk90

mawilk90 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

It's strange, but after latest changes here TestAccDataSourceVPC_ipv4 started to fail with "provider produced inconsistent result after apply". When I reverted it locally it works fine. Moreover, adding listplanmodifier.RequiresReplace() into ipv4's PlanModifiers (instead of reverting) solves the issue, however then - if my understanding is correct - it is inconsistent with ResourceSchemaIPv4NestedObject (?) + should RequiresReplace be used at all in the context of ipv4?

@ezilber-akamai

Copy link
Copy Markdown
Contributor Author

It's strange, but after latest changes here TestAccDataSourceVPC_ipv4 started to fail with "provider produced inconsistent result after apply". When I reverted it locally it works fine. Moreover, adding listplanmodifier.RequiresReplace() into ipv4's PlanModifiers (instead of reverting) solves the issue, however then - if my understanding is correct - it is inconsistent with ResourceSchemaIPv4NestedObject (?) + should RequiresReplace be used at all in the context of ipv4?

Strange, it was passing for me locally. Let me look into this.

@ezilber-akamai

Copy link
Copy Markdown
Contributor Author

It's strange, but after latest changes here TestAccDataSourceVPC_ipv4 started to fail with "provider produced inconsistent result after apply". When I reverted it locally it works fine. Moreover, adding listplanmodifier.RequiresReplace() into ipv4's PlanModifiers (instead of reverting) solves the issue, however then - if my understanding is correct - it is inconsistent with ResourceSchemaIPv4NestedObject (?) + should RequiresReplace be used at all in the context of ipv4?

Ah I see the issue was with TestAccResourceVPC_ipv4, not TestAccDataSourceVPC_ipv4. I think you're right, the listplanmodifier.RequiresReplace() should not be there. I pushed up a commit with the fix. Thanks!

@lgarber-akamai lgarber-akamai self-requested a review July 8, 2026 17:13
@ezilber-akamai ezilber-akamai force-pushed the TPT-4479-configurable-vpc-ipv4-prefixes branch from ab72f1d to ea73caf Compare July 8, 2026 19:10
Comment thread linode/vpc/framework_schema_resource.go Outdated

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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.

Comment thread linode/vpc/framework_resource.go Outdated
Comment thread linode/vpc/framework_resource.go Outdated
Comment thread linode/vpc/framework_resource.go Outdated
Comment thread linode/vpc/framework_schema_resource.go
Comment thread linode/vpc/resource_test.go
@ezilber-akamai ezilber-akamai merged commit 78515e3 into linode:proj/configurable-vpc-ipv4-preifxes Jul 9, 2026
9 checks passed
ezilber-akamai added a commit that referenced this pull request Jul 9, 2026
…2406)

* Added datasource for GET vpcs/default_ranges

* Added support for IPv4 in VPC resource/datasource and VPCs datasource

* Fix docs

* Address CoPilot suggestion

* Address PR comments

* Remove LKE fix since it is out of scope

* Fix tests

* More fixes

* More fixes

* Remove custom type from ResourceSchemaIPv4NestedObject range attribute

* Address CoPilot suggestions
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.

4 participants