Skip to content

Commit

Permalink
feat: adding BGP enable/disable functionality to routing-protocol-bgp…
Browse files Browse the repository at this point in the history
… example scripts
  • Loading branch information
srushti-patl committed Sep 22, 2023
1 parent c810d08 commit 5d7c3ec
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ data "equinix_fabric_service_profiles" "sp" {
filter {
property = "/name"
operator = "="
values = [var.fabric_sp_name]
values = [var.fabric_sp_name]
}
}

resource "equinix_fabric_connection" "fcr2profile" {
name = var.connection_name
type = var.connection_type
notifications{
type=var.notifications_type
emails=var.notifications_emails
type = var.notifications_type
emails = var.notifications_emails
}
bandwidth = var.bandwidth
redundancy {priority= var.redundancy}
redundancy {priority = var.redundancy}
order {
purchase_order_number= var.purchase_order_number
purchase_order_number = var.purchase_order_number
}
a_side {
access_point {
type= var.aside_ap_type
type = var.aside_ap_type
router {
uuid = var.fcr_uuid
}
}
}
z_side {
access_point {
type= var.zside_ap_type
type = var.zside_ap_type
profile {
type= var.zside_ap_profile_type
uuid= data.equinix_fabric_service_profiles.sp.id
type = var.zside_ap_profile_type
uuid = data.equinix_fabric_service_profiles.sp.id
}
location {
metro_code= var.zside_location
metro_code = var.zside_location
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ At minimum, you must set below variables in `terraform.tfvars` file:
obtained same way as above
- `rp_name`- Name of routing Protocol
- `rp_type`- Type of routing Protocol entity, "BGP"
- `bgp_enabled_` - Enable or Disable BGP ipv4 and ipv6 sessions
- connection_uuid = "d557cb4c-9052-4298-b5ca-8a9ed914cf03"
rp_type = "DIRECT"
rp_name = "FCR-RP"
customer_peer_ipv4 = "192.1.1.2"
customer_peer_ipv6 = "192::1:2"
bgp_enabled_ipv4 = "true" #Can either be true or false
- bgp_enabled_ipv6 = "true" #Can either be true or false
customer_asn = "100"

## Initialize
- First step is to initialize the terraform directory/resource we are going to work on.
In the given example, the folder to perform CRUD operations on an RP resource can be found at examples/routing-protocol-bgp/.
In the given example, the folder to perform CRUD operations on an RP resource can be found at examples/fabric/v4/cloudRouterConnectivity/routing-protocol-bgp/.

- Change directory into - `CD examples/routing-protocol-bgp/`
- Change directory into - `CD examples/fabric/v4/cloudRouterConnectivity/routing-protocol-bgp/`
- Initialize Terraform plugins - `terraform init`

## Routing-protocol BGP : Create, Read, Update and Delete(CRUD) operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ provider "equinix" {
client_secret = var.equinix_client_secret
}

resource "equinix_fabric_routing_protocol" "test"{
resource "equinix_fabric_routing_protocol" "test" {
connection_uuid = var.connection_uuid
type = var.rp_type
name = var.rp_name
type = var.rp_type
name = var.rp_name
bgp_ipv4 {
customer_peer_ip = var.customer_peer_ipv4
customer_peer_ip = var.customer_peer_ipv4
enabled = var.bgp_enabled_ipv4
}
bgp_ipv6{
customer_peer_ip = var.customer_peer_ipv6
bgp_ipv6 {
customer_peer_ip = var.customer_peer_ipv6
enabled = var.bgp_enabled_ipv6
}
customer_asn = var.customer_asn
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
equinix_client_id = "MyEquinixClientId"
equinix_client_secret = "MyEquinixSecret"
equinix_client_id = "MyEquinixClientId"
equinix_client_secret = "MyEquinixSecret"

connection_uuid = "bfa41c64-3720-4cef-88dd-ec795ba36800"
rp_type = "BGP"
rp_name = "FCR-Con-BGP"
connection_uuid = "bfa41c64-3720-4cef-88dd-ec795ba36800"
rp_type = "BGP"
rp_name = "FCR-Con-BGP"
customer_peer_ipv4 = "190.1.1.2"
customer_peer_ipv6 = "190::1:2"
customer_asn = "100"
bgp_enabled_ipv4 = true #Can either be true or false
bgp_enabled_ipv6 = true #Can either be true or false
customer_asn = "100"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ variable "rp_type" {}
variable "rp_name" {}
variable "customer_peer_ipv4" {}
variable "customer_peer_ipv6" {}
variable "bgp_enabled_ipv4" {}
variable "bgp_enabled_ipv6" {}
variable "customer_asn" {}

0 comments on commit 5d7c3ec

Please sign in to comment.