Skip to content

Commit

Permalink
fix: Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
srushti-patl committed Dec 18, 2024
1 parent 3d610e1 commit 58ae485
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 40 deletions.
79 changes: 52 additions & 27 deletions docs/resources/fabric_service_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Additional documentation:
Aside Port Service Token
```terraform
resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
description = "Aside COLO Service Token"
type = "VC_TOKEN"
description = "Aside COLO Service Token"
expiration_date_time = "2025-01-18T06:43:49.981Z"
service_token_connection {
type = "EVPL_VC"
Expand Down Expand Up @@ -44,8 +44,8 @@ resource "equinix_fabric_service_token" "test" {
Zside Port Service Token
```terraform
resource "equinix_fabric_service_token" "test"{
type = "VC_TOKEN"
description = "Zside COLO Service Token"
type = "VC_TOKEN"
description = "Zside COLO Service Token"
expiration_date_time = "2025-01-18T06:43:49.981Z"
service_token_connection {
type = "EVPL_VC"
Expand All @@ -70,11 +70,36 @@ resource "equinix_fabric_service_token" "test"{
}
```

Zside Network Service Token
```terraform
resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
description = "Zside Network Service Token"
expiration_date_time = "2025-01-18T06:43:49.986Z"
service_token_connection {
type = "EVPL_VC"
supported_bandwidths = [50, 200, 10000]
z_side {
access_point_selectors {
type = "NETWORK"
network {
uuid = "<network_uuid>"
}
}
}
}
notifications {
type = "ALL"
emails = ["[email protected]"]
}
}
```

Zside Virtual Device Service Token
```terraform
resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
description = "Zside VD Service Token"
description = "Zside VD Service Token"
expiration_date_time = "2025-01-18T06:43:49.986Z"
service_token_connection {
type = "EVPL_VC"
Expand Down Expand Up @@ -206,27 +231,27 @@ Optional:
<a id="nestedblock--service_token_connection--a_side--access_point_selectors--network"></a>
### Nested Schema for `service_token_connection.a_side.access_point_selectors.network`

Optional:
Required:

- `location` (Block Set) Location (see [below for nested schema](#nestedblock--service_token_connection--a_side--access_point_selectors--network--location))
- `name` (String) Network Name
- `scope` (String) Scope of Network
- `type` (String) Type of Network
- `uuid` (String) Equinix-assigned Network identifier

Read-Only:

- `href` (String) Unique Resource Identifier
- `location` (Set of Object) Location (see [below for nested schema](#nestedatt--service_token_connection--a_side--access_point_selectors--network--location))
- `name` (String) Network Name
- `scope` (String) Scope of Network
- `type` (String) Type of Network

<a id="nestedblock--service_token_connection--a_side--access_point_selectors--network--location"></a>
<a id="nestedatt--service_token_connection--a_side--access_point_selectors--network--location"></a>
### Nested Schema for `service_token_connection.a_side.access_point_selectors.network.location`

Optional:
Read-Only:

- `ibx` (String) IBX Code
- `metro_code` (String) Access point metro code
- `metro_name` (String) Access point metro name
- `region` (String) Access point region
- `ibx` (String)
- `metro_code` (String)
- `metro_name` (String)
- `region` (String)



Expand Down Expand Up @@ -330,27 +355,27 @@ Optional:
<a id="nestedblock--service_token_connection--z_side--access_point_selectors--network"></a>
### Nested Schema for `service_token_connection.z_side.access_point_selectors.network`

Optional:
Required:

- `location` (Block Set) Location (see [below for nested schema](#nestedblock--service_token_connection--z_side--access_point_selectors--network--location))
- `name` (String) Network Name
- `scope` (String) Scope of Network
- `type` (String) Type of Network
- `uuid` (String) Equinix-assigned Network identifier

Read-Only:

- `href` (String) Unique Resource Identifier
- `location` (Set of Object) Location (see [below for nested schema](#nestedatt--service_token_connection--z_side--access_point_selectors--network--location))
- `name` (String) Network Name
- `scope` (String) Scope of Network
- `type` (String) Type of Network

<a id="nestedblock--service_token_connection--z_side--access_point_selectors--network--location"></a>
<a id="nestedatt--service_token_connection--z_side--access_point_selectors--network--location"></a>
### Nested Schema for `service_token_connection.z_side.access_point_selectors.network.location`

Optional:
Read-Only:

- `ibx` (String) IBX Code
- `metro_code` (String) Access point metro code
- `metro_name` (String) Access point metro name
- `region` (String) Access point region
- `ibx` (String)
- `metro_code` (String)
- `metro_name` (String)
- `region` (String)



Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
description = "Aside COLO Service Token"
type = "VC_TOKEN"
description = "Aside COLO Service Token"
expiration_date_time = "2025-01-18T06:43:49.981Z"
service_token_connection {
type = "EVPL_VC"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "equinix_fabric_service_token" "test"{
type = "VC_TOKEN"
description = "Zside COLO Service Token"
type = "VC_TOKEN"
description = "Zside COLO Service Token"
expiration_date_time = "2025-01-18T06:43:49.981Z"
service_token_connection {
type = "EVPL_VC"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
description = "Zside Network Service Token"
expiration_date_time = "2025-01-18T06:43:49.986Z"
service_token_connection {
type = "EVPL_VC"
supported_bandwidths = [50, 200, 10000]
z_side {
access_point_selectors {
type = "NETWORK"
network {
uuid = "<network_uuid>"
}
}
}
}
notifications {
type = "ALL"
emails = ["[email protected]"]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
description = "Zside VD Service Token"
description = "Zside VD Service Token"
expiration_date_time = "2025-01-18T06:43:49.986Z"
service_token_connection {
type = "EVPL_VC"
Expand Down
21 changes: 13 additions & 8 deletions internal/resources/fabric/service_token/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,34 +158,39 @@ func TestAccFabricZsidePortServiceToken_PNFV(t *testing.T) {
}

func TestAccFabricZsideNetworkServiceToken_PNFV(t *testing.T) {
connectionTestData := testing_helpers.GetFabricEnvConnectionTestData(t)
var networkUuid string
if len(connectionTestData) > 0 {
networkUuid = connectionTestData["pfcr"]["network"]
}
serviceTokenName, serviceTokenUpdatedName := "token_zwan_PNFV", "UP_Token_zwan_PNFV"
serviceTokenDescription, serviceTokenUpdatedDescription := "zside port token", "Updated zside port token"
serviceTokenDescription, serviceTokenUpdatedDescription := "zside network token", "Updated zside network token"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acceptance.TestAccPreCheck(t) },
Providers: acceptance.TestAccProviders,
CheckDestroy: CheckServiceTokenDelete,
Steps: []resource.TestStep{
{
Config: testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName, serviceTokenDescription),
Config: testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName, serviceTokenDescription, networkUuid),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("equinix_fabric_service_token.test", "uuid"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "name", serviceTokenName),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "type", "VC_TOKEN"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "description", serviceTokenDescription),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "expiration_date_time", "2025-02-18T06:43:49.981Z"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "service_token_connection.0.z_side.0.access_point_selectors.0.network.0.uuid", "ff241e62-42f5-48bc-96c4-e0b5297fbed1"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "service_token_connection.0.z_side.0.access_point_selectors.0.network.0.uuid", networkUuid),
),
ExpectNonEmptyPlan: false,
},
{
Config: testAccFabricZsideNetworkServiceTokenConfig(serviceTokenUpdatedName, serviceTokenUpdatedDescription),
Config: testAccFabricZsideNetworkServiceTokenConfig(serviceTokenUpdatedName, serviceTokenUpdatedDescription, networkUuid),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("equinix_fabric_service_token.test", "uuid"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "name", serviceTokenUpdatedName),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "type", "VC_TOKEN"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "description", serviceTokenUpdatedDescription),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "expiration_date_time", "2025-02-18T06:43:49.981Z"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "service_token_connection.0.z_side.0.access_point_selectors.0.network.0.uuid", "ff241e62-42f5-48bc-96c4-e0b5297fbed1"),
resource.TestCheckResourceAttr("equinix_fabric_service_token.test", "service_token_connection.0.z_side.0.access_point_selectors.0.network.0.uuid", networkUuid),
),
ExpectNonEmptyPlan: false,
},
Expand Down Expand Up @@ -289,7 +294,7 @@ func testAccFabricZsideVirtualDeviceServiceTokenConfig(serviceTokenName string,
`, serviceTokenName, serviceTokenDescription, virtualDeviceUuid)
}

func testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName string, serviceTokenDescription string) string {
func testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName string, serviceTokenDescription string, networkUuid string) string {
return fmt.Sprintf(
`resource "equinix_fabric_service_token" "test" {
type = "VC_TOKEN"
Expand All @@ -303,7 +308,7 @@ func testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName string, servic
access_point_selectors{
type = "NETWORK"
network {
uuid = "ff241e62-42f5-48bc-96c4-e0b5297fbed1"
uuid = "%s"
}
}
}
Expand All @@ -313,7 +318,7 @@ func testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName string, servic
emails = ["[email protected]", "[email protected]"]
}
}
`, serviceTokenName, serviceTokenDescription)
`, serviceTokenName, serviceTokenDescription, networkUuid)
}

func CheckServiceTokenDelete(s *terraform.State) error {
Expand Down
3 changes: 3 additions & 0 deletions templates/resources/fabric_service_token.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Aside Port Service Token
Zside Port Service Token
{{tffile "examples/resources/equinix_fabric_service_token/zside_colo_service_token.tf"}}

Zside Network Service Token
{{tffile "examples/resources/equinix_fabric_service_token/zside_network_service_token.tf"}}

Zside Virtual Device Service Token
{{tffile "examples/resources/equinix_fabric_service_token/zside_vd_service_token.tf"}}

Expand Down

0 comments on commit 58ae485

Please sign in to comment.