1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. HaVipv2
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.vpc.HaVipv2

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    Provides a VPC Ha Vip resource.

    Highly available virtual IP.

    For information about VPC Ha Vip and how to use it, see What is Ha Vip.

    NOTE: Available since v1.205.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const _default = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultVpc = new alicloud.vpc.Network("defaultVpc", {
        description: name,
        vpcName: name,
        cidrBlock: "192.168.0.0/16",
    });
    const defaultVswitch = new alicloud.vpc.Switch("defaultVswitch", {
        vpcId: defaultVpc.id,
        cidrBlock: "192.168.0.0/21",
        vswitchName: `${name}1`,
        zoneId: _default.then(_default => _default.zones?.[0]?.id),
        description: name,
    });
    const defaultRg = new alicloud.resourcemanager.ResourceGroup("defaultRg", {
        displayName: "tf-example-defaultRg",
        resourceGroupName: `${name}2`,
    });
    const changeRg = new alicloud.resourcemanager.ResourceGroup("changeRg", {
        displayName: "tf-example-changeRg",
        resourceGroupName: `${name}3`,
    });
    const defaultHaVipv2 = new alicloud.vpc.HaVipv2("default", {
        description: name,
        vswitchId: defaultVswitch.id,
        haVipName: name,
        ipAddress: "192.168.1.101",
        resourceGroupId: defaultRg.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.get_zones(available_resource_creation="VSwitch")
    default_vpc = alicloud.vpc.Network("defaultVpc",
        description=name,
        vpc_name=name,
        cidr_block="192.168.0.0/16")
    default_vswitch = alicloud.vpc.Switch("defaultVswitch",
        vpc_id=default_vpc.id,
        cidr_block="192.168.0.0/21",
        vswitch_name=f"{name}1",
        zone_id=default.zones[0].id,
        description=name)
    default_rg = alicloud.resourcemanager.ResourceGroup("defaultRg",
        display_name="tf-example-defaultRg",
        resource_group_name=f"{name}2")
    change_rg = alicloud.resourcemanager.ResourceGroup("changeRg",
        display_name="tf-example-changeRg",
        resource_group_name=f"{name}3")
    default_ha_vipv2 = alicloud.vpc.HaVipv2("default",
        description=name,
        vswitch_id=default_vswitch.id,
        ha_vip_name=name,
        ip_address="192.168.1.101",
        resource_group_id=default_rg.id)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"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, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultVpc, err := vpc.NewNetwork(ctx, "defaultVpc", &vpc.NetworkArgs{
    			Description: pulumi.String(name),
    			VpcName:     pulumi.String(name),
    			CidrBlock:   pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultVswitch, err := vpc.NewSwitch(ctx, "defaultVswitch", &vpc.SwitchArgs{
    			VpcId:       defaultVpc.ID(),
    			CidrBlock:   pulumi.String("192.168.0.0/21"),
    			VswitchName: pulumi.Sprintf("%v1", name),
    			ZoneId:      pulumi.String(_default.Zones[0].Id),
    			Description: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultRg, err := resourcemanager.NewResourceGroup(ctx, "defaultRg", &resourcemanager.ResourceGroupArgs{
    			DisplayName:       pulumi.String("tf-example-defaultRg"),
    			ResourceGroupName: pulumi.Sprintf("%v2", name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = resourcemanager.NewResourceGroup(ctx, "changeRg", &resourcemanager.ResourceGroupArgs{
    			DisplayName:       pulumi.String("tf-example-changeRg"),
    			ResourceGroupName: pulumi.Sprintf("%v3", name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewHaVipv2(ctx, "default", &vpc.HaVipv2Args{
    			Description:     pulumi.String(name),
    			VswitchId:       defaultVswitch.ID(),
    			HaVipName:       pulumi.String(name),
    			IpAddress:       pulumi.String("192.168.1.101"),
    			ResourceGroupId: defaultRg.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultVpc = new AliCloud.Vpc.Network("defaultVpc", new()
        {
            Description = name,
            VpcName = name,
            CidrBlock = "192.168.0.0/16",
        });
    
        var defaultVswitch = new AliCloud.Vpc.Switch("defaultVswitch", new()
        {
            VpcId = defaultVpc.Id,
            CidrBlock = "192.168.0.0/21",
            VswitchName = $"{name}1",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
            Description = name,
        });
    
        var defaultRg = new AliCloud.ResourceManager.ResourceGroup("defaultRg", new()
        {
            DisplayName = "tf-example-defaultRg",
            ResourceGroupName = $"{name}2",
        });
    
        var changeRg = new AliCloud.ResourceManager.ResourceGroup("changeRg", new()
        {
            DisplayName = "tf-example-changeRg",
            ResourceGroupName = $"{name}3",
        });
    
        var defaultHaVipv2 = new AliCloud.Vpc.HaVipv2("default", new()
        {
            Description = name,
            VswitchId = defaultVswitch.Id,
            HaVipName = name,
            IpAddress = "192.168.1.101",
            ResourceGroupId = defaultRg.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.resourcemanager.ResourceGroup;
    import com.pulumi.alicloud.resourcemanager.ResourceGroupArgs;
    import com.pulumi.alicloud.vpc.HaVipv2;
    import com.pulumi.alicloud.vpc.HaVipv2Args;
    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 name = config.get("name").orElse("tf-example");
            final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultVpc = new Network("defaultVpc", NetworkArgs.builder()
                .description(name)
                .vpcName(name)
                .cidrBlock("192.168.0.0/16")
                .build());
    
            var defaultVswitch = new Switch("defaultVswitch", SwitchArgs.builder()
                .vpcId(defaultVpc.id())
                .cidrBlock("192.168.0.0/21")
                .vswitchName(String.format("%s1", name))
                .zoneId(default_.zones()[0].id())
                .description(name)
                .build());
    
            var defaultRg = new ResourceGroup("defaultRg", ResourceGroupArgs.builder()
                .displayName("tf-example-defaultRg")
                .resourceGroupName(String.format("%s2", name))
                .build());
    
            var changeRg = new ResourceGroup("changeRg", ResourceGroupArgs.builder()
                .displayName("tf-example-changeRg")
                .resourceGroupName(String.format("%s3", name))
                .build());
    
            var defaultHaVipv2 = new HaVipv2("defaultHaVipv2", HaVipv2Args.builder()
                .description(name)
                .vswitchId(defaultVswitch.id())
                .haVipName(name)
                .ipAddress("192.168.1.101")
                .resourceGroupId(defaultRg.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultVpc:
        type: alicloud:vpc:Network
        properties:
          description: ${name}
          vpcName: ${name}
          cidrBlock: 192.168.0.0/16
      defaultVswitch:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultVpc.id}
          cidrBlock: 192.168.0.0/21
          vswitchName: ${name}1
          zoneId: ${default.zones[0].id}
          description: ${name}
      defaultRg:
        type: alicloud:resourcemanager:ResourceGroup
        properties:
          displayName: tf-example-defaultRg
          resourceGroupName: ${name}2
      changeRg:
        type: alicloud:resourcemanager:ResourceGroup
        properties:
          displayName: tf-example-changeRg
          resourceGroupName: ${name}3
      defaultHaVipv2:
        type: alicloud:vpc:HaVipv2
        name: default
        properties:
          description: ${name}
          vswitchId: ${defaultVswitch.id}
          haVipName: ${name}
          ipAddress: 192.168.1.101
          resourceGroupId: ${defaultRg.id}
    variables:
      default:
        fn::invoke:
          function: alicloud:getZones
          arguments:
            availableResourceCreation: VSwitch
    

    Create HaVipv2 Resource

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

    Constructor syntax

    new HaVipv2(name: string, args: HaVipv2Args, opts?: CustomResourceOptions);
    @overload
    def HaVipv2(resource_name: str,
                args: HaVipv2Args,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def HaVipv2(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                vswitch_id: Optional[str] = None,
                description: Optional[str] = None,
                ha_vip_name: Optional[str] = None,
                havip_name: Optional[str] = None,
                ip_address: Optional[str] = None,
                resource_group_id: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None)
    func NewHaVipv2(ctx *Context, name string, args HaVipv2Args, opts ...ResourceOption) (*HaVipv2, error)
    public HaVipv2(string name, HaVipv2Args args, CustomResourceOptions? opts = null)
    public HaVipv2(String name, HaVipv2Args args)
    public HaVipv2(String name, HaVipv2Args args, CustomResourceOptions options)
    
    type: alicloud:vpc:HaVipv2
    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 HaVipv2Args
    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 HaVipv2Args
    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 HaVipv2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HaVipv2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HaVipv2Args
    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 haVipv2Resource = new AliCloud.Vpc.HaVipv2("haVipv2Resource", new()
    {
        VswitchId = "string",
        Description = "string",
        HaVipName = "string",
        IpAddress = "string",
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := vpc.NewHaVipv2(ctx, "haVipv2Resource", &vpc.HaVipv2Args{
    	VswitchId:       pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	HaVipName:       pulumi.String("string"),
    	IpAddress:       pulumi.String("string"),
    	ResourceGroupId: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var haVipv2Resource = new HaVipv2("haVipv2Resource", HaVipv2Args.builder()
        .vswitchId("string")
        .description("string")
        .haVipName("string")
        .ipAddress("string")
        .resourceGroupId("string")
        .tags(Map.of("string", "string"))
        .build());
    
    ha_vipv2_resource = alicloud.vpc.HaVipv2("haVipv2Resource",
        vswitch_id="string",
        description="string",
        ha_vip_name="string",
        ip_address="string",
        resource_group_id="string",
        tags={
            "string": "string",
        })
    
    const haVipv2Resource = new alicloud.vpc.HaVipv2("haVipv2Resource", {
        vswitchId: "string",
        description: "string",
        haVipName: "string",
        ipAddress: "string",
        resourceGroupId: "string",
        tags: {
            string: "string",
        },
    });
    
    type: alicloud:vpc:HaVipv2
    properties:
        description: string
        haVipName: string
        ipAddress: string
        resourceGroupId: string
        tags:
            string: string
        vswitchId: string
    

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

    VswitchId string

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    Description string
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    HaVipName string
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    HavipName string
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    IpAddress string
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    ResourceGroupId string
    The ID of the resource group to which the HAVIP belongs.
    Tags Dictionary<string, string>
    The tags of HaVip.
    VswitchId string

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    Description string
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    HaVipName string
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    HavipName string
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    IpAddress string
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    ResourceGroupId string
    The ID of the resource group to which the HAVIP belongs.
    Tags map[string]string
    The tags of HaVip.
    vswitchId String

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    description String
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    haVipName String
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havipName String
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ipAddress String
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    resourceGroupId String
    The ID of the resource group to which the HAVIP belongs.
    tags Map<String,String>
    The tags of HaVip.
    vswitchId string

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    description string
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    haVipName string
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havipName string
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ipAddress string
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    resourceGroupId string
    The ID of the resource group to which the HAVIP belongs.
    tags {[key: string]: string}
    The tags of HaVip.
    vswitch_id str

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    description str
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    ha_vip_name str
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havip_name str
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ip_address str
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    resource_group_id str
    The ID of the resource group to which the HAVIP belongs.
    tags Mapping[str, str]
    The tags of HaVip.
    vswitchId String

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    description String
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    haVipName String
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havipName String
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ipAddress String
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    resourceGroupId String
    The ID of the resource group to which the HAVIP belongs.
    tags Map<String>
    The tags of HaVip.

    Outputs

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

    AssociatedEipAddresses List<string>
    EIP bound to HaVip
    AssociatedInstanceType string
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    AssociatedInstances List<string>
    The ID of the ECS instance to be associated with the HAVIP.
    CreateTime string
    The creation time of the resource
    HaVipId string
    The ID of the HaVip instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    MasterInstanceId string
    The primary instance ID bound to HaVip
    Status string
    The status of this resource instance.
    VpcId string
    The VPC ID to which the HaVip instance belongs
    AssociatedEipAddresses []string
    EIP bound to HaVip
    AssociatedInstanceType string
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    AssociatedInstances []string
    The ID of the ECS instance to be associated with the HAVIP.
    CreateTime string
    The creation time of the resource
    HaVipId string
    The ID of the HaVip instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    MasterInstanceId string
    The primary instance ID bound to HaVip
    Status string
    The status of this resource instance.
    VpcId string
    The VPC ID to which the HaVip instance belongs
    associatedEipAddresses List<String>
    EIP bound to HaVip
    associatedInstanceType String
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associatedInstances List<String>
    The ID of the ECS instance to be associated with the HAVIP.
    createTime String
    The creation time of the resource
    haVipId String
    The ID of the HaVip instance.
    id String
    The provider-assigned unique ID for this managed resource.
    masterInstanceId String
    The primary instance ID bound to HaVip
    status String
    The status of this resource instance.
    vpcId String
    The VPC ID to which the HaVip instance belongs
    associatedEipAddresses string[]
    EIP bound to HaVip
    associatedInstanceType string
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associatedInstances string[]
    The ID of the ECS instance to be associated with the HAVIP.
    createTime string
    The creation time of the resource
    haVipId string
    The ID of the HaVip instance.
    id string
    The provider-assigned unique ID for this managed resource.
    masterInstanceId string
    The primary instance ID bound to HaVip
    status string
    The status of this resource instance.
    vpcId string
    The VPC ID to which the HaVip instance belongs
    associated_eip_addresses Sequence[str]
    EIP bound to HaVip
    associated_instance_type str
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associated_instances Sequence[str]
    The ID of the ECS instance to be associated with the HAVIP.
    create_time str
    The creation time of the resource
    ha_vip_id str
    The ID of the HaVip instance.
    id str
    The provider-assigned unique ID for this managed resource.
    master_instance_id str
    The primary instance ID bound to HaVip
    status str
    The status of this resource instance.
    vpc_id str
    The VPC ID to which the HaVip instance belongs
    associatedEipAddresses List<String>
    EIP bound to HaVip
    associatedInstanceType String
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associatedInstances List<String>
    The ID of the ECS instance to be associated with the HAVIP.
    createTime String
    The creation time of the resource
    haVipId String
    The ID of the HaVip instance.
    id String
    The provider-assigned unique ID for this managed resource.
    masterInstanceId String
    The primary instance ID bound to HaVip
    status String
    The status of this resource instance.
    vpcId String
    The VPC ID to which the HaVip instance belongs

    Look up Existing HaVipv2 Resource

    Get an existing HaVipv2 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?: HaVipv2State, opts?: CustomResourceOptions): HaVipv2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            associated_eip_addresses: Optional[Sequence[str]] = None,
            associated_instance_type: Optional[str] = None,
            associated_instances: Optional[Sequence[str]] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            ha_vip_id: Optional[str] = None,
            ha_vip_name: Optional[str] = None,
            havip_name: Optional[str] = None,
            ip_address: Optional[str] = None,
            master_instance_id: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            vpc_id: Optional[str] = None,
            vswitch_id: Optional[str] = None) -> HaVipv2
    func GetHaVipv2(ctx *Context, name string, id IDInput, state *HaVipv2State, opts ...ResourceOption) (*HaVipv2, error)
    public static HaVipv2 Get(string name, Input<string> id, HaVipv2State? state, CustomResourceOptions? opts = null)
    public static HaVipv2 get(String name, Output<String> id, HaVipv2State state, CustomResourceOptions options)
    resources:  _:    type: alicloud:vpc:HaVipv2    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:
    AssociatedEipAddresses List<string>
    EIP bound to HaVip
    AssociatedInstanceType string
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    AssociatedInstances List<string>
    The ID of the ECS instance to be associated with the HAVIP.
    CreateTime string
    The creation time of the resource
    Description string
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    HaVipId string
    The ID of the HaVip instance.
    HaVipName string
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    HavipName string
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    IpAddress string
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    MasterInstanceId string
    The primary instance ID bound to HaVip
    ResourceGroupId string
    The ID of the resource group to which the HAVIP belongs.
    Status string
    The status of this resource instance.
    Tags Dictionary<string, string>
    The tags of HaVip.
    VpcId string
    The VPC ID to which the HaVip instance belongs
    VswitchId string

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    AssociatedEipAddresses []string
    EIP bound to HaVip
    AssociatedInstanceType string
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    AssociatedInstances []string
    The ID of the ECS instance to be associated with the HAVIP.
    CreateTime string
    The creation time of the resource
    Description string
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    HaVipId string
    The ID of the HaVip instance.
    HaVipName string
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    HavipName string
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    IpAddress string
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    MasterInstanceId string
    The primary instance ID bound to HaVip
    ResourceGroupId string
    The ID of the resource group to which the HAVIP belongs.
    Status string
    The status of this resource instance.
    Tags map[string]string
    The tags of HaVip.
    VpcId string
    The VPC ID to which the HaVip instance belongs
    VswitchId string

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    associatedEipAddresses List<String>
    EIP bound to HaVip
    associatedInstanceType String
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associatedInstances List<String>
    The ID of the ECS instance to be associated with the HAVIP.
    createTime String
    The creation time of the resource
    description String
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    haVipId String
    The ID of the HaVip instance.
    haVipName String
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havipName String
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ipAddress String
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    masterInstanceId String
    The primary instance ID bound to HaVip
    resourceGroupId String
    The ID of the resource group to which the HAVIP belongs.
    status String
    The status of this resource instance.
    tags Map<String,String>
    The tags of HaVip.
    vpcId String
    The VPC ID to which the HaVip instance belongs
    vswitchId String

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    associatedEipAddresses string[]
    EIP bound to HaVip
    associatedInstanceType string
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associatedInstances string[]
    The ID of the ECS instance to be associated with the HAVIP.
    createTime string
    The creation time of the resource
    description string
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    haVipId string
    The ID of the HaVip instance.
    haVipName string
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havipName string
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ipAddress string
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    masterInstanceId string
    The primary instance ID bound to HaVip
    resourceGroupId string
    The ID of the resource group to which the HAVIP belongs.
    status string
    The status of this resource instance.
    tags {[key: string]: string}
    The tags of HaVip.
    vpcId string
    The VPC ID to which the HaVip instance belongs
    vswitchId string

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    associated_eip_addresses Sequence[str]
    EIP bound to HaVip
    associated_instance_type str
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associated_instances Sequence[str]
    The ID of the ECS instance to be associated with the HAVIP.
    create_time str
    The creation time of the resource
    description str
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    ha_vip_id str
    The ID of the HaVip instance.
    ha_vip_name str
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havip_name str
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ip_address str
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    master_instance_id str
    The primary instance ID bound to HaVip
    resource_group_id str
    The ID of the resource group to which the HAVIP belongs.
    status str
    The status of this resource instance.
    tags Mapping[str, str]
    The tags of HaVip.
    vpc_id str
    The VPC ID to which the HaVip instance belongs
    vswitch_id str

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    associatedEipAddresses List<String>
    EIP bound to HaVip
    associatedInstanceType String
    The type of the instance that is bound to the HaVip. Value:

    • EcsInstance: ECS instance.
    • NetworkInterface: ENI instance.
    associatedInstances List<String>
    The ID of the ECS instance to be associated with the HAVIP.
    createTime String
    The creation time of the resource
    description String
    The description of the HAVIP. The description must be 1 to 255 characters in length and cannot start with http:// or https://.
    haVipId String
    The ID of the HaVip instance.
    haVipName String
    The name of the HAVIP. The name must be 1 to 128 characters in length, and cannot start with http:// or https://.
    havipName String
    . Field 'havip_name' has been deprecated from provider version 1.259.0. New field 'ha_vip_name' instead.

    Deprecated: Field 'havip_name' has been deprecated from provider version 1.205.0. New field 'ha_vip_name' instead.

    ipAddress String
    The IP address of the HAVIP. The specified IP address must be an idle IP address that falls within the CIDR block of the vSwitch. If this parameter is not set, an idle IP address from the CIDR block of the vSwitch is randomly assigned to the HAVIP.
    masterInstanceId String
    The primary instance ID bound to HaVip
    resourceGroupId String
    The ID of the resource group to which the HAVIP belongs.
    status String
    The status of this resource instance.
    tags Map<String>
    The tags of HaVip.
    vpcId String
    The VPC ID to which the HaVip instance belongs
    vswitchId String

    The switch ID to which the HaVip instance belongs

    The following arguments will be discarded. Please use new fields as soon as possible:

    Import

    VPC Ha Vip can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/haVipv2:HaVipv2 example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi