-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d610e1
commit 58ae485
Showing
7 changed files
with
94 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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" | ||
|
@@ -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" | ||
|
@@ -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) | ||
|
||
|
||
|
||
|
@@ -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) | ||
|
||
|
||
|
||
|
4 changes: 2 additions & 2 deletions
4
examples/resources/equinix_fabric_service_token/aside_colo_service_token.tf
This file contains 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
4 changes: 2 additions & 2 deletions
4
examples/resources/equinix_fabric_service_token/zside_colo_service_token.tf
This file contains 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
21 changes: 21 additions & 0 deletions
21
examples/resources/equinix_fabric_service_token/zside_network_service_token.tf
This file contains 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
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]"] | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
examples/resources/equinix_fabric_service_token/zside_vd_service_token.tf
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
}, | ||
|
@@ -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" | ||
|
@@ -303,7 +308,7 @@ func testAccFabricZsideNetworkServiceTokenConfig(serviceTokenName string, servic | |
access_point_selectors{ | ||
type = "NETWORK" | ||
network { | ||
uuid = "ff241e62-42f5-48bc-96c4-e0b5297fbed1" | ||
uuid = "%s" | ||
} | ||
} | ||
} | ||
|
@@ -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 { | ||
|
This file contains 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