diff --git a/Makefile b/Makefile index 0b245798..56586122 100644 --- a/Makefile +++ b/Makefile @@ -30,11 +30,12 @@ development: install_plugins provider lint_provider build_sdks install_sdks clea build: install_plugins provider build_sdks install_sdks only_build: build -tfgen: cleanup install_plugins upstream +tfgen: cleanup install_plugins upstream examples (cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN}) $(WORKING_DIR)/bin/${TFGEN} schema --out provider/cmd/${PROVIDER} (cd provider && VERSION=$(VERSION) go generate cmd/${PROVIDER}/main.go) + bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -197,12 +198,6 @@ upstream.rebase: examples: install_equinix_plugin scripts/generate_examples.sh -examples_check: examples - if git status --porcelain | grep examples; then \ - echo "Uncommitted changes detected. Run 'make examples' and commit changes."; \ - exit 1; \ - fi - # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: @mkdir -p .pulumi diff --git a/docs/resource/equinix_metal_connection.examples.md b/docs/resource/equinix_metal_connection.examples.md index 30916e8c..4d3952fd 100644 --- a/docs/resource/equinix_metal_connection.examples.md +++ b/docs/resource/equinix_metal_connection.examples.md @@ -1,7 +1,7 @@ ## Example Usage {{% example %}} -### metal billed token +### example metal billed token ```typescript import * as pulumi from "@pulumi/pulumi"; import * as equinix from "@equinix-labs/pulumi-equinix"; @@ -184,7 +184,7 @@ outputs: {{% /example %}} {{% example %}} -### fabric billed token +### example fabric billed token ```typescript import * as pulumi from "@pulumi/pulumi"; import * as equinix from "@equinix-labs/pulumi-equinix"; diff --git a/docs/resource/equinix_metal_device_network_type.examples.md b/docs/resource/equinix_metal_device_network_type.examples.md new file mode 100644 index 00000000..c9a7432c --- /dev/null +++ b/docs/resource/equinix_metal_device_network_type.examples.md @@ -0,0 +1,131 @@ +## Example Usage +{{% example %}} +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const config = new pulumi.Config(); +const deviceId = config.require("deviceId"); +const networkType = config.get("networkType") || "hybrid"; +const deviceNetwork = new equinix.metal.DeviceNetworkType("deviceNetwork", { + deviceId: deviceId, + type: networkType, +}); +export const deviceNetworkId = deviceNetwork.id; +``` +```python +import pulumi +import pulumi_equinix as equinix + +config = pulumi.Config() +device_id = config.require("deviceId") +network_type = config.get("networkType") +if network_type is None: + network_type = "hybrid" +device_network = equinix.metal.DeviceNetworkType("deviceNetwork", + device_id=device_id, + type=network_type) +pulumi.export("deviceNetworkId", device_network.id) +``` +```go +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + cfg := config.New(ctx, "") + deviceId := cfg.Require("deviceId") + networkType := "hybrid" + if param := cfg.Get("networkType"); param != "" { + networkType = param + } + deviceNetwork, err := metal.NewDeviceNetworkType(ctx, "deviceNetwork", &metal.DeviceNetworkTypeArgs{ + DeviceId: pulumi.String(deviceId), + Type: pulumi.String(networkType), + }) + if err != nil { + return err + } + ctx.Export("deviceNetworkId", deviceNetwork.ID()) + return nil + }) +} +``` +```csharp +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var config = new Config(); + var deviceId = config.Require("deviceId"); + var networkType = config.Get("networkType") ?? "hybrid"; + var deviceNetwork = new Equinix.Metal.DeviceNetworkType("deviceNetwork", new() + { + DeviceId = deviceId, + Type = networkType, + }); + + return new Dictionary + { + ["deviceNetworkId"] = deviceNetwork.Id, + }; +}); +``` +```java +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.metal.DeviceNetworkType; +import com.pulumi.equinix.metal.DeviceNetworkTypeArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + final var config = ctx.config(); + final var deviceId = config.get("deviceId"); + final var networkType = config.get("networkType").orElse("hybrid"); + var deviceNetwork = new DeviceNetworkType("deviceNetwork", DeviceNetworkTypeArgs.builder() + .deviceId(deviceId) + .type(networkType) + .build()); + + ctx.export("deviceNetworkId", deviceNetwork.id()); + } +} +``` +```yaml +config: + deviceId: + type: string + networkType: + type: string + default: hybrid +resources: + deviceNetwork: + type: equinix:metal:DeviceNetworkType + properties: + deviceId: ${deviceId} + type: ${networkType} +outputs: + deviceNetworkId: ${deviceNetwork.id} +``` +{{% /example %}} diff --git a/docs/resource/equinix_metal_port.examples.md b/docs/resource/equinix_metal_port.examples.md index 6fdb7bec..0da0c68b 100644 --- a/docs/resource/equinix_metal_port.examples.md +++ b/docs/resource/equinix_metal_port.examples.md @@ -1,559 +1,3 @@ ## Example Usage -{{% example %}} -### vlan attachment -{{% example %}} -### example 2 -```typescript -import * as pulumi from "@pulumi/pulumi"; -import * as equinix from "@equinix-labs/pulumi-equinix"; - -const test = new equinix.metal.Device("test", { - hostname: "test", - plan: equinix.metal.Plan.C3SmallX86, - metro: "ny", - operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, - billingCycle: equinix.metal.BillingCycle.Hourly, - projectId: projectId, -}); -const testDeviceNetworkType = new equinix.metal.DeviceNetworkType("testDeviceNetworkType", { - deviceId: test.id, - type: "layer2-individual", -}); -const test1 = new equinix.metal.Vlan("test1", { - description: "VLAN in New York", - metro: "ny", - projectId: projectId, -}); -const test2 = new equinix.metal.Vlan("test2", { - description: "VLAN in New Jersey", - metro: "ny", - projectId: projectId, -}); -const test1PortVlanAttachment = new equinix.metal.PortVlanAttachment("test1PortVlanAttachment", { - deviceId: testDeviceNetworkType.id, - vlanVnid: test1.vxlan, - portName: "eth1", -}); -const test2PortVlanAttachment = new equinix.metal.PortVlanAttachment("test2PortVlanAttachment", { - deviceId: testDeviceNetworkType.id, - vlanVnid: test2.vxlan, - portName: "eth1", - native: true, -}, { - dependsOn: [test1PortVlanAttachment], -}); -``` -```python -import pulumi -import pulumi_equinix as equinix - -test = equinix.metal.Device("test", - hostname="test", - plan=equinix.metal.Plan.C3_SMALL_X86, - metro="ny", - operating_system=equinix.metal.OperatingSystem.UBUNTU20_04, - billing_cycle=equinix.metal.BillingCycle.HOURLY, - project_id=project_id) -test_device_network_type = equinix.metal.DeviceNetworkType("testDeviceNetworkType", - device_id=test.id, - type="layer2-individual") -test1 = equinix.metal.Vlan("test1", - description="VLAN in New York", - metro="ny", - project_id=project_id) -test2 = equinix.metal.Vlan("test2", - description="VLAN in New Jersey", - metro="ny", - project_id=project_id) -test1_port_vlan_attachment = equinix.metal.PortVlanAttachment("test1PortVlanAttachment", - device_id=test_device_network_type.id, - vlan_vnid=test1.vxlan, - port_name="eth1") -test2_port_vlan_attachment = equinix.metal.PortVlanAttachment("test2PortVlanAttachment", - device_id=test_device_network_type.id, - vlan_vnid=test2.vxlan, - port_name="eth1", - native=True, - opts = pulumi.ResourceOptions(depends_on=[test1_port_vlan_attachment])) -``` -```go -package main - -import ( - "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -func main() { - pulumi.Run(func(ctx *pulumi.Context) error { - test, err := metal.NewDevice(ctx, "test", &metal.DeviceArgs{ - Hostname: pulumi.String("test"), - Plan: pulumi.String(metal.PlanC3SmallX86), - Metro: pulumi.String("ny"), - OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04), - BillingCycle: pulumi.String(metal.BillingCycleHourly), - ProjectId: pulumi.Any(projectId), - }) - if err != nil { - return err - } - testDeviceNetworkType, err := metal.NewDeviceNetworkType(ctx, "testDeviceNetworkType", &metal.DeviceNetworkTypeArgs{ - DeviceId: test.ID(), - Type: pulumi.String("layer2-individual"), - }) - if err != nil { - return err - } - test1, err := metal.NewVlan(ctx, "test1", &metal.VlanArgs{ - Description: pulumi.String("VLAN in New York"), - Metro: pulumi.String("ny"), - ProjectId: pulumi.Any(projectId), - }) - if err != nil { - return err - } - test2, err := metal.NewVlan(ctx, "test2", &metal.VlanArgs{ - Description: pulumi.String("VLAN in New Jersey"), - Metro: pulumi.String("ny"), - ProjectId: pulumi.Any(projectId), - }) - if err != nil { - return err - } - test1PortVlanAttachment, err := metal.NewPortVlanAttachment(ctx, "test1PortVlanAttachment", &metal.PortVlanAttachmentArgs{ - DeviceId: testDeviceNetworkType.ID(), - VlanVnid: test1.Vxlan, - PortName: pulumi.String("eth1"), - }) - if err != nil { - return err - } - _, err = metal.NewPortVlanAttachment(ctx, "test2PortVlanAttachment", &metal.PortVlanAttachmentArgs{ - DeviceId: testDeviceNetworkType.ID(), - VlanVnid: test2.Vxlan, - PortName: pulumi.String("eth1"), - Native: pulumi.Bool(true), - }, pulumi.DependsOn([]pulumi.Resource{ - test1PortVlanAttachment, - })) - if err != nil { - return err - } - return nil - }) -} -``` -```csharp -using System.Collections.Generic; -using System.Linq; -using Pulumi; -using Equinix = Pulumi.Equinix; - -return await Deployment.RunAsync(() => -{ - var test = new Equinix.Metal.Device("test", new() - { - Hostname = "test", - Plan = Equinix.Metal.Plan.C3SmallX86, - Metro = "ny", - OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04, - BillingCycle = Equinix.Metal.BillingCycle.Hourly, - ProjectId = projectId, - }); - - var testDeviceNetworkType = new Equinix.Metal.DeviceNetworkType("testDeviceNetworkType", new() - { - DeviceId = test.Id, - Type = "layer2-individual", - }); - - var test1 = new Equinix.Metal.Vlan("test1", new() - { - Description = "VLAN in New York", - Metro = "ny", - ProjectId = projectId, - }); - - var test2 = new Equinix.Metal.Vlan("test2", new() - { - Description = "VLAN in New Jersey", - Metro = "ny", - ProjectId = projectId, - }); - - var test1PortVlanAttachment = new Equinix.Metal.PortVlanAttachment("test1PortVlanAttachment", new() - { - DeviceId = testDeviceNetworkType.Id, - VlanVnid = test1.Vxlan, - PortName = "eth1", - }); - - var test2PortVlanAttachment = new Equinix.Metal.PortVlanAttachment("test2PortVlanAttachment", new() - { - DeviceId = testDeviceNetworkType.Id, - VlanVnid = test2.Vxlan, - PortName = "eth1", - Native = true, - }, new CustomResourceOptions - { - DependsOn = - { - test1PortVlanAttachment, - }, - }); - -}); -``` -```java -package generated_program; - -import com.pulumi.Context; -import com.pulumi.Pulumi; -import com.pulumi.core.Output; -import com.pulumi.equinix.metal.Device; -import com.pulumi.equinix.metal.DeviceArgs; -import com.pulumi.equinix.metal.DeviceNetworkType; -import com.pulumi.equinix.metal.DeviceNetworkTypeArgs; -import com.pulumi.equinix.metal.Vlan; -import com.pulumi.equinix.metal.VlanArgs; -import com.pulumi.equinix.metal.PortVlanAttachment; -import com.pulumi.equinix.metal.PortVlanAttachmentArgs; -import com.pulumi.resources.CustomResourceOptions; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class App { - public static void main(String[] args) { - Pulumi.run(App::stack); - } - - public static void stack(Context ctx) { - var test = new Device("test", DeviceArgs.builder() - .hostname("test") - .plan("c3.small.x86") - .metro("ny") - .operatingSystem("ubuntu_20_04") - .billingCycle("hourly") - .projectId(projectId) - .build()); - - var testDeviceNetworkType = new DeviceNetworkType("testDeviceNetworkType", DeviceNetworkTypeArgs.builder() - .deviceId(test.id()) - .type("layer2-individual") - .build()); - - var test1 = new Vlan("test1", VlanArgs.builder() - .description("VLAN in New York") - .metro("ny") - .projectId(projectId) - .build()); - - var test2 = new Vlan("test2", VlanArgs.builder() - .description("VLAN in New Jersey") - .metro("ny") - .projectId(projectId) - .build()); - - var test1PortVlanAttachment = new PortVlanAttachment("test1PortVlanAttachment", PortVlanAttachmentArgs.builder() - .deviceId(testDeviceNetworkType.id()) - .vlanVnid(test1.vxlan()) - .portName("eth1") - .build()); - - var test2PortVlanAttachment = new PortVlanAttachment("test2PortVlanAttachment", PortVlanAttachmentArgs.builder() - .deviceId(testDeviceNetworkType.id()) - .vlanVnid(test2.vxlan()) - .portName("eth1") - .native_(true) - .build(), CustomResourceOptions.builder() - .dependsOn(test1PortVlanAttachment) - .build()); - - } -} -``` -```yaml - test: - type: equinix:metal:Device - properties: - hostname: test - plan: c3.small.x86 - metro: ny - operatingSystem: ubuntu_20_04 - billingCycle: hourly - projectId: ${projectId} - testDeviceNetworkType: - type: equinix:metal:DeviceNetworkType - name: test - properties: - deviceId: ${test.id} - type: layer2-individual - test1: - type: equinix:metal:Vlan - properties: - description: VLAN in New York - metro: ny - projectId: ${projectId} - test2: - type: equinix:metal:Vlan - properties: - description: VLAN in New Jersey - metro: ny - projectId: ${projectId} - test1PortVlanAttachment: - type: equinix:metal:PortVlanAttachment - name: test1 - properties: - deviceId: ${testDeviceNetworkType.id} - vlanVnid: ${test1.vxlan} - portName: eth1 - test2PortVlanAttachment: - type: equinix:metal:PortVlanAttachment - name: test2 - properties: - deviceId: ${testDeviceNetworkType.id} - vlanVnid: ${test2.vxlan} - portName: eth1 - native: true - options: - dependson: - - ${test1PortVlanAttachment} -``` -{{% /example %}} - -{{% example %}} -### example 1 -```typescript -import * as pulumi from "@pulumi/pulumi"; -import * as equinix from "@equinix-labs/pulumi-equinix"; - -const test = new equinix.metal.Vlan("test", { - description: "VLAN in New York", - metro: "ny", - projectId: projectId, -}); -const testDevice = new equinix.metal.Device("testDevice", { - hostname: "test", - plan: equinix.metal.Plan.C3SmallX86, - metro: "ny", - operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, - billingCycle: equinix.metal.BillingCycle.Hourly, - projectId: projectId, -}); -const testDeviceNetworkType = new equinix.metal.DeviceNetworkType("testDeviceNetworkType", { - deviceId: testDevice.id, - type: "hybrid", -}); -const testPortVlanAttachment = new equinix.metal.PortVlanAttachment("testPortVlanAttachment", { - deviceId: testDeviceNetworkType.id, - portName: "eth1", - vlanVnid: test.vxlan, -}); -``` -```python -import pulumi -import pulumi_equinix as equinix - -test = equinix.metal.Vlan("test", - description="VLAN in New York", - metro="ny", - project_id=project_id) -test_device = equinix.metal.Device("testDevice", - hostname="test", - plan=equinix.metal.Plan.C3_SMALL_X86, - metro="ny", - operating_system=equinix.metal.OperatingSystem.UBUNTU20_04, - billing_cycle=equinix.metal.BillingCycle.HOURLY, - project_id=project_id) -test_device_network_type = equinix.metal.DeviceNetworkType("testDeviceNetworkType", - device_id=test_device.id, - type="hybrid") -test_port_vlan_attachment = equinix.metal.PortVlanAttachment("testPortVlanAttachment", - device_id=test_device_network_type.id, - port_name="eth1", - vlan_vnid=test.vxlan) -``` -```go -package main - -import ( - "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -func main() { - pulumi.Run(func(ctx *pulumi.Context) error { - test, err := metal.NewVlan(ctx, "test", &metal.VlanArgs{ - Description: pulumi.String("VLAN in New York"), - Metro: pulumi.String("ny"), - ProjectId: pulumi.Any(projectId), - }) - if err != nil { - return err - } - testDevice, err := metal.NewDevice(ctx, "testDevice", &metal.DeviceArgs{ - Hostname: pulumi.String("test"), - Plan: pulumi.String(metal.PlanC3SmallX86), - Metro: pulumi.String("ny"), - OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04), - BillingCycle: pulumi.String(metal.BillingCycleHourly), - ProjectId: pulumi.Any(projectId), - }) - if err != nil { - return err - } - testDeviceNetworkType, err := metal.NewDeviceNetworkType(ctx, "testDeviceNetworkType", &metal.DeviceNetworkTypeArgs{ - DeviceId: testDevice.ID(), - Type: pulumi.String("hybrid"), - }) - if err != nil { - return err - } - _, err = metal.NewPortVlanAttachment(ctx, "testPortVlanAttachment", &metal.PortVlanAttachmentArgs{ - DeviceId: testDeviceNetworkType.ID(), - PortName: pulumi.String("eth1"), - VlanVnid: test.Vxlan, - }) - if err != nil { - return err - } - return nil - }) -} -``` -```csharp -using System.Collections.Generic; -using System.Linq; -using Pulumi; -using Equinix = Pulumi.Equinix; - -return await Deployment.RunAsync(() => -{ - var test = new Equinix.Metal.Vlan("test", new() - { - Description = "VLAN in New York", - Metro = "ny", - ProjectId = projectId, - }); - - var testDevice = new Equinix.Metal.Device("testDevice", new() - { - Hostname = "test", - Plan = Equinix.Metal.Plan.C3SmallX86, - Metro = "ny", - OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04, - BillingCycle = Equinix.Metal.BillingCycle.Hourly, - ProjectId = projectId, - }); - - var testDeviceNetworkType = new Equinix.Metal.DeviceNetworkType("testDeviceNetworkType", new() - { - DeviceId = testDevice.Id, - Type = "hybrid", - }); - - var testPortVlanAttachment = new Equinix.Metal.PortVlanAttachment("testPortVlanAttachment", new() - { - DeviceId = testDeviceNetworkType.Id, - PortName = "eth1", - VlanVnid = test.Vxlan, - }); - -}); -``` -```java -package generated_program; - -import com.pulumi.Context; -import com.pulumi.Pulumi; -import com.pulumi.core.Output; -import com.pulumi.equinix.metal.Vlan; -import com.pulumi.equinix.metal.VlanArgs; -import com.pulumi.equinix.metal.Device; -import com.pulumi.equinix.metal.DeviceArgs; -import com.pulumi.equinix.metal.DeviceNetworkType; -import com.pulumi.equinix.metal.DeviceNetworkTypeArgs; -import com.pulumi.equinix.metal.PortVlanAttachment; -import com.pulumi.equinix.metal.PortVlanAttachmentArgs; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class App { - public static void main(String[] args) { - Pulumi.run(App::stack); - } - - public static void stack(Context ctx) { - var test = new Vlan("test", VlanArgs.builder() - .description("VLAN in New York") - .metro("ny") - .projectId(projectId) - .build()); - - var testDevice = new Device("testDevice", DeviceArgs.builder() - .hostname("test") - .plan("c3.small.x86") - .metro("ny") - .operatingSystem("ubuntu_20_04") - .billingCycle("hourly") - .projectId(projectId) - .build()); - - var testDeviceNetworkType = new DeviceNetworkType("testDeviceNetworkType", DeviceNetworkTypeArgs.builder() - .deviceId(testDevice.id()) - .type("hybrid") - .build()); - - var testPortVlanAttachment = new PortVlanAttachment("testPortVlanAttachment", PortVlanAttachmentArgs.builder() - .deviceId(testDeviceNetworkType.id()) - .portName("eth1") - .vlanVnid(test.vxlan()) - .build()); - - } -} -``` -```yaml - test: - type: equinix:metal:Vlan - properties: - description: VLAN in New York - metro: ny - projectId: ${projectId} - testDevice: - type: equinix:metal:Device - name: test - properties: - hostname: test - plan: c3.small.x86 - metro: ny - operatingSystem: ubuntu_20_04 - billingCycle: hourly - projectId: ${projectId} - testDeviceNetworkType: - type: equinix:metal:DeviceNetworkType - name: test - properties: - deviceId: ${testDevice.id} - type: hybrid - testPortVlanAttachment: - type: equinix:metal:PortVlanAttachment - name: test - properties: - deviceId: ${testDeviceNetworkType.id} - portName: eth1 - vlanVnid: ${test.vxlan} -``` -{{% /example %}} -{{% /example %}} - diff --git a/docs/resource/equinix_metal_port_vlan_attachment.examples.md b/docs/resource/equinix_metal_port_vlan_attachment.examples.md new file mode 100644 index 00000000..39bc9524 --- /dev/null +++ b/docs/resource/equinix_metal_port_vlan_attachment.examples.md @@ -0,0 +1,556 @@ +## Example Usage + +{{% example %}} +### example 2 +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const test = new equinix.metal.Device("test", { + hostname: "test", + plan: equinix.metal.Plan.C3SmallX86, + metro: "ny", + operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, + billingCycle: equinix.metal.BillingCycle.Hourly, + projectId: projectId, +}); +const testDeviceNetworkType = new equinix.metal.DeviceNetworkType("testDeviceNetworkType", { + deviceId: test.id, + type: "layer2-individual", +}); +const test1 = new equinix.metal.Vlan("test1", { + description: "VLAN in New York", + metro: "ny", + projectId: projectId, +}); +const test2 = new equinix.metal.Vlan("test2", { + description: "VLAN in New Jersey", + metro: "ny", + projectId: projectId, +}); +const test1PortVlanAttachment = new equinix.metal.PortVlanAttachment("test1PortVlanAttachment", { + deviceId: testDeviceNetworkType.id, + vlanVnid: test1.vxlan, + portName: "eth1", +}); +const test2PortVlanAttachment = new equinix.metal.PortVlanAttachment("test2PortVlanAttachment", { + deviceId: testDeviceNetworkType.id, + vlanVnid: test2.vxlan, + portName: "eth1", + native: true, +}, { + dependsOn: [test1PortVlanAttachment], +}); +``` +```python +import pulumi +import pulumi_equinix as equinix + +test = equinix.metal.Device("test", + hostname="test", + plan=equinix.metal.Plan.C3_SMALL_X86, + metro="ny", + operating_system=equinix.metal.OperatingSystem.UBUNTU20_04, + billing_cycle=equinix.metal.BillingCycle.HOURLY, + project_id=project_id) +test_device_network_type = equinix.metal.DeviceNetworkType("testDeviceNetworkType", + device_id=test.id, + type="layer2-individual") +test1 = equinix.metal.Vlan("test1", + description="VLAN in New York", + metro="ny", + project_id=project_id) +test2 = equinix.metal.Vlan("test2", + description="VLAN in New Jersey", + metro="ny", + project_id=project_id) +test1_port_vlan_attachment = equinix.metal.PortVlanAttachment("test1PortVlanAttachment", + device_id=test_device_network_type.id, + vlan_vnid=test1.vxlan, + port_name="eth1") +test2_port_vlan_attachment = equinix.metal.PortVlanAttachment("test2PortVlanAttachment", + device_id=test_device_network_type.id, + vlan_vnid=test2.vxlan, + port_name="eth1", + native=True, + opts = pulumi.ResourceOptions(depends_on=[test1_port_vlan_attachment])) +``` +```go +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + test, err := metal.NewDevice(ctx, "test", &metal.DeviceArgs{ + Hostname: pulumi.String("test"), + Plan: pulumi.String(metal.PlanC3SmallX86), + Metro: pulumi.String("ny"), + OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04), + BillingCycle: pulumi.String(metal.BillingCycleHourly), + ProjectId: pulumi.Any(projectId), + }) + if err != nil { + return err + } + testDeviceNetworkType, err := metal.NewDeviceNetworkType(ctx, "testDeviceNetworkType", &metal.DeviceNetworkTypeArgs{ + DeviceId: test.ID(), + Type: pulumi.String("layer2-individual"), + }) + if err != nil { + return err + } + test1, err := metal.NewVlan(ctx, "test1", &metal.VlanArgs{ + Description: pulumi.String("VLAN in New York"), + Metro: pulumi.String("ny"), + ProjectId: pulumi.Any(projectId), + }) + if err != nil { + return err + } + test2, err := metal.NewVlan(ctx, "test2", &metal.VlanArgs{ + Description: pulumi.String("VLAN in New Jersey"), + Metro: pulumi.String("ny"), + ProjectId: pulumi.Any(projectId), + }) + if err != nil { + return err + } + test1PortVlanAttachment, err := metal.NewPortVlanAttachment(ctx, "test1PortVlanAttachment", &metal.PortVlanAttachmentArgs{ + DeviceId: testDeviceNetworkType.ID(), + VlanVnid: test1.Vxlan, + PortName: pulumi.String("eth1"), + }) + if err != nil { + return err + } + _, err = metal.NewPortVlanAttachment(ctx, "test2PortVlanAttachment", &metal.PortVlanAttachmentArgs{ + DeviceId: testDeviceNetworkType.ID(), + VlanVnid: test2.Vxlan, + PortName: pulumi.String("eth1"), + Native: pulumi.Bool(true), + }, pulumi.DependsOn([]pulumi.Resource{ + test1PortVlanAttachment, + })) + if err != nil { + return err + } + return nil + }) +} +``` +```csharp +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var test = new Equinix.Metal.Device("test", new() + { + Hostname = "test", + Plan = Equinix.Metal.Plan.C3SmallX86, + Metro = "ny", + OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04, + BillingCycle = Equinix.Metal.BillingCycle.Hourly, + ProjectId = projectId, + }); + + var testDeviceNetworkType = new Equinix.Metal.DeviceNetworkType("testDeviceNetworkType", new() + { + DeviceId = test.Id, + Type = "layer2-individual", + }); + + var test1 = new Equinix.Metal.Vlan("test1", new() + { + Description = "VLAN in New York", + Metro = "ny", + ProjectId = projectId, + }); + + var test2 = new Equinix.Metal.Vlan("test2", new() + { + Description = "VLAN in New Jersey", + Metro = "ny", + ProjectId = projectId, + }); + + var test1PortVlanAttachment = new Equinix.Metal.PortVlanAttachment("test1PortVlanAttachment", new() + { + DeviceId = testDeviceNetworkType.Id, + VlanVnid = test1.Vxlan, + PortName = "eth1", + }); + + var test2PortVlanAttachment = new Equinix.Metal.PortVlanAttachment("test2PortVlanAttachment", new() + { + DeviceId = testDeviceNetworkType.Id, + VlanVnid = test2.Vxlan, + PortName = "eth1", + Native = true, + }, new CustomResourceOptions + { + DependsOn = + { + test1PortVlanAttachment, + }, + }); + +}); +``` +```java +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.metal.Device; +import com.pulumi.equinix.metal.DeviceArgs; +import com.pulumi.equinix.metal.DeviceNetworkType; +import com.pulumi.equinix.metal.DeviceNetworkTypeArgs; +import com.pulumi.equinix.metal.Vlan; +import com.pulumi.equinix.metal.VlanArgs; +import com.pulumi.equinix.metal.PortVlanAttachment; +import com.pulumi.equinix.metal.PortVlanAttachmentArgs; +import com.pulumi.resources.CustomResourceOptions; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var test = new Device("test", DeviceArgs.builder() + .hostname("test") + .plan("c3.small.x86") + .metro("ny") + .operatingSystem("ubuntu_20_04") + .billingCycle("hourly") + .projectId(projectId) + .build()); + + var testDeviceNetworkType = new DeviceNetworkType("testDeviceNetworkType", DeviceNetworkTypeArgs.builder() + .deviceId(test.id()) + .type("layer2-individual") + .build()); + + var test1 = new Vlan("test1", VlanArgs.builder() + .description("VLAN in New York") + .metro("ny") + .projectId(projectId) + .build()); + + var test2 = new Vlan("test2", VlanArgs.builder() + .description("VLAN in New Jersey") + .metro("ny") + .projectId(projectId) + .build()); + + var test1PortVlanAttachment = new PortVlanAttachment("test1PortVlanAttachment", PortVlanAttachmentArgs.builder() + .deviceId(testDeviceNetworkType.id()) + .vlanVnid(test1.vxlan()) + .portName("eth1") + .build()); + + var test2PortVlanAttachment = new PortVlanAttachment("test2PortVlanAttachment", PortVlanAttachmentArgs.builder() + .deviceId(testDeviceNetworkType.id()) + .vlanVnid(test2.vxlan()) + .portName("eth1") + .native_(true) + .build(), CustomResourceOptions.builder() + .dependsOn(test1PortVlanAttachment) + .build()); + + } +} +``` +```yaml + test: + type: equinix:metal:Device + properties: + hostname: test + plan: c3.small.x86 + metro: ny + operatingSystem: ubuntu_20_04 + billingCycle: hourly + projectId: ${projectId} + testDeviceNetworkType: + type: equinix:metal:DeviceNetworkType + name: test + properties: + deviceId: ${test.id} + type: layer2-individual + test1: + type: equinix:metal:Vlan + properties: + description: VLAN in New York + metro: ny + projectId: ${projectId} + test2: + type: equinix:metal:Vlan + properties: + description: VLAN in New Jersey + metro: ny + projectId: ${projectId} + test1PortVlanAttachment: + type: equinix:metal:PortVlanAttachment + name: test1 + properties: + deviceId: ${testDeviceNetworkType.id} + vlanVnid: ${test1.vxlan} + portName: eth1 + test2PortVlanAttachment: + type: equinix:metal:PortVlanAttachment + name: test2 + properties: + deviceId: ${testDeviceNetworkType.id} + vlanVnid: ${test2.vxlan} + portName: eth1 + native: true + options: + dependson: + - ${test1PortVlanAttachment} +``` +{{% /example %}} + +{{% example %}} +### example 1 +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const test = new equinix.metal.Vlan("test", { + description: "VLAN in New York", + metro: "ny", + projectId: projectId, +}); +const testDevice = new equinix.metal.Device("testDevice", { + hostname: "test", + plan: equinix.metal.Plan.C3SmallX86, + metro: "ny", + operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, + billingCycle: equinix.metal.BillingCycle.Hourly, + projectId: projectId, +}); +const testDeviceNetworkType = new equinix.metal.DeviceNetworkType("testDeviceNetworkType", { + deviceId: testDevice.id, + type: "hybrid", +}); +const testPortVlanAttachment = new equinix.metal.PortVlanAttachment("testPortVlanAttachment", { + deviceId: testDeviceNetworkType.id, + portName: "eth1", + vlanVnid: test.vxlan, +}); +``` +```python +import pulumi +import pulumi_equinix as equinix + +test = equinix.metal.Vlan("test", + description="VLAN in New York", + metro="ny", + project_id=project_id) +test_device = equinix.metal.Device("testDevice", + hostname="test", + plan=equinix.metal.Plan.C3_SMALL_X86, + metro="ny", + operating_system=equinix.metal.OperatingSystem.UBUNTU20_04, + billing_cycle=equinix.metal.BillingCycle.HOURLY, + project_id=project_id) +test_device_network_type = equinix.metal.DeviceNetworkType("testDeviceNetworkType", + device_id=test_device.id, + type="hybrid") +test_port_vlan_attachment = equinix.metal.PortVlanAttachment("testPortVlanAttachment", + device_id=test_device_network_type.id, + port_name="eth1", + vlan_vnid=test.vxlan) +``` +```go +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + test, err := metal.NewVlan(ctx, "test", &metal.VlanArgs{ + Description: pulumi.String("VLAN in New York"), + Metro: pulumi.String("ny"), + ProjectId: pulumi.Any(projectId), + }) + if err != nil { + return err + } + testDevice, err := metal.NewDevice(ctx, "testDevice", &metal.DeviceArgs{ + Hostname: pulumi.String("test"), + Plan: pulumi.String(metal.PlanC3SmallX86), + Metro: pulumi.String("ny"), + OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04), + BillingCycle: pulumi.String(metal.BillingCycleHourly), + ProjectId: pulumi.Any(projectId), + }) + if err != nil { + return err + } + testDeviceNetworkType, err := metal.NewDeviceNetworkType(ctx, "testDeviceNetworkType", &metal.DeviceNetworkTypeArgs{ + DeviceId: testDevice.ID(), + Type: pulumi.String("hybrid"), + }) + if err != nil { + return err + } + _, err = metal.NewPortVlanAttachment(ctx, "testPortVlanAttachment", &metal.PortVlanAttachmentArgs{ + DeviceId: testDeviceNetworkType.ID(), + PortName: pulumi.String("eth1"), + VlanVnid: test.Vxlan, + }) + if err != nil { + return err + } + return nil + }) +} +``` +```csharp +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var test = new Equinix.Metal.Vlan("test", new() + { + Description = "VLAN in New York", + Metro = "ny", + ProjectId = projectId, + }); + + var testDevice = new Equinix.Metal.Device("testDevice", new() + { + Hostname = "test", + Plan = Equinix.Metal.Plan.C3SmallX86, + Metro = "ny", + OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04, + BillingCycle = Equinix.Metal.BillingCycle.Hourly, + ProjectId = projectId, + }); + + var testDeviceNetworkType = new Equinix.Metal.DeviceNetworkType("testDeviceNetworkType", new() + { + DeviceId = testDevice.Id, + Type = "hybrid", + }); + + var testPortVlanAttachment = new Equinix.Metal.PortVlanAttachment("testPortVlanAttachment", new() + { + DeviceId = testDeviceNetworkType.Id, + PortName = "eth1", + VlanVnid = test.Vxlan, + }); + +}); +``` +```java +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.metal.Vlan; +import com.pulumi.equinix.metal.VlanArgs; +import com.pulumi.equinix.metal.Device; +import com.pulumi.equinix.metal.DeviceArgs; +import com.pulumi.equinix.metal.DeviceNetworkType; +import com.pulumi.equinix.metal.DeviceNetworkTypeArgs; +import com.pulumi.equinix.metal.PortVlanAttachment; +import com.pulumi.equinix.metal.PortVlanAttachmentArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var test = new Vlan("test", VlanArgs.builder() + .description("VLAN in New York") + .metro("ny") + .projectId(projectId) + .build()); + + var testDevice = new Device("testDevice", DeviceArgs.builder() + .hostname("test") + .plan("c3.small.x86") + .metro("ny") + .operatingSystem("ubuntu_20_04") + .billingCycle("hourly") + .projectId(projectId) + .build()); + + var testDeviceNetworkType = new DeviceNetworkType("testDeviceNetworkType", DeviceNetworkTypeArgs.builder() + .deviceId(testDevice.id()) + .type("hybrid") + .build()); + + var testPortVlanAttachment = new PortVlanAttachment("testPortVlanAttachment", PortVlanAttachmentArgs.builder() + .deviceId(testDeviceNetworkType.id()) + .portName("eth1") + .vlanVnid(test.vxlan()) + .build()); + + } +} +``` +```yaml + test: + type: equinix:metal:Vlan + properties: + description: VLAN in New York + metro: ny + projectId: ${projectId} + testDevice: + type: equinix:metal:Device + name: test + properties: + hostname: test + plan: c3.small.x86 + metro: ny + operatingSystem: ubuntu_20_04 + billingCycle: hourly + projectId: ${projectId} + testDeviceNetworkType: + type: equinix:metal:DeviceNetworkType + name: test + properties: + deviceId: ${testDevice.id} + type: hybrid + testPortVlanAttachment: + type: equinix:metal:PortVlanAttachment + name: test + properties: + deviceId: ${testDeviceNetworkType.id} + portName: eth1 + vlanVnid: ${test.vxlan} +``` +{{% /example %}} + + diff --git a/docs/resource/equinix_metal_project.examples.md b/docs/resource/equinix_metal_project.examples.md index f2c6d0fb..b6135208 100644 --- a/docs/resource/equinix_metal_project.examples.md +++ b/docs/resource/equinix_metal_project.examples.md @@ -1,183 +1,5 @@ ## Example Usage -{{% example %}} -### ssh key -```typescript -import * as pulumi from "@pulumi/pulumi"; -import * as equinix from "@equinix-labs/pulumi-equinix"; - -const projectId = ""; -const test = new equinix.metal.ProjectSshKey("test", { - name: "test", - publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2", - projectId: projectId, -}); -const testDevice = new equinix.metal.Device("testDevice", { - hostname: "test", - plan: equinix.metal.Plan.C3MediumX86, - metro: "ny", - operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, - billingCycle: equinix.metal.BillingCycle.Hourly, - projectSshKeyIds: [test.id], - projectId: projectId, -}); -``` -```python -import pulumi -import pulumi_equinix as equinix - -project_id = "" -test = equinix.metal.ProjectSshKey("test", - name="test", - public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2", - project_id=project_id) -test_device = equinix.metal.Device("testDevice", - hostname="test", - plan=equinix.metal.Plan.C3_MEDIUM_X86, - metro="ny", - operating_system=equinix.metal.OperatingSystem.UBUNTU20_04, - billing_cycle=equinix.metal.BillingCycle.HOURLY, - project_ssh_key_ids=[test.id], - project_id=project_id) -``` -```go -package main - -import ( - "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -func main() { - pulumi.Run(func(ctx *pulumi.Context) error { - projectId := "" - test, err := metal.NewProjectSshKey(ctx, "test", &metal.ProjectSshKeyArgs{ - Name: pulumi.String("test"), - PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2"), - ProjectId: pulumi.String(projectId), - }) - if err != nil { - return err - } - _, err = metal.NewDevice(ctx, "testDevice", &metal.DeviceArgs{ - Hostname: pulumi.String("test"), - Plan: pulumi.String(metal.PlanC3MediumX86), - Metro: pulumi.String("ny"), - OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04), - BillingCycle: pulumi.String(metal.BillingCycleHourly), - ProjectSshKeyIds: pulumi.StringArray{ - test.ID(), - }, - ProjectId: pulumi.String(projectId), - }) - if err != nil { - return err - } - return nil - }) -} -``` -```csharp -using System.Collections.Generic; -using System.Linq; -using Pulumi; -using Equinix = Pulumi.Equinix; - -return await Deployment.RunAsync(() => -{ - var projectId = ""; - - var test = new Equinix.Metal.ProjectSshKey("test", new() - { - Name = "test", - PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2", - ProjectId = projectId, - }); - - var testDevice = new Equinix.Metal.Device("testDevice", new() - { - Hostname = "test", - Plan = Equinix.Metal.Plan.C3MediumX86, - Metro = "ny", - OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04, - BillingCycle = Equinix.Metal.BillingCycle.Hourly, - ProjectSshKeyIds = new[] - { - test.Id, - }, - ProjectId = projectId, - }); - -}); -``` -```java -package generated_program; - -import com.pulumi.Context; -import com.pulumi.Pulumi; -import com.pulumi.core.Output; -import com.pulumi.equinix.metal.ProjectSshKey; -import com.pulumi.equinix.metal.ProjectSshKeyArgs; -import com.pulumi.equinix.metal.Device; -import com.pulumi.equinix.metal.DeviceArgs; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class App { - public static void main(String[] args) { - Pulumi.run(App::stack); - } - - public static void stack(Context ctx) { - final var projectId = ""; - - var test = new ProjectSshKey("test", ProjectSshKeyArgs.builder() - .name("test") - .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2") - .projectId(projectId) - .build()); - - var testDevice = new Device("testDevice", DeviceArgs.builder() - .hostname("test") - .plan("c3.medium.x86") - .metro("ny") - .operatingSystem("ubuntu_20_04") - .billingCycle("hourly") - .projectSshKeyIds(test.id()) - .projectId(projectId) - .build()); - - } -} -``` -```yaml - test: - type: equinix:metal:ProjectSshKey - properties: - name: test - publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2 - projectId: ${projectId} - testDevice: - type: equinix:metal:Device - name: test - properties: - hostname: test - plan: c3.medium.x86 - metro: ny - operatingSystem: ubuntu_20_04 - billingCycle: hourly - projectSshKeyIds: - - ${test.id} - projectId: ${projectId} -variables: - projectId: -``` -{{% /example %}} - {{% example %}} ### example 3 ```typescript @@ -298,107 +120,6 @@ public class App { ``` {{% /example %}} -{{% example %}} -### api key -```typescript -import * as pulumi from "@pulumi/pulumi"; -import * as equinix from "@equinix-labs/pulumi-equinix"; - -const test = new equinix.metal.ProjectApiKey("test", { - projectId: existingProjectId, - description: "Read-only key scoped to a projct", - readOnly: true, -}); -``` -```python -import pulumi -import pulumi_equinix as equinix - -test = equinix.metal.ProjectApiKey("test", - project_id=existing_project_id, - description="Read-only key scoped to a projct", - read_only=True) -``` -```go -package main - -import ( - "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -func main() { - pulumi.Run(func(ctx *pulumi.Context) error { - _, err := metal.NewProjectApiKey(ctx, "test", &metal.ProjectApiKeyArgs{ - ProjectId: pulumi.Any(existingProjectId), - Description: pulumi.String("Read-only key scoped to a projct"), - ReadOnly: pulumi.Bool(true), - }) - if err != nil { - return err - } - return nil - }) -} -``` -```csharp -using System.Collections.Generic; -using System.Linq; -using Pulumi; -using Equinix = Pulumi.Equinix; - -return await Deployment.RunAsync(() => -{ - var test = new Equinix.Metal.ProjectApiKey("test", new() - { - ProjectId = existingProjectId, - Description = "Read-only key scoped to a projct", - ReadOnly = true, - }); - -}); -``` -```java -package generated_program; - -import com.pulumi.Context; -import com.pulumi.Pulumi; -import com.pulumi.core.Output; -import com.pulumi.equinix.metal.ProjectApiKey; -import com.pulumi.equinix.metal.ProjectApiKeyArgs; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class App { - public static void main(String[] args) { - Pulumi.run(App::stack); - } - - public static void stack(Context ctx) { - var test = new ProjectApiKey("test", ProjectApiKeyArgs.builder() - .projectId(existingProjectId) - .description("Read-only key scoped to a projct") - .readOnly(true) - .build()); - - } -} -``` -```yaml - # Create a new read-only API key in existing project - test: - type: equinix:metal:ProjectApiKey - properties: - projectId: ${existingProjectId} - description: Read-only key scoped to a projct - readOnly: true -``` -{{% /example %}} - {{% example %}} ### example 2 ```typescript diff --git a/docs/resource/equinix_metal_project_api_key.examples.md b/docs/resource/equinix_metal_project_api_key.examples.md new file mode 100644 index 00000000..ffb9968e --- /dev/null +++ b/docs/resource/equinix_metal_project_api_key.examples.md @@ -0,0 +1,100 @@ +## Example Usage +{{% example %}} +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const test = new equinix.metal.ProjectApiKey("test", { + projectId: existingProjectId, + description: "Read-only key scoped to a projct", + readOnly: true, +}); +``` +```python +import pulumi +import pulumi_equinix as equinix + +test = equinix.metal.ProjectApiKey("test", + project_id=existing_project_id, + description="Read-only key scoped to a projct", + read_only=True) +``` +```go +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + _, err := metal.NewProjectApiKey(ctx, "test", &metal.ProjectApiKeyArgs{ + ProjectId: pulumi.Any(existingProjectId), + Description: pulumi.String("Read-only key scoped to a projct"), + ReadOnly: pulumi.Bool(true), + }) + if err != nil { + return err + } + return nil + }) +} +``` +```csharp +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var test = new Equinix.Metal.ProjectApiKey("test", new() + { + ProjectId = existingProjectId, + Description = "Read-only key scoped to a projct", + ReadOnly = true, + }); + +}); +``` +```java +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.metal.ProjectApiKey; +import com.pulumi.equinix.metal.ProjectApiKeyArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var test = new ProjectApiKey("test", ProjectApiKeyArgs.builder() + .projectId(existingProjectId) + .description("Read-only key scoped to a projct") + .readOnly(true) + .build()); + + } +} +``` +```yaml + # Create a new read-only API key in existing project + test: + type: equinix:metal:ProjectApiKey + properties: + projectId: ${existingProjectId} + description: Read-only key scoped to a projct + readOnly: true +``` +{{% /example %}} diff --git a/docs/resource/equinix_metal_project_ssh_key.examples.md b/docs/resource/equinix_metal_project_ssh_key.examples.md new file mode 100644 index 00000000..2ccb3522 --- /dev/null +++ b/docs/resource/equinix_metal_project_ssh_key.examples.md @@ -0,0 +1,177 @@ +## Example Usage +{{% example %}} +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const projectId = ""; +const test = new equinix.metal.ProjectSshKey("test", { + name: "test", + publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2", + projectId: projectId, +}); +const testDevice = new equinix.metal.Device("testDevice", { + hostname: "test", + plan: equinix.metal.Plan.C3MediumX86, + metro: "ny", + operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, + billingCycle: equinix.metal.BillingCycle.Hourly, + projectSshKeyIds: [test.id], + projectId: projectId, +}); +``` +```python +import pulumi +import pulumi_equinix as equinix + +project_id = "" +test = equinix.metal.ProjectSshKey("test", + name="test", + public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2", + project_id=project_id) +test_device = equinix.metal.Device("testDevice", + hostname="test", + plan=equinix.metal.Plan.C3_MEDIUM_X86, + metro="ny", + operating_system=equinix.metal.OperatingSystem.UBUNTU20_04, + billing_cycle=equinix.metal.BillingCycle.HOURLY, + project_ssh_key_ids=[test.id], + project_id=project_id) +``` +```go +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + projectId := "" + test, err := metal.NewProjectSshKey(ctx, "test", &metal.ProjectSshKeyArgs{ + Name: pulumi.String("test"), + PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2"), + ProjectId: pulumi.String(projectId), + }) + if err != nil { + return err + } + _, err = metal.NewDevice(ctx, "testDevice", &metal.DeviceArgs{ + Hostname: pulumi.String("test"), + Plan: pulumi.String(metal.PlanC3MediumX86), + Metro: pulumi.String("ny"), + OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04), + BillingCycle: pulumi.String(metal.BillingCycleHourly), + ProjectSshKeyIds: pulumi.StringArray{ + test.ID(), + }, + ProjectId: pulumi.String(projectId), + }) + if err != nil { + return err + } + return nil + }) +} +``` +```csharp +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var projectId = ""; + + var test = new Equinix.Metal.ProjectSshKey("test", new() + { + Name = "test", + PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2", + ProjectId = projectId, + }); + + var testDevice = new Equinix.Metal.Device("testDevice", new() + { + Hostname = "test", + Plan = Equinix.Metal.Plan.C3MediumX86, + Metro = "ny", + OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04, + BillingCycle = Equinix.Metal.BillingCycle.Hourly, + ProjectSshKeyIds = new[] + { + test.Id, + }, + ProjectId = projectId, + }); + +}); +``` +```java +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.metal.ProjectSshKey; +import com.pulumi.equinix.metal.ProjectSshKeyArgs; +import com.pulumi.equinix.metal.Device; +import com.pulumi.equinix.metal.DeviceArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + final var projectId = ""; + + var test = new ProjectSshKey("test", ProjectSshKeyArgs.builder() + .name("test") + .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2") + .projectId(projectId) + .build()); + + var testDevice = new Device("testDevice", DeviceArgs.builder() + .hostname("test") + .plan("c3.medium.x86") + .metro("ny") + .operatingSystem("ubuntu_20_04") + .billingCycle("hourly") + .projectSshKeyIds(test.id()) + .projectId(projectId) + .build()); + + } +} +``` +```yaml + test: + type: equinix:metal:ProjectSshKey + properties: + name: test + publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2 + projectId: ${projectId} + testDevice: + type: equinix:metal:Device + name: test + properties: + hostname: test + plan: c3.medium.x86 + metro: ny + operatingSystem: ubuntu_20_04 + billingCycle: hourly + projectSshKeyIds: + - ${test.id} + projectId: ${projectId} +variables: + projectId: +``` +{{% /example %}} diff --git a/docs/resource/equinix_network_device.examples.md b/docs/resource/equinix_network_device.examples.md index a46061f7..02cf306c 100644 --- a/docs/resource/equinix_network_device.examples.md +++ b/docs/resource/equinix_network_device.examples.md @@ -965,226 +965,6 @@ variables: ``` {{% /example %}} -{{% example %}} -### link -```typescript -import * as pulumi from "@pulumi/pulumi"; -import * as equinix from "@equinix-labs/pulumi-equinix"; - -const test = new equinix.networkedge.DeviceLink("test", { - name: "test-link", - subnet: "192.168.40.64/27", - projectId: "a86d7112-d740-4758-9c9c-31e66373746b", - devices: [ - { - id: testEquinixNetworkDevice.uuid, - asn: 22111, - interfaceId: 6, - }, - { - id: testEquinixNetworkDevice.secondaryDevice[0].uuid, - asn: 22333, - interfaceId: 7, - }, - ], - links: [{ - accountNumber: testEquinixNetworkDevice.accountNumber, - srcMetroCode: testEquinixNetworkDevice.metroCode, - dstMetroCode: testEquinixNetworkDevice.secondaryDevice[0].metroCode, - throughput: "50", - throughputUnit: "Mbps", - }], -}); -``` -```python -import pulumi -import pulumi_equinix as equinix - -test = equinix.networkedge.DeviceLink("test", - name="test-link", - subnet="192.168.40.64/27", - project_id="a86d7112-d740-4758-9c9c-31e66373746b", - devices=[ - equinix.networkedge.DeviceLinkDeviceArgs( - id=test_equinix_network_device["uuid"], - asn=22111, - interface_id=6, - ), - equinix.networkedge.DeviceLinkDeviceArgs( - id=test_equinix_network_device["secondaryDevice"][0]["uuid"], - asn=22333, - interface_id=7, - ), - ], - links=[equinix.networkedge.DeviceLinkLinkArgs( - account_number=test_equinix_network_device["accountNumber"], - src_metro_code=test_equinix_network_device["metroCode"], - dst_metro_code=test_equinix_network_device["secondaryDevice"][0]["metroCode"], - throughput="50", - throughput_unit="Mbps", - )]) -``` -```go -package main - -import ( - "github.com/equinix/pulumi-equinix/sdk/go/equinix/networkedge" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" -) - -func main() { - pulumi.Run(func(ctx *pulumi.Context) error { - _, err := networkedge.NewDeviceLink(ctx, "test", &networkedge.DeviceLinkArgs{ - Name: pulumi.String("test-link"), - Subnet: pulumi.String("192.168.40.64/27"), - ProjectId: pulumi.String("a86d7112-d740-4758-9c9c-31e66373746b"), - Devices: networkedge.DeviceLinkDeviceArray{ - &networkedge.DeviceLinkDeviceArgs{ - Id: pulumi.Any(testEquinixNetworkDevice.Uuid), - Asn: pulumi.Int(22111), - InterfaceId: pulumi.Int(6), - }, - &networkedge.DeviceLinkDeviceArgs{ - Id: pulumi.Any(testEquinixNetworkDevice.SecondaryDevice[0].Uuid), - Asn: pulumi.Int(22333), - InterfaceId: pulumi.Int(7), - }, - }, - Links: networkedge.DeviceLinkLinkArray{ - &networkedge.DeviceLinkLinkArgs{ - AccountNumber: pulumi.Any(testEquinixNetworkDevice.AccountNumber), - SrcMetroCode: pulumi.Any(testEquinixNetworkDevice.MetroCode), - DstMetroCode: pulumi.Any(testEquinixNetworkDevice.SecondaryDevice[0].MetroCode), - Throughput: pulumi.String("50"), - ThroughputUnit: pulumi.String("Mbps"), - }, - }, - }) - if err != nil { - return err - } - return nil - }) -} -``` -```csharp -using System.Collections.Generic; -using System.Linq; -using Pulumi; -using Equinix = Pulumi.Equinix; - -return await Deployment.RunAsync(() => -{ - var test = new Equinix.NetworkEdge.DeviceLink("test", new() - { - Name = "test-link", - Subnet = "192.168.40.64/27", - ProjectId = "a86d7112-d740-4758-9c9c-31e66373746b", - Devices = new[] - { - new Equinix.NetworkEdge.Inputs.DeviceLinkDeviceArgs - { - Id = testEquinixNetworkDevice.Uuid, - Asn = 22111, - InterfaceId = 6, - }, - new Equinix.NetworkEdge.Inputs.DeviceLinkDeviceArgs - { - Id = testEquinixNetworkDevice.SecondaryDevice[0].Uuid, - Asn = 22333, - InterfaceId = 7, - }, - }, - Links = new[] - { - new Equinix.NetworkEdge.Inputs.DeviceLinkLinkArgs - { - AccountNumber = testEquinixNetworkDevice.AccountNumber, - SrcMetroCode = testEquinixNetworkDevice.MetroCode, - DstMetroCode = testEquinixNetworkDevice.SecondaryDevice[0].MetroCode, - Throughput = "50", - ThroughputUnit = "Mbps", - }, - }, - }); - -}); -``` -```java -package generated_program; - -import com.pulumi.Context; -import com.pulumi.Pulumi; -import com.pulumi.core.Output; -import com.pulumi.equinix.networkedge.DeviceLink; -import com.pulumi.equinix.networkedge.DeviceLinkArgs; -import com.pulumi.equinix.networkedge.inputs.DeviceLinkDeviceArgs; -import com.pulumi.equinix.networkedge.inputs.DeviceLinkLinkArgs; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class App { - public static void main(String[] args) { - Pulumi.run(App::stack); - } - - public static void stack(Context ctx) { - var test = new DeviceLink("test", DeviceLinkArgs.builder() - .name("test-link") - .subnet("192.168.40.64/27") - .projectId("a86d7112-d740-4758-9c9c-31e66373746b") - .devices( - DeviceLinkDeviceArgs.builder() - .id(testEquinixNetworkDevice.uuid()) - .asn(22111) - .interfaceId(6) - .build(), - DeviceLinkDeviceArgs.builder() - .id(testEquinixNetworkDevice.secondaryDevice()[0].uuid()) - .asn(22333) - .interfaceId(7) - .build()) - .links(DeviceLinkLinkArgs.builder() - .accountNumber(testEquinixNetworkDevice.accountNumber()) - .srcMetroCode(testEquinixNetworkDevice.metroCode()) - .dstMetroCode(testEquinixNetworkDevice.secondaryDevice()[0].metroCode()) - .throughput("50") - .throughputUnit("Mbps") - .build()) - .build()); - - } -} -``` -```yaml - # Example of device link with HA device pair - # where each device is in different metro - test: - type: equinix:networkedge:DeviceLink - properties: - name: test-link - subnet: 192.168.40.64/27 - projectId: a86d7112-d740-4758-9c9c-31e66373746b - devices: - - id: ${testEquinixNetworkDevice.uuid} - asn: 22111 - interfaceId: 6 - - id: ${testEquinixNetworkDevice.secondaryDevice[0].uuid} - asn: 22333 - interfaceId: 7 - links: - - accountNumber: ${testEquinixNetworkDevice.accountNumber} - srcMetroCode: ${testEquinixNetworkDevice.metroCode} - dstMetroCode: ${testEquinixNetworkDevice.secondaryDevice[0].metroCode} - throughput: '50' - throughputUnit: Mbps -``` -{{% /example %}} - {{% example %}} ### example 7 ```typescript diff --git a/docs/resource/equinix_network_device_link.examples.md b/docs/resource/equinix_network_device_link.examples.md new file mode 100644 index 00000000..a4ab039b --- /dev/null +++ b/docs/resource/equinix_network_device_link.examples.md @@ -0,0 +1,219 @@ +## Example Usage +{{% example %}} +```typescript +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const test = new equinix.networkedge.DeviceLink("test", { + name: "test-link", + subnet: "192.168.40.64/27", + projectId: "a86d7112-d740-4758-9c9c-31e66373746b", + devices: [ + { + id: testEquinixNetworkDevice.uuid, + asn: 22111, + interfaceId: 6, + }, + { + id: testEquinixNetworkDevice.secondaryDevice[0].uuid, + asn: 22333, + interfaceId: 7, + }, + ], + links: [{ + accountNumber: testEquinixNetworkDevice.accountNumber, + srcMetroCode: testEquinixNetworkDevice.metroCode, + dstMetroCode: testEquinixNetworkDevice.secondaryDevice[0].metroCode, + throughput: "50", + throughputUnit: "Mbps", + }], +}); +``` +```python +import pulumi +import pulumi_equinix as equinix + +test = equinix.networkedge.DeviceLink("test", + name="test-link", + subnet="192.168.40.64/27", + project_id="a86d7112-d740-4758-9c9c-31e66373746b", + devices=[ + equinix.networkedge.DeviceLinkDeviceArgs( + id=test_equinix_network_device["uuid"], + asn=22111, + interface_id=6, + ), + equinix.networkedge.DeviceLinkDeviceArgs( + id=test_equinix_network_device["secondaryDevice"][0]["uuid"], + asn=22333, + interface_id=7, + ), + ], + links=[equinix.networkedge.DeviceLinkLinkArgs( + account_number=test_equinix_network_device["accountNumber"], + src_metro_code=test_equinix_network_device["metroCode"], + dst_metro_code=test_equinix_network_device["secondaryDevice"][0]["metroCode"], + throughput="50", + throughput_unit="Mbps", + )]) +``` +```go +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/networkedge" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + _, err := networkedge.NewDeviceLink(ctx, "test", &networkedge.DeviceLinkArgs{ + Name: pulumi.String("test-link"), + Subnet: pulumi.String("192.168.40.64/27"), + ProjectId: pulumi.String("a86d7112-d740-4758-9c9c-31e66373746b"), + Devices: networkedge.DeviceLinkDeviceArray{ + &networkedge.DeviceLinkDeviceArgs{ + Id: pulumi.Any(testEquinixNetworkDevice.Uuid), + Asn: pulumi.Int(22111), + InterfaceId: pulumi.Int(6), + }, + &networkedge.DeviceLinkDeviceArgs{ + Id: pulumi.Any(testEquinixNetworkDevice.SecondaryDevice[0].Uuid), + Asn: pulumi.Int(22333), + InterfaceId: pulumi.Int(7), + }, + }, + Links: networkedge.DeviceLinkLinkArray{ + &networkedge.DeviceLinkLinkArgs{ + AccountNumber: pulumi.Any(testEquinixNetworkDevice.AccountNumber), + SrcMetroCode: pulumi.Any(testEquinixNetworkDevice.MetroCode), + DstMetroCode: pulumi.Any(testEquinixNetworkDevice.SecondaryDevice[0].MetroCode), + Throughput: pulumi.String("50"), + ThroughputUnit: pulumi.String("Mbps"), + }, + }, + }) + if err != nil { + return err + } + return nil + }) +} +``` +```csharp +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var test = new Equinix.NetworkEdge.DeviceLink("test", new() + { + Name = "test-link", + Subnet = "192.168.40.64/27", + ProjectId = "a86d7112-d740-4758-9c9c-31e66373746b", + Devices = new[] + { + new Equinix.NetworkEdge.Inputs.DeviceLinkDeviceArgs + { + Id = testEquinixNetworkDevice.Uuid, + Asn = 22111, + InterfaceId = 6, + }, + new Equinix.NetworkEdge.Inputs.DeviceLinkDeviceArgs + { + Id = testEquinixNetworkDevice.SecondaryDevice[0].Uuid, + Asn = 22333, + InterfaceId = 7, + }, + }, + Links = new[] + { + new Equinix.NetworkEdge.Inputs.DeviceLinkLinkArgs + { + AccountNumber = testEquinixNetworkDevice.AccountNumber, + SrcMetroCode = testEquinixNetworkDevice.MetroCode, + DstMetroCode = testEquinixNetworkDevice.SecondaryDevice[0].MetroCode, + Throughput = "50", + ThroughputUnit = "Mbps", + }, + }, + }); + +}); +``` +```java +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.networkedge.DeviceLink; +import com.pulumi.equinix.networkedge.DeviceLinkArgs; +import com.pulumi.equinix.networkedge.inputs.DeviceLinkDeviceArgs; +import com.pulumi.equinix.networkedge.inputs.DeviceLinkLinkArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + var test = new DeviceLink("test", DeviceLinkArgs.builder() + .name("test-link") + .subnet("192.168.40.64/27") + .projectId("a86d7112-d740-4758-9c9c-31e66373746b") + .devices( + DeviceLinkDeviceArgs.builder() + .id(testEquinixNetworkDevice.uuid()) + .asn(22111) + .interfaceId(6) + .build(), + DeviceLinkDeviceArgs.builder() + .id(testEquinixNetworkDevice.secondaryDevice()[0].uuid()) + .asn(22333) + .interfaceId(7) + .build()) + .links(DeviceLinkLinkArgs.builder() + .accountNumber(testEquinixNetworkDevice.accountNumber()) + .srcMetroCode(testEquinixNetworkDevice.metroCode()) + .dstMetroCode(testEquinixNetworkDevice.secondaryDevice()[0].metroCode()) + .throughput("50") + .throughputUnit("Mbps") + .build()) + .build()); + + } +} +``` +```yaml + # Example of device link with HA device pair + # where each device is in different metro + test: + type: equinix:networkedge:DeviceLink + properties: + name: test-link + subnet: 192.168.40.64/27 + projectId: a86d7112-d740-4758-9c9c-31e66373746b + devices: + - id: ${testEquinixNetworkDevice.uuid} + asn: 22111 + interfaceId: 6 + - id: ${testEquinixNetworkDevice.secondaryDevice[0].uuid} + asn: 22333 + interfaceId: 7 + links: + - accountNumber: ${testEquinixNetworkDevice.accountNumber} + srcMetroCode: ${testEquinixNetworkDevice.metroCode} + dstMetroCode: ${testEquinixNetworkDevice.secondaryDevice[0].metroCode} + throughput: '50' + throughputUnit: Mbps +``` +{{% /example %}} diff --git a/examples/metal/connection/fabric_billed/Pulumi.yaml b/examples/metal/connection/example_fabric_billed/Pulumi.yaml similarity index 92% rename from examples/metal/connection/fabric_billed/Pulumi.yaml rename to examples/metal/connection/example_fabric_billed/Pulumi.yaml index 94a2703f..74b564d8 100644 --- a/examples/metal/connection/fabric_billed/Pulumi.yaml +++ b/examples/metal/connection/example_fabric_billed/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-fabric-billed-token +name: equinix-metal-connection-example-fabric-billed-token runtime: yaml description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-fabric-billed) -Fabric Billed- resource config: diff --git a/examples/metal/connection/fabric_billed/csharp/.gitignore b/examples/metal/connection/example_fabric_billed/csharp/.gitignore similarity index 100% rename from examples/metal/connection/fabric_billed/csharp/.gitignore rename to examples/metal/connection/example_fabric_billed/csharp/.gitignore diff --git a/examples/metal/connection/fabric_billed/csharp/Program.cs b/examples/metal/connection/example_fabric_billed/csharp/Program.cs similarity index 100% rename from examples/metal/connection/fabric_billed/csharp/Program.cs rename to examples/metal/connection/example_fabric_billed/csharp/Program.cs diff --git a/examples/metal/connection/fabric_billed/csharp/Pulumi.yaml b/examples/metal/connection/example_fabric_billed/csharp/Pulumi.yaml similarity index 85% rename from examples/metal/connection/fabric_billed/csharp/Pulumi.yaml rename to examples/metal/connection/example_fabric_billed/csharp/Pulumi.yaml index d745cf53..aeb2dc93 100644 --- a/examples/metal/connection/fabric_billed/csharp/Pulumi.yaml +++ b/examples/metal/connection/example_fabric_billed/csharp/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-fabric-billed-token +name: equinix-metal-connection-example-fabric-billed-token runtime: dotnet description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-fabric-billed) -Fabric Billed- resource config: diff --git a/examples/metal/connection/fabric_billed/csharp/equinix-metal-connection-fabric-billed-token.csproj b/examples/metal/connection/example_fabric_billed/csharp/equinix-metal-connection-example-fabric-billed-token.csproj similarity index 100% rename from examples/metal/connection/fabric_billed/csharp/equinix-metal-connection-fabric-billed-token.csproj rename to examples/metal/connection/example_fabric_billed/csharp/equinix-metal-connection-example-fabric-billed-token.csproj diff --git a/examples/metal/connection/example_fabric_billed/csharp/equinix-metal-connection-fabric-billed-token.csproj b/examples/metal/connection/example_fabric_billed/csharp/equinix-metal-connection-fabric-billed-token.csproj new file mode 100644 index 00000000..ad20437e --- /dev/null +++ b/examples/metal/connection/example_fabric_billed/csharp/equinix-metal-connection-fabric-billed-token.csproj @@ -0,0 +1,13 @@ + + + + Exe + net6.0 + enable + + + + + + + \ No newline at end of file diff --git a/examples/metal/connection/fabric_billed/go/Pulumi.yaml b/examples/metal/connection/example_fabric_billed/go/Pulumi.yaml similarity index 85% rename from examples/metal/connection/fabric_billed/go/Pulumi.yaml rename to examples/metal/connection/example_fabric_billed/go/Pulumi.yaml index 86327e13..21e83049 100644 --- a/examples/metal/connection/fabric_billed/go/Pulumi.yaml +++ b/examples/metal/connection/example_fabric_billed/go/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-fabric-billed-token +name: equinix-metal-connection-example-fabric-billed-token runtime: go description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-fabric-billed) -Fabric Billed- resource config: diff --git a/examples/metal/connection/example_fabric_billed/go/go.mod b/examples/metal/connection/example_fabric_billed/go/go.mod new file mode 100644 index 00000000..701b392c --- /dev/null +++ b/examples/metal/connection/example_fabric_billed/go/go.mod @@ -0,0 +1,95 @@ +module equinix-metal-connection-example-fabric-billed-token + +go 1.21 + +toolchain go1.22.4 + +require ( + github.com/equinix/pulumi-equinix/sdk 0.11.5 + github.com/pulumi/pulumi/sdk/v3 v3.121.0 +) + +require ( + dario.cat/mergo v1.0.0 // indirect + github.com/BurntSushi/toml v1.2.1 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect + github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/atotto/clipboard v0.1.4 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/charmbracelet/bubbles v0.16.1 // indirect + github.com/charmbracelet/bubbletea v0.25.0 // indirect + github.com/charmbracelet/lipgloss v0.7.1 // indirect + github.com/cheggaaa/pb v1.0.29 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/djherbis/times v1.5.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-git/v5 v5.12.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.2.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/hcl/v2 v2.20.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mitchellh/go-ps v1.0.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/reflow v0.3.0 // indirect + github.com/muesli/termenv v0.15.2 // indirect + github.com/opentracing/basictracer-go v1.1.0 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pgavlin/fx v0.1.6 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pkg/term v1.1.0 // indirect + github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect + github.com/pulumi/esc v0.9.1 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect + github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect + github.com/skeema/knownhosts v1.2.2 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/texttheater/golang-levenshtein v1.0.1 // indirect + github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect + github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect + github.com/uber/jaeger-lib v2.4.1+incompatible // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect + github.com/zclconf/go-cty v1.14.4 // indirect + go.uber.org/atomic v1.11.0 // indirect + golang.org/x/crypto v0.24.0 // indirect + golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.22.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect + google.golang.org/grpc v1.63.2 // indirect + google.golang.org/protobuf v1.34.0 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + lukechampine.com/frand v1.4.2 // indirect +) diff --git a/examples/metal/connection/fabric_billed/go/main.go b/examples/metal/connection/example_fabric_billed/go/main.go similarity index 100% rename from examples/metal/connection/fabric_billed/go/main.go rename to examples/metal/connection/example_fabric_billed/go/main.go diff --git a/examples/metal/connection/fabric_billed/java/Pulumi.yaml b/examples/metal/connection/example_fabric_billed/java/Pulumi.yaml similarity index 85% rename from examples/metal/connection/fabric_billed/java/Pulumi.yaml rename to examples/metal/connection/example_fabric_billed/java/Pulumi.yaml index ff9f43aa..028e4ec1 100644 --- a/examples/metal/connection/fabric_billed/java/Pulumi.yaml +++ b/examples/metal/connection/example_fabric_billed/java/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-fabric-billed-token +name: equinix-metal-connection-example-fabric-billed-token runtime: java description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-fabric-billed) -Fabric Billed- resource config: diff --git a/examples/metal/connection/example_fabric_billed/java/pom.xml b/examples/metal/connection/example_fabric_billed/java/pom.xml new file mode 100644 index 00000000..22f4a724 --- /dev/null +++ b/examples/metal/connection/example_fabric_billed/java/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + + com.pulumi + equinix-metal-connection-example-fabric-billed-token + 1.0-SNAPSHOT + + + UTF-8 + 11 + 11 + 11 + generated_program.App + + + + + + com.pulumi + pulumi + (,1.0] + + + com.pulumi + equinix + (,1.0) + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + true + ${mainClass} + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + + + true + ${mainClass} + + + + jar-with-dependencies + + + + + make-my-jar-with-dependencies + package + + single + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + ${mainClass} + ${mainArgs} + + + + org.apache.maven.plugins + maven-wrapper-plugin + 3.1.1 + + 3.8.5 + + + + + \ No newline at end of file diff --git a/examples/metal/connection/fabric_billed/java/src/main/java/generated_program/App.java b/examples/metal/connection/example_fabric_billed/java/src/main/java/generated_program/App.java similarity index 100% rename from examples/metal/connection/fabric_billed/java/src/main/java/generated_program/App.java rename to examples/metal/connection/example_fabric_billed/java/src/main/java/generated_program/App.java diff --git a/examples/metal/connection/fabric_billed/python/.gitignore b/examples/metal/connection/example_fabric_billed/python/.gitignore similarity index 100% rename from examples/metal/connection/fabric_billed/python/.gitignore rename to examples/metal/connection/example_fabric_billed/python/.gitignore diff --git a/examples/metal/connection/fabric_billed/python/Pulumi.yaml b/examples/metal/connection/example_fabric_billed/python/Pulumi.yaml similarity index 85% rename from examples/metal/connection/fabric_billed/python/Pulumi.yaml rename to examples/metal/connection/example_fabric_billed/python/Pulumi.yaml index 0b5da0ab..c0361a95 100644 --- a/examples/metal/connection/fabric_billed/python/Pulumi.yaml +++ b/examples/metal/connection/example_fabric_billed/python/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-fabric-billed-token +name: equinix-metal-connection-example-fabric-billed-token runtime: python description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-fabric-billed) -Fabric Billed- resource config: diff --git a/examples/metal/connection/fabric_billed/python/__main__.py b/examples/metal/connection/example_fabric_billed/python/__main__.py similarity index 100% rename from examples/metal/connection/fabric_billed/python/__main__.py rename to examples/metal/connection/example_fabric_billed/python/__main__.py diff --git a/examples/metal/connection/fabric_billed/python/requirements.txt b/examples/metal/connection/example_fabric_billed/python/requirements.txt similarity index 100% rename from examples/metal/connection/fabric_billed/python/requirements.txt rename to examples/metal/connection/example_fabric_billed/python/requirements.txt diff --git a/examples/metal/connection/fabric_billed/typescript/.gitignore b/examples/metal/connection/example_fabric_billed/typescript/.gitignore similarity index 100% rename from examples/metal/connection/fabric_billed/typescript/.gitignore rename to examples/metal/connection/example_fabric_billed/typescript/.gitignore diff --git a/examples/metal/connection/fabric_billed/typescript/Pulumi.yaml b/examples/metal/connection/example_fabric_billed/typescript/Pulumi.yaml similarity index 85% rename from examples/metal/connection/fabric_billed/typescript/Pulumi.yaml rename to examples/metal/connection/example_fabric_billed/typescript/Pulumi.yaml index 58d0dba0..7cb9b6c2 100644 --- a/examples/metal/connection/fabric_billed/typescript/Pulumi.yaml +++ b/examples/metal/connection/example_fabric_billed/typescript/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-fabric-billed-token +name: equinix-metal-connection-example-fabric-billed-token runtime: nodejs description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-fabric-billed) -Fabric Billed- resource config: diff --git a/examples/metal/connection/fabric_billed/typescript/index.ts b/examples/metal/connection/example_fabric_billed/typescript/index.ts similarity index 100% rename from examples/metal/connection/fabric_billed/typescript/index.ts rename to examples/metal/connection/example_fabric_billed/typescript/index.ts diff --git a/examples/metal/connection/example_fabric_billed/typescript/package.json b/examples/metal/connection/example_fabric_billed/typescript/package.json new file mode 100644 index 00000000..99159eb3 --- /dev/null +++ b/examples/metal/connection/example_fabric_billed/typescript/package.json @@ -0,0 +1,11 @@ +{ + "name": "equinix-metal-connection-example-fabric-billed-token", + "devDependencies": { + "@types/node": "^14" + }, + "dependencies": { + "typescript": "^4.0.0", + "@pulumi/pulumi": "^3.0.0", + "@equinix-labs/pulumi-equinix": "<1.0.0" + } +} \ No newline at end of file diff --git a/examples/metal/connection/fabric_billed/typescript/tsconfig.json b/examples/metal/connection/example_fabric_billed/typescript/tsconfig.json similarity index 100% rename from examples/metal/connection/fabric_billed/typescript/tsconfig.json rename to examples/metal/connection/example_fabric_billed/typescript/tsconfig.json diff --git a/examples/metal/connection/metal_billed/Pulumi.yaml b/examples/metal/connection/example_metal_billed/Pulumi.yaml similarity index 92% rename from examples/metal/connection/metal_billed/Pulumi.yaml rename to examples/metal/connection/example_metal_billed/Pulumi.yaml index 529c814d..def819d2 100644 --- a/examples/metal/connection/metal_billed/Pulumi.yaml +++ b/examples/metal/connection/example_metal_billed/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-metal-billed-token +name: equinix-metal-connection-example-metal-billed-token runtime: yaml description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-metal-billed) -Metal Billed- resource config: diff --git a/examples/metal/connection/metal_billed/csharp/.gitignore b/examples/metal/connection/example_metal_billed/csharp/.gitignore similarity index 100% rename from examples/metal/connection/metal_billed/csharp/.gitignore rename to examples/metal/connection/example_metal_billed/csharp/.gitignore diff --git a/examples/metal/connection/metal_billed/csharp/Program.cs b/examples/metal/connection/example_metal_billed/csharp/Program.cs similarity index 100% rename from examples/metal/connection/metal_billed/csharp/Program.cs rename to examples/metal/connection/example_metal_billed/csharp/Program.cs diff --git a/examples/metal/connection/metal_billed/csharp/Pulumi.yaml b/examples/metal/connection/example_metal_billed/csharp/Pulumi.yaml similarity index 85% rename from examples/metal/connection/metal_billed/csharp/Pulumi.yaml rename to examples/metal/connection/example_metal_billed/csharp/Pulumi.yaml index eac3d89e..ed9613b3 100644 --- a/examples/metal/connection/metal_billed/csharp/Pulumi.yaml +++ b/examples/metal/connection/example_metal_billed/csharp/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-metal-billed-token +name: equinix-metal-connection-example-metal-billed-token runtime: dotnet description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-metal-billed) -Metal Billed- resource config: diff --git a/examples/metal/connection/metal_billed/csharp/equinix-metal-connection-metal-billed-token.csproj b/examples/metal/connection/example_metal_billed/csharp/equinix-metal-connection-example-metal-billed-token.csproj similarity index 100% rename from examples/metal/connection/metal_billed/csharp/equinix-metal-connection-metal-billed-token.csproj rename to examples/metal/connection/example_metal_billed/csharp/equinix-metal-connection-example-metal-billed-token.csproj diff --git a/examples/metal/connection/example_metal_billed/csharp/equinix-metal-connection-metal-billed-token.csproj b/examples/metal/connection/example_metal_billed/csharp/equinix-metal-connection-metal-billed-token.csproj new file mode 100644 index 00000000..ad20437e --- /dev/null +++ b/examples/metal/connection/example_metal_billed/csharp/equinix-metal-connection-metal-billed-token.csproj @@ -0,0 +1,13 @@ + + + + Exe + net6.0 + enable + + + + + + + \ No newline at end of file diff --git a/examples/metal/connection/metal_billed/go/Pulumi.yaml b/examples/metal/connection/example_metal_billed/go/Pulumi.yaml similarity index 85% rename from examples/metal/connection/metal_billed/go/Pulumi.yaml rename to examples/metal/connection/example_metal_billed/go/Pulumi.yaml index ca7aff11..60102ac0 100644 --- a/examples/metal/connection/metal_billed/go/Pulumi.yaml +++ b/examples/metal/connection/example_metal_billed/go/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-metal-billed-token +name: equinix-metal-connection-example-metal-billed-token runtime: go description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-metal-billed) -Metal Billed- resource config: diff --git a/examples/metal/connection/fabric_billed/go/go.mod b/examples/metal/connection/example_metal_billed/go/go.mod similarity index 98% rename from examples/metal/connection/fabric_billed/go/go.mod rename to examples/metal/connection/example_metal_billed/go/go.mod index ceb6f18d..2a056967 100644 --- a/examples/metal/connection/fabric_billed/go/go.mod +++ b/examples/metal/connection/example_metal_billed/go/go.mod @@ -1,4 +1,4 @@ -module equinix-metal-connection-fabric-billed-token +module equinix-metal-connection-example-metal-billed-token go 1.21 diff --git a/examples/metal/connection/metal_billed/go/main.go b/examples/metal/connection/example_metal_billed/go/main.go similarity index 100% rename from examples/metal/connection/metal_billed/go/main.go rename to examples/metal/connection/example_metal_billed/go/main.go diff --git a/examples/metal/connection/metal_billed/java/Pulumi.yaml b/examples/metal/connection/example_metal_billed/java/Pulumi.yaml similarity index 85% rename from examples/metal/connection/metal_billed/java/Pulumi.yaml rename to examples/metal/connection/example_metal_billed/java/Pulumi.yaml index 6f1f61a6..ff8307ce 100644 --- a/examples/metal/connection/metal_billed/java/Pulumi.yaml +++ b/examples/metal/connection/example_metal_billed/java/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-metal-billed-token +name: equinix-metal-connection-example-metal-billed-token runtime: java description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-metal-billed) -Metal Billed- resource config: diff --git a/examples/metal/connection/fabric_billed/java/pom.xml b/examples/metal/connection/example_metal_billed/java/pom.xml similarity index 97% rename from examples/metal/connection/fabric_billed/java/pom.xml rename to examples/metal/connection/example_metal_billed/java/pom.xml index 5ba6a0ad..5395ab8f 100644 --- a/examples/metal/connection/fabric_billed/java/pom.xml +++ b/examples/metal/connection/example_metal_billed/java/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.pulumi - equinix-metal-connection-fabric-billed-token + equinix-metal-connection-example-metal-billed-token 1.0-SNAPSHOT diff --git a/examples/metal/connection/metal_billed/java/src/main/java/generated_program/App.java b/examples/metal/connection/example_metal_billed/java/src/main/java/generated_program/App.java similarity index 100% rename from examples/metal/connection/metal_billed/java/src/main/java/generated_program/App.java rename to examples/metal/connection/example_metal_billed/java/src/main/java/generated_program/App.java diff --git a/examples/metal/connection/metal_billed/python/.gitignore b/examples/metal/connection/example_metal_billed/python/.gitignore similarity index 100% rename from examples/metal/connection/metal_billed/python/.gitignore rename to examples/metal/connection/example_metal_billed/python/.gitignore diff --git a/examples/metal/connection/metal_billed/python/Pulumi.yaml b/examples/metal/connection/example_metal_billed/python/Pulumi.yaml similarity index 85% rename from examples/metal/connection/metal_billed/python/Pulumi.yaml rename to examples/metal/connection/example_metal_billed/python/Pulumi.yaml index 74c573cf..8c223b6f 100644 --- a/examples/metal/connection/metal_billed/python/Pulumi.yaml +++ b/examples/metal/connection/example_metal_billed/python/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-metal-billed-token +name: equinix-metal-connection-example-metal-billed-token runtime: python description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-metal-billed) -Metal Billed- resource config: diff --git a/examples/metal/connection/metal_billed/python/__main__.py b/examples/metal/connection/example_metal_billed/python/__main__.py similarity index 100% rename from examples/metal/connection/metal_billed/python/__main__.py rename to examples/metal/connection/example_metal_billed/python/__main__.py diff --git a/examples/metal/connection/metal_billed/python/requirements.txt b/examples/metal/connection/example_metal_billed/python/requirements.txt similarity index 100% rename from examples/metal/connection/metal_billed/python/requirements.txt rename to examples/metal/connection/example_metal_billed/python/requirements.txt diff --git a/examples/metal/connection/metal_billed/typescript/.gitignore b/examples/metal/connection/example_metal_billed/typescript/.gitignore similarity index 100% rename from examples/metal/connection/metal_billed/typescript/.gitignore rename to examples/metal/connection/example_metal_billed/typescript/.gitignore diff --git a/examples/metal/connection/metal_billed/typescript/Pulumi.yaml b/examples/metal/connection/example_metal_billed/typescript/Pulumi.yaml similarity index 85% rename from examples/metal/connection/metal_billed/typescript/Pulumi.yaml rename to examples/metal/connection/example_metal_billed/typescript/Pulumi.yaml index 41bc8b36..adbd7c5b 100644 --- a/examples/metal/connection/metal_billed/typescript/Pulumi.yaml +++ b/examples/metal/connection/example_metal_billed/typescript/Pulumi.yaml @@ -1,4 +1,4 @@ -name: equinix-metal-connection-metal-billed-token +name: equinix-metal-connection-example-metal-billed-token runtime: nodejs description: An [Equinix Metal Interconnection](https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#fabric-virtual-connections-metal-billed) -Metal Billed- resource config: diff --git a/examples/metal/connection/metal_billed/typescript/index.ts b/examples/metal/connection/example_metal_billed/typescript/index.ts similarity index 100% rename from examples/metal/connection/metal_billed/typescript/index.ts rename to examples/metal/connection/example_metal_billed/typescript/index.ts diff --git a/examples/metal/connection/fabric_billed/typescript/package.json b/examples/metal/connection/example_metal_billed/typescript/package.json similarity index 72% rename from examples/metal/connection/fabric_billed/typescript/package.json rename to examples/metal/connection/example_metal_billed/typescript/package.json index e412ef3f..1240ca30 100644 --- a/examples/metal/connection/fabric_billed/typescript/package.json +++ b/examples/metal/connection/example_metal_billed/typescript/package.json @@ -1,5 +1,5 @@ { - "name": "equinix-metal-connection-fabric-billed-token", + "name": "equinix-metal-connection-example-metal-billed-token", "devDependencies": { "@types/node": "^14" }, diff --git a/examples/metal/connection/metal_billed/typescript/tsconfig.json b/examples/metal/connection/example_metal_billed/typescript/tsconfig.json similarity index 100% rename from examples/metal/connection/metal_billed/typescript/tsconfig.json rename to examples/metal/connection/example_metal_billed/typescript/tsconfig.json diff --git a/examples/metal/device_network_type/Pulumi.yaml b/examples/metal/device_network_type/Pulumi.yaml new file mode 100644 index 00000000..2eaeeca8 --- /dev/null +++ b/examples/metal/device_network_type/Pulumi.yaml @@ -0,0 +1,17 @@ +name: equinix-metal-device-network-type +runtime: yaml +description: An Equinix Metal Device Network Type resource +config: + deviceId: + type: string + networkType: + type: string + default: hybrid +resources: + deviceNetwork: + type: equinix:metal:DeviceNetworkType + properties: + deviceId: ${deviceId} + type: ${networkType} +outputs: + deviceNetworkId: ${deviceNetwork.id} \ No newline at end of file diff --git a/examples/metal/device_network_type/csharp/.gitignore b/examples/metal/device_network_type/csharp/.gitignore new file mode 100644 index 00000000..e6452706 --- /dev/null +++ b/examples/metal/device_network_type/csharp/.gitignore @@ -0,0 +1,353 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/examples/metal/device_network_type/csharp/Program.cs b/examples/metal/device_network_type/csharp/Program.cs new file mode 100644 index 00000000..5365727f --- /dev/null +++ b/examples/metal/device_network_type/csharp/Program.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using System.Linq; +using Pulumi; +using Equinix = Pulumi.Equinix; + +return await Deployment.RunAsync(() => +{ + var config = new Config(); + var deviceId = config.Require("deviceId"); + var networkType = config.Get("networkType") ?? "hybrid"; + var deviceNetwork = new Equinix.Metal.DeviceNetworkType("deviceNetwork", new() + { + DeviceId = deviceId, + Type = networkType, + }); + + return new Dictionary + { + ["deviceNetworkId"] = deviceNetwork.Id, + }; +}); + diff --git a/examples/metal/device_network_type/csharp/Pulumi.yaml b/examples/metal/device_network_type/csharp/Pulumi.yaml new file mode 100644 index 00000000..6993738f --- /dev/null +++ b/examples/metal/device_network_type/csharp/Pulumi.yaml @@ -0,0 +1,9 @@ +name: equinix-metal-device-network-type +runtime: dotnet +description: An Equinix Metal Device Network Type resource +config: + deviceId: + type: string + networkType: + type: string + default: hybrid diff --git a/examples/metal/device_network_type/csharp/equinix-metal-device-network-type.csproj b/examples/metal/device_network_type/csharp/equinix-metal-device-network-type.csproj new file mode 100644 index 00000000..36182104 --- /dev/null +++ b/examples/metal/device_network_type/csharp/equinix-metal-device-network-type.csproj @@ -0,0 +1,13 @@ + + + + Exe + net6.0 + enable + + + + + + + \ No newline at end of file diff --git a/examples/metal/device_network_type/go/Pulumi.yaml b/examples/metal/device_network_type/go/Pulumi.yaml new file mode 100644 index 00000000..e4ee7db1 --- /dev/null +++ b/examples/metal/device_network_type/go/Pulumi.yaml @@ -0,0 +1,9 @@ +name: equinix-metal-device-network-type +runtime: go +description: An Equinix Metal Device Network Type resource +config: + deviceId: + type: string + networkType: + type: string + default: hybrid diff --git a/examples/metal/connection/metal_billed/go/go.mod b/examples/metal/device_network_type/go/go.mod similarity index 98% rename from examples/metal/connection/metal_billed/go/go.mod rename to examples/metal/device_network_type/go/go.mod index d9bd3fd8..a5ac95a6 100644 --- a/examples/metal/connection/metal_billed/go/go.mod +++ b/examples/metal/device_network_type/go/go.mod @@ -1,4 +1,4 @@ -module equinix-metal-connection-metal-billed-token +module equinix-metal-device-network-type go 1.21 diff --git a/examples/metal/device_network_type/go/main.go b/examples/metal/device_network_type/go/main.go new file mode 100644 index 00000000..49945a18 --- /dev/null +++ b/examples/metal/device_network_type/go/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "github.com/equinix/pulumi-equinix/sdk/go/equinix/metal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +) + +func main() { + pulumi.Run(func(ctx *pulumi.Context) error { + cfg := config.New(ctx, "") + deviceId := cfg.Require("deviceId") + networkType := "hybrid" + if param := cfg.Get("networkType"); param != "" { + networkType = param + } + deviceNetwork, err := metal.NewDeviceNetworkType(ctx, "deviceNetwork", &metal.DeviceNetworkTypeArgs{ + DeviceId: pulumi.String(deviceId), + Type: pulumi.String(networkType), + }) + if err != nil { + return err + } + ctx.Export("deviceNetworkId", deviceNetwork.ID()) + return nil + }) +} diff --git a/examples/metal/device_network_type/java/Pulumi.yaml b/examples/metal/device_network_type/java/Pulumi.yaml new file mode 100644 index 00000000..aeee4e14 --- /dev/null +++ b/examples/metal/device_network_type/java/Pulumi.yaml @@ -0,0 +1,9 @@ +name: equinix-metal-device-network-type +runtime: java +description: An Equinix Metal Device Network Type resource +config: + deviceId: + type: string + networkType: + type: string + default: hybrid diff --git a/examples/metal/connection/metal_billed/java/pom.xml b/examples/metal/device_network_type/java/pom.xml similarity index 97% rename from examples/metal/connection/metal_billed/java/pom.xml rename to examples/metal/device_network_type/java/pom.xml index f2b56dc4..7b25a5ad 100644 --- a/examples/metal/connection/metal_billed/java/pom.xml +++ b/examples/metal/device_network_type/java/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.pulumi - equinix-metal-connection-metal-billed-token + equinix-metal-device-network-type 1.0-SNAPSHOT diff --git a/examples/metal/device_network_type/java/src/main/java/generated_program/App.java b/examples/metal/device_network_type/java/src/main/java/generated_program/App.java new file mode 100644 index 00000000..c99b2352 --- /dev/null +++ b/examples/metal/device_network_type/java/src/main/java/generated_program/App.java @@ -0,0 +1,31 @@ +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.equinix.metal.DeviceNetworkType; +import com.pulumi.equinix.metal.DeviceNetworkTypeArgs; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + final var config = ctx.config(); + final var deviceId = config.get("deviceId"); + final var networkType = config.get("networkType").orElse("hybrid"); + var deviceNetwork = new DeviceNetworkType("deviceNetwork", DeviceNetworkTypeArgs.builder() + .deviceId(deviceId) + .type(networkType) + .build()); + + ctx.export("deviceNetworkId", deviceNetwork.id()); + } +} diff --git a/examples/metal/device_network_type/python/.gitignore b/examples/metal/device_network_type/python/.gitignore new file mode 100644 index 00000000..b664ab4e --- /dev/null +++ b/examples/metal/device_network_type/python/.gitignore @@ -0,0 +1,2 @@ +*.pyc +venv/ \ No newline at end of file diff --git a/examples/metal/device_network_type/python/Pulumi.yaml b/examples/metal/device_network_type/python/Pulumi.yaml new file mode 100644 index 00000000..aa10ce97 --- /dev/null +++ b/examples/metal/device_network_type/python/Pulumi.yaml @@ -0,0 +1,9 @@ +name: equinix-metal-device-network-type +runtime: python +description: An Equinix Metal Device Network Type resource +config: + deviceId: + type: string + networkType: + type: string + default: hybrid diff --git a/examples/metal/device_network_type/python/__main__.py b/examples/metal/device_network_type/python/__main__.py new file mode 100644 index 00000000..9a077cc5 --- /dev/null +++ b/examples/metal/device_network_type/python/__main__.py @@ -0,0 +1,12 @@ +import pulumi +import pulumi_equinix as equinix + +config = pulumi.Config() +device_id = config.require("deviceId") +network_type = config.get("networkType") +if network_type is None: + network_type = "hybrid" +device_network = equinix.metal.DeviceNetworkType("deviceNetwork", + device_id=device_id, + type=network_type) +pulumi.export("deviceNetworkId", device_network.id) diff --git a/examples/metal/device_network_type/python/requirements.txt b/examples/metal/device_network_type/python/requirements.txt new file mode 100644 index 00000000..317d94a1 --- /dev/null +++ b/examples/metal/device_network_type/python/requirements.txt @@ -0,0 +1,2 @@ +pulumi>=3.0.0,<4.0.0 +pulumi_equinix==<1.0.0 diff --git a/examples/metal/device_network_type/typescript/.gitignore b/examples/metal/device_network_type/typescript/.gitignore new file mode 100644 index 00000000..dc902b57 --- /dev/null +++ b/examples/metal/device_network_type/typescript/.gitignore @@ -0,0 +1,2 @@ +/bin/ +/node_modules/ \ No newline at end of file diff --git a/examples/metal/device_network_type/typescript/Pulumi.yaml b/examples/metal/device_network_type/typescript/Pulumi.yaml new file mode 100644 index 00000000..a7667e2a --- /dev/null +++ b/examples/metal/device_network_type/typescript/Pulumi.yaml @@ -0,0 +1,9 @@ +name: equinix-metal-device-network-type +runtime: nodejs +description: An Equinix Metal Device Network Type resource +config: + deviceId: + type: string + networkType: + type: string + default: hybrid diff --git a/examples/metal/device_network_type/typescript/index.ts b/examples/metal/device_network_type/typescript/index.ts new file mode 100644 index 00000000..7362c306 --- /dev/null +++ b/examples/metal/device_network_type/typescript/index.ts @@ -0,0 +1,11 @@ +import * as pulumi from "@pulumi/pulumi"; +import * as equinix from "@equinix-labs/pulumi-equinix"; + +const config = new pulumi.Config(); +const deviceId = config.require("deviceId"); +const networkType = config.get("networkType") || "hybrid"; +const deviceNetwork = new equinix.metal.DeviceNetworkType("deviceNetwork", { + deviceId: deviceId, + type: networkType, +}); +export const deviceNetworkId = deviceNetwork.id; diff --git a/examples/metal/connection/metal_billed/typescript/package.json b/examples/metal/device_network_type/typescript/package.json similarity index 75% rename from examples/metal/connection/metal_billed/typescript/package.json rename to examples/metal/device_network_type/typescript/package.json index 32ab74fe..26f12c66 100644 --- a/examples/metal/connection/metal_billed/typescript/package.json +++ b/examples/metal/device_network_type/typescript/package.json @@ -1,5 +1,5 @@ { - "name": "equinix-metal-connection-metal-billed-token", + "name": "equinix-metal-device-network-type", "devDependencies": { "@types/node": "^14" }, diff --git a/examples/metal/device_network_type/typescript/tsconfig.json b/examples/metal/device_network_type/typescript/tsconfig.json new file mode 100644 index 00000000..11fc69af --- /dev/null +++ b/examples/metal/device_network_type/typescript/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "strict": true, + "outDir": "bin", + "target": "es2016", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "experimentalDecorators": true, + "pretty": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.ts", + ] +} \ No newline at end of file diff --git a/examples/metal/ip_attachment/csharp/equinix-metal-ip_attachment.csproj b/examples/metal/ip_attachment/csharp/equinix-metal-ip_attachment.csproj index 2aebd67d..ef1958d7 100644 --- a/examples/metal/ip_attachment/csharp/equinix-metal-ip_attachment.csproj +++ b/examples/metal/ip_attachment/csharp/equinix-metal-ip_attachment.csproj @@ -7,8 +7,8 @@ - + \ No newline at end of file diff --git a/examples/metal/project_ssh_key/main.tf.bak b/examples/metal/project_ssh_key/main.tf.bak deleted file mode 100644 index e591a6e4..00000000 --- a/examples/metal/project_ssh_key/main.tf.bak +++ /dev/null @@ -1,19 +0,0 @@ -locals { - project_id = "" -} - -resource "equinix_metal_project_ssh_key" "test" { - name = "test" - public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2" - project_id = local.project_id -} - -resource "equinix_metal_device" "test" { - hostname = "test" - plan = "c3.medium.x86" - metro = "ny" - operating_system = "ubuntu_20_04" - billing_cycle = "hourly" - project_ssh_key_ids = [equinix_metal_project_ssh_key.test.id] - project_id = local.project_id -} diff --git a/examples/network/device/example_8/csharp/equinix-network-device-example_8.csproj b/examples/network/device/example_8/csharp/equinix-network-device-example_8.csproj index ef1958d7..2aebd67d 100644 --- a/examples/network/device/example_8/csharp/equinix-network-device-example_8.csproj +++ b/examples/network/device/example_8/csharp/equinix-network-device-example_8.csproj @@ -7,8 +7,8 @@ - + \ No newline at end of file diff --git a/provider/cmd/pulumi-resource-equinix/schema.json b/provider/cmd/pulumi-resource-equinix/schema.json index 99273d77..1ee96299 100644 --- a/provider/cmd/pulumi-resource-equinix/schema.json +++ b/provider/cmd/pulumi-resource-equinix/schema.json @@ -14832,7 +14832,7 @@ } }, "equinix:metal/gateway:Gateway": { - "description": "Use this resource to create Metal Gateway resources in Equinix Metal.\n\nSee the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst config = new pulumi.Config();\nconst projectId = config.require(\"projectId\");\nconst vlanId = config.require(\"vlanId\");\nconst gateway = new equinix.metal.Gateway(\"gateway\", {\n projectId: projectId,\n vlanId: vlanId,\n privateIpv4SubnetSize: 8,\n});\nexport const gatewayState = gateway.state;\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nconfig = pulumi.Config()\nproject_id = config.require(\"projectId\")\nvlan_id = config.require(\"vlanId\")\ngateway = equinix.metal.Gateway(\"gateway\",\n project_id=project_id,\n vlan_id=vlan_id,\n private_ipv4_subnet_size=8)\npulumi.export(\"gatewayState\", gateway.state)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcfg := config.New(ctx, \"\")\n\t\tprojectId := cfg.Require(\"projectId\")\n\t\tvlanId := cfg.Require(\"vlanId\")\n\t\tgateway, err := metal.NewGateway(ctx, \"gateway\", \u0026metal.GatewayArgs{\n\t\t\tProjectId: pulumi.String(projectId),\n\t\t\tVlanId: pulumi.String(vlanId),\n\t\t\tPrivateIpv4SubnetSize: pulumi.Int(8),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"gatewayState\", gateway.State)\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var projectId = config.Require(\"projectId\");\n var vlanId = config.Require(\"vlanId\");\n var gateway = new Equinix.Metal.Gateway(\"gateway\", new()\n {\n ProjectId = projectId,\n VlanId = vlanId,\n PrivateIpv4SubnetSize = 8,\n });\n\n return new Dictionary\u003cstring, object?\u003e\n {\n [\"gatewayState\"] = gateway.State,\n };\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Gateway;\nimport com.pulumi.equinix.metal.GatewayArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var projectId = config.get(\"projectId\");\n final var vlanId = config.get(\"vlanId\");\n var gateway = new Gateway(\"gateway\", GatewayArgs.builder()\n .projectId(projectId)\n .vlanId(vlanId)\n .privateIpv4SubnetSize(8)\n .build());\n\n ctx.export(\"gatewayState\", gateway.state());\n }\n}\n```\n```yaml\nconfig:\n projectId:\n type: string\n vlanId:\n type: string\nresources:\n gateway:\n type: equinix:metal:Gateway\n properties:\n projectId: ${projectId}\n vlanId: ${vlanId}\n privateIpv4SubnetSize: 8\noutputs:\n gatewayState: ${gateway.state}\n```\n{{% /example %}}\n\n{{% /examples %}}", + "description": "Use this resource to create Metal Gateway resources in Equinix Metal.\n\nSee the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n### example 1\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst test = new equinix.metal.Vlan(\"test\", {\n description: \"test VLAN in SV\",\n metro: \"sv\",\n projectId: projectId,\n});\nconst testGateway = new equinix.metal.Gateway(\"testGateway\", {\n projectId: projectId,\n vlanId: test.id,\n privateIpv4SubnetSize: 8,\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\ntest = equinix.metal.Vlan(\"test\",\n description=\"test VLAN in SV\",\n metro=\"sv\",\n project_id=project_id)\ntest_gateway = equinix.metal.Gateway(\"testGateway\",\n project_id=project_id,\n vlan_id=test.id,\n private_ipv4_subnet_size=8)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttest, err := metal.NewVlan(ctx, \"test\", \u0026metal.VlanArgs{\n\t\t\tDescription: pulumi.String(\"test VLAN in SV\"),\n\t\t\tMetro: pulumi.String(\"sv\"),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewGateway(ctx, \"testGateway\", \u0026metal.GatewayArgs{\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t\tVlanId: test.ID(),\n\t\t\tPrivateIpv4SubnetSize: pulumi.Int(8),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = new Equinix.Metal.Vlan(\"test\", new()\n {\n Description = \"test VLAN in SV\",\n Metro = \"sv\",\n ProjectId = projectId,\n });\n\n var testGateway = new Equinix.Metal.Gateway(\"testGateway\", new()\n {\n ProjectId = projectId,\n VlanId = test.Id,\n PrivateIpv4SubnetSize = 8,\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Vlan;\nimport com.pulumi.equinix.metal.VlanArgs;\nimport com.pulumi.equinix.metal.Gateway;\nimport com.pulumi.equinix.metal.GatewayArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Vlan(\"test\", VlanArgs.builder()\n .description(\"test VLAN in SV\")\n .metro(\"sv\")\n .projectId(projectId)\n .build());\n\n var testGateway = new Gateway(\"testGateway\", GatewayArgs.builder()\n .projectId(projectId)\n .vlanId(test.id())\n .privateIpv4SubnetSize(8)\n .build());\n\n }\n}\n```\n```yaml\n # Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses\n test:\n type: equinix:metal:Vlan\n properties:\n description: test VLAN in SV\n metro: sv\n projectId: ${projectId}\n testGateway:\n type: equinix:metal:Gateway\n name: test\n properties:\n projectId: ${projectId}\n vlanId: ${test.id}\n privateIpv4SubnetSize: 8\n```\n{{% /example %}}\n\n{{% example %}}\n### example 2\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst test = new equinix.metal.Vlan(\"test\", {\n description: \"test VLAN in SV\",\n metro: \"sv\",\n projectId: projectId,\n});\nconst test1 = new equinix.metal.ReservedIpBlock(\"test1\", {\n projectId: projectId,\n metro: \"sv\",\n quantity: 8,\n});\nconst testGateway = new equinix.metal.Gateway(\"testGateway\", {\n projectId: projectId,\n vlanId: test.id,\n ipReservationId: testEquinixMetalReservedIpBlock.id,\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\ntest = equinix.metal.Vlan(\"test\",\n description=\"test VLAN in SV\",\n metro=\"sv\",\n project_id=project_id)\ntest1 = equinix.metal.ReservedIpBlock(\"test1\",\n project_id=project_id,\n metro=\"sv\",\n quantity=8)\ntest_gateway = equinix.metal.Gateway(\"testGateway\",\n project_id=project_id,\n vlan_id=test.id,\n ip_reservation_id=test_equinix_metal_reserved_ip_block[\"id\"])\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttest, err := metal.NewVlan(ctx, \"test\", \u0026metal.VlanArgs{\n\t\t\tDescription: pulumi.String(\"test VLAN in SV\"),\n\t\t\tMetro: pulumi.String(\"sv\"),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewReservedIpBlock(ctx, \"test1\", \u0026metal.ReservedIpBlockArgs{\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t\tMetro: pulumi.String(\"sv\"),\n\t\t\tQuantity: pulumi.Int(8),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewGateway(ctx, \"testGateway\", \u0026metal.GatewayArgs{\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t\tVlanId: test.ID(),\n\t\t\tIpReservationId: pulumi.Any(testEquinixMetalReservedIpBlock.Id),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = new Equinix.Metal.Vlan(\"test\", new()\n {\n Description = \"test VLAN in SV\",\n Metro = \"sv\",\n ProjectId = projectId,\n });\n\n var test1 = new Equinix.Metal.ReservedIpBlock(\"test1\", new()\n {\n ProjectId = projectId,\n Metro = \"sv\",\n Quantity = 8,\n });\n\n var testGateway = new Equinix.Metal.Gateway(\"testGateway\", new()\n {\n ProjectId = projectId,\n VlanId = test.Id,\n IpReservationId = testEquinixMetalReservedIpBlock.Id,\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Vlan;\nimport com.pulumi.equinix.metal.VlanArgs;\nimport com.pulumi.equinix.metal.ReservedIpBlock;\nimport com.pulumi.equinix.metal.ReservedIpBlockArgs;\nimport com.pulumi.equinix.metal.Gateway;\nimport com.pulumi.equinix.metal.GatewayArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Vlan(\"test\", VlanArgs.builder()\n .description(\"test VLAN in SV\")\n .metro(\"sv\")\n .projectId(projectId)\n .build());\n\n var test1 = new ReservedIpBlock(\"test1\", ReservedIpBlockArgs.builder()\n .projectId(projectId)\n .metro(\"sv\")\n .quantity(8)\n .build());\n\n var testGateway = new Gateway(\"testGateway\", GatewayArgs.builder()\n .projectId(projectId)\n .vlanId(test.id())\n .ipReservationId(testEquinixMetalReservedIpBlock.id())\n .build());\n\n }\n}\n```\n```yaml\n # Create Metal Gateway for a VLAN and reserved IP address block\n test:\n type: equinix:metal:Vlan\n properties:\n description: test VLAN in SV\n metro: sv\n projectId: ${projectId}\n test1:\n type: equinix:metal:ReservedIpBlock\n properties:\n projectId: ${projectId}\n metro: sv\n quantity: 8\n testGateway:\n type: equinix:metal:Gateway\n name: test\n properties:\n projectId: ${projectId}\n vlanId: ${test.id}\n ipReservationId: ${testEquinixMetalReservedIpBlock.id}\n```\n{{% /example %}}\n\n{{% /examples %}}", "properties": { "ipReservationId": { "type": "string", @@ -14930,7 +14930,7 @@ } }, "equinix:metal/interconnection:Interconnection": { - "description": "Use this resource to request the creation an Interconnection asset to connect with other parties using [Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/).\n\n\u003e Equinix Metal connection with with Service Token A-side / Z-side (service_token_type) is not generally available and may not be enabled yet for your organization.\n", + "description": "Use this resource to request the creation an Interconnection asset to connect with other parties using [Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/).\n\n\u003e Equinix Metal connection with with Service Token A-side / Z-side (service_token_type) is not generally available and may not be enabled yet for your organization.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n### example metal billed token\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst config = new pulumi.Config();\nconst projectId = config.require(\"projectId\");\nconst metro = config.get(\"metro\") || \"SV\";\nconst speedInMbps = config.getNumber(\"speedInMbps\") || 1000;\nconst connection = new equinix.metal.Interconnection(\"connection\", {\n name: \"metal-to-cloudprovider\",\n projectId: projectId,\n type: \"shared\",\n redundancy: \"primary\",\n metro: metro,\n speed: `${speedInMbps}Mbps`,\n serviceTokenType: \"a_side\",\n});\nexport const connectionStatus = connection.status;\nexport const connectionTokens = connection.serviceTokens;\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nconfig = pulumi.Config()\nproject_id = config.require(\"projectId\")\nmetro = config.get(\"metro\")\nif metro is None:\n metro = \"SV\"\nspeed_in_mbps = config.get_int(\"speedInMbps\")\nif speed_in_mbps is None:\n speed_in_mbps = 1000\nconnection = equinix.metal.Interconnection(\"connection\",\n name=\"metal-to-cloudprovider\",\n project_id=project_id,\n type=\"shared\",\n redundancy=\"primary\",\n metro=metro,\n speed=f\"{speed_in_mbps}Mbps\",\n service_token_type=\"a_side\")\npulumi.export(\"connectionStatus\", connection.status)\npulumi.export(\"connectionTokens\", connection.service_tokens)\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcfg := config.New(ctx, \"\")\n\t\tprojectId := cfg.Require(\"projectId\")\n\t\tmetro := \"SV\"\n\t\tif param := cfg.Get(\"metro\"); param != \"\" {\n\t\t\tmetro = param\n\t\t}\n\t\tspeedInMbps := 1000\n\t\tif param := cfg.GetInt(\"speedInMbps\"); param != 0 {\n\t\t\tspeedInMbps = param\n\t\t}\n\t\tconnection, err := metal.NewInterconnection(ctx, \"connection\", \u0026metal.InterconnectionArgs{\n\t\t\tName: pulumi.String(\"metal-to-cloudprovider\"),\n\t\t\tProjectId: pulumi.String(projectId),\n\t\t\tType: pulumi.String(\"shared\"),\n\t\t\tRedundancy: pulumi.String(\"primary\"),\n\t\t\tMetro: pulumi.String(metro),\n\t\t\tSpeed: pulumi.String(fmt.Sprintf(\"%vMbps\", speedInMbps)),\n\t\t\tServiceTokenType: pulumi.String(\"a_side\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"connectionStatus\", connection.Status)\n\t\tctx.Export(\"connectionTokens\", connection.ServiceTokens)\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var projectId = config.Require(\"projectId\");\n var metro = config.Get(\"metro\") ?? \"SV\";\n var speedInMbps = config.GetInt32(\"speedInMbps\") ?? 1000;\n var connection = new Equinix.Metal.Interconnection(\"connection\", new()\n {\n Name = \"metal-to-cloudprovider\",\n ProjectId = projectId,\n Type = \"shared\",\n Redundancy = \"primary\",\n Metro = metro,\n Speed = $\"{speedInMbps}Mbps\",\n ServiceTokenType = \"a_side\",\n });\n\n return new Dictionary\u003cstring, object?\u003e\n {\n [\"connectionStatus\"] = connection.Status,\n [\"connectionTokens\"] = connection.ServiceTokens,\n };\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Interconnection;\nimport com.pulumi.equinix.metal.InterconnectionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var projectId = config.get(\"projectId\");\n final var metro = config.get(\"metro\").orElse(\"SV\");\n final var speedInMbps = config.get(\"speedInMbps\").orElse(1000);\n var connection = new Interconnection(\"connection\", InterconnectionArgs.builder()\n .name(\"metal-to-cloudprovider\")\n .projectId(projectId)\n .type(\"shared\")\n .redundancy(\"primary\")\n .metro(metro)\n .speed(String.format(\"%sMbps\", speedInMbps))\n .serviceTokenType(\"a_side\")\n .build());\n\n ctx.export(\"connectionStatus\", connection.status());\n ctx.export(\"connectionTokens\", connection.serviceTokens());\n }\n}\n```\n```yaml\nconfig:\n projectId:\n type: string\n metro:\n type: string\n default: SV\n speedInMbps:\n type: integer\n default: 1000\nresources:\n connection:\n type: equinix:metal:Interconnection\n properties:\n name: metal-to-cloudprovider\n projectId: ${projectId}\n type: shared\n redundancy: primary\n metro: ${metro}\n speed: ${speedInMbps}Mbps\n serviceTokenType: a_side\noutputs:\n connectionStatus: ${connection.status}\n connectionTokens: ${connection.serviceTokens}\n```\n{{% /example %}}\n\n{{% example %}}\n### example fabric billed token\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst config = new pulumi.Config();\nconst projectId = config.require(\"projectId\");\nconst metro = config.get(\"metro\") || \"SV\";\nconst speedInMbps = config.getNumber(\"speedInMbps\") || 200;\nconst connection = new equinix.metal.Interconnection(\"connection\", {\n name: \"fabric-port-to-metal\",\n projectId: projectId,\n type: \"shared\",\n redundancy: \"primary\",\n metro: metro,\n speed: `${speedInMbps}Mbps`,\n serviceTokenType: \"z_side\",\n});\nexport const connectionStatus = connection.status;\nexport const connectionTokens = connection.serviceTokens;\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nconfig = pulumi.Config()\nproject_id = config.require(\"projectId\")\nmetro = config.get(\"metro\")\nif metro is None:\n metro = \"SV\"\nspeed_in_mbps = config.get_int(\"speedInMbps\")\nif speed_in_mbps is None:\n speed_in_mbps = 200\nconnection = equinix.metal.Interconnection(\"connection\",\n name=\"fabric-port-to-metal\",\n project_id=project_id,\n type=\"shared\",\n redundancy=\"primary\",\n metro=metro,\n speed=f\"{speed_in_mbps}Mbps\",\n service_token_type=\"z_side\")\npulumi.export(\"connectionStatus\", connection.status)\npulumi.export(\"connectionTokens\", connection.service_tokens)\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcfg := config.New(ctx, \"\")\n\t\tprojectId := cfg.Require(\"projectId\")\n\t\tmetro := \"SV\"\n\t\tif param := cfg.Get(\"metro\"); param != \"\" {\n\t\t\tmetro = param\n\t\t}\n\t\tspeedInMbps := 200\n\t\tif param := cfg.GetInt(\"speedInMbps\"); param != 0 {\n\t\t\tspeedInMbps = param\n\t\t}\n\t\tconnection, err := metal.NewInterconnection(ctx, \"connection\", \u0026metal.InterconnectionArgs{\n\t\t\tName: pulumi.String(\"fabric-port-to-metal\"),\n\t\t\tProjectId: pulumi.String(projectId),\n\t\t\tType: pulumi.String(\"shared\"),\n\t\t\tRedundancy: pulumi.String(\"primary\"),\n\t\t\tMetro: pulumi.String(metro),\n\t\t\tSpeed: pulumi.String(fmt.Sprintf(\"%vMbps\", speedInMbps)),\n\t\t\tServiceTokenType: pulumi.String(\"z_side\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"connectionStatus\", connection.Status)\n\t\tctx.Export(\"connectionTokens\", connection.ServiceTokens)\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var projectId = config.Require(\"projectId\");\n var metro = config.Get(\"metro\") ?? \"SV\";\n var speedInMbps = config.GetInt32(\"speedInMbps\") ?? 200;\n var connection = new Equinix.Metal.Interconnection(\"connection\", new()\n {\n Name = \"fabric-port-to-metal\",\n ProjectId = projectId,\n Type = \"shared\",\n Redundancy = \"primary\",\n Metro = metro,\n Speed = $\"{speedInMbps}Mbps\",\n ServiceTokenType = \"z_side\",\n });\n\n return new Dictionary\u003cstring, object?\u003e\n {\n [\"connectionStatus\"] = connection.Status,\n [\"connectionTokens\"] = connection.ServiceTokens,\n };\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Interconnection;\nimport com.pulumi.equinix.metal.InterconnectionArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var projectId = config.get(\"projectId\");\n final var metro = config.get(\"metro\").orElse(\"SV\");\n final var speedInMbps = config.get(\"speedInMbps\").orElse(200);\n var connection = new Interconnection(\"connection\", InterconnectionArgs.builder()\n .name(\"fabric-port-to-metal\")\n .projectId(projectId)\n .type(\"shared\")\n .redundancy(\"primary\")\n .metro(metro)\n .speed(String.format(\"%sMbps\", speedInMbps))\n .serviceTokenType(\"z_side\")\n .build());\n\n ctx.export(\"connectionStatus\", connection.status());\n ctx.export(\"connectionTokens\", connection.serviceTokens());\n }\n}\n```\n```yaml\nconfig:\n projectId:\n type: string\n metro:\n type: string\n default: SV\n speedInMbps:\n type: integer\n default: 200\nresources:\n connection:\n type: equinix:metal:Interconnection\n properties:\n name: fabric-port-to-metal\n projectId: ${projectId}\n type: shared\n redundancy: primary\n metro: ${metro}\n speed: ${speedInMbps}Mbps\n serviceTokenType: z_side\noutputs:\n connectionStatus: ${connection.status}\n connectionTokens: ${connection.serviceTokens}\n```\n{{% /example %}}\n\n{{% /examples %}}", "properties": { "authorizationCode": { "type": "string", @@ -15815,7 +15815,7 @@ } }, "equinix:metal/portVlanAttachment:PortVlanAttachment": { - "description": "Provides a resource to attach device ports to VLANs.\n\nDevice and VLAN must be in the same metro.\n\nIf you need this resource to add the port back to bond on removal, set `force_bond = true`.\n\nTo learn more about Layer 2 networking in Equinix Metal, refer to\n\n* https://metal.equinix.com/developers/docs/networking/layer2/\n* https://metal.equinix.com/developers/docs/networking/layer2-configs/\n\n## Attribute Referece\n\nIn addition to all arguments above, the following attributes are exported:\n\n* `id` - UUID of device port used in the assignment.\n* `vlan_id` - UUID of VLAN API resource.\n* `port_id` - UUID of device port.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst config = new pulumi.Config();\nconst deviceId = config.require(\"deviceId\");\nconst portName = config.get(\"portName\") || \"eth1\";\nconst vxlanId = config.getNumber(\"vxlanId\") || 1004;\nconst attach = new equinix.metal.PortVlanAttachment(\"attach\", {\n deviceId: deviceId,\n portName: portName,\n vlanVnid: vxlanId,\n});\nexport const attachId = attach.id;\nexport const portId = attach.portId;\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nconfig = pulumi.Config()\ndevice_id = config.require(\"deviceId\")\nport_name = config.get(\"portName\")\nif port_name is None:\n port_name = \"eth1\"\nvxlan_id = config.get_int(\"vxlanId\")\nif vxlan_id is None:\n vxlan_id = 1004\nattach = equinix.metal.PortVlanAttachment(\"attach\",\n device_id=device_id,\n port_name=port_name,\n vlan_vnid=vxlan_id)\npulumi.export(\"attachId\", attach.id)\npulumi.export(\"portId\", attach.port_id)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcfg := config.New(ctx, \"\")\n\t\tdeviceId := cfg.Require(\"deviceId\")\n\t\tportName := \"eth1\"\n\t\tif param := cfg.Get(\"portName\"); param != \"\" {\n\t\t\tportName = param\n\t\t}\n\t\tvxlanId := 1004\n\t\tif param := cfg.GetInt(\"vxlanId\"); param != 0 {\n\t\t\tvxlanId = param\n\t\t}\n\t\tattach, err := metal.NewPortVlanAttachment(ctx, \"attach\", \u0026metal.PortVlanAttachmentArgs{\n\t\t\tDeviceId: pulumi.String(deviceId),\n\t\t\tPortName: pulumi.String(portName),\n\t\t\tVlanVnid: pulumi.Int(vxlanId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"attachId\", attach.ID())\n\t\tctx.Export(\"portId\", attach.PortId)\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var deviceId = config.Require(\"deviceId\");\n var portName = config.Get(\"portName\") ?? \"eth1\";\n var vxlanId = config.GetInt32(\"vxlanId\") ?? 1004;\n var attach = new Equinix.Metal.PortVlanAttachment(\"attach\", new()\n {\n DeviceId = deviceId,\n PortName = portName,\n VlanVnid = vxlanId,\n });\n\n return new Dictionary\u003cstring, object?\u003e\n {\n [\"attachId\"] = attach.Id,\n [\"portId\"] = attach.PortId,\n };\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.PortVlanAttachment;\nimport com.pulumi.equinix.metal.PortVlanAttachmentArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var deviceId = config.get(\"deviceId\");\n final var portName = config.get(\"portName\").orElse(\"eth1\");\n final var vxlanId = config.get(\"vxlanId\").orElse(1004);\n var attach = new PortVlanAttachment(\"attach\", PortVlanAttachmentArgs.builder()\n .deviceId(deviceId)\n .portName(portName)\n .vlanVnid(vxlanId)\n .build());\n\n ctx.export(\"attachId\", attach.id());\n ctx.export(\"portId\", attach.portId());\n }\n}\n```\n```yaml\nconfig:\n deviceId:\n type: string\n portName:\n type: string\n default: eth1\n vxlanId:\n type: integer\n default: 1004\nresources:\n attach:\n type: equinix:metal:PortVlanAttachment\n properties:\n deviceId: ${deviceId}\n portName: ${portName}\n vlanVnid: ${vxlanId}\noutputs:\n attachId: ${attach.id}\n portId: ${attach.portId}\n```\n{{% /example %}}\n\n{{% /examples %}}", + "description": "Provides a resource to attach device ports to VLANs.\n\nDevice and VLAN must be in the same metro.\n\nIf you need this resource to add the port back to bond on removal, set `force_bond = true`.\n\nTo learn more about Layer 2 networking in Equinix Metal, refer to\n\n* https://metal.equinix.com/developers/docs/networking/layer2/\n* https://metal.equinix.com/developers/docs/networking/layer2-configs/\n\n## Attribute Referece\n\nIn addition to all arguments above, the following attributes are exported:\n\n* `id` - UUID of device port used in the assignment.\n* `vlan_id` - UUID of VLAN API resource.\n* `port_id` - UUID of device port.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n### example 2\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst test = new equinix.metal.Device(\"test\", {\n hostname: \"test\",\n plan: equinix.metal.Plan.C3SmallX86,\n metro: \"ny\",\n operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04,\n billingCycle: equinix.metal.BillingCycle.Hourly,\n projectId: projectId,\n});\nconst testDeviceNetworkType = new equinix.metal.DeviceNetworkType(\"testDeviceNetworkType\", {\n deviceId: test.id,\n type: \"layer2-individual\",\n});\nconst test1 = new equinix.metal.Vlan(\"test1\", {\n description: \"VLAN in New York\",\n metro: \"ny\",\n projectId: projectId,\n});\nconst test2 = new equinix.metal.Vlan(\"test2\", {\n description: \"VLAN in New Jersey\",\n metro: \"ny\",\n projectId: projectId,\n});\nconst test1PortVlanAttachment = new equinix.metal.PortVlanAttachment(\"test1PortVlanAttachment\", {\n deviceId: testDeviceNetworkType.id,\n vlanVnid: test1.vxlan,\n portName: \"eth1\",\n});\nconst test2PortVlanAttachment = new equinix.metal.PortVlanAttachment(\"test2PortVlanAttachment\", {\n deviceId: testDeviceNetworkType.id,\n vlanVnid: test2.vxlan,\n portName: \"eth1\",\n native: true,\n}, {\n dependsOn: [test1PortVlanAttachment],\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\ntest = equinix.metal.Device(\"test\",\n hostname=\"test\",\n plan=equinix.metal.Plan.C3_SMALL_X86,\n metro=\"ny\",\n operating_system=equinix.metal.OperatingSystem.UBUNTU20_04,\n billing_cycle=equinix.metal.BillingCycle.HOURLY,\n project_id=project_id)\ntest_device_network_type = equinix.metal.DeviceNetworkType(\"testDeviceNetworkType\",\n device_id=test.id,\n type=\"layer2-individual\")\ntest1 = equinix.metal.Vlan(\"test1\",\n description=\"VLAN in New York\",\n metro=\"ny\",\n project_id=project_id)\ntest2 = equinix.metal.Vlan(\"test2\",\n description=\"VLAN in New Jersey\",\n metro=\"ny\",\n project_id=project_id)\ntest1_port_vlan_attachment = equinix.metal.PortVlanAttachment(\"test1PortVlanAttachment\",\n device_id=test_device_network_type.id,\n vlan_vnid=test1.vxlan,\n port_name=\"eth1\")\ntest2_port_vlan_attachment = equinix.metal.PortVlanAttachment(\"test2PortVlanAttachment\",\n device_id=test_device_network_type.id,\n vlan_vnid=test2.vxlan,\n port_name=\"eth1\",\n native=True,\n opts = pulumi.ResourceOptions(depends_on=[test1_port_vlan_attachment]))\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttest, err := metal.NewDevice(ctx, \"test\", \u0026metal.DeviceArgs{\n\t\t\tHostname: pulumi.String(\"test\"),\n\t\t\tPlan: pulumi.String(metal.PlanC3SmallX86),\n\t\t\tMetro: pulumi.String(\"ny\"),\n\t\t\tOperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04),\n\t\t\tBillingCycle: pulumi.String(metal.BillingCycleHourly),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestDeviceNetworkType, err := metal.NewDeviceNetworkType(ctx, \"testDeviceNetworkType\", \u0026metal.DeviceNetworkTypeArgs{\n\t\t\tDeviceId: test.ID(),\n\t\t\tType: pulumi.String(\"layer2-individual\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttest1, err := metal.NewVlan(ctx, \"test1\", \u0026metal.VlanArgs{\n\t\t\tDescription: pulumi.String(\"VLAN in New York\"),\n\t\t\tMetro: pulumi.String(\"ny\"),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttest2, err := metal.NewVlan(ctx, \"test2\", \u0026metal.VlanArgs{\n\t\t\tDescription: pulumi.String(\"VLAN in New Jersey\"),\n\t\t\tMetro: pulumi.String(\"ny\"),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttest1PortVlanAttachment, err := metal.NewPortVlanAttachment(ctx, \"test1PortVlanAttachment\", \u0026metal.PortVlanAttachmentArgs{\n\t\t\tDeviceId: testDeviceNetworkType.ID(),\n\t\t\tVlanVnid: test1.Vxlan,\n\t\t\tPortName: pulumi.String(\"eth1\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewPortVlanAttachment(ctx, \"test2PortVlanAttachment\", \u0026metal.PortVlanAttachmentArgs{\n\t\t\tDeviceId: testDeviceNetworkType.ID(),\n\t\t\tVlanVnid: test2.Vxlan,\n\t\t\tPortName: pulumi.String(\"eth1\"),\n\t\t\tNative: pulumi.Bool(true),\n\t\t}, pulumi.DependsOn([]pulumi.Resource{\n\t\t\ttest1PortVlanAttachment,\n\t\t}))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = new Equinix.Metal.Device(\"test\", new()\n {\n Hostname = \"test\",\n Plan = Equinix.Metal.Plan.C3SmallX86,\n Metro = \"ny\",\n OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04,\n BillingCycle = Equinix.Metal.BillingCycle.Hourly,\n ProjectId = projectId,\n });\n\n var testDeviceNetworkType = new Equinix.Metal.DeviceNetworkType(\"testDeviceNetworkType\", new()\n {\n DeviceId = test.Id,\n Type = \"layer2-individual\",\n });\n\n var test1 = new Equinix.Metal.Vlan(\"test1\", new()\n {\n Description = \"VLAN in New York\",\n Metro = \"ny\",\n ProjectId = projectId,\n });\n\n var test2 = new Equinix.Metal.Vlan(\"test2\", new()\n {\n Description = \"VLAN in New Jersey\",\n Metro = \"ny\",\n ProjectId = projectId,\n });\n\n var test1PortVlanAttachment = new Equinix.Metal.PortVlanAttachment(\"test1PortVlanAttachment\", new()\n {\n DeviceId = testDeviceNetworkType.Id,\n VlanVnid = test1.Vxlan,\n PortName = \"eth1\",\n });\n\n var test2PortVlanAttachment = new Equinix.Metal.PortVlanAttachment(\"test2PortVlanAttachment\", new()\n {\n DeviceId = testDeviceNetworkType.Id,\n VlanVnid = test2.Vxlan,\n PortName = \"eth1\",\n Native = true,\n }, new CustomResourceOptions\n {\n DependsOn =\n {\n test1PortVlanAttachment,\n },\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Device;\nimport com.pulumi.equinix.metal.DeviceArgs;\nimport com.pulumi.equinix.metal.DeviceNetworkType;\nimport com.pulumi.equinix.metal.DeviceNetworkTypeArgs;\nimport com.pulumi.equinix.metal.Vlan;\nimport com.pulumi.equinix.metal.VlanArgs;\nimport com.pulumi.equinix.metal.PortVlanAttachment;\nimport com.pulumi.equinix.metal.PortVlanAttachmentArgs;\nimport com.pulumi.resources.CustomResourceOptions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Device(\"test\", DeviceArgs.builder()\n .hostname(\"test\")\n .plan(\"c3.small.x86\")\n .metro(\"ny\")\n .operatingSystem(\"ubuntu_20_04\")\n .billingCycle(\"hourly\")\n .projectId(projectId)\n .build());\n\n var testDeviceNetworkType = new DeviceNetworkType(\"testDeviceNetworkType\", DeviceNetworkTypeArgs.builder()\n .deviceId(test.id())\n .type(\"layer2-individual\")\n .build());\n\n var test1 = new Vlan(\"test1\", VlanArgs.builder()\n .description(\"VLAN in New York\")\n .metro(\"ny\")\n .projectId(projectId)\n .build());\n\n var test2 = new Vlan(\"test2\", VlanArgs.builder()\n .description(\"VLAN in New Jersey\")\n .metro(\"ny\")\n .projectId(projectId)\n .build());\n\n var test1PortVlanAttachment = new PortVlanAttachment(\"test1PortVlanAttachment\", PortVlanAttachmentArgs.builder()\n .deviceId(testDeviceNetworkType.id())\n .vlanVnid(test1.vxlan())\n .portName(\"eth1\")\n .build());\n\n var test2PortVlanAttachment = new PortVlanAttachment(\"test2PortVlanAttachment\", PortVlanAttachmentArgs.builder()\n .deviceId(testDeviceNetworkType.id())\n .vlanVnid(test2.vxlan())\n .portName(\"eth1\")\n .native_(true)\n .build(), CustomResourceOptions.builder()\n .dependsOn(test1PortVlanAttachment)\n .build());\n\n }\n}\n```\n```yaml\n test:\n type: equinix:metal:Device\n properties:\n hostname: test\n plan: c3.small.x86\n metro: ny\n operatingSystem: ubuntu_20_04\n billingCycle: hourly\n projectId: ${projectId}\n testDeviceNetworkType:\n type: equinix:metal:DeviceNetworkType\n name: test\n properties:\n deviceId: ${test.id}\n type: layer2-individual\n test1:\n type: equinix:metal:Vlan\n properties:\n description: VLAN in New York\n metro: ny\n projectId: ${projectId}\n test2:\n type: equinix:metal:Vlan\n properties:\n description: VLAN in New Jersey\n metro: ny\n projectId: ${projectId}\n test1PortVlanAttachment:\n type: equinix:metal:PortVlanAttachment\n name: test1\n properties:\n deviceId: ${testDeviceNetworkType.id}\n vlanVnid: ${test1.vxlan}\n portName: eth1\n test2PortVlanAttachment:\n type: equinix:metal:PortVlanAttachment\n name: test2\n properties:\n deviceId: ${testDeviceNetworkType.id}\n vlanVnid: ${test2.vxlan}\n portName: eth1\n native: true\n options:\n dependson:\n - ${test1PortVlanAttachment}\n```\n{{% /example %}}\n\n{{% example %}}\n### example 1\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst test = new equinix.metal.Vlan(\"test\", {\n description: \"VLAN in New York\",\n metro: \"ny\",\n projectId: projectId,\n});\nconst testDevice = new equinix.metal.Device(\"testDevice\", {\n hostname: \"test\",\n plan: equinix.metal.Plan.C3SmallX86,\n metro: \"ny\",\n operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04,\n billingCycle: equinix.metal.BillingCycle.Hourly,\n projectId: projectId,\n});\nconst testDeviceNetworkType = new equinix.metal.DeviceNetworkType(\"testDeviceNetworkType\", {\n deviceId: testDevice.id,\n type: \"hybrid\",\n});\nconst testPortVlanAttachment = new equinix.metal.PortVlanAttachment(\"testPortVlanAttachment\", {\n deviceId: testDeviceNetworkType.id,\n portName: \"eth1\",\n vlanVnid: test.vxlan,\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\ntest = equinix.metal.Vlan(\"test\",\n description=\"VLAN in New York\",\n metro=\"ny\",\n project_id=project_id)\ntest_device = equinix.metal.Device(\"testDevice\",\n hostname=\"test\",\n plan=equinix.metal.Plan.C3_SMALL_X86,\n metro=\"ny\",\n operating_system=equinix.metal.OperatingSystem.UBUNTU20_04,\n billing_cycle=equinix.metal.BillingCycle.HOURLY,\n project_id=project_id)\ntest_device_network_type = equinix.metal.DeviceNetworkType(\"testDeviceNetworkType\",\n device_id=test_device.id,\n type=\"hybrid\")\ntest_port_vlan_attachment = equinix.metal.PortVlanAttachment(\"testPortVlanAttachment\",\n device_id=test_device_network_type.id,\n port_name=\"eth1\",\n vlan_vnid=test.vxlan)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttest, err := metal.NewVlan(ctx, \"test\", \u0026metal.VlanArgs{\n\t\t\tDescription: pulumi.String(\"VLAN in New York\"),\n\t\t\tMetro: pulumi.String(\"ny\"),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestDevice, err := metal.NewDevice(ctx, \"testDevice\", \u0026metal.DeviceArgs{\n\t\t\tHostname: pulumi.String(\"test\"),\n\t\t\tPlan: pulumi.String(metal.PlanC3SmallX86),\n\t\t\tMetro: pulumi.String(\"ny\"),\n\t\t\tOperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04),\n\t\t\tBillingCycle: pulumi.String(metal.BillingCycleHourly),\n\t\t\tProjectId: pulumi.Any(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttestDeviceNetworkType, err := metal.NewDeviceNetworkType(ctx, \"testDeviceNetworkType\", \u0026metal.DeviceNetworkTypeArgs{\n\t\t\tDeviceId: testDevice.ID(),\n\t\t\tType: pulumi.String(\"hybrid\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewPortVlanAttachment(ctx, \"testPortVlanAttachment\", \u0026metal.PortVlanAttachmentArgs{\n\t\t\tDeviceId: testDeviceNetworkType.ID(),\n\t\t\tPortName: pulumi.String(\"eth1\"),\n\t\t\tVlanVnid: test.Vxlan,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = new Equinix.Metal.Vlan(\"test\", new()\n {\n Description = \"VLAN in New York\",\n Metro = \"ny\",\n ProjectId = projectId,\n });\n\n var testDevice = new Equinix.Metal.Device(\"testDevice\", new()\n {\n Hostname = \"test\",\n Plan = Equinix.Metal.Plan.C3SmallX86,\n Metro = \"ny\",\n OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04,\n BillingCycle = Equinix.Metal.BillingCycle.Hourly,\n ProjectId = projectId,\n });\n\n var testDeviceNetworkType = new Equinix.Metal.DeviceNetworkType(\"testDeviceNetworkType\", new()\n {\n DeviceId = testDevice.Id,\n Type = \"hybrid\",\n });\n\n var testPortVlanAttachment = new Equinix.Metal.PortVlanAttachment(\"testPortVlanAttachment\", new()\n {\n DeviceId = testDeviceNetworkType.Id,\n PortName = \"eth1\",\n VlanVnid = test.Vxlan,\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Vlan;\nimport com.pulumi.equinix.metal.VlanArgs;\nimport com.pulumi.equinix.metal.Device;\nimport com.pulumi.equinix.metal.DeviceArgs;\nimport com.pulumi.equinix.metal.DeviceNetworkType;\nimport com.pulumi.equinix.metal.DeviceNetworkTypeArgs;\nimport com.pulumi.equinix.metal.PortVlanAttachment;\nimport com.pulumi.equinix.metal.PortVlanAttachmentArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var test = new Vlan(\"test\", VlanArgs.builder()\n .description(\"VLAN in New York\")\n .metro(\"ny\")\n .projectId(projectId)\n .build());\n\n var testDevice = new Device(\"testDevice\", DeviceArgs.builder()\n .hostname(\"test\")\n .plan(\"c3.small.x86\")\n .metro(\"ny\")\n .operatingSystem(\"ubuntu_20_04\")\n .billingCycle(\"hourly\")\n .projectId(projectId)\n .build());\n\n var testDeviceNetworkType = new DeviceNetworkType(\"testDeviceNetworkType\", DeviceNetworkTypeArgs.builder()\n .deviceId(testDevice.id())\n .type(\"hybrid\")\n .build());\n\n var testPortVlanAttachment = new PortVlanAttachment(\"testPortVlanAttachment\", PortVlanAttachmentArgs.builder()\n .deviceId(testDeviceNetworkType.id())\n .portName(\"eth1\")\n .vlanVnid(test.vxlan())\n .build());\n\n }\n}\n```\n```yaml\n test:\n type: equinix:metal:Vlan\n properties:\n description: VLAN in New York\n metro: ny\n projectId: ${projectId}\n testDevice:\n type: equinix:metal:Device\n name: test\n properties:\n hostname: test\n plan: c3.small.x86\n metro: ny\n operatingSystem: ubuntu_20_04\n billingCycle: hourly\n projectId: ${projectId}\n testDeviceNetworkType:\n type: equinix:metal:DeviceNetworkType\n name: test\n properties:\n deviceId: ${testDevice.id}\n type: hybrid\n testPortVlanAttachment:\n type: equinix:metal:PortVlanAttachment\n name: test\n properties:\n deviceId: ${testDeviceNetworkType.id}\n portName: eth1\n vlanVnid: ${test.vxlan}\n```\n{{% /example %}}\n\n{{% /examples %}}", "properties": { "deviceId": { "type": "string", @@ -15924,7 +15924,7 @@ } }, "equinix:metal/project:Project": { - "description": "Provides an Equinix Metal project resource to allow you manage devices in your projects.\n\n\u003e **NOTE:** Keep in mind that Equinix Metal invoicing is per project, so creating many `equinix.metal.Project` resources will affect the rendered invoice. If you want to keep your Equinix Metal bill simple and easy to review, please re-use your existing projects.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst config = new pulumi.Config();\nconst organizationId = config.require(\"organizationId\");\nconst name = config.get(\"name\") || \"Default Project\";\nconst projectResource = new equinix.metal.Project(\"project\", {\n name: name,\n organizationId: organizationId,\n});\nexport const projectId = projectResource.id;\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nconfig = pulumi.Config()\norganization_id = config.require(\"organizationId\")\nname = config.get(\"name\")\nif name is None:\n name = \"Default Project\"\nproject_resource = equinix.metal.Project(\"project\",\n name=name,\n organization_id=organization_id)\npulumi.export(\"projectId\", project_resource.id)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcfg := config.New(ctx, \"\")\n\t\torganizationId := cfg.Require(\"organizationId\")\n\t\tname := \"Default Project\"\n\t\tif param := cfg.Get(\"name\"); param != \"\" {\n\t\t\tname = param\n\t\t}\n\t\tprojectResource, err := metal.NewProject(ctx, \"project\", \u0026metal.ProjectArgs{\n\t\t\tName: pulumi.String(name),\n\t\t\tOrganizationId: pulumi.String(organizationId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"projectId\", projectResource.ID())\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var organizationId = config.Require(\"organizationId\");\n var name = config.Get(\"name\") ?? \"Default Project\";\n var projectResource = new Equinix.Metal.Project(\"project\", new()\n {\n Name = name,\n OrganizationId = organizationId,\n });\n\n return new Dictionary\u003cstring, object?\u003e\n {\n [\"projectId\"] = projectResource.Id,\n };\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Project;\nimport com.pulumi.equinix.metal.ProjectArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var organizationId = config.get(\"organizationId\");\n final var name = config.get(\"name\").orElse(\"Default Project\");\n var projectResource = new Project(\"projectResource\", ProjectArgs.builder()\n .name(name)\n .organizationId(organizationId)\n .build());\n\n ctx.export(\"projectId\", projectResource.id());\n }\n}\n```\n```yaml\nconfig:\n organizationId:\n type: string\n name:\n type: string\n default: Default Project\nresources:\n project:\n type: equinix:metal:Project\n properties:\n name: ${name}\n organizationId: ${organizationId}\noutputs:\n projectId: ${project.id}\n```\n{{% /example %}}\n\n## Import\n\nThis resource can be imported using an existing project ID:\n\n```sh\n$ pulumi import equinix:metal/project:Project equinix_metal_project {existing_project_id}\n```\n\n\n{{% /examples %}}", + "description": "Provides an Equinix Metal project resource to allow you manage devices in your projects.\n\n\u003e **NOTE:** Keep in mind that Equinix Metal invoicing is per project, so creating many `equinix.metal.Project` resources will affect the rendered invoice. If you want to keep your Equinix Metal bill simple and easy to review, please re-use your existing projects.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n### example 3\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst existingProject = new equinix.metal.Project(\"existingProject\", {\n name: \"The name of the project (if different, will rewrite)\",\n bgpConfig: {\n deploymentType: \"local\",\n md5: \"C179c28c41a85b\",\n asn: 65000,\n },\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nexisting_project = equinix.metal.Project(\"existingProject\",\n name=\"The name of the project (if different, will rewrite)\",\n bgp_config=equinix.metal.ProjectBgpConfigArgs(\n deployment_type=\"local\",\n md5=\"C179c28c41a85b\",\n asn=65000,\n ))\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := metal.NewProject(ctx, \"existingProject\", \u0026metal.ProjectArgs{\n\t\t\tName: pulumi.String(\"The name of the project (if different, will rewrite)\"),\n\t\t\tBgpConfig: \u0026metal.ProjectBgpConfigArgs{\n\t\t\t\tDeploymentType: pulumi.String(\"local\"),\n\t\t\t\tMd5: pulumi.String(\"C179c28c41a85b\"),\n\t\t\t\tAsn: pulumi.Int(65000),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var existingProject = new Equinix.Metal.Project(\"existingProject\", new()\n {\n Name = \"The name of the project (if different, will rewrite)\",\n BgpConfig = new Equinix.Metal.Inputs.ProjectBgpConfigArgs\n {\n DeploymentType = \"local\",\n Md5 = \"C179c28c41a85b\",\n Asn = 65000,\n },\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Project;\nimport com.pulumi.equinix.metal.ProjectArgs;\nimport com.pulumi.equinix.metal.inputs.ProjectBgpConfigArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var existingProject = new Project(\"existingProject\", ProjectArgs.builder()\n .name(\"The name of the project (if different, will rewrite)\")\n .bgpConfig(ProjectBgpConfigArgs.builder()\n .deploymentType(\"local\")\n .md5(\"C179c28c41a85b\")\n .asn(65000)\n .build())\n .build());\n\n }\n}\n```\n```yaml\n existingProject:\n type: equinix:metal:Project\n name: existing_project\n properties:\n name: The name of the project (if different, will rewrite)\n bgpConfig:\n deploymentType: local\n md5: C179c28c41a85b\n asn: 65000\n```\n{{% /example %}}\n\n{{% example %}}\n### example 2\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst tfProject1 = new equinix.metal.Project(\"tfProject1\", {\n name: \"tftest\",\n bgpConfig: {\n deploymentType: \"local\",\n md5: \"C179c28c41a85b\",\n asn: 65000,\n },\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\ntf_project1 = equinix.metal.Project(\"tfProject1\",\n name=\"tftest\",\n bgp_config=equinix.metal.ProjectBgpConfigArgs(\n deployment_type=\"local\",\n md5=\"C179c28c41a85b\",\n asn=65000,\n ))\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := metal.NewProject(ctx, \"tfProject1\", \u0026metal.ProjectArgs{\n\t\t\tName: pulumi.String(\"tftest\"),\n\t\t\tBgpConfig: \u0026metal.ProjectBgpConfigArgs{\n\t\t\t\tDeploymentType: pulumi.String(\"local\"),\n\t\t\t\tMd5: pulumi.String(\"C179c28c41a85b\"),\n\t\t\t\tAsn: pulumi.Int(65000),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var tfProject1 = new Equinix.Metal.Project(\"tfProject1\", new()\n {\n Name = \"tftest\",\n BgpConfig = new Equinix.Metal.Inputs.ProjectBgpConfigArgs\n {\n DeploymentType = \"local\",\n Md5 = \"C179c28c41a85b\",\n Asn = 65000,\n },\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Project;\nimport com.pulumi.equinix.metal.ProjectArgs;\nimport com.pulumi.equinix.metal.inputs.ProjectBgpConfigArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var tfProject1 = new Project(\"tfProject1\", ProjectArgs.builder()\n .name(\"tftest\")\n .bgpConfig(ProjectBgpConfigArgs.builder()\n .deploymentType(\"local\")\n .md5(\"C179c28c41a85b\")\n .asn(65000)\n .build())\n .build());\n\n }\n}\n```\n```yaml\n # Create a new Project\n tfProject1:\n type: equinix:metal:Project\n name: tf_project_1\n properties:\n name: tftest\n bgpConfig:\n deploymentType: local\n md5: C179c28c41a85b\n asn: 65000\n```\n{{% /example %}}\n\n{{% example %}}\n### example 1\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst tfProject1 = new equinix.metal.Project(\"tfProject1\", {name: \"Terraform Fun\"});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\ntf_project1 = equinix.metal.Project(\"tfProject1\", name=\"Terraform Fun\")\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := metal.NewProject(ctx, \"tfProject1\", \u0026metal.ProjectArgs{\n\t\t\tName: pulumi.String(\"Terraform Fun\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var tfProject1 = new Equinix.Metal.Project(\"tfProject1\", new()\n {\n Name = \"Terraform Fun\",\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Project;\nimport com.pulumi.equinix.metal.ProjectArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var tfProject1 = new Project(\"tfProject1\", ProjectArgs.builder()\n .name(\"Terraform Fun\")\n .build());\n\n }\n}\n```\n```yaml\n tfProject1:\n type: equinix:metal:Project\n name: tf_project_1\n properties:\n name: Terraform Fun\n```\n{{% /example %}}\n\n## Import\n\nThis resource can be imported using an existing project ID:\n\n```sh\n$ pulumi import equinix:metal/project:Project equinix_metal_project {existing_project_id}\n```\n\n\n{{% /examples %}}", "properties": { "backendTransfer": { "type": "boolean", @@ -17148,7 +17148,7 @@ } }, "equinix:metal/vrf:Vrf": { - "description": "Use this resource to manage a VRF.\n\nSee the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst config = new pulumi.Config();\nconst projectId = config.require(\"projectId\");\nconst metro = config.get(\"metro\") || \"DA\";\nconst vrf = new equinix.metal.Vrf(\"vrf\", {\n description: \"VRF with ASN 65000 and a pool of address space\",\n name: \"example-vrf\",\n metro: metro,\n localAsn: 65000,\n ipRanges: [\n \"192.168.100.0/25\",\n \"192.168.200.0/25\",\n ],\n projectId: projectId,\n});\nexport const vrfId = vrf.id;\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nconfig = pulumi.Config()\nproject_id = config.require(\"projectId\")\nmetro = config.get(\"metro\")\nif metro is None:\n metro = \"DA\"\nvrf = equinix.metal.Vrf(\"vrf\",\n description=\"VRF with ASN 65000 and a pool of address space\",\n name=\"example-vrf\",\n metro=metro,\n local_asn=65000,\n ip_ranges=[\n \"192.168.100.0/25\",\n \"192.168.200.0/25\",\n ],\n project_id=project_id)\npulumi.export(\"vrfId\", vrf.id)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\tcfg := config.New(ctx, \"\")\n\t\tprojectId := cfg.Require(\"projectId\")\n\t\tmetro := \"DA\"\n\t\tif param := cfg.Get(\"metro\"); param != \"\" {\n\t\t\tmetro = param\n\t\t}\n\t\tvrf, err := metal.NewVrf(ctx, \"vrf\", \u0026metal.VrfArgs{\n\t\t\tDescription: pulumi.String(\"VRF with ASN 65000 and a pool of address space\"),\n\t\t\tName: pulumi.String(\"example-vrf\"),\n\t\t\tMetro: pulumi.String(metro),\n\t\t\tLocalAsn: pulumi.Int(65000),\n\t\t\tIpRanges: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"192.168.100.0/25\"),\n\t\t\t\tpulumi.String(\"192.168.200.0/25\"),\n\t\t\t},\n\t\t\tProjectId: pulumi.String(projectId),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx.Export(\"vrfId\", vrf.ID())\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var config = new Config();\n var projectId = config.Require(\"projectId\");\n var metro = config.Get(\"metro\") ?? \"DA\";\n var vrf = new Equinix.Metal.Vrf(\"vrf\", new()\n {\n Description = \"VRF with ASN 65000 and a pool of address space\",\n Name = \"example-vrf\",\n Metro = metro,\n LocalAsn = 65000,\n IpRanges = new[]\n {\n \"192.168.100.0/25\",\n \"192.168.200.0/25\",\n },\n ProjectId = projectId,\n });\n\n return new Dictionary\u003cstring, object?\u003e\n {\n [\"vrfId\"] = vrf.Id,\n };\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Vrf;\nimport com.pulumi.equinix.metal.VrfArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var config = ctx.config();\n final var projectId = config.get(\"projectId\");\n final var metro = config.get(\"metro\").orElse(\"DA\");\n var vrf = new Vrf(\"vrf\", VrfArgs.builder()\n .description(\"VRF with ASN 65000 and a pool of address space\")\n .name(\"example-vrf\")\n .metro(metro)\n .localAsn(65000)\n .ipRanges( \n \"192.168.100.0/25\",\n \"192.168.200.0/25\")\n .projectId(projectId)\n .build());\n\n ctx.export(\"vrfId\", vrf.id());\n }\n}\n```\n```yaml\nconfig:\n projectId:\n type: string\n metro:\n type: string\n default: DA\nresources:\n vrf:\n type: equinix:metal:Vrf\n properties:\n description: VRF with ASN 65000 and a pool of address space\n name: example-vrf\n metro: ${metro}\n localAsn: 65000\n ipRanges:\n - 192.168.100.0/25\n - 192.168.200.0/25\n projectId: ${projectId}\noutputs:\n vrfId: ${vrf.id}\n```\n{{% /example %}}\n\n## Import\n\nThis resource can be imported using an existing VRF ID:\n\n```sh\n$ pulumi import equinix:metal/vrf:Vrf equinix_metal_vrf {existing_id}\n```\n\n\n{{% /examples %}}", + "description": "Use this resource to manage a VRF.\n\nSee the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.\n\n{{% examples %}}\n## Example Usage\n\n{{% example %}}\n### example 2\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst example = new equinix.metal.ReservedIpBlock(\"example\", {\n description: \"Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.\",\n projectId: exampleEquinixMetalProject.id,\n metro: exampleEquinixMetalVrf.metro,\n type: \"vrf\",\n vrfId: exampleEquinixMetalVrf.id,\n cidr: 29,\n network: \"192.168.100.0\",\n});\nconst exampleVlan = new equinix.metal.Vlan(\"exampleVlan\", {\n description: \"A VLAN for Layer2 and Hybrid Metal devices\",\n metro: exampleEquinixMetalVrf.metro,\n projectId: exampleEquinixMetalProject.id,\n});\nconst exampleGateway = new equinix.metal.Gateway(\"exampleGateway\", {\n projectId: exampleEquinixMetalProject.id,\n vlanId: exampleVlan.id,\n ipReservationId: example.id,\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nexample = equinix.metal.ReservedIpBlock(\"example\",\n description=\"Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.\",\n project_id=example_equinix_metal_project[\"id\"],\n metro=example_equinix_metal_vrf[\"metro\"],\n type=\"vrf\",\n vrf_id=example_equinix_metal_vrf[\"id\"],\n cidr=29,\n network=\"192.168.100.0\")\nexample_vlan = equinix.metal.Vlan(\"exampleVlan\",\n description=\"A VLAN for Layer2 and Hybrid Metal devices\",\n metro=example_equinix_metal_vrf[\"metro\"],\n project_id=example_equinix_metal_project[\"id\"])\nexample_gateway = equinix.metal.Gateway(\"exampleGateway\",\n project_id=example_equinix_metal_project[\"id\"],\n vlan_id=example_vlan.id,\n ip_reservation_id=example.id)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\texample, err := metal.NewReservedIpBlock(ctx, \"example\", \u0026metal.ReservedIpBlockArgs{\n\t\t\tDescription: pulumi.String(\"Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.\"),\n\t\t\tProjectId: pulumi.Any(exampleEquinixMetalProject.Id),\n\t\t\tMetro: pulumi.Any(exampleEquinixMetalVrf.Metro),\n\t\t\tType: pulumi.String(\"vrf\"),\n\t\t\tVrfId: pulumi.Any(exampleEquinixMetalVrf.Id),\n\t\t\tCidr: pulumi.Int(29),\n\t\t\tNetwork: pulumi.String(\"192.168.100.0\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texampleVlan, err := metal.NewVlan(ctx, \"exampleVlan\", \u0026metal.VlanArgs{\n\t\t\tDescription: pulumi.String(\"A VLAN for Layer2 and Hybrid Metal devices\"),\n\t\t\tMetro: pulumi.Any(exampleEquinixMetalVrf.Metro),\n\t\t\tProjectId: pulumi.Any(exampleEquinixMetalProject.Id),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewGateway(ctx, \"exampleGateway\", \u0026metal.GatewayArgs{\n\t\t\tProjectId: pulumi.Any(exampleEquinixMetalProject.Id),\n\t\t\tVlanId: exampleVlan.ID(),\n\t\t\tIpReservationId: example.ID(),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Equinix.Metal.ReservedIpBlock(\"example\", new()\n {\n Description = \"Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.\",\n ProjectId = exampleEquinixMetalProject.Id,\n Metro = exampleEquinixMetalVrf.Metro,\n Type = \"vrf\",\n VrfId = exampleEquinixMetalVrf.Id,\n Cidr = 29,\n Network = \"192.168.100.0\",\n });\n\n var exampleVlan = new Equinix.Metal.Vlan(\"exampleVlan\", new()\n {\n Description = \"A VLAN for Layer2 and Hybrid Metal devices\",\n Metro = exampleEquinixMetalVrf.Metro,\n ProjectId = exampleEquinixMetalProject.Id,\n });\n\n var exampleGateway = new Equinix.Metal.Gateway(\"exampleGateway\", new()\n {\n ProjectId = exampleEquinixMetalProject.Id,\n VlanId = exampleVlan.Id,\n IpReservationId = example.Id,\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.ReservedIpBlock;\nimport com.pulumi.equinix.metal.ReservedIpBlockArgs;\nimport com.pulumi.equinix.metal.Vlan;\nimport com.pulumi.equinix.metal.VlanArgs;\nimport com.pulumi.equinix.metal.Gateway;\nimport com.pulumi.equinix.metal.GatewayArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new ReservedIpBlock(\"example\", ReservedIpBlockArgs.builder()\n .description(\"Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.\")\n .projectId(exampleEquinixMetalProject.id())\n .metro(exampleEquinixMetalVrf.metro())\n .type(\"vrf\")\n .vrfId(exampleEquinixMetalVrf.id())\n .cidr(29)\n .network(\"192.168.100.0\")\n .build());\n\n var exampleVlan = new Vlan(\"exampleVlan\", VlanArgs.builder()\n .description(\"A VLAN for Layer2 and Hybrid Metal devices\")\n .metro(exampleEquinixMetalVrf.metro())\n .projectId(exampleEquinixMetalProject.id())\n .build());\n\n var exampleGateway = new Gateway(\"exampleGateway\", GatewayArgs.builder()\n .projectId(exampleEquinixMetalProject.id())\n .vlanId(exampleVlan.id())\n .ipReservationId(example.id())\n .build());\n\n }\n}\n```\n```yaml\n example:\n type: equinix:metal:ReservedIpBlock\n properties:\n description: Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.\n projectId: ${exampleEquinixMetalProject.id}\n metro: ${exampleEquinixMetalVrf.metro}\n type: vrf\n vrfId: ${exampleEquinixMetalVrf.id}\n cidr: 29\n network: 192.168.100.0\n exampleVlan:\n type: equinix:metal:Vlan\n name: example\n properties:\n description: A VLAN for Layer2 and Hybrid Metal devices\n metro: ${exampleEquinixMetalVrf.metro}\n projectId: ${exampleEquinixMetalProject.id}\n exampleGateway:\n type: equinix:metal:Gateway\n name: example\n properties:\n projectId: ${exampleEquinixMetalProject.id}\n vlanId: ${exampleVlan.id}\n ipReservationId: ${example.id}\n```\n{{% /example %}}\n\n{{% example %}}\n### example 1\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst example = new equinix.metal.Project(\"example\", {name: \"example\"});\nconst exampleVrf = new equinix.metal.Vrf(\"exampleVrf\", {\n description: \"VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25\",\n name: \"example-vrf\",\n metro: \"da\",\n localAsn: 65000,\n ipRanges: [\n \"192.168.100.0/25\",\n \"192.168.200.0/25\",\n ],\n projectId: example.id,\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nexample = equinix.metal.Project(\"example\", name=\"example\")\nexample_vrf = equinix.metal.Vrf(\"exampleVrf\",\n description=\"VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25\",\n name=\"example-vrf\",\n metro=\"da\",\n local_asn=65000,\n ip_ranges=[\n \"192.168.100.0/25\",\n \"192.168.200.0/25\",\n ],\n project_id=example.id)\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\texample, err := metal.NewProject(ctx, \"example\", \u0026metal.ProjectArgs{\n\t\t\tName: pulumi.String(\"example\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = metal.NewVrf(ctx, \"exampleVrf\", \u0026metal.VrfArgs{\n\t\t\tDescription: pulumi.String(\"VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25\"),\n\t\t\tName: pulumi.String(\"example-vrf\"),\n\t\t\tMetro: pulumi.String(\"da\"),\n\t\t\tLocalAsn: pulumi.Int(65000),\n\t\t\tIpRanges: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"192.168.100.0/25\"),\n\t\t\t\tpulumi.String(\"192.168.200.0/25\"),\n\t\t\t},\n\t\t\tProjectId: example.ID(),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Equinix.Metal.Project(\"example\", new()\n {\n Name = \"example\",\n });\n\n var exampleVrf = new Equinix.Metal.Vrf(\"exampleVrf\", new()\n {\n Description = \"VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25\",\n Name = \"example-vrf\",\n Metro = \"da\",\n LocalAsn = 65000,\n IpRanges = new[]\n {\n \"192.168.100.0/25\",\n \"192.168.200.0/25\",\n },\n ProjectId = example.Id,\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.Project;\nimport com.pulumi.equinix.metal.ProjectArgs;\nimport com.pulumi.equinix.metal.Vrf;\nimport com.pulumi.equinix.metal.VrfArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new Project(\"example\", ProjectArgs.builder()\n .name(\"example\")\n .build());\n\n var exampleVrf = new Vrf(\"exampleVrf\", VrfArgs.builder()\n .description(\"VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25\")\n .name(\"example-vrf\")\n .metro(\"da\")\n .localAsn(\"65000\")\n .ipRanges( \n \"192.168.100.0/25\",\n \"192.168.200.0/25\")\n .projectId(example.id())\n .build());\n\n }\n}\n```\n```yaml\n example:\n type: equinix:metal:Project\n properties:\n name: example\n exampleVrf:\n type: equinix:metal:Vrf\n name: example\n properties:\n description: VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25\n name: example-vrf\n metro: da\n localAsn: '65000'\n ipRanges:\n - 192.168.100.0/25\n - 192.168.200.0/25\n projectId: ${example.id}\n```\n{{% /example %}}\n\n{{% example %}}\n### example 3\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as equinix from \"@equinix-labs/pulumi-equinix\";\n\nconst exampleVirtualCircuit = new equinix.metal.VirtualCircuit(\"exampleVirtualCircuit\", {\n name: \"example-vc\",\n description: \"Virtual Circuit\",\n connectionId: example.id,\n projectId: exampleEquinixMetalProject.id,\n portId: example.ports[0].id,\n nniVlan: 1024,\n vrfId: exampleEquinixMetalVrf.id,\n peerAsn: 65530,\n subnet: \"192.168.100.16/31\",\n metalIp: \"192.168.100.16\",\n customerIp: \"192.168.100.17\",\n});\n```\n```python\nimport pulumi\nimport pulumi_equinix as equinix\n\nexample_virtual_circuit = equinix.metal.VirtualCircuit(\"exampleVirtualCircuit\",\n name=\"example-vc\",\n description=\"Virtual Circuit\",\n connection_id=example[\"id\"],\n project_id=example_equinix_metal_project[\"id\"],\n port_id=example[\"ports\"][0][\"id\"],\n nni_vlan=1024,\n vrf_id=example_equinix_metal_vrf[\"id\"],\n peer_asn=65530,\n subnet=\"192.168.100.16/31\",\n metal_ip=\"192.168.100.16\",\n customer_ip=\"192.168.100.17\")\n```\n```go\npackage main\n\nimport (\n\t\"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := metal.NewVirtualCircuit(ctx, \"exampleVirtualCircuit\", \u0026metal.VirtualCircuitArgs{\n\t\t\tName: pulumi.String(\"example-vc\"),\n\t\t\tDescription: pulumi.String(\"Virtual Circuit\"),\n\t\t\tConnectionId: pulumi.Any(example.Id),\n\t\t\tProjectId: pulumi.Any(exampleEquinixMetalProject.Id),\n\t\t\tPortId: pulumi.Any(example.Ports[0].Id),\n\t\t\tNniVlan: pulumi.Int(1024),\n\t\t\tVrfId: pulumi.Any(exampleEquinixMetalVrf.Id),\n\t\t\tPeerAsn: pulumi.Int(65530),\n\t\t\tSubnet: pulumi.String(\"192.168.100.16/31\"),\n\t\t\tMetalIp: pulumi.String(\"192.168.100.16\"),\n\t\t\tCustomerIp: pulumi.String(\"192.168.100.17\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Equinix = Pulumi.Equinix;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var exampleVirtualCircuit = new Equinix.Metal.VirtualCircuit(\"exampleVirtualCircuit\", new()\n {\n Name = \"example-vc\",\n Description = \"Virtual Circuit\",\n ConnectionId = example.Id,\n ProjectId = exampleEquinixMetalProject.Id,\n PortId = example.Ports[0].Id,\n NniVlan = 1024,\n VrfId = exampleEquinixMetalVrf.Id,\n PeerAsn = 65530,\n Subnet = \"192.168.100.16/31\",\n MetalIp = \"192.168.100.16\",\n CustomerIp = \"192.168.100.17\",\n });\n\n});\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.equinix.metal.VirtualCircuit;\nimport com.pulumi.equinix.metal.VirtualCircuitArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var exampleVirtualCircuit = new VirtualCircuit(\"exampleVirtualCircuit\", VirtualCircuitArgs.builder()\n .name(\"example-vc\")\n .description(\"Virtual Circuit\")\n .connectionId(example.id())\n .projectId(exampleEquinixMetalProject.id())\n .portId(example.ports()[0].id())\n .nniVlan(1024)\n .vrfId(exampleEquinixMetalVrf.id())\n .peerAsn(65530)\n .subnet(\"192.168.100.16/31\")\n .metalIp(\"192.168.100.16\")\n .customerIp(\"192.168.100.17\")\n .build());\n\n }\n}\n```\n```yaml\n exampleVirtualCircuit:\n type: equinix:metal:VirtualCircuit\n name: example\n properties:\n name: example-vc\n description: Virtual Circuit\n connectionId: ${example.id}\n projectId: ${exampleEquinixMetalProject.id}\n portId: ${example.ports[0].id}\n nniVlan: 1024\n vrfId: ${exampleEquinixMetalVrf.id}\n peerAsn: 65530\n subnet: 192.168.100.16/31\n metalIp: 192.168.100.16\n customerIp: 192.168.100.17\nvariables:\n example:\n fn::invoke:\n Function: equinix:metal:getInterconnection\n Arguments:\n connectionId: ${metalDedicatedConnectionId}\n```\n{{% /example %}}\n\n## Import\n\nThis resource can be imported using an existing VRF ID:\n\n```sh\n$ pulumi import equinix:metal/vrf:Vrf equinix_metal_vrf {existing_id}\n```\n\n\n{{% /examples %}}", "properties": { "description": { "type": "string", diff --git a/scripts/generate_examples.sh b/scripts/generate_examples.sh index af1bf56d..5c6f0d9b 100755 --- a/scripts/generate_examples.sh +++ b/scripts/generate_examples.sh @@ -59,7 +59,8 @@ mappings() { sed -i '' 's/"arista-ha"/"arista_ha"/g' "$tf_file" sed -i '' 's/"vsrx-single"/"vsrx_single"/g' "$tf_file" sed -i '' 's/"c8kv-single"/"c8kv_single"/g' "$tf_file" - + + rm ${tf_file}.bak } # generate pululmi yaml from terraform examples @@ -246,7 +247,7 @@ merge_example_files() { echo "Generating merged example: $RESULT_FILE_NAME" echo "${1}_example_*.examples.md" # Find all example files with the specified prefix in OUTPUT_DIR - local EXAMPLES_TO_MERGE=($(find "$OUTPUT_DIR" -maxdepth 1 -name "${1}_*.examples.md")) + local EXAMPLES_TO_MERGE=($(find "$OUTPUT_DIR" -maxdepth 1 -name "${1}_example*.examples.md")) echo "${EXAMPLES_TO_MERGE[@]}" local CONTENTS=""