TPT-4294: terraform: Update linode_instance resource to support reserved IP assignment at creation#2323
Conversation
…ved IP assignment at creation
There was a problem hiding this comment.
Pull request overview
Updates the linode_instance resource implementation and tests to better support reserved IPv4 assignment workflows by normalizing how instance IPv4 addresses are flattened into Terraform state and ensuring reserved-IP acceptance tests execute as part of the standard instance suite.
Changes:
- Refactors repeated IPv4 flattening logic into a shared
flattenInstanceIPv4helper. - Updates instance read/create paths to use the shared IPv4 flattening helper.
- Removes opt-in gating from reserved-IP acceptance tests so they run under the normal
instanceintegration tag.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
linode/instance/resource.go |
Uses shared IPv4 flattening helper when setting ipv4 in state during read/create. |
linode/instance/flatten.go |
Introduces flattenInstanceIPv4 helper and reuses it in flattenInstance. |
linode/instance/flatten_unit_test.go |
Adds unit coverage for the new IPv4 flattening helper. |
linode/instance/resource_test.go |
Ensures reserved-IP acceptance tests run without opt-in gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Sorry but I don't quite understand those changes - what changed that it enables using reserved IP in this resource? |
It is only cleanup for the functionality which was already introduced earlier. |
|
Okay, so the PR title and commit message are a bit misleading for me |
…te-linode_instance-resource-to-support-reserved-ip-assignment-at
…ved IP assignment at creation
lgarber-akamai
left a comment
There was a problem hiding this comment.
Looks great, nice work!
📝 Description
Extend the linode_instance resource to support assigning a pre-reserved IPv4 address to the instance at creation time. Currently, reserved IP assignment after creation is handled by linode_instance_reserved_ip_assignment. This story adds support for specifying a reserved IP at the point of POST /linode/instances.
✔️ How to Test