title: "VipAssociate" title_tag: "huaweicloud.Vpc.VipAssociate" meta_desc: "Documentation for the huaweicloud.Vpc.VipAssociate resource with examples, input properties, output properties, lookup functions, and supporting types." layout: api no_edit_this_page: true


Manages a Vip associate resource within HuaweiCloud.

## Example Usage
using System.Collections.Generic;
using Pulumi;
using Huaweicloud = Pulumi.Huaweicloud;

return await Deployment.RunAsync(() => 
{
    var mynet = Huaweicloud.Vpc.GetSubnet.Invoke(new()
    {
        Name = "subnet-default",
    });

    var myvip = new Huaweicloud.Vpc.Vip("myvip", new()
    {
        NetworkId = mynet.Apply(getSubnetResult => getSubnetResult.Id),
    });

    var vipAssociated = new Huaweicloud.Vpc.VipAssociate("vipAssociated", new()
    {
        VipId = myvip.Id,
        PortIds = new[]
        {
            @var.Port_1,
            @var.Port_2,
        },
    });

});
package main

import (
    "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
    "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
    "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        mynet, err := Vpc.GetSubnet(ctx, &vpc.GetSubnetArgs{
            Name: pulumi.StringRef("subnet-default"),
        }, nil)
        if err != nil {
            return err
        }
        myvip, err := Vpc.NewVip(ctx, "myvip", &Vpc.VipArgs{
            NetworkId: pulumi.String(mynet.Id),
        })
        if err != nil {
            return err
        }
        _, err = Vpc.NewVipAssociate(ctx, "vipAssociated", &Vpc.VipAssociateArgs{
            VipId: myvip.ID(),
            PortIds: pulumi.StringArray{
                pulumi.Any(_var.Port_1),
                pulumi.Any(_var.Port_2),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.huaweicloud.Vpc.VpcFunctions;
import com.pulumi.huaweicloud.Vpc.inputs.GetSubnetArgs;
import com.pulumi.huaweicloud.Vpc.Vip;
import com.pulumi.huaweicloud.Vpc.VipArgs;
import com.pulumi.huaweicloud.Vpc.VipAssociate;
import com.pulumi.huaweicloud.Vpc.VipAssociateArgs;
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 mynet = VpcFunctions.getSubnet(GetSubnetArgs.builder()
            .name("subnet-default")
            .build());

        var myvip = new Vip("myvip", VipArgs.builder()        
            .networkId(mynet.applyValue(getSubnetResult -> getSubnetResult.id()))
            .build());

        var vipAssociated = new VipAssociate("vipAssociated", VipAssociateArgs.builder()        
            .vipId(myvip.id())
            .portIds(            
                var_.port_1(),
                var_.port_2())
            .build());

    }
}
import pulumi
import pulumi_huaweicloud as huaweicloud

mynet = huaweicloud.Vpc.get_subnet(name="subnet-default")
myvip = huaweicloud.vpc.Vip("myvip", network_id=mynet.id)
vip_associated = huaweicloud.vpc.VipAssociate("vipAssociated",
    vip_id=myvip.id,
    port_ids=[
        var["port_1"],
        var["port_2"],
    ])
import * as pulumi from "@pulumi/pulumi";
import * as huaweicloud from "@pulumi/huaweicloud";
import * as pulumi from "@huaweicloudos/pulumi";

const mynet = huaweicloud.Vpc.getSubnet({
    name: "subnet-default",
});
const myvip = new huaweicloud.vpc.Vip("myvip", {networkId: mynet.then(mynet => mynet.id)});
const vipAssociated = new huaweicloud.vpc.VipAssociate("vipAssociated", {
    vipId: myvip.id,
    portIds: [
        _var.port_1,
        _var.port_2,
    ],
});
resources:
  myvip:
    type: huaweicloud:Vpc:Vip
    properties:
      networkId: ${mynet.id}
  vipAssociated:
    type: huaweicloud:Vpc:VipAssociate
    properties:
      vipId: ${myvip.id}
      portIds:
        - ${var.port_1}
        - ${var.port_2}
variables:
  mynet:
    Fn::Invoke:
      Function: huaweicloud:Vpc:getSubnet
      Arguments:
        name: subnet-default

Create VipAssociate Resource {#create}

new VipAssociate(name: string, args: VipAssociateArgs, opts?: CustomResourceOptions);
@overload
def VipAssociate(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 port_ids: Optional[Sequence[str]] = None,
                 region: Optional[str] = None,
                 vip_id: Optional[str] = None)
@overload
def VipAssociate(resource_name: str,
                 args: VipAssociateArgs,
                 opts: Optional[ResourceOptions] = None)
func NewVipAssociate(ctx *Context, name string, args VipAssociateArgs, opts ...ResourceOption) (*VipAssociate, error)
public VipAssociate(string name, VipAssociateArgs args, CustomResourceOptions? opts = null)
public VipAssociate(String name, VipAssociateArgs args)
public VipAssociate(String name, VipAssociateArgs args, CustomResourceOptions options)
type: huaweicloud:Vpc:VipAssociate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args VipAssociateArgs
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 VipAssociateArgs
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 VipAssociateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VipAssociateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args VipAssociateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

VipAssociate Resource Properties {#properties}

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

Inputs

The VipAssociate resource accepts the following input properties:

PortIds List<string>

An array of one or more IDs of the ports to attach the vip to.

VipId string

The ID of vip to attach the ports to.

Region string

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

PortIds []string

An array of one or more IDs of the ports to attach the vip to.

VipId string

The ID of vip to attach the ports to.

Region string

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

portIds List<String>

An array of one or more IDs of the ports to attach the vip to.

vipId String

The ID of vip to attach the ports to.

region String

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

portIds string[]

An array of one or more IDs of the ports to attach the vip to.

vipId string

The ID of vip to attach the ports to.

region string

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

port_ids Sequence[str]

An array of one or more IDs of the ports to attach the vip to.

vip_id str

The ID of vip to attach the ports to.

region str

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

portIds List<String>

An array of one or more IDs of the ports to attach the vip to.

vipId String

The ID of vip to attach the ports to.

region String

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

IpAddresses List<string>

The IP addresses of ports to attach the vip to.

VipIpAddress string

The IP address in the subnet for this vip.

VipSubnetId string

The ID of the subnet this vip connects to.

Id string

The provider-assigned unique ID for this managed resource.

IpAddresses []string

The IP addresses of ports to attach the vip to.

VipIpAddress string

The IP address in the subnet for this vip.

VipSubnetId string

The ID of the subnet this vip connects to.

id String

The provider-assigned unique ID for this managed resource.

ipAddresses List<String>

The IP addresses of ports to attach the vip to.

vipIpAddress String

The IP address in the subnet for this vip.

vipSubnetId String

The ID of the subnet this vip connects to.

id string

The provider-assigned unique ID for this managed resource.

ipAddresses string[]

The IP addresses of ports to attach the vip to.

vipIpAddress string

The IP address in the subnet for this vip.

vipSubnetId string

The ID of the subnet this vip connects to.

id str

The provider-assigned unique ID for this managed resource.

ip_addresses Sequence[str]

The IP addresses of ports to attach the vip to.

vip_ip_address str

The IP address in the subnet for this vip.

vip_subnet_id str

The ID of the subnet this vip connects to.

id String

The provider-assigned unique ID for this managed resource.

ipAddresses List<String>

The IP addresses of ports to attach the vip to.

vipIpAddress String

The IP address in the subnet for this vip.

vipSubnetId String

The ID of the subnet this vip connects to.

Look up Existing VipAssociate Resource {#look-up}

Get an existing VipAssociate 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?: VipAssociateState, opts?: CustomResourceOptions): VipAssociate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        ip_addresses: Optional[Sequence[str]] = None,
        port_ids: Optional[Sequence[str]] = None,
        region: Optional[str] = None,
        vip_id: Optional[str] = None,
        vip_ip_address: Optional[str] = None,
        vip_subnet_id: Optional[str] = None) -> VipAssociate
func GetVipAssociate(ctx *Context, name string, id IDInput, state *VipAssociateState, opts ...ResourceOption) (*VipAssociate, error)
public static VipAssociate Get(string name, Input<string> id, VipAssociateState? state, CustomResourceOptions? opts = null)
public static VipAssociate get(String name, Output<String> id, VipAssociateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
IpAddresses List<string>

The IP addresses of ports to attach the vip to.

PortIds List<string>

An array of one or more IDs of the ports to attach the vip to.

Region string

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

VipId string

The ID of vip to attach the ports to.

VipIpAddress string

The IP address in the subnet for this vip.

VipSubnetId string

The ID of the subnet this vip connects to.

IpAddresses []string

The IP addresses of ports to attach the vip to.

PortIds []string

An array of one or more IDs of the ports to attach the vip to.

Region string

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

VipId string

The ID of vip to attach the ports to.

VipIpAddress string

The IP address in the subnet for this vip.

VipSubnetId string

The ID of the subnet this vip connects to.

ipAddresses List<String>

The IP addresses of ports to attach the vip to.

portIds List<String>

An array of one or more IDs of the ports to attach the vip to.

region String

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

vipId String

The ID of vip to attach the ports to.

vipIpAddress String

The IP address in the subnet for this vip.

vipSubnetId String

The ID of the subnet this vip connects to.

ipAddresses string[]

The IP addresses of ports to attach the vip to.

portIds string[]

An array of one or more IDs of the ports to attach the vip to.

region string

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

vipId string

The ID of vip to attach the ports to.

vipIpAddress string

The IP address in the subnet for this vip.

vipSubnetId string

The ID of the subnet this vip connects to.

ip_addresses Sequence[str]

The IP addresses of ports to attach the vip to.

port_ids Sequence[str]

An array of one or more IDs of the ports to attach the vip to.

region str

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

vip_id str

The ID of vip to attach the ports to.

vip_ip_address str

The IP address in the subnet for this vip.

vip_subnet_id str

The ID of the subnet this vip connects to.

ipAddresses List<String>

The IP addresses of ports to attach the vip to.

portIds List<String>

An array of one or more IDs of the ports to attach the vip to.

region String

The region in which to create the vip associate resource. If omitted, the provider-level region will be used.

vipId String

The ID of vip to attach the ports to.

vipIpAddress String

The IP address in the subnet for this vip.

vipSubnetId String

The ID of the subnet this vip connects to.

Import

Vip associate can be imported using the vip_id and port IDs separated by slashes (no limit on the number of port IDs), e.g.

 $ pulumi import huaweicloud:Vpc/vipAssociate:VipAssociate vip_associated vip_id/port1_id/port2_id

Package Details

Repository
https://github.com/huaweicloud/pulumi-huaweicloud
License
Apache-2.0
Notes

This Pulumi package is based on the huaweicloud Terraform Provider.