1. Packages
  2. Ucloud Provider
  3. API Docs
  4. Vip
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.Vip

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    Provides a VIP resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const fooVpc = new ucloud.Vpc("fooVpc", {
        tag: "tf-acc",
        cidrBlocks: ["192.168.0.0/16"],
    });
    const fooSubnet = new ucloud.Subnet("fooSubnet", {
        tag: "tf-acc",
        cidrBlock: "192.168.1.0/24",
        vpcId: fooVpc.vpcId,
    });
    const fooVip = new ucloud.Vip("fooVip", {
        vpcId: fooVpc.vpcId,
        subnetId: fooSubnet.subnetId,
        remark: "test",
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo_vpc = ucloud.Vpc("fooVpc",
        tag="tf-acc",
        cidr_blocks=["192.168.0.0/16"])
    foo_subnet = ucloud.Subnet("fooSubnet",
        tag="tf-acc",
        cidr_block="192.168.1.0/24",
        vpc_id=foo_vpc.vpc_id)
    foo_vip = ucloud.Vip("fooVip",
        vpc_id=foo_vpc.vpc_id,
        subnet_id=foo_subnet.subnet_id,
        remark="test")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooVpc, err := ucloud.NewVpc(ctx, "fooVpc", &ucloud.VpcArgs{
    			Tag: pulumi.String("tf-acc"),
    			CidrBlocks: pulumi.StringArray{
    				pulumi.String("192.168.0.0/16"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooSubnet, err := ucloud.NewSubnet(ctx, "fooSubnet", &ucloud.SubnetArgs{
    			Tag:       pulumi.String("tf-acc"),
    			CidrBlock: pulumi.String("192.168.1.0/24"),
    			VpcId:     fooVpc.VpcId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ucloud.NewVip(ctx, "fooVip", &ucloud.VipArgs{
    			VpcId:    fooVpc.VpcId,
    			SubnetId: fooSubnet.SubnetId,
    			Remark:   pulumi.String("test"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fooVpc = new Ucloud.Vpc("fooVpc", new()
        {
            Tag = "tf-acc",
            CidrBlocks = new[]
            {
                "192.168.0.0/16",
            },
        });
    
        var fooSubnet = new Ucloud.Subnet("fooSubnet", new()
        {
            Tag = "tf-acc",
            CidrBlock = "192.168.1.0/24",
            VpcId = fooVpc.VpcId,
        });
    
        var fooVip = new Ucloud.Vip("fooVip", new()
        {
            VpcId = fooVpc.VpcId,
            SubnetId = fooSubnet.SubnetId,
            Remark = "test",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.Vpc;
    import com.pulumi.ucloud.VpcArgs;
    import com.pulumi.ucloud.Subnet;
    import com.pulumi.ucloud.SubnetArgs;
    import com.pulumi.ucloud.Vip;
    import com.pulumi.ucloud.VipArgs;
    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 fooVpc = new Vpc("fooVpc", VpcArgs.builder()
                .tag("tf-acc")
                .cidrBlocks("192.168.0.0/16")
                .build());
    
            var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
                .tag("tf-acc")
                .cidrBlock("192.168.1.0/24")
                .vpcId(fooVpc.vpcId())
                .build());
    
            var fooVip = new Vip("fooVip", VipArgs.builder()
                .vpcId(fooVpc.vpcId())
                .subnetId(fooSubnet.subnetId())
                .remark("test")
                .build());
    
        }
    }
    
    resources:
      fooVpc:
        type: ucloud:Vpc
        properties:
          tag: tf-acc
          cidrBlocks:
            - 192.168.0.0/16
      fooSubnet:
        type: ucloud:Subnet
        properties:
          tag: tf-acc
          cidrBlock: 192.168.1.0/24
          vpcId: ${fooVpc.vpcId}
      fooVip:
        type: ucloud:Vip
        properties:
          vpcId: ${fooVpc.vpcId}
          subnetId: ${fooSubnet.subnetId}
          remark: test
    

    Create Vip Resource

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

    Constructor syntax

    new Vip(name: string, args: VipArgs, opts?: CustomResourceOptions);
    @overload
    def Vip(resource_name: str,
            args: VipArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Vip(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            subnet_id: Optional[str] = None,
            vpc_id: Optional[str] = None,
            name: Optional[str] = None,
            remark: Optional[str] = None,
            tag: Optional[str] = None,
            vip_id: Optional[str] = None)
    func NewVip(ctx *Context, name string, args VipArgs, opts ...ResourceOption) (*Vip, error)
    public Vip(string name, VipArgs args, CustomResourceOptions? opts = null)
    public Vip(String name, VipArgs args)
    public Vip(String name, VipArgs args, CustomResourceOptions options)
    
    type: ucloud:Vip
    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 VipArgs
    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 VipArgs
    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 VipArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VipArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VipArgs
    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 vipResource = new Ucloud.Vip("vipResource", new()
    {
        SubnetId = "string",
        VpcId = "string",
        Name = "string",
        Remark = "string",
        Tag = "string",
        VipId = "string",
    });
    
    example, err := ucloud.NewVip(ctx, "vipResource", &ucloud.VipArgs{
    	SubnetId: pulumi.String("string"),
    	VpcId:    pulumi.String("string"),
    	Name:     pulumi.String("string"),
    	Remark:   pulumi.String("string"),
    	Tag:      pulumi.String("string"),
    	VipId:    pulumi.String("string"),
    })
    
    var vipResource = new Vip("vipResource", VipArgs.builder()
        .subnetId("string")
        .vpcId("string")
        .name("string")
        .remark("string")
        .tag("string")
        .vipId("string")
        .build());
    
    vip_resource = ucloud.Vip("vipResource",
        subnet_id="string",
        vpc_id="string",
        name="string",
        remark="string",
        tag="string",
        vip_id="string")
    
    const vipResource = new ucloud.Vip("vipResource", {
        subnetId: "string",
        vpcId: "string",
        name: "string",
        remark: "string",
        tag: "string",
        vipId: "string",
    });
    
    type: ucloud:Vip
    properties:
        name: string
        remark: string
        subnetId: string
        tag: string
        vipId: string
        vpcId: string
    

    Vip 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 Vip resource accepts the following input properties:

    SubnetId string
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    VpcId string
    The ID of VPC linked to the VIP.
    Name string
    Remark string
    The remarks of the VIP. (Default: "").
    Tag string
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VipId string
    The ID of the resource VIP.
    SubnetId string
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    VpcId string
    The ID of VPC linked to the VIP.
    Name string
    Remark string
    The remarks of the VIP. (Default: "").
    Tag string
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VipId string
    The ID of the resource VIP.
    subnetId String
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    vpcId String
    The ID of VPC linked to the VIP.
    name String
    remark String
    The remarks of the VIP. (Default: "").
    tag String
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vipId String
    The ID of the resource VIP.
    subnetId string
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    vpcId string
    The ID of VPC linked to the VIP.
    name string
    remark string
    The remarks of the VIP. (Default: "").
    tag string
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vipId string
    The ID of the resource VIP.
    subnet_id str
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    vpc_id str
    The ID of VPC linked to the VIP.
    name str
    remark str
    The remarks of the VIP. (Default: "").
    tag str
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vip_id str
    The ID of the resource VIP.
    subnetId String
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    vpcId String
    The ID of VPC linked to the VIP.
    name String
    remark String
    The remarks of the VIP. (Default: "").
    tag String
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vipId String
    The ID of the resource VIP.

    Outputs

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

    CreateTime string
    The time of creation for VIP, formatted in RFC3339 time string.
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddress string
    The ip address of the VIP.
    CreateTime string
    The time of creation for VIP, formatted in RFC3339 time string.
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddress string
    The ip address of the VIP.
    createTime String
    The time of creation for VIP, formatted in RFC3339 time string.
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddress String
    The ip address of the VIP.
    createTime string
    The time of creation for VIP, formatted in RFC3339 time string.
    id string
    The provider-assigned unique ID for this managed resource.
    ipAddress string
    The ip address of the VIP.
    create_time str
    The time of creation for VIP, formatted in RFC3339 time string.
    id str
    The provider-assigned unique ID for this managed resource.
    ip_address str
    The ip address of the VIP.
    createTime String
    The time of creation for VIP, formatted in RFC3339 time string.
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddress String
    The ip address of the VIP.

    Look up Existing Vip Resource

    Get an existing Vip 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?: VipState, opts?: CustomResourceOptions): Vip
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            ip_address: Optional[str] = None,
            name: Optional[str] = None,
            remark: Optional[str] = None,
            subnet_id: Optional[str] = None,
            tag: Optional[str] = None,
            vip_id: Optional[str] = None,
            vpc_id: Optional[str] = None) -> Vip
    func GetVip(ctx *Context, name string, id IDInput, state *VipState, opts ...ResourceOption) (*Vip, error)
    public static Vip Get(string name, Input<string> id, VipState? state, CustomResourceOptions? opts = null)
    public static Vip get(String name, Output<String> id, VipState state, CustomResourceOptions options)
    resources:  _:    type: ucloud:Vip    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.
    The following state arguments are supported:
    CreateTime string
    The time of creation for VIP, formatted in RFC3339 time string.
    IpAddress string
    The ip address of the VIP.
    Name string
    Remark string
    The remarks of the VIP. (Default: "").
    SubnetId string
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    Tag string
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VipId string
    The ID of the resource VIP.
    VpcId string
    The ID of VPC linked to the VIP.
    CreateTime string
    The time of creation for VIP, formatted in RFC3339 time string.
    IpAddress string
    The ip address of the VIP.
    Name string
    Remark string
    The remarks of the VIP. (Default: "").
    SubnetId string
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    Tag string
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    VipId string
    The ID of the resource VIP.
    VpcId string
    The ID of VPC linked to the VIP.
    createTime String
    The time of creation for VIP, formatted in RFC3339 time string.
    ipAddress String
    The ip address of the VIP.
    name String
    remark String
    The remarks of the VIP. (Default: "").
    subnetId String
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    tag String
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vipId String
    The ID of the resource VIP.
    vpcId String
    The ID of VPC linked to the VIP.
    createTime string
    The time of creation for VIP, formatted in RFC3339 time string.
    ipAddress string
    The ip address of the VIP.
    name string
    remark string
    The remarks of the VIP. (Default: "").
    subnetId string
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    tag string
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vipId string
    The ID of the resource VIP.
    vpcId string
    The ID of VPC linked to the VIP.
    create_time str
    The time of creation for VIP, formatted in RFC3339 time string.
    ip_address str
    The ip address of the VIP.
    name str
    remark str
    The remarks of the VIP. (Default: "").
    subnet_id str
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    tag str
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vip_id str
    The ID of the resource VIP.
    vpc_id str
    The ID of VPC linked to the VIP.
    createTime String
    The time of creation for VIP, formatted in RFC3339 time string.
    ipAddress String
    The ip address of the VIP.
    name String
    remark String
    The remarks of the VIP. (Default: "").
    subnetId String
    The ID of subnet. If defined vpc_id, the subnet_id is Required.


    tag String
    A tag assigned to VIP, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
    vipId String
    The ID of the resource VIP.
    vpcId String
    The ID of VPC linked to the VIP.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud