Skip to content

Conversation

@sudomateo
Copy link
Collaborator

@sudomateo sudomateo commented Jun 24, 2025

Added acceptance tests to surface the issue reported in #453.

See #453 (comment) for an understanding of what's happening.

Removed the computed attributes from the firewall rules since those computed fields were being updated for all of the rules, even when Terraform did not expect a rule to be updated. Unfortunately all of the computed attributes had to be removed for this to work and keep the update in-place logic.

@sudomateo sudomateo linked an issue Jun 24, 2025 that may be closed by this pull request
@sudomateo sudomateo force-pushed the sudomateo/vpc_firewall_rules branch from 5fc347c to 3de3991 Compare June 24, 2025 18:19
@sudomateo sudomateo marked this pull request as ready for review June 24, 2025 18:19
@sudomateo sudomateo requested a review from karencfv as a code owner June 24, 2025 18:19
@sudomateo
Copy link
Collaborator Author

> TEST_ACC_NAME=TestAccCloudResourceFirewallRules make testacc
-> Running terraform acceptance tests
=== RUN   TestAccCloudResourceFirewallRules_full
=== PAUSE TestAccCloudResourceFirewallRules_full
=== CONT  TestAccCloudResourceFirewallRules_full
--- PASS: TestAccCloudResourceFirewallRules_full (9.36s)
PASS
ok      github.com/oxidecomputer/terraform-provider-oxide/internal/provider     9.367s

Copy link
Collaborator

@karencfv karencfv left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this! Looks good.

Could you add an entry to the changelog for a breaking change since we're changing the schema?

@sudomateo sudomateo force-pushed the sudomateo/vpc_firewall_rules branch 4 times, most recently from 3335ef6 to b28af6f Compare June 25, 2025 19:11
@sudomateo
Copy link
Collaborator Author

Changelog added and tests are passing.

> TEST_ACC_NAME=TestAccCloudResourceFirewallRules make testacc
-> Running terraform acceptance tests
=== RUN   TestAccCloudResourceFirewallRules_full
=== PAUSE TestAccCloudResourceFirewallRules_full
=== CONT  TestAccCloudResourceFirewallRules_full
--- PASS: TestAccCloudResourceFirewallRules_full (12.00s)
PASS
ok      github.com/oxidecomputer/terraform-provider-oxide/internal/provider     12.002s

Copy link
Collaborator

@karencfv karencfv left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments! Sorry, I just realised we need to update the resource's documentation as well with the schema changes https://github.com/oxidecomputer/terraform-provider-oxide/blob/main/docs/resources/oxide_vpc_firewall_rules.md

@sudomateo sudomateo force-pushed the sudomateo/vpc_firewall_rules branch from b28af6f to 59b8ad3 Compare June 25, 2025 21:41
@sudomateo
Copy link
Collaborator Author

Thanks for addressing my comments! Sorry, I just realised we need to update the resource's documentation as well with the schema changes https://github.com/oxidecomputer/terraform-provider-oxide/blob/main/docs/resources/oxide_vpc_firewall_rules.md

No worries! I forgot too. Heat wave is making my brain melt this week haha.

Added acceptance tests to surface the issue reported in
#453.

See
#453 (comment)
for an understanding of what's happening.

Removed the computed attributes from the firewall rules since those
computed fields were being updated for all of the rules, even when
Terraform did not expect a rule to be updated. Unfortunately all of
the computed attributes had to be removed for this to work and keep the
update in-place logic.
@sudomateo sudomateo force-pushed the sudomateo/vpc_firewall_rules branch from 59b8ad3 to 89c1622 Compare June 26, 2025 00:03
Copy link
Collaborator

@karencfv karencfv left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for the fix!

@sudomateo sudomateo merged commit d93050b into main Jun 26, 2025
1 check passed
@sudomateo sudomateo deleted the sudomateo/vpc_firewall_rules branch June 27, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resource(vpc_firewall_rules): provider produced invalid plan

3 participants