feat(vpnaas): Neutron VPNaaS family (service, IKE/IPsec policies, endpoint group, site connection) - #21
Merged
Merged
Conversation
Add a new internal/services/vpnaas package (reusing NetworkV2Client, since VPNaaS is a Neutron extension) with the site-to-site IPsec VPN resources: - pcd_vpnaas_service (VPN endpoint on a router) - pcd_vpnaas_ike_policy (nested lifetime block) - pcd_vpnaas_ipsec_policy (nested lifetime block) - pcd_vpnaas_endpoint_group (local subnets / peer CIDRs) - pcd_vpnaas_site_connection (nested dpd block, sensitive psk) Design: - lifetime and dpd are SingleNestedAttribute (Optional+Computed) with UseStateForUnknown on both the whole object and each sub-field, so a partially-specified block does not churn and omitted blocks take the server default. peer_cidrs is an Optional+Computed list. - Every server-populated field is Optional+Computed (or has a default); the enum fields with an upstream default (auth/encryption/pfs/ike_version/ phase1_negotiation_mode) get that default, the rest are server-assigned. - The VPN service and site connection wait for the object to 404 after delete (asynchronous teardown), so a dependent router/subnet can be torn down in the same apply. Policies and endpoint groups delete synchronously. - Import by the object UUID; ForceNew on the immutable references (router_id, ike/ipsec/vpn policy ids, endpoint type/endpoints, tenant_id). Templates gain a "vpnaas" -> "VPN" documentation subcategory. Matches upstream field-for-field except the value_specs escape hatch (not used anywhere in this port). Avoids two upstream bugs: the phase_1_negotiation_mode update-key typo and the peer_cidrs []string cast panic. Includes a full-tree acceptance test (service + policies + endpoint groups + site connection + rename + import), examples, and CHANGELOG/DECISIONS entries.
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
feat(vpnaas): Neutron VPNaaS family (service, IKE/IPsec policies, endpoint group, site connection)
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
Adds the VPNaaS family (Phase 3, final family), ported from
terraform-provider-openstackv3.4.0. Newinternal/services/vpnaaspackage reusingNetworkV2Client(VPNaaS is a Neutron extension — no new client).pcd_vpnaas_servicepcd_vpnaas_ike_policylifetime)pcd_vpnaas_ipsec_policylifetime)pcd_vpnaas_endpoint_grouppcd_vpnaas_site_connectiondpd, sensitivepsk)Design
lifetime,dpd) areSingleNestedAttribute(Optional+Computed) withUseStateForUnknownon both the whole object and each sub-field — a partially-specified block (e.g.dpd = { action = "restart" }) doesn't churn on the omitted sub-fields, and an omitted block takes the server default.peer_cidrsis an Optional+Computed list.auth_algorithm,encryption_algorithm,pfs,ike_version,phase1_negotiation_mode) get that default; the rest are server-assigned.404after delete, so a dependent router/subnet can be torn down in the same apply. Policies and endpoint groups delete synchronously.ForceNewon the immutable references (router_id, the IKE/IPsec/VPN policy IDs, endpointtype/endpoints,tenant_id).Notes
value_specsescape hatch (unused anywhere in this port; a documented deferral).phase_1_negotiation_modeupdate-key typo (updates silently dropped) and thepeer_cidrs.([]string)cast panic on update.= { ... }assignment (not block{ ... }) syntax for aSingleNestedAttribute.Adversarial review
A review workflow (3 finder dimensions — state-consistency incl. nested-object apply-consistency, gophercloud API usage, lifecycle/delete/import/registration — each finding adversarially verified against Terraform core + gophercloud source) returned 0 confirmed findings. The one candidate (
pskread back from the server) was refuted: Neutron returns the PSK verbatim, so reading it back is safe and detects out-of-band drift.Testing
go build,go vet,gofmt,golangci-lint— clean (0 issues); unit tests pass;terraform fmtclean; docs regenerate with the "VPN" subcategory.TestAccVPNaaS_tree): service + IKE/IPsec policies + local/peer endpoint groups + site connection, verify via API, rename, import. Not run live this session (CE lab credentials unavailable; needs the Neutronvpnaasextension enabled); tracked PENDING in DECISIONS.md.