-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Description
Currently, the nsxt_policy_bgp_neighbor resource does not support configuring the Neighbor Local AS feature, which is available in the NSX-T UI under BGP Neighbor settings.
Use Case(s)
In multi-tenant or VRF environments, it is common to use the "neighbor local-as" BGP feature to present a different AS number to specific peers. The "no-prepend replace-as" option is particularly important for AS migration scenarios and when establishing eBGP peering with partners who expect a specific AS number.
Without this feature in Terraform, users cannot fully automate BGP neighbor configuration and must manually configure these settings through the UI or API.
Potential Configuration
Add support for BgpNeighborLocalAsConfig in the nsxt_policy_bgp_neighbor resource to allow configuring:
local_as_num - The local AS number to use for this specific neighbor. BGP neighbor local-as number in ASPLAIN/ASDOT Format
as_path_modifier_type - AS_PATH modifier type for BGP local AS
resource "nsxt_policy_bgp_neighbor" "example" {
display_name = "ToR-Peer"
bgp_path = nsxt_policy_bgp_config.bgp.path
neighbor_address = "192.168.1.1"
remote_as_num = "65001"
# New block for Local AS configuration
local_as_config {
local_as_num = "65100"
as_path_modifier_type = "NO_PREPEND_REPLACE_AS" # NO_PREPEND, NO_PREPEND_REPLACE_AS
}
}
References
NSX API Reference:
The NSX Policy API supports this via BgpNeighborLocalAsConfig object in the BGP neighbor configuration:
PUT /global-manager/api/v1/global-infra/tier-0s/{tier-0-id}/locale-services/{locale-service-id}/bgp/neighbors/{neighbor-id}