Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding service token example for port and network #160

Merged
merged 3 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions examples/service-token-for-aside-port/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Fabric Service Token for Aside Port Creation Example

This example shows how to create Fabric Aside Port based Service Token.

It leverages the Equinix Terraform Provider to setup the service token based on the parameters you have provided to this example; or based on the pattern
you see used in this example it will allow you to create a more specific use case for your own needs.

See example usage below for details on how to use this example.

<!-- BEGIN_TF_DOCS -->
<!-- END_TF_DOCS -->
37 changes: 37 additions & 0 deletions examples/service-token-for-aside-port/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
data "equinix_fabric_ports" "aside_port" {
filters {
name = var.aside_port_name
}
}

resource "equinix_fabric_service_token" "service-token" {
type = var.service_token_type
name = var.service_token_name
description = var.service_token_description
expiration_date_time = var.service_token_expiration_date_time
notifications {
type = var.notifications_type
emails = var.notifications_emails
}

service_token_connection {
type = var.connection_type
bandwidth_limit = var.bandwidth_limit
a_side {
access_point_selectors {
type = var.aside_ap_type
port {
uuid = data.equinix_fabric_ports.aside_port.data.0.uuid
}
link_protocol {
type = var.aside_vlan_tag_type
vlan_tag = var.aside_vlan_tag
}
}
}
}
}
6 changes: 6 additions & 0 deletions examples/service-token-for-aside-port/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
output "service_token_id" {
value = equinix_fabric_service_token.service-token.id
}
output "service-token" {
value = equinix_fabric_service_token.service-token
}
16 changes: 16 additions & 0 deletions examples/service-token-for-aside-port/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

#Service Token
service_token_type = "VC_TOKEN"
service_token_name = "Terra_Test_Token"
service_token_description = "Zside VD Token Test"
service_token_expiration_date_time = "2024-12-29T06:43:49.980Z"
notifications_type = "ALL"
notifications_emails = ["example@equinix.com"]
connection_type = "EVPL_VC"
bandwidth_limit = 1000
aside_ap_type = "COLO"
aside_port_name = "<Fabric_Port_Name>"
aside_vlan_tag_type = "DOT1Q"
aside_vlan_tag = "2876"
61 changes: 61 additions & 0 deletions examples/service-token-for-aside-port/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}

#Service Token
variable "service_token_name" {
description = "Service Token Name"
type = string
}
variable "service_token_type" {
description = "Service Token Type; VC_TOKEN,EPL_TOKEN"
type = string
}
variable "service_token_description" {
description = "Service Token Description"
type = string
}
variable "service_token_expiration_date_time" {
description = "Expiration date and time of the service token; 2020-11-06T07:00:00"
type = string
}
variable "notifications_type" {
description = "Notification Type - ALL is the only type currently supported"
type = string
}
variable "notifications_emails" {
description = "Array of contact emails"
type = list(string)
}
variable "connection_type" {
description = "Type of Connection supported by Service Token you will create; EVPL_VC, EVPLAN_VC, EPLAN_VC, IPWAN_VC"
type = string
}
variable "bandwidth_limit" {
description = "Connection bandwidth limit in Mbps"
type = number
}
variable "aside_ap_type" {
description = "Type of Access point; COLO, VD, NETWORK"
type = string
}
variable "aside_port_name" {
description = "Virtual Device UUID"
type = string
}
variable "aside_vlan_tag_type" {
description = "Vlan Tag Type; DOT1Q or QINQ"
type = string
}
variable "aside_vlan_tag" {
description = "Vlan Tag information, outer vlanSTag for QINQ connections"
type = string
}

9 changes: 9 additions & 0 deletions examples/service-token-for-aside-port/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source="equinix/equinix"
version = "2.11.0"
}
}
}
11 changes: 11 additions & 0 deletions examples/service-token-for-zside-network/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Fabric Service Token for Zside Network Creation Example

This example shows how to create Fabric Zside Network based Service Token.

It leverages the Equinix Terraform Provider to setup the service token based on the parameters you have provided to this example; or based on the pattern
you see used in this example it will allow you to create a more specific use case for your own needs.

See example usage below for details on how to use this example.

<!-- BEGIN_TF_DOCS -->
<!-- END_TF_DOCS -->
27 changes: 27 additions & 0 deletions examples/service-token-for-zside-network/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

resource "equinix_fabric_service_token" "service-token" {
type = var.service_token_type
name = var.service_token_name
description = var.service_token_description
expiration_date_time = var.service_token_expiration_date_time
notifications {
type = var.notifications_type
emails = var.notifications_emails
}
service_token_connection {
type = var.connection_type
supported_bandwidths = var.supported_bandwidths
z_side {
access_point_selectors {
type = var.zside_ap_type
network {
uuid = var.zside_network_uuid
}
}
}
}
}
6 changes: 6 additions & 0 deletions examples/service-token-for-zside-network/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
output "service_token_id" {
value = equinix_fabric_service_token.service-token.id
}
output "service-token" {
value = equinix_fabric_service_token.service-token
}
14 changes: 14 additions & 0 deletions examples/service-token-for-zside-network/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

#Service Token
service_token_type = "VC_TOKEN"
service_token_name = "Terra_Test_Token"
service_token_description = "Zside VD Token Test"
service_token_expiration_date_time = "2024-12-29T06:43:49.980Z"
notifications_type = "ALL"
notifications_emails = ["example@equinix.com"]
connection_type = "EVPL_VC"
supported_bandwidths = [50,100, 500, 1000]
zside_ap_type = "NETWORK"
zside_network_uuid = "<Network_UUID>"
56 changes: 56 additions & 0 deletions examples/service-token-for-zside-network/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
variable "equinix_client_id" {
description = "Equinix client ID (consumer key), obtained after registering app in the developer platform"
type = string
sensitive = true
}
variable "equinix_client_secret" {
description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform"
type = string
sensitive = true
}

#Service Token
variable "service_token_name" {
description = "Service Token Name"
type = string
}
variable "service_token_type" {
description = "Service Token Type; VC_TOKEN,EPL_TOKEN"
type = string
}
variable "service_token_description" {
description = "Service Token Description"
type = string
}
variable "service_token_expiration_date_time" {
description = "Expiration date and time of the service token; 2020-11-06T07:00:00"
type = string
}
variable "notifications_type" {
description = "Notification Type - ALL is the only type currently supported"
type = string
}
variable "notifications_emails" {
description = "Array of contact emails"
type = list(string)
}
variable "connection_type" {
description = "Type of Connection supported by Service Token you will create; EVPL_VC, EVPLAN_VC, EPLAN_VC, IPWAN_VC"
type = string
}
variable "supported_bandwidths" {
description = "List of permitted bandwidths"
type = list
}
variable "zside_ap_type" {
description = "Type of Access point; COLO, VD, NETWORK"
type = string
}
variable "zside_network_type" {
description = "Network type"
type = string
}
variable "zside_network_uuid" {
description = "Network UUID"
type = string
}
9 changes: 9 additions & 0 deletions examples/service-token-for-zside-network/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source="equinix/equinix"
version = "3.1.0"
}
}
}
11 changes: 11 additions & 0 deletions examples/service-token-for-zside-port/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Fabric Service Token for Zside Port Creation Example

This example shows how to create Fabric Zside Port based Service Token.

It leverages the Equinix Terraform Provider to setup the service token based on the parameters you have provided to this example; or based on the pattern
you see used in this example it will allow you to create a more specific use case for your own needs.

See example usage below for details on how to use this example.

<!-- BEGIN_TF_DOCS -->
<!-- END_TF_DOCS -->
38 changes: 38 additions & 0 deletions examples/service-token-for-zside-port/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
data "equinix_fabric_ports" "zside_port" {
filters {
name = var.zside_port_name
}
}

resource "equinix_fabric_service_token" "service-token" {
type = var.service_token_type
name = var.service_token_name
description = var.service_token_description
expiration_date_time = var.service_token_expiration_date_time
notifications {
type = var.notifications_type
emails = var.notifications_emails
}

service_token_connection {
type = var.connection_type
supported_bandwidths = var.supported_bandwidths
allow_remote_connection = var.allow_remote_connection
z_side {
access_point_selectors {
type = var.zside_ap_type
port {
uuid = data.equinix_fabric_ports.zside_port.data.0.uuid
}
link_protocol {
type = var.zside_vlan_tag_type
vlan_tag = var.zside_vlan_tag
}
}
}
}
}
6 changes: 6 additions & 0 deletions examples/service-token-for-zside-port/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
output "service-token_id" {
value = equinix_fabric_service_token.service-token.id
}
output "service-token" {
value = equinix_fabric_service_token.service-token
}
16 changes: 16 additions & 0 deletions examples/service-token-for-zside-port/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

#Service Token
service_token_type = "VC_TOKEN"
service_token_name = "Terra_Test_Token"
service_token_description = "Zside VD Token Test"
service_token_expiration_date_time = "2024-12-29T06:43:49.980Z"
notifications_type = "ALL"
notifications_emails = ["example@equinix.com"]
connection_type = "EVPL_VC"
supported_bandwidths = [50,100, 500, 1000]
zside_ap_type = "COLO"
zside_port_name = "<Fabric_Port_Name>"
zside_vlan_tag_type = "DOT1Q"
zside_vlan_tag = "2876"
Loading
Loading