Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: equinix/terraform-provider-equinix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 481419a271771c17573685b6b33ae3c71f81c1a3
Choose a base ref
..
head repository: equinix/terraform-provider-equinix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 77970cb1996e4078fe37d0fabeff600dc338393c
Choose a head ref
3 changes: 3 additions & 0 deletions docs/resources/equinix_network_acl_template.md
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ traffic. Templates can be assigned to the network devices.
resource "equinix_network_acl_template" "myacl" {
name = "test"
description = "Test ACL template"
project_id = "a86d7112-d740-4758-9c9c-31e66373746b"
inbound_rule {
subnet = "1.1.1.1/32"
protocol = "IP"
@@ -38,6 +39,8 @@ resource "equinix_network_acl_template" "myacl" {
The following arguments are supported:

* `name` - (Required) ACL template name.
* `project_id` - (Optional) Unique Identifier for the project resource where the acl template is scoped to.If you
leave it out, the ACL template will be created under the default project id of your organization.
* `description` - (Optional) ACL template description, up to 200 characters.
* `metro_code` - (Deprecated) ACL template location metro code.
* `inbound_rule` - (Required) One or more rules to specify allowed inbound traffic.
35 changes: 34 additions & 1 deletion docs/resources/equinix_network_device.md
Original file line number Diff line number Diff line change
@@ -172,6 +172,37 @@ resource "equinix_network_device" "c8kv-single" {
}
```

```hcl
# Create self configured single VSRX device with BYOL License
data "equinix_network_account" "sv" {
name = "account-name"
metro_code = "SV"
}
resource "equinix_network_device" "vsrx-single" {
name = "tf-c8kv-sdwan"
metro_code = data.equinix_network_account.sv.metro_code
type_code = "VSRX"
self_managed = true
byol = true
package_code = "STD"
notifications = ["test@equinix.com"]
hostname = "VSRX"
account_number = data.equinix_network_account.sv.number
version = "23.2R1.13"
core_count = 2
term_length = 12
additional_bandwidth = 5
project_id = "a86d7112-d740-4758-9c9c-31e66373746b"
ssh_key {
username = "test-username"
key_name = "valid-key-name"
}
acl_template_id = "3e548c02-9164-4197-aa23-05b1f644883c"
}
```

```hcl
# Create self configured redundant Arista router with DSA key
@@ -264,7 +295,9 @@ device configurations. See [Secondary Device](#secondary-device) below for more
* `cluster_details` - (Optional) An object that has the cluster details. See
[Cluster Details](#cluster-details) below for more details.
* `connectivity` - (Optional) Device accessibility (INTERNET-ACCESS or PRIVATE or INTERNET-ACCESS-WITH-PRVT-MGMT).
If not specified, default will be INTERNET-ACCESS
If not specified, default will be INTERNET-ACCESS
* `project_id` - (Optional) Unique Identifier for the project resource where the device is scoped to.If you
leave it out, the device will be created under the default project id of your organization.

### Secondary Device

3 changes: 3 additions & 0 deletions docs/resources/equinix_network_device_link.md
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ Network Edge virtual network device links.
resource "equinix_network_device_link" "test" {
name = "test-link"
subnet = "192.168.40.64/27"
project_id = "a86d7112-d740-4758-9c9c-31e66373746b"
device {
id = equinix_network_device.test.uuid
asn = equinix_network_device.test.asn > 0 ? equinix_network_device.test.asn : 22111
@@ -47,6 +48,8 @@ between self configured devices.
device link. See [Device](#device) section below for more details.
* `link` - (Optional) definition of one or more, inter metro, connections belonging
to the device link. See [Link](#link) section below for more details.
* `project_id` - (Optional) Unique Identifier for the project resource where the device link is scoped to.If you
leave it out, the device link will be created under the default project id of your organization.

### Device

3 changes: 3 additions & 0 deletions docs/resources/equinix_network_ssh_key.md
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ resource "equinix_network_ssh_key" "john" {
WQnuAHCy9N4Td0Sntzu/xhCZ8xN0oO67Cqlsk98xSRLXeg21PuuhOYJw0DLF6L68zU2OO0RzqoNq/F
jIsltSUJPAIfYKL0yEefeNWOXSrasI1ezw== John.Kent@company.com"
type = "RSA"
project_id = "a86d7112-d740-4758-9c9c-31e66373746b"
}
```

@@ -33,6 +34,8 @@ The following arguments are supported:
* `public_key` - (Required) The SSH public key. If this is a file, it can be read using the file
interpolation function.
* `type` - (Optional) The type of SSH key: `RSA` (default) or `DSA`.
* `project_id` - (Optional) Unique Identifier for the project resource where the SSH key is scoped to.If you
leave it out, the ssh key will be created under the default project id of your organization.

## Attributes Reference

13 changes: 13 additions & 0 deletions equinix/data_source_network_device.go
Original file line number Diff line number Diff line change
@@ -284,6 +284,11 @@ func createDataSourceNetworkDeviceSchema() map[string]*schema.Schema {
Computed: true,
Description: neDeviceDescriptions["Connectivity"],
},
neDeviceSchemaNames["ProjectID"]: {
Type: schema.TypeString,
Computed: true,
Description: neDeviceDescriptions["ProjectID"],
},
neDeviceSchemaNames["Secondary"]: {
Type: schema.TypeList,
Computed: true,
@@ -295,6 +300,11 @@ func createDataSourceNetworkDeviceSchema() map[string]*schema.Schema {
Computed: true,
Description: neDeviceDescriptions["UUID"],
},
neDeviceSchemaNames["ProjectID"]: {
Type: schema.TypeString,
Computed: true,
Description: neDeviceDescriptions["ProjectID"],
},
neDeviceSchemaNames["Name"]: {
Type: schema.TypeString,
Required: true,
@@ -788,6 +798,9 @@ func updateDataSourceNetworkDeviceResource(primary *ne.Device, secondary *ne.Dev
if err := d.Set(neDeviceSchemaNames["ZoneCode"], primary.ZoneCode); err != nil {
return fmt.Errorf("error reading ZoneCode: %s", err)
}
if err := d.Set(neDeviceSchemaNames["ProjectID"], primary.ProjectID); err != nil {
return fmt.Errorf("error reading ProjectID: %s", err)
}
if secondary != nil {
if v, ok := d.GetOk(neDeviceSchemaNames["Secondary"]); ok {
secondaryFromSchema := expandNetworkDeviceSecondary(v.([]interface{}))
16 changes: 16 additions & 0 deletions equinix/resource_network_acl_template.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ var networkACLTemplateSchemaNames = map[string]string{
"DeviceACLStatus": "device_acl_status",
"InboundRules": "inbound_rule",
"DeviceDetails": "device_details",
"ProjectID": "project_id",
}

var networkACLTemplateDescriptions = map[string]string{
@@ -37,6 +38,7 @@ var networkACLTemplateDescriptions = map[string]string{
"DeviceACLStatus": "Status of ACL template provisioning process on a device, where template was applied",
"InboundRules": "One or more rules to specify allowed inbound traffic. Rules are ordered, matching traffic rule stops processing subsequent ones.",
"DeviceDetails": "Device Details to which ACL template is assigned to. ",
"ProjectID": "The unique identifier of Project Resource to which ACL template is scoped to",
}

var networkACLTemplateInboundRuleSchemaNames = map[string]string{
@@ -147,6 +149,14 @@ func createNetworkACLTemplateSchema() map[string]*schema.Schema {
},
Description: networkACLTemplateDescriptions["DeviceDetails"],
},
networkACLTemplateSchemaNames["ProjectID"]: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.IsUUID,
Description: networkACLTemplateDescriptions["ProjectID"],
},
}
}

@@ -296,6 +306,9 @@ func createACLTemplate(d *schema.ResourceData) ne.ACLTemplate {
if v, ok := d.GetOk(networkACLTemplateSchemaNames["Description"]); ok {
template.Description = ne.String(v.(string))
}
if v, ok := d.GetOk(networkACLTemplateSchemaNames["ProjectID"]); ok {
template.ProjectID = ne.String(v.(string))
}
if v, ok := d.GetOk(networkACLTemplateSchemaNames["MetroCode"]); ok {
template.MetroCode = ne.String(v.(string))
}
@@ -318,6 +331,9 @@ func updateACLTemplateResource(template *ne.ACLTemplate, d *schema.ResourceData)
if err := d.Set(networkACLTemplateSchemaNames["DeviceACLStatus"], template.DeviceACLStatus); err != nil {
return fmt.Errorf("error reading %s: %s", networkACLTemplateSchemaNames["DeviceACLStatus"], err)
}
if err := d.Set(networkACLTemplateSchemaNames["ProjectID"], template.ProjectID); err != nil {
return fmt.Errorf("error reading %s: %s", networkACLTemplateSchemaNames["ProjectID"], err)
}
var inboundRules []ne.ACLTemplateInboundRule
if v, ok := d.GetOk(networkACLTemplateSchemaNames["InboundRules"]); ok {
inboundRules = expandACLTemplateInboundRules(v.([]interface{}))
2 changes: 2 additions & 0 deletions equinix/resource_network_acl_template_test.go
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ func TestNetworkACLTemplate_createFromResourceData(t *testing.T) {
Name: ne.String("test"),
Description: ne.String("testTemplate"),
MetroCode: ne.String("SV"),
ProjectID: ne.String("68ccfd49-39b1-478e-957a-67c72f719d7a"),
InboundRules: []ne.ACLTemplateInboundRule{
{
SeqNo: ne.Int(1),
@@ -30,6 +31,7 @@ func TestNetworkACLTemplate_createFromResourceData(t *testing.T) {
networkACLTemplateSchemaNames["Name"]: ne.StringValue(expected.Name),
networkACLTemplateSchemaNames["Description"]: ne.StringValue(expected.Description),
networkACLTemplateSchemaNames["MetroCode"]: ne.StringValue(expected.MetroCode),
networkACLTemplateSchemaNames["ProjectID"]: ne.StringValue(expected.ProjectID),
}
d := schema.TestResourceDataRaw(t, createNetworkACLTemplateSchema(), rawData)
d.Set(networkACLTemplateSchemaNames["InboundRules"], flattenACLTemplateInboundRules(expected.InboundRules, expected.InboundRules))
25 changes: 25 additions & 0 deletions equinix/resource_network_device.go
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ var neDeviceSchemaNames = map[string]string{
"PurchaseOrderNumber": "purchase_order_number",
"RedundancyType": "redundancy_type",
"RedundantUUID": "redundant_id",
"ProjectID": "project_id",
"TermLength": "term_length",
"AdditionalBandwidth": "additional_bandwidth",
"OrderReference": "order_reference",
@@ -112,6 +113,7 @@ var neDeviceDescriptions = map[string]string{
"ClusterDetails": "An object that has the cluster details",
"ValidStatusList": "Comma Separated List of states to be considered valid when searching by name",
"Connectivity": "Parameter to identify internet access for device. Supported Values: INTERNET-ACCESS(default) or PRIVATE or INTERNET-ACCESS-WITH-PRVT-MGMT",
"ProjectID": "The unique identifier of Project Resource to which device is scoped to",
}

var neDeviceInterfaceSchemaNames = map[string]string{
@@ -404,6 +406,14 @@ func createNetworkDeviceSchema() map[string]*schema.Schema {
ValidateFunc: validation.IntInSlice([]int{1, 12, 24, 36}),
Description: neDeviceDescriptions["TermLength"],
},
neDeviceSchemaNames["ProjectID"]: {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.IsUUID,
Description: neDeviceDescriptions["ProjectID"],
},
neDeviceSchemaNames["AdditionalBandwidth"]: {
Type: schema.TypeInt,
Optional: true,
@@ -506,6 +516,11 @@ func createNetworkDeviceSchema() map[string]*schema.Schema {
Computed: true,
Description: neDeviceDescriptions["UUID"],
},
neDeviceSchemaNames["ProjectID"]: {
Type: schema.TypeString,
Computed: true,
Description: neDeviceDescriptions["ProjectID"],
},
neDeviceSchemaNames["Name"]: {
Type: schema.TypeString,
Required: true,
@@ -1044,6 +1059,9 @@ func createNetworkDevices(d *schema.ResourceData) (*ne.Device, *ne.Device) {
if v, ok := d.GetOk(neDeviceSchemaNames["MetroCode"]); ok {
primary.MetroCode = ne.String(v.(string))
}
if v, ok := d.GetOk(neDeviceSchemaNames["ProjectID"]); ok {
primary.ProjectID = ne.String(v.(string))
}
if v, ok := d.GetOk(neDeviceSchemaNames["Throughput"]); ok {
primary.Throughput = ne.Int(v.(int))
}
@@ -1135,6 +1153,9 @@ func updateNetworkDeviceResource(primary *ne.Device, secondary *ne.Device, d *sc
if err := d.Set(neDeviceSchemaNames["Name"], primary.Name); err != nil {
return fmt.Errorf("error reading Name: %s", err)
}
if err := d.Set(neDeviceSchemaNames["ProjectID"], primary.ProjectID); err != nil {
return fmt.Errorf("error reading ProjectID: %s", err)
}
if err := d.Set(neDeviceSchemaNames["TypeCode"], primary.TypeCode); err != nil {
return fmt.Errorf("error reading TypeCode: %s", err)
}
@@ -1277,6 +1298,7 @@ func flattenNetworkDeviceSecondary(device *ne.Device) interface{} {
transformed[neDeviceSchemaNames["AccountNumber"]] = device.AccountNumber
transformed[neDeviceSchemaNames["Notifications"]] = device.Notifications
transformed[neDeviceSchemaNames["RedundancyType"]] = device.RedundancyType
transformed[neDeviceSchemaNames["ProjectID"]] = device.ProjectID
transformed[neDeviceSchemaNames["RedundantUUID"]] = device.RedundantUUID
transformed[neDeviceSchemaNames["AdditionalBandwidth"]] = device.AdditionalBandwidth
transformed[neDeviceSchemaNames["Interfaces"]] = flattenNetworkDeviceInterfaces(device.Interfaces)
@@ -1300,6 +1322,9 @@ func expandNetworkDeviceSecondary(devices []interface{}) *ne.Device {
if v, ok := device[neDeviceSchemaNames["Name"]]; ok && !isEmpty(v) {
transformed.Name = ne.String(v.(string))
}
if v, ok := device[neDeviceSchemaNames["ProjectID"]]; ok && !isEmpty(v) {
transformed.ProjectID = ne.String(v.(string))
}
if v, ok := device[neDeviceSchemaNames["MetroCode"]]; ok && !isEmpty(v) {
transformed.MetroCode = ne.String(v.(string))
}
40 changes: 28 additions & 12 deletions equinix/resource_network_device_link.go
Original file line number Diff line number Diff line change
@@ -20,21 +20,23 @@ import (
)

var networkDeviceLinkSchemaNames = map[string]string{
"UUID": "uuid",
"Name": "name",
"Subnet": "subnet",
"Devices": "device",
"Links": "link",
"Status": "status",
"UUID": "uuid",
"Name": "name",
"Subnet": "subnet",
"Devices": "device",
"Links": "link",
"Status": "status",
"ProjectID": "project_id",
}

var networkDeviceLinkDescriptions = map[string]string{
"UUID": "Device link unique identifier",
"Name": "Device link name",
"Subnet": "Device link subnet CIDR.",
"Devices": "Definition of one or more devices belonging to the device link",
"Links": "Definition of one or more, inter metro connections belonging to the device link",
"Status": "Device link provisioning status",
"UUID": "Device link unique identifier",
"Name": "Device link name",
"Subnet": "Device link subnet CIDR.",
"Devices": "Definition of one or more devices belonging to the device link",
"Links": "Definition of one or more, inter metro connections belonging to the device link",
"Status": "Device link provisioning status",
"ProjectID": "The unique identifier of Project Resource to which device link is scoped to",
}

var networkDeviceLinkDeviceSchemaNames = map[string]string{
@@ -114,6 +116,14 @@ func createNetworkDeviceLinkResourceSchema() map[string]*schema.Schema {
ValidateFunc: validation.StringLenBetween(3, 50),
Description: networkDeviceLinkSchemaNames["Name"],
},
networkDeviceLinkSchemaNames["ProjectID"]: {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.IsUUID,
Description: networkDeviceLinkSchemaNames["ProjectID"],
},
networkDeviceLinkSchemaNames["Subnet"]: {
Type: schema.TypeString,
Optional: true,
@@ -338,6 +348,9 @@ func createNetworkDeviceLink(d *schema.ResourceData) ne.DeviceLinkGroup {
if v, ok := d.GetOk(networkDeviceLinkSchemaNames["Subnet"]); ok {
link.Subnet = ne.String(v.(string))
}
if v, ok := d.GetOk(networkDeviceLinkSchemaNames["ProjectID"]); ok {
link.ProjectID = ne.String(v.(string))
}
if v, ok := d.GetOk(networkDeviceLinkSchemaNames["Devices"]); ok {
link.Devices = expandNetworkDeviceLinkDevices(v.(*schema.Set))
}
@@ -366,6 +379,9 @@ func updateNetworkDeviceLinkResource(link *ne.DeviceLinkGroup, d *schema.Resourc
if err := d.Set(networkDeviceLinkSchemaNames["Links"], flattenNetworkDeviceLinkConnections(d.Get(networkDeviceLinkSchemaNames["Devices"]).(*schema.Set), link.Links)); err != nil {
return fmt.Errorf("error setting Links: %s", err)
}
if err := d.Set(networkDeviceLinkSchemaNames["ProjectID"], link.ProjectID); err != nil {
return fmt.Errorf("error setting ProjectID: %s", err)
}
return nil
}

10 changes: 6 additions & 4 deletions equinix/resource_network_device_link_test.go
Original file line number Diff line number Diff line change
@@ -12,8 +12,9 @@ func TestNetworkDeviceLink_createFromResourceData(t *testing.T) {
// given

expected := ne.DeviceLinkGroup{
Name: ne.String("testGroup"),
Subnet: ne.String("10.10.1.0/24"),
Name: ne.String("testGroup"),
Subnet: ne.String("10.10.1.0/24"),
ProjectID: ne.String("68ccfd49-39b1-478e-957a-67c72f719d7a"),
Devices: []ne.DeviceLinkGroupDevice{
{
DeviceID: ne.String("3eee8518-b19d-4de5-afd8-afd9b67e6e8c"),
@@ -39,8 +40,9 @@ func TestNetworkDeviceLink_createFromResourceData(t *testing.T) {
}

rawData := map[string]interface{}{
networkDeviceLinkSchemaNames["Name"]: ne.StringValue(expected.Name),
networkDeviceLinkSchemaNames["Subnet"]: ne.StringValue(expected.Subnet),
networkDeviceLinkSchemaNames["Name"]: ne.StringValue(expected.Name),
networkDeviceLinkSchemaNames["Subnet"]: ne.StringValue(expected.Subnet),
networkDeviceLinkSchemaNames["ProjectID"]: ne.StringValue(expected.ProjectID),
}
d := schema.TestResourceDataRaw(t, createNetworkDeviceLinkResourceSchema(), rawData)
d.Set(networkDeviceLinkSchemaNames["Devices"], flattenNetworkDeviceLinkDevices(nil, expected.Devices))
Loading