scaleway.InstancePrivateNic
Explore with Pulumi AI
Creates and manages Scaleway Instance Private NICs. For more information, see the documentation.
Example Usage
Basic
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const pnic01 = new scaleway.InstancePrivateNic("pnic01", {
privateNetworkId: "fr-par-1/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
serverId: "fr-par-1/11111111-1111-1111-1111-111111111111",
});
import pulumi
import pulumiverse_scaleway as scaleway
pnic01 = scaleway.InstancePrivateNic("pnic01",
private_network_id="fr-par-1/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
server_id="fr-par-1/11111111-1111-1111-1111-111111111111")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := scaleway.NewInstancePrivateNic(ctx, "pnic01", &scaleway.InstancePrivateNicArgs{
PrivateNetworkId: pulumi.String("fr-par-1/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
ServerId: pulumi.String("fr-par-1/11111111-1111-1111-1111-111111111111"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var pnic01 = new Scaleway.InstancePrivateNic("pnic01", new()
{
PrivateNetworkId = "fr-par-1/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
ServerId = "fr-par-1/11111111-1111-1111-1111-111111111111",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.InstancePrivateNic;
import com.pulumi.scaleway.InstancePrivateNicArgs;
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 pnic01 = new InstancePrivateNic("pnic01", InstancePrivateNicArgs.builder()
.privateNetworkId("fr-par-1/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
.serverId("fr-par-1/11111111-1111-1111-1111-111111111111")
.build());
}
}
resources:
pnic01:
type: scaleway:InstancePrivateNic
properties:
privateNetworkId: fr-par-1/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
serverId: fr-par-1/11111111-1111-1111-1111-111111111111
With zone
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const pn01 = new scaleway.VpcPrivateNetwork("pn01", {zone: "fr-par-2"});
const base = new scaleway.InstanceServer("base", {
image: "ubuntu_jammy",
type: "DEV1-S",
zone: pn01.zone,
});
const pnic01 = new scaleway.InstancePrivateNic("pnic01", {
serverId: base.id,
privateNetworkId: pn01.id,
zone: pn01.zone,
});
import pulumi
import pulumiverse_scaleway as scaleway
pn01 = scaleway.VpcPrivateNetwork("pn01", zone="fr-par-2")
base = scaleway.InstanceServer("base",
image="ubuntu_jammy",
type="DEV1-S",
zone=pn01.zone)
pnic01 = scaleway.InstancePrivateNic("pnic01",
server_id=base.id,
private_network_id=pn01.id,
zone=pn01.zone)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pn01, err := scaleway.NewVpcPrivateNetwork(ctx, "pn01", &scaleway.VpcPrivateNetworkArgs{
Zone: pulumi.String("fr-par-2"),
})
if err != nil {
return err
}
base, err := scaleway.NewInstanceServer(ctx, "base", &scaleway.InstanceServerArgs{
Image: pulumi.String("ubuntu_jammy"),
Type: pulumi.String("DEV1-S"),
Zone: pn01.Zone,
})
if err != nil {
return err
}
_, err = scaleway.NewInstancePrivateNic(ctx, "pnic01", &scaleway.InstancePrivateNicArgs{
ServerId: base.ID(),
PrivateNetworkId: pn01.ID(),
Zone: pn01.Zone,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var pn01 = new Scaleway.VpcPrivateNetwork("pn01", new()
{
Zone = "fr-par-2",
});
var @base = new Scaleway.InstanceServer("base", new()
{
Image = "ubuntu_jammy",
Type = "DEV1-S",
Zone = pn01.Zone,
});
var pnic01 = new Scaleway.InstancePrivateNic("pnic01", new()
{
ServerId = @base.Id,
PrivateNetworkId = pn01.Id,
Zone = pn01.Zone,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.VpcPrivateNetwork;
import com.pulumi.scaleway.VpcPrivateNetworkArgs;
import com.pulumi.scaleway.InstanceServer;
import com.pulumi.scaleway.InstanceServerArgs;
import com.pulumi.scaleway.InstancePrivateNic;
import com.pulumi.scaleway.InstancePrivateNicArgs;
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 pn01 = new VpcPrivateNetwork("pn01", VpcPrivateNetworkArgs.builder()
.zone("fr-par-2")
.build());
var base = new InstanceServer("base", InstanceServerArgs.builder()
.image("ubuntu_jammy")
.type("DEV1-S")
.zone(pn01.zone())
.build());
var pnic01 = new InstancePrivateNic("pnic01", InstancePrivateNicArgs.builder()
.serverId(base.id())
.privateNetworkId(pn01.id())
.zone(pn01.zone())
.build());
}
}
resources:
pn01:
type: scaleway:VpcPrivateNetwork
properties:
zone: fr-par-2
base:
type: scaleway:InstanceServer
properties:
image: ubuntu_jammy
type: DEV1-S
zone: ${pn01.zone}
pnic01:
type: scaleway:InstancePrivateNic
properties:
serverId: ${base.id}
privateNetworkId: ${pn01.id}
zone: ${pn01.zone}
Create InstancePrivateNic Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new InstancePrivateNic(name: string, args: InstancePrivateNicArgs, opts?: CustomResourceOptions);
@overload
def InstancePrivateNic(resource_name: str,
args: InstancePrivateNicArgs,
opts: Optional[ResourceOptions] = None)
@overload
def InstancePrivateNic(resource_name: str,
opts: Optional[ResourceOptions] = None,
private_network_id: Optional[str] = None,
server_id: Optional[str] = None,
ip_ids: Optional[Sequence[str]] = None,
tags: Optional[Sequence[str]] = None,
zone: Optional[str] = None)
func NewInstancePrivateNic(ctx *Context, name string, args InstancePrivateNicArgs, opts ...ResourceOption) (*InstancePrivateNic, error)
public InstancePrivateNic(string name, InstancePrivateNicArgs args, CustomResourceOptions? opts = null)
public InstancePrivateNic(String name, InstancePrivateNicArgs args)
public InstancePrivateNic(String name, InstancePrivateNicArgs args, CustomResourceOptions options)
type: scaleway:InstancePrivateNic
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args InstancePrivateNicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args InstancePrivateNicArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InstancePrivateNicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstancePrivateNicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstancePrivateNicArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var instancePrivateNicResource = new Scaleway.InstancePrivateNic("instancePrivateNicResource", new()
{
PrivateNetworkId = "string",
ServerId = "string",
IpIds = new[]
{
"string",
},
Tags = new[]
{
"string",
},
Zone = "string",
});
example, err := scaleway.NewInstancePrivateNic(ctx, "instancePrivateNicResource", &scaleway.InstancePrivateNicArgs{
PrivateNetworkId: pulumi.String("string"),
ServerId: pulumi.String("string"),
IpIds: pulumi.StringArray{
pulumi.String("string"),
},
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Zone: pulumi.String("string"),
})
var instancePrivateNicResource = new InstancePrivateNic("instancePrivateNicResource", InstancePrivateNicArgs.builder()
.privateNetworkId("string")
.serverId("string")
.ipIds("string")
.tags("string")
.zone("string")
.build());
instance_private_nic_resource = scaleway.InstancePrivateNic("instancePrivateNicResource",
private_network_id="string",
server_id="string",
ip_ids=["string"],
tags=["string"],
zone="string")
const instancePrivateNicResource = new scaleway.InstancePrivateNic("instancePrivateNicResource", {
privateNetworkId: "string",
serverId: "string",
ipIds: ["string"],
tags: ["string"],
zone: "string",
});
type: scaleway:InstancePrivateNic
properties:
ipIds:
- string
privateNetworkId: string
serverId: string
tags:
- string
zone: string
InstancePrivateNic Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The InstancePrivateNic resource accepts the following input properties:
- Private
Network stringId - The ID of the private network attached to.
- Server
Id string - The ID of the server associated with.
- Ip
Ids List<string> - IPAM ip list, should be for internal use only
- List<string>
- The tags associated with the private NIC.
- Zone string
zone
) The zone in which the server must be created.
- Private
Network stringId - The ID of the private network attached to.
- Server
Id string - The ID of the server associated with.
- Ip
Ids []string - IPAM ip list, should be for internal use only
- []string
- The tags associated with the private NIC.
- Zone string
zone
) The zone in which the server must be created.
- private
Network StringId - The ID of the private network attached to.
- server
Id String - The ID of the server associated with.
- ip
Ids List<String> - IPAM ip list, should be for internal use only
- List<String>
- The tags associated with the private NIC.
- zone String
zone
) The zone in which the server must be created.
- private
Network stringId - The ID of the private network attached to.
- server
Id string - The ID of the server associated with.
- ip
Ids string[] - IPAM ip list, should be for internal use only
- string[]
- The tags associated with the private NIC.
- zone string
zone
) The zone in which the server must be created.
- private_
network_ strid - The ID of the private network attached to.
- server_
id str - The ID of the server associated with.
- ip_
ids Sequence[str] - IPAM ip list, should be for internal use only
- Sequence[str]
- The tags associated with the private NIC.
- zone str
zone
) The zone in which the server must be created.
- private
Network StringId - The ID of the private network attached to.
- server
Id String - The ID of the server associated with.
- ip
Ids List<String> - IPAM ip list, should be for internal use only
- List<String>
- The tags associated with the private NIC.
- zone String
zone
) The zone in which the server must be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the InstancePrivateNic resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Mac
Address string - The MAC address of the private NIC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Mac
Address string - The MAC address of the private NIC.
- id String
- The provider-assigned unique ID for this managed resource.
- mac
Address String - The MAC address of the private NIC.
- id string
- The provider-assigned unique ID for this managed resource.
- mac
Address string - The MAC address of the private NIC.
- id str
- The provider-assigned unique ID for this managed resource.
- mac_
address str - The MAC address of the private NIC.
- id String
- The provider-assigned unique ID for this managed resource.
- mac
Address String - The MAC address of the private NIC.
Look up Existing InstancePrivateNic Resource
Get an existing InstancePrivateNic resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: InstancePrivateNicState, opts?: CustomResourceOptions): InstancePrivateNic
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ip_ids: Optional[Sequence[str]] = None,
mac_address: Optional[str] = None,
private_network_id: Optional[str] = None,
server_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
zone: Optional[str] = None) -> InstancePrivateNic
func GetInstancePrivateNic(ctx *Context, name string, id IDInput, state *InstancePrivateNicState, opts ...ResourceOption) (*InstancePrivateNic, error)
public static InstancePrivateNic Get(string name, Input<string> id, InstancePrivateNicState? state, CustomResourceOptions? opts = null)
public static InstancePrivateNic get(String name, Output<String> id, InstancePrivateNicState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Ip
Ids List<string> - IPAM ip list, should be for internal use only
- Mac
Address string - The MAC address of the private NIC.
- Private
Network stringId - The ID of the private network attached to.
- Server
Id string - The ID of the server associated with.
- List<string>
- The tags associated with the private NIC.
- Zone string
zone
) The zone in which the server must be created.
- Ip
Ids []string - IPAM ip list, should be for internal use only
- Mac
Address string - The MAC address of the private NIC.
- Private
Network stringId - The ID of the private network attached to.
- Server
Id string - The ID of the server associated with.
- []string
- The tags associated with the private NIC.
- Zone string
zone
) The zone in which the server must be created.
- ip
Ids List<String> - IPAM ip list, should be for internal use only
- mac
Address String - The MAC address of the private NIC.
- private
Network StringId - The ID of the private network attached to.
- server
Id String - The ID of the server associated with.
- List<String>
- The tags associated with the private NIC.
- zone String
zone
) The zone in which the server must be created.
- ip
Ids string[] - IPAM ip list, should be for internal use only
- mac
Address string - The MAC address of the private NIC.
- private
Network stringId - The ID of the private network attached to.
- server
Id string - The ID of the server associated with.
- string[]
- The tags associated with the private NIC.
- zone string
zone
) The zone in which the server must be created.
- ip_
ids Sequence[str] - IPAM ip list, should be for internal use only
- mac_
address str - The MAC address of the private NIC.
- private_
network_ strid - The ID of the private network attached to.
- server_
id str - The ID of the server associated with.
- Sequence[str]
- The tags associated with the private NIC.
- zone str
zone
) The zone in which the server must be created.
- ip
Ids List<String> - IPAM ip list, should be for internal use only
- mac
Address String - The MAC address of the private NIC.
- private
Network StringId - The ID of the private network attached to.
- server
Id String - The ID of the server associated with.
- List<String>
- The tags associated with the private NIC.
- zone String
zone
) The zone in which the server must be created.
Import
Private NICs can be imported using the {zone}/{server_id}/{private_nic_id}
, e.g.
bash
$ pulumi import scaleway:index/instancePrivateNic:InstancePrivateNic pnic01 fr-par-1/11111111-1111-1111-1111-111111111111/22222222-2222-2222-2222-222222222222
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scaleway pulumiverse/pulumi-scaleway
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scaleway
Terraform Provider.