data-source/alicloud_cloud_firewall_nat_firewalls: expose status and region_no output fields - #10418
Open
api-tool-agent wants to merge 1 commit into
Open
data-source/alicloud_cloud_firewall_nat_firewalls: expose status and region_no output fields#10418api-tool-agent wants to merge 1 commit into
api-tool-agent wants to merge 1 commit into
Conversation
…region_no output fields
## Summary
The `alicloud_cloud_firewall_nat_firewalls` data source did not expose the
status or region of each NAT firewall in its `firewalls` output block.
Consumers could not read a firewall's status to find NAT gateways without a
firewall created, and could not feed the data source result into
`alicloud_cloud_firewall_nat_firewall` resources, which require `region_no`.
This adds two computed output fields to the `firewalls` block:
- `status` - mapped from the `ProxyStatus` response field
- `region_no` - mapped from the `RegionId` response field
The existing `status` and `region_no` input filters are unchanged, and the
existing pagination, ids filtering and output logic is untouched. A latent
reference to an empty object key (`objectRaw[""]`) and its unused accumulator
are also removed.
## Test plan
- [x] gofmt on the changed Go files (clean)
- [x] `go vet ./alicloud` builds the package; no vet issues in the changed files
- [x] `data_source_alicloud_cloud_firewall_nat_firewalls_test.go` adds
`firewalls.0.status` and `firewalls.0.region_no` CHECKSET assertions to
the existing exist-case checks; existing assertions unchanged
- [ ] GitHub CI on the final head SHA
- [ ] Independent QA verification of the datasource contract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
alicloud_cloud_firewall_nat_firewallsdata source exposes the list of NAT firewalls but did not include each firewall status or region in thefirewallsoutput block. As a result, users could not read a firewall status to locate NAT gateways without a firewall created, and could not pass the data source output intoalicloud_cloud_firewall_nat_firewallresources, which requireregion_no.This change adds two computed output attributes to the
firewallsblock:status- mapped from theProxyStatusresponse fieldregion_no- mapped from theRegionIdresponse fieldThe existing
statusandregion_noinput filters, pagination, and ids matching logic are unchanged. A latent reference to an empty object key and its unused accumulator are also removed.Test plan
gofmton the changed Go files (clean)go vet ./alicloud- the package builds; no vet issues in the changed filesfirewalls.0.statusandfirewalls.0.region_noCHECKSET assertions to the existing exist-case checks indata_source_alicloud_cloud_firewall_nat_firewalls_test.go; existing assertions unchanged