1. Packages
  2. Outscale Provider
  3. API Docs
  4. NicPrivateIp
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.NicPrivateIp

Explore with Pulumi AI

Manages a NIC’s private IPs.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

Required resources

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const net01 = new outscale.Net("net01", {ipRange: "10.0.0.0/16"});
const subnet01 = new outscale.Subnet("subnet01", {
    subregionName: `${_var.region}a`,
    ipRange: "10.0.0.0/16",
    netId: net01.netId,
});
const nic01 = new outscale.Nic("nic01", {subnetId: subnet01.subnetId});
Copy
import pulumi
import pulumi_outscale as outscale

net01 = outscale.Net("net01", ip_range="10.0.0.0/16")
subnet01 = outscale.Subnet("subnet01",
    subregion_name=f"{var['region']}a",
    ip_range="10.0.0.0/16",
    net_id=net01.net_id)
nic01 = outscale.Nic("nic01", subnet_id=subnet01.subnet_id)
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		net01, err := outscale.NewNet(ctx, "net01", &outscale.NetArgs{
			IpRange: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		subnet01, err := outscale.NewSubnet(ctx, "subnet01", &outscale.SubnetArgs{
			SubregionName: pulumi.Sprintf("%va", _var.Region),
			IpRange:       pulumi.String("10.0.0.0/16"),
			NetId:         net01.NetId,
		})
		if err != nil {
			return err
		}
		_, err = outscale.NewNic(ctx, "nic01", &outscale.NicArgs{
			SubnetId: subnet01.SubnetId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var net01 = new Outscale.Net("net01", new()
    {
        IpRange = "10.0.0.0/16",
    });

    var subnet01 = new Outscale.Subnet("subnet01", new()
    {
        SubregionName = $"{@var.Region}a",
        IpRange = "10.0.0.0/16",
        NetId = net01.NetId,
    });

    var nic01 = new Outscale.Nic("nic01", new()
    {
        SubnetId = subnet01.SubnetId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.Net;
import com.pulumi.outscale.NetArgs;
import com.pulumi.outscale.Subnet;
import com.pulumi.outscale.SubnetArgs;
import com.pulumi.outscale.Nic;
import com.pulumi.outscale.NicArgs;
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 net01 = new Net("net01", NetArgs.builder()
            .ipRange("10.0.0.0/16")
            .build());

        var subnet01 = new Subnet("subnet01", SubnetArgs.builder()
            .subregionName(String.format("%sa", var_.region()))
            .ipRange("10.0.0.0/16")
            .netId(net01.netId())
            .build());

        var nic01 = new Nic("nic01", NicArgs.builder()
            .subnetId(subnet01.subnetId())
            .build());

    }
}
Copy
resources:
  net01:
    type: outscale:Net
    properties:
      ipRange: 10.0.0.0/16
  subnet01:
    type: outscale:Subnet
    properties:
      subregionName: ${var.region}a
      ipRange: 10.0.0.0/16
      netId: ${net01.netId}
  nic01:
    type: outscale:Nic
    properties:
      subnetId: ${subnet01.subnetId}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const nicPrivateIp01 = new outscale.NicPrivateIp("nicPrivateIp01", {
    nicId: outscale_nic.nic01.nic_id,
    privateIps: [
        "10.0.12.34",
        "10.0.12.35",
    ],
});
Copy
import pulumi
import pulumi_outscale as outscale

nic_private_ip01 = outscale.NicPrivateIp("nicPrivateIp01",
    nic_id=outscale_nic["nic01"]["nic_id"],
    private_ips=[
        "10.0.12.34",
        "10.0.12.35",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewNicPrivateIp(ctx, "nicPrivateIp01", &outscale.NicPrivateIpArgs{
			NicId: pulumi.Any(outscale_nic.Nic01.Nic_id),
			PrivateIps: pulumi.StringArray{
				pulumi.String("10.0.12.34"),
				pulumi.String("10.0.12.35"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var nicPrivateIp01 = new Outscale.NicPrivateIp("nicPrivateIp01", new()
    {
        NicId = outscale_nic.Nic01.Nic_id,
        PrivateIps = new[]
        {
            "10.0.12.34",
            "10.0.12.35",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.NicPrivateIp;
import com.pulumi.outscale.NicPrivateIpArgs;
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 nicPrivateIp01 = new NicPrivateIp("nicPrivateIp01", NicPrivateIpArgs.builder()
            .nicId(outscale_nic.nic01().nic_id())
            .privateIps(            
                "10.0.12.34",
                "10.0.12.35")
            .build());

    }
}
Copy
resources:
  nicPrivateIp01:
    type: outscale:NicPrivateIp
    properties:
      nicId: ${outscale_nic.nic01.nic_id}
      privateIps:
        - 10.0.12.34
        - 10.0.12.35
Copy
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const nicPrivateIp02 = new outscale.NicPrivateIp("nicPrivateIp02", {
    nicId: outscale_nic.nic01.nic_id,
    secondaryPrivateIpCount: 2,
});
Copy
import pulumi
import pulumi_outscale as outscale

nic_private_ip02 = outscale.NicPrivateIp("nicPrivateIp02",
    nic_id=outscale_nic["nic01"]["nic_id"],
    secondary_private_ip_count=2)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewNicPrivateIp(ctx, "nicPrivateIp02", &outscale.NicPrivateIpArgs{
			NicId:                   pulumi.Any(outscale_nic.Nic01.Nic_id),
			SecondaryPrivateIpCount: pulumi.Float64(2),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var nicPrivateIp02 = new Outscale.NicPrivateIp("nicPrivateIp02", new()
    {
        NicId = outscale_nic.Nic01.Nic_id,
        SecondaryPrivateIpCount = 2,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.NicPrivateIp;
import com.pulumi.outscale.NicPrivateIpArgs;
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 nicPrivateIp02 = new NicPrivateIp("nicPrivateIp02", NicPrivateIpArgs.builder()
            .nicId(outscale_nic.nic01().nic_id())
            .secondaryPrivateIpCount(2)
            .build());

    }
}
Copy
resources:
  nicPrivateIp02:
    type: outscale:NicPrivateIp
    properties:
      nicId: ${outscale_nic.nic01.nic_id}
      secondaryPrivateIpCount: 2
Copy

Create NicPrivateIp Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NicPrivateIp(name: string, args: NicPrivateIpArgs, opts?: CustomResourceOptions);
@overload
def NicPrivateIp(resource_name: str,
                 args: NicPrivateIpInitArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def NicPrivateIp(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 nic_id: Optional[str] = None,
                 allow_relink: Optional[bool] = None,
                 nic_private_ip_id: Optional[str] = None,
                 private_ips: Optional[Sequence[str]] = None,
                 secondary_private_ip_count: Optional[float] = None)
func NewNicPrivateIp(ctx *Context, name string, args NicPrivateIpArgs, opts ...ResourceOption) (*NicPrivateIp, error)
public NicPrivateIp(string name, NicPrivateIpArgs args, CustomResourceOptions? opts = null)
public NicPrivateIp(String name, NicPrivateIpArgs args)
public NicPrivateIp(String name, NicPrivateIpArgs args, CustomResourceOptions options)
type: outscale:NicPrivateIp
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NicPrivateIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NicPrivateIpInitArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NicPrivateIpArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NicPrivateIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NicPrivateIpArgs
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 nicPrivateIpResource = new Outscale.NicPrivateIp("nicPrivateIpResource", new()
{
    NicId = "string",
    AllowRelink = false,
    NicPrivateIpId = "string",
    PrivateIps = new[]
    {
        "string",
    },
    SecondaryPrivateIpCount = 0,
});
Copy
example, err := outscale.NewNicPrivateIp(ctx, "nicPrivateIpResource", &outscale.NicPrivateIpArgs{
	NicId:          pulumi.String("string"),
	AllowRelink:    pulumi.Bool(false),
	NicPrivateIpId: pulumi.String("string"),
	PrivateIps: pulumi.StringArray{
		pulumi.String("string"),
	},
	SecondaryPrivateIpCount: pulumi.Float64(0),
})
Copy
var nicPrivateIpResource = new NicPrivateIp("nicPrivateIpResource", NicPrivateIpArgs.builder()
    .nicId("string")
    .allowRelink(false)
    .nicPrivateIpId("string")
    .privateIps("string")
    .secondaryPrivateIpCount(0)
    .build());
Copy
nic_private_ip_resource = outscale.NicPrivateIp("nicPrivateIpResource",
    nic_id="string",
    allow_relink=False,
    nic_private_ip_id="string",
    private_ips=["string"],
    secondary_private_ip_count=0)
Copy
const nicPrivateIpResource = new outscale.NicPrivateIp("nicPrivateIpResource", {
    nicId: "string",
    allowRelink: false,
    nicPrivateIpId: "string",
    privateIps: ["string"],
    secondaryPrivateIpCount: 0,
});
Copy
type: outscale:NicPrivateIp
properties:
    allowRelink: false
    nicId: string
    nicPrivateIpId: string
    privateIps:
        - string
    secondaryPrivateIpCount: 0
Copy

NicPrivateIp Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The NicPrivateIp resource accepts the following input properties:

NicId This property is required. string
The ID of the NIC.
AllowRelink bool
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
NicPrivateIpId string
PrivateIps List<string>
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
SecondaryPrivateIpCount double
The number of secondary private IPs to assign to the NIC.
NicId This property is required. string
The ID of the NIC.
AllowRelink bool
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
NicPrivateIpId string
PrivateIps []string
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
SecondaryPrivateIpCount float64
The number of secondary private IPs to assign to the NIC.
nicId This property is required. String
The ID of the NIC.
allowRelink Boolean
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nicPrivateIpId String
privateIps List<String>
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
secondaryPrivateIpCount Double
The number of secondary private IPs to assign to the NIC.
nicId This property is required. string
The ID of the NIC.
allowRelink boolean
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nicPrivateIpId string
privateIps string[]
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
secondaryPrivateIpCount number
The number of secondary private IPs to assign to the NIC.
nic_id This property is required. str
The ID of the NIC.
allow_relink bool
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nic_private_ip_id str
private_ips Sequence[str]
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
secondary_private_ip_count float
The number of secondary private IPs to assign to the NIC.
nicId This property is required. String
The ID of the NIC.
allowRelink Boolean
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nicPrivateIpId String
privateIps List<String>
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
secondaryPrivateIpCount Number
The number of secondary private IPs to assign to the NIC.

Outputs

All input properties are implicitly available as output properties. Additionally, the NicPrivateIp resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
PrimaryPrivateIp string
RequestId string
Id string
The provider-assigned unique ID for this managed resource.
PrimaryPrivateIp string
RequestId string
id String
The provider-assigned unique ID for this managed resource.
primaryPrivateIp String
requestId String
id string
The provider-assigned unique ID for this managed resource.
primaryPrivateIp string
requestId string
id str
The provider-assigned unique ID for this managed resource.
primary_private_ip str
request_id str
id String
The provider-assigned unique ID for this managed resource.
primaryPrivateIp String
requestId String

Look up Existing NicPrivateIp Resource

Get an existing NicPrivateIp 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?: NicPrivateIpState, opts?: CustomResourceOptions): NicPrivateIp
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allow_relink: Optional[bool] = None,
        nic_id: Optional[str] = None,
        nic_private_ip_id: Optional[str] = None,
        primary_private_ip: Optional[str] = None,
        private_ips: Optional[Sequence[str]] = None,
        request_id: Optional[str] = None,
        secondary_private_ip_count: Optional[float] = None) -> NicPrivateIp
func GetNicPrivateIp(ctx *Context, name string, id IDInput, state *NicPrivateIpState, opts ...ResourceOption) (*NicPrivateIp, error)
public static NicPrivateIp Get(string name, Input<string> id, NicPrivateIpState? state, CustomResourceOptions? opts = null)
public static NicPrivateIp get(String name, Output<String> id, NicPrivateIpState state, CustomResourceOptions options)
resources:  _:    type: outscale:NicPrivateIp    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
AllowRelink bool
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
NicId string
The ID of the NIC.
NicPrivateIpId string
PrimaryPrivateIp string
PrivateIps List<string>
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
RequestId string
SecondaryPrivateIpCount double
The number of secondary private IPs to assign to the NIC.
AllowRelink bool
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
NicId string
The ID of the NIC.
NicPrivateIpId string
PrimaryPrivateIp string
PrivateIps []string
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
RequestId string
SecondaryPrivateIpCount float64
The number of secondary private IPs to assign to the NIC.
allowRelink Boolean
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nicId String
The ID of the NIC.
nicPrivateIpId String
primaryPrivateIp String
privateIps List<String>
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
requestId String
secondaryPrivateIpCount Double
The number of secondary private IPs to assign to the NIC.
allowRelink boolean
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nicId string
The ID of the NIC.
nicPrivateIpId string
primaryPrivateIp string
privateIps string[]
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
requestId string
secondaryPrivateIpCount number
The number of secondary private IPs to assign to the NIC.
allow_relink bool
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nic_id str
The ID of the NIC.
nic_private_ip_id str
primary_private_ip str
private_ips Sequence[str]
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
request_id str
secondary_private_ip_count float
The number of secondary private IPs to assign to the NIC.
allowRelink Boolean
If true, allows an IP that is already assigned to another NIC in the same Subnet to be assigned to the NIC you specified.
nicId String
The ID of the NIC.
nicPrivateIpId String
primaryPrivateIp String
privateIps List<String>
The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
requestId String
secondaryPrivateIpCount Number
The number of secondary private IPs to assign to the NIC.

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.