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});
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)
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
	})
}
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,
    });
});
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());
    }
}
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}
Link a specific secondary private IP address to a NIC
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",
    ],
});
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",
    ])
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
	})
}
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",
        },
    });
});
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());
    }
}
resources:
  nicPrivateIp01:
    type: outscale:NicPrivateIp
    properties:
      nicId: ${outscale_nic.nic01.nic_id}
      privateIps:
        - 10.0.12.34
        - 10.0.12.35
Link several automatic secondary private IP addresses to a NIC
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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
resources:
  nicPrivateIp02:
    type: outscale:NicPrivateIp
    properties:
      nicId: ${outscale_nic.nic01.nic_id}
      secondaryPrivateIpCount: 2
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 string
- The unique name of the resource.
- args NicPrivateIpArgs
- 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 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 string
- The unique name of the resource.
- args NicPrivateIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NicPrivateIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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,
});
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),
})
var nicPrivateIpResource = new NicPrivateIp("nicPrivateIpResource", NicPrivateIpArgs.builder()
    .nicId("string")
    .allowRelink(false)
    .nicPrivateIpId("string")
    .privateIps("string")
    .secondaryPrivateIpCount(0)
    .build());
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)
const nicPrivateIpResource = new outscale.NicPrivateIp("nicPrivateIpResource", {
    nicId: "string",
    allowRelink: false,
    nicPrivateIpId: "string",
    privateIps: ["string"],
    secondaryPrivateIpCount: 0,
});
type: outscale:NicPrivateIp
properties:
    allowRelink: false
    nicId: string
    nicPrivateIpId: string
    privateIps:
        - string
    secondaryPrivateIpCount: 0
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 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.
- NicPrivate stringIp Id 
- PrivateIps List<string>
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- SecondaryPrivate doubleIp Count 
- The number of secondary private IPs to assign to the NIC.
- NicId 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.
- NicPrivate stringIp Id 
- PrivateIps []string
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- SecondaryPrivate float64Ip Count 
- The number of secondary private IPs to assign to the NIC.
- nicId 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.
- nicPrivate StringIp Id 
- privateIps List<String>
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- secondaryPrivate DoubleIp Count 
- The number of secondary private IPs to assign to the NIC.
- nicId 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.
- nicPrivate stringIp Id 
- privateIps string[]
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- secondaryPrivate numberIp Count 
- The number of secondary private IPs to assign to the NIC.
- nic_id 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_ strip_ id 
- 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_ floatip_ count 
- The number of secondary private IPs to assign to the NIC.
- nicId 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.
- nicPrivate StringIp Id 
- privateIps List<String>
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- secondaryPrivate NumberIp Count 
- 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.
- PrimaryPrivate stringIp 
- RequestId string
- Id string
- The provider-assigned unique ID for this managed resource.
- PrimaryPrivate stringIp 
- RequestId string
- id String
- The provider-assigned unique ID for this managed resource.
- primaryPrivate StringIp 
- requestId String
- id string
- The provider-assigned unique ID for this managed resource.
- primaryPrivate stringIp 
- requestId string
- id str
- The provider-assigned unique ID for this managed resource.
- primary_private_ strip 
- request_id str
- id String
- The provider-assigned unique ID for this managed resource.
- primaryPrivate StringIp 
- 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) -> NicPrivateIpfunc 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
- 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.
- 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.
- NicPrivate stringIp Id 
- PrimaryPrivate stringIp 
- 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
- SecondaryPrivate doubleIp Count 
- 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.
- NicPrivate stringIp Id 
- PrimaryPrivate stringIp 
- PrivateIps []string
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- RequestId string
- SecondaryPrivate float64Ip Count 
- 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.
- nicPrivate StringIp Id 
- primaryPrivate StringIp 
- 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
- secondaryPrivate DoubleIp Count 
- 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.
- nicPrivate stringIp Id 
- primaryPrivate stringIp 
- privateIps string[]
- The secondary private IP or IPs you want to assign to the NIC within the IP range of the Subnet.
- requestId string
- secondaryPrivate numberIp Count 
- 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_ strip_ id 
- primary_private_ strip 
- 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_ floatip_ count 
- 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.
- nicPrivate StringIp Id 
- primaryPrivate StringIp 
- 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
- secondaryPrivate NumberIp Count 
- 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 outscaleTerraform Provider.