1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. EipAssociation
tencentcloud 1.81.186 published on Thursday, Apr 24, 2025 by tencentcloudstack

tencentcloud.EipAssociation

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.186 published on Thursday, Apr 24, 2025 by tencentcloudstack

    Provides an eip resource associated with other resource like CVM, ENI and CLB.

    NOTE: Please DO NOT define allocate_public_ip in tencentcloud.Instance resource when using tencentcloud.EipAssociation.

    Example Usage

    Bind elastic public IP By Instance ID

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const zones = tencentcloud.getAvailabilityZones({});
    const image = tencentcloud.getImages({
        imageTypes: ["PUBLIC_IMAGE"],
        imageNameRegex: "Final",
    });
    const instanceTypes = zones.then(zones => tencentcloud.getInstanceTypes({
        filters: [
            {
                name: "zone",
                values: [zones.zones?.[0]?.name],
            },
            {
                name: "instance-family",
                values: ["S5"],
            },
        ],
        cpuCoreCount: 2,
        excludeSoldOut: true,
    }));
    const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
    const subnet = new tencentcloud.Subnet("subnet", {
        availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
        vpcId: vpc.vpcId,
        cidrBlock: "10.0.0.0/16",
        isMulticast: false,
    });
    const eip = new tencentcloud.Eip("eip", {
        internetChargeType: "TRAFFIC_POSTPAID_BY_HOUR",
        type: "EIP",
    });
    const exampleInstance = new tencentcloud.Instance("exampleInstance", {
        instanceName: "example-cvm",
        availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
        imageId: image.then(image => image.images?.[0]?.imageId),
        instanceType: instanceTypes.then(instanceTypes => instanceTypes.instanceTypes?.[0]?.instanceType),
        systemDiskType: "CLOUD_PREMIUM",
        disableSecurityService: true,
        disableMonitorService: true,
        vpcId: vpc.vpcId,
        subnetId: subnet.subnetId,
    });
    const exampleEipAssociation = new tencentcloud.EipAssociation("exampleEipAssociation", {
        eipId: eip.eipId,
        instanceId: exampleInstance.instanceId,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    zones = tencentcloud.get_availability_zones()
    image = tencentcloud.get_images(image_types=["PUBLIC_IMAGE"],
        image_name_regex="Final")
    instance_types = tencentcloud.get_instance_types(filters=[
            {
                "name": "zone",
                "values": [zones.zones[0].name],
            },
            {
                "name": "instance-family",
                "values": ["S5"],
            },
        ],
        cpu_core_count=2,
        exclude_sold_out=True)
    vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
    subnet = tencentcloud.Subnet("subnet",
        availability_zone=zones.zones[0].name,
        vpc_id=vpc.vpc_id,
        cidr_block="10.0.0.0/16",
        is_multicast=False)
    eip = tencentcloud.Eip("eip",
        internet_charge_type="TRAFFIC_POSTPAID_BY_HOUR",
        type="EIP")
    example_instance = tencentcloud.Instance("exampleInstance",
        instance_name="example-cvm",
        availability_zone=zones.zones[0].name,
        image_id=image.images[0].image_id,
        instance_type=instance_types.instance_types[0].instance_type,
        system_disk_type="CLOUD_PREMIUM",
        disable_security_service=True,
        disable_monitor_service=True,
        vpc_id=vpc.vpc_id,
        subnet_id=subnet.subnet_id)
    example_eip_association = tencentcloud.EipAssociation("exampleEipAssociation",
        eip_id=eip.eip_id,
        instance_id=example_instance.instance_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    zones, err := tencentcloud.GetAvailabilityZones(ctx, &tencentcloud.GetAvailabilityZonesArgs{
    }, nil);
    if err != nil {
    return err
    }
    image, err := tencentcloud.GetImages(ctx, &tencentcloud.GetImagesArgs{
    ImageTypes: []string{
    "PUBLIC_IMAGE",
    },
    ImageNameRegex: pulumi.StringRef("Final"),
    }, nil);
    if err != nil {
    return err
    }
    instanceTypes, err := tencentcloud.GetInstanceTypes(ctx, &tencentcloud.GetInstanceTypesArgs{
    Filters: []tencentcloud.GetInstanceTypesFilter{
    {
    Name: "zone",
    Values: interface{}{
    zones.Zones[0].Name,
    },
    },
    {
    Name: "instance-family",
    Values: []string{
    "S5",
    },
    },
    },
    CpuCoreCount: pulumi.Float64Ref(2),
    ExcludeSoldOut: pulumi.BoolRef(true),
    }, nil);
    if err != nil {
    return err
    }
    vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
    CidrBlock: pulumi.String("10.0.0.0/16"),
    })
    if err != nil {
    return err
    }
    subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
    AvailabilityZone: pulumi.String(zones.Zones[0].Name),
    VpcId: vpc.VpcId,
    CidrBlock: pulumi.String("10.0.0.0/16"),
    IsMulticast: pulumi.Bool(false),
    })
    if err != nil {
    return err
    }
    eip, err := tencentcloud.NewEip(ctx, "eip", &tencentcloud.EipArgs{
    InternetChargeType: pulumi.String("TRAFFIC_POSTPAID_BY_HOUR"),
    Type: pulumi.String("EIP"),
    })
    if err != nil {
    return err
    }
    exampleInstance, err := tencentcloud.NewInstance(ctx, "exampleInstance", &tencentcloud.InstanceArgs{
    InstanceName: pulumi.String("example-cvm"),
    AvailabilityZone: pulumi.String(zones.Zones[0].Name),
    ImageId: pulumi.String(image.Images[0].ImageId),
    InstanceType: pulumi.String(instanceTypes.InstanceTypes[0].InstanceType),
    SystemDiskType: pulumi.String("CLOUD_PREMIUM"),
    DisableSecurityService: pulumi.Bool(true),
    DisableMonitorService: pulumi.Bool(true),
    VpcId: vpc.VpcId,
    SubnetId: subnet.SubnetId,
    })
    if err != nil {
    return err
    }
    _, err = tencentcloud.NewEipAssociation(ctx, "exampleEipAssociation", &tencentcloud.EipAssociationArgs{
    EipId: eip.EipId,
    InstanceId: exampleInstance.InstanceId,
    })
    if err != nil {
    return err
    }
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var zones = Tencentcloud.GetAvailabilityZones.Invoke();
    
        var image = Tencentcloud.GetImages.Invoke(new()
        {
            ImageTypes = new[]
            {
                "PUBLIC_IMAGE",
            },
            ImageNameRegex = "Final",
        });
    
        var instanceTypes = Tencentcloud.GetInstanceTypes.Invoke(new()
        {
            Filters = new[]
            {
                new Tencentcloud.Inputs.GetInstanceTypesFilterInputArgs
                {
                    Name = "zone",
                    Values = new[]
                    {
                        zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
                    },
                },
                new Tencentcloud.Inputs.GetInstanceTypesFilterInputArgs
                {
                    Name = "instance-family",
                    Values = new[]
                    {
                        "S5",
                    },
                },
            },
            CpuCoreCount = 2,
            ExcludeSoldOut = true,
        });
    
        var vpc = new Tencentcloud.Vpc("vpc", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        var subnet = new Tencentcloud.Subnet("subnet", new()
        {
            AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
            VpcId = vpc.VpcId,
            CidrBlock = "10.0.0.0/16",
            IsMulticast = false,
        });
    
        var eip = new Tencentcloud.Eip("eip", new()
        {
            InternetChargeType = "TRAFFIC_POSTPAID_BY_HOUR",
            Type = "EIP",
        });
    
        var exampleInstance = new Tencentcloud.Instance("exampleInstance", new()
        {
            InstanceName = "example-cvm",
            AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
            ImageId = image.Apply(getImagesResult => getImagesResult.Images[0]?.ImageId),
            InstanceType = instanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.InstanceType),
            SystemDiskType = "CLOUD_PREMIUM",
            DisableSecurityService = true,
            DisableMonitorService = true,
            VpcId = vpc.VpcId,
            SubnetId = subnet.SubnetId,
        });
    
        var exampleEipAssociation = new Tencentcloud.EipAssociation("exampleEipAssociation", new()
        {
            EipId = eip.EipId,
            InstanceId = exampleInstance.InstanceId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesArgs;
    import com.pulumi.tencentcloud.inputs.GetImagesArgs;
    import com.pulumi.tencentcloud.inputs.GetInstanceTypesArgs;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.Subnet;
    import com.pulumi.tencentcloud.SubnetArgs;
    import com.pulumi.tencentcloud.Eip;
    import com.pulumi.tencentcloud.EipArgs;
    import com.pulumi.tencentcloud.Instance;
    import com.pulumi.tencentcloud.InstanceArgs;
    import com.pulumi.tencentcloud.EipAssociation;
    import com.pulumi.tencentcloud.EipAssociationArgs;
    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 zones = TencentcloudFunctions.getAvailabilityZones();
    
            final var image = TencentcloudFunctions.getImages(GetImagesArgs.builder()
                .imageTypes("PUBLIC_IMAGE")
                .imageNameRegex("Final")
                .build());
    
            final var instanceTypes = TencentcloudFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .filters(            
                    GetInstanceTypesFilterArgs.builder()
                        .name("zone")
                        .values(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
                        .build(),
                    GetInstanceTypesFilterArgs.builder()
                        .name("instance-family")
                        .values("S5")
                        .build())
                .cpuCoreCount(2)
                .excludeSoldOut(true)
                .build());
    
            var vpc = new Vpc("vpc", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .availabilityZone(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
                .vpcId(vpc.vpcId())
                .cidrBlock("10.0.0.0/16")
                .isMulticast(false)
                .build());
    
            var eip = new Eip("eip", EipArgs.builder()
                .internetChargeType("TRAFFIC_POSTPAID_BY_HOUR")
                .type("EIP")
                .build());
    
            var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
                .instanceName("example-cvm")
                .availabilityZone(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
                .imageId(image.applyValue(getImagesResult -> getImagesResult.images()[0].imageId()))
                .instanceType(instanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].instanceType()))
                .systemDiskType("CLOUD_PREMIUM")
                .disableSecurityService(true)
                .disableMonitorService(true)
                .vpcId(vpc.vpcId())
                .subnetId(subnet.subnetId())
                .build());
    
            var exampleEipAssociation = new EipAssociation("exampleEipAssociation", EipAssociationArgs.builder()
                .eipId(eip.eipId())
                .instanceId(exampleInstance.instanceId())
                .build());
    
        }
    }
    
    resources:
      vpc:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      subnet:
        type: tencentcloud:Subnet
        properties:
          availabilityZone: ${zones.zones[0].name}
          vpcId: ${vpc.vpcId}
          cidrBlock: 10.0.0.0/16
          isMulticast: false
      eip:
        type: tencentcloud:Eip
        properties:
          internetChargeType: TRAFFIC_POSTPAID_BY_HOUR
          type: EIP
      exampleInstance:
        type: tencentcloud:Instance
        properties:
          instanceName: example-cvm
          availabilityZone: ${zones.zones[0].name}
          imageId: ${image.images[0].imageId}
          instanceType: ${instanceTypes.instanceTypes[0].instanceType}
          systemDiskType: CLOUD_PREMIUM
          disableSecurityService: true
          disableMonitorService: true
          vpcId: ${vpc.vpcId}
          subnetId: ${subnet.subnetId}
      exampleEipAssociation:
        type: tencentcloud:EipAssociation
        properties:
          eipId: ${eip.eipId}
          instanceId: ${exampleInstance.instanceId}
    variables:
      zones:
        fn::invoke:
          function: tencentcloud:getAvailabilityZones
          arguments: {}
      image:
        fn::invoke:
          function: tencentcloud:getImages
          arguments:
            imageTypes:
              - PUBLIC_IMAGE
            imageNameRegex: Final
      instanceTypes:
        fn::invoke:
          function: tencentcloud:getInstanceTypes
          arguments:
            filters:
              - name: zone
                values:
                  - ${zones.zones[0].name}
              - name: instance-family
                values:
                  - S5
            cpuCoreCount: 2
            excludeSoldOut: true
    

    Bind elastic public IP By elastic network card

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const zones = tencentcloud.getAvailabilityZones({});
    const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
    const subnet = new tencentcloud.Subnet("subnet", {
        availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
        vpcId: vpc.vpcId,
        cidrBlock: "10.0.0.0/16",
        isMulticast: false,
    });
    const eni = new tencentcloud.Eni("eni", {
        vpcId: vpc.vpcId,
        subnetId: subnet.subnetId,
        description: "eni desc",
        ipv4Count: 1,
    });
    const eip = new tencentcloud.Eip("eip", {
        internetChargeType: "TRAFFIC_POSTPAID_BY_HOUR",
        type: "EIP",
    });
    const example = new tencentcloud.EipAssociation("example", {
        eipId: eip.eipId,
        networkInterfaceId: eni.eniId,
        privateIp: eni.ipv4Infos.apply(ipv4Infos => ipv4Infos[0].ip),
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    zones = tencentcloud.get_availability_zones()
    vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
    subnet = tencentcloud.Subnet("subnet",
        availability_zone=zones.zones[0].name,
        vpc_id=vpc.vpc_id,
        cidr_block="10.0.0.0/16",
        is_multicast=False)
    eni = tencentcloud.Eni("eni",
        vpc_id=vpc.vpc_id,
        subnet_id=subnet.subnet_id,
        description="eni desc",
        ipv4_count=1)
    eip = tencentcloud.Eip("eip",
        internet_charge_type="TRAFFIC_POSTPAID_BY_HOUR",
        type="EIP")
    example = tencentcloud.EipAssociation("example",
        eip_id=eip.eip_id,
        network_interface_id=eni.eni_id,
        private_ip=eni.ipv4_infos[0].ip)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		zones, err := tencentcloud.GetAvailabilityZones(ctx, &tencentcloud.GetAvailabilityZonesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
    			AvailabilityZone: pulumi.String(zones.Zones[0].Name),
    			VpcId:            vpc.VpcId,
    			CidrBlock:        pulumi.String("10.0.0.0/16"),
    			IsMulticast:      pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		eni, err := tencentcloud.NewEni(ctx, "eni", &tencentcloud.EniArgs{
    			VpcId:       vpc.VpcId,
    			SubnetId:    subnet.SubnetId,
    			Description: pulumi.String("eni desc"),
    			Ipv4Count:   pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		eip, err := tencentcloud.NewEip(ctx, "eip", &tencentcloud.EipArgs{
    			InternetChargeType: pulumi.String("TRAFFIC_POSTPAID_BY_HOUR"),
    			Type:               pulumi.String("EIP"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewEipAssociation(ctx, "example", &tencentcloud.EipAssociationArgs{
    			EipId:              eip.EipId,
    			NetworkInterfaceId: eni.EniId,
    			PrivateIp: pulumi.String(eni.Ipv4Infos.ApplyT(func(ipv4Infos []tencentcloud.EniIpv4Info) (*string, error) {
    				return &ipv4Infos[0].Ip, nil
    			}).(pulumi.StringPtrOutput)),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var zones = Tencentcloud.GetAvailabilityZones.Invoke();
    
        var vpc = new Tencentcloud.Vpc("vpc", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        var subnet = new Tencentcloud.Subnet("subnet", new()
        {
            AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
            VpcId = vpc.VpcId,
            CidrBlock = "10.0.0.0/16",
            IsMulticast = false,
        });
    
        var eni = new Tencentcloud.Eni("eni", new()
        {
            VpcId = vpc.VpcId,
            SubnetId = subnet.SubnetId,
            Description = "eni desc",
            Ipv4Count = 1,
        });
    
        var eip = new Tencentcloud.Eip("eip", new()
        {
            InternetChargeType = "TRAFFIC_POSTPAID_BY_HOUR",
            Type = "EIP",
        });
    
        var example = new Tencentcloud.EipAssociation("example", new()
        {
            EipId = eip.EipId,
            NetworkInterfaceId = eni.EniId,
            PrivateIp = eni.Ipv4Infos.Apply(ipv4Infos => ipv4Infos[0].Ip),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesArgs;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.Subnet;
    import com.pulumi.tencentcloud.SubnetArgs;
    import com.pulumi.tencentcloud.Eni;
    import com.pulumi.tencentcloud.EniArgs;
    import com.pulumi.tencentcloud.Eip;
    import com.pulumi.tencentcloud.EipArgs;
    import com.pulumi.tencentcloud.EipAssociation;
    import com.pulumi.tencentcloud.EipAssociationArgs;
    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 zones = TencentcloudFunctions.getAvailabilityZones();
    
            var vpc = new Vpc("vpc", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .availabilityZone(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
                .vpcId(vpc.vpcId())
                .cidrBlock("10.0.0.0/16")
                .isMulticast(false)
                .build());
    
            var eni = new Eni("eni", EniArgs.builder()
                .vpcId(vpc.vpcId())
                .subnetId(subnet.subnetId())
                .description("eni desc")
                .ipv4Count(1)
                .build());
    
            var eip = new Eip("eip", EipArgs.builder()
                .internetChargeType("TRAFFIC_POSTPAID_BY_HOUR")
                .type("EIP")
                .build());
    
            var example = new EipAssociation("example", EipAssociationArgs.builder()
                .eipId(eip.eipId())
                .networkInterfaceId(eni.eniId())
                .privateIp(eni.ipv4Infos().applyValue(ipv4Infos -> ipv4Infos[0].ip()))
                .build());
    
        }
    }
    
    resources:
      vpc:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      subnet:
        type: tencentcloud:Subnet
        properties:
          availabilityZone: ${zones.zones[0].name}
          vpcId: ${vpc.vpcId}
          cidrBlock: 10.0.0.0/16
          isMulticast: false
      eni:
        type: tencentcloud:Eni
        properties:
          vpcId: ${vpc.vpcId}
          subnetId: ${subnet.subnetId}
          description: eni desc
          ipv4Count: 1
      eip:
        type: tencentcloud:Eip
        properties:
          internetChargeType: TRAFFIC_POSTPAID_BY_HOUR
          type: EIP
      example:
        type: tencentcloud:EipAssociation
        properties:
          eipId: ${eip.eipId}
          networkInterfaceId: ${eni.eniId}
          privateIp: ${eni.ipv4Infos[0].ip}
    variables:
      zones:
        fn::invoke:
          function: tencentcloud:getAvailabilityZones
          arguments: {}
    

    Create EipAssociation Resource

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

    Constructor syntax

    new EipAssociation(name: string, args: EipAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def EipAssociation(resource_name: str,
                       args: EipAssociationArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def EipAssociation(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       eip_id: Optional[str] = None,
                       eip_association_id: Optional[str] = None,
                       instance_id: Optional[str] = None,
                       network_interface_id: Optional[str] = None,
                       private_ip: Optional[str] = None)
    func NewEipAssociation(ctx *Context, name string, args EipAssociationArgs, opts ...ResourceOption) (*EipAssociation, error)
    public EipAssociation(string name, EipAssociationArgs args, CustomResourceOptions? opts = null)
    public EipAssociation(String name, EipAssociationArgs args)
    public EipAssociation(String name, EipAssociationArgs args, CustomResourceOptions options)
    
    type: tencentcloud:EipAssociation
    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 EipAssociationArgs
    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 EipAssociationArgs
    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 EipAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EipAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EipAssociationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    EipId string
    The ID of EIP.
    EipAssociationId string
    ID of the resource.
    InstanceId string
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    NetworkInterfaceId string
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    PrivateIp string
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    EipId string
    The ID of EIP.
    EipAssociationId string
    ID of the resource.
    InstanceId string
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    NetworkInterfaceId string
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    PrivateIp string
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eipId String
    The ID of EIP.
    eipAssociationId String
    ID of the resource.
    instanceId String
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    networkInterfaceId String
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    privateIp String
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eipId string
    The ID of EIP.
    eipAssociationId string
    ID of the resource.
    instanceId string
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    networkInterfaceId string
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    privateIp string
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eip_id str
    The ID of EIP.
    eip_association_id str
    ID of the resource.
    instance_id str
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    network_interface_id str
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    private_ip str
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eipId String
    The ID of EIP.
    eipAssociationId String
    ID of the resource.
    instanceId String
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    networkInterfaceId String
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    privateIp String
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing EipAssociation Resource

    Get an existing EipAssociation 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?: EipAssociationState, opts?: CustomResourceOptions): EipAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            eip_association_id: Optional[str] = None,
            eip_id: Optional[str] = None,
            instance_id: Optional[str] = None,
            network_interface_id: Optional[str] = None,
            private_ip: Optional[str] = None) -> EipAssociation
    func GetEipAssociation(ctx *Context, name string, id IDInput, state *EipAssociationState, opts ...ResourceOption) (*EipAssociation, error)
    public static EipAssociation Get(string name, Input<string> id, EipAssociationState? state, CustomResourceOptions? opts = null)
    public static EipAssociation get(String name, Output<String> id, EipAssociationState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:EipAssociation    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:
    EipAssociationId string
    ID of the resource.
    EipId string
    The ID of EIP.
    InstanceId string
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    NetworkInterfaceId string
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    PrivateIp string
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    EipAssociationId string
    ID of the resource.
    EipId string
    The ID of EIP.
    InstanceId string
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    NetworkInterfaceId string
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    PrivateIp string
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eipAssociationId String
    ID of the resource.
    eipId String
    The ID of EIP.
    instanceId String
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    networkInterfaceId String
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    privateIp String
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eipAssociationId string
    ID of the resource.
    eipId string
    The ID of EIP.
    instanceId string
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    networkInterfaceId string
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    privateIp string
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eip_association_id str
    ID of the resource.
    eip_id str
    The ID of EIP.
    instance_id str
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    network_interface_id str
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    private_ip str
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.
    eipAssociationId String
    ID of the resource.
    eipId String
    The ID of EIP.
    instanceId String
    The CVM or CLB instance id going to bind with the EIP. This field is conflict with network_interface_id and private_ip fields.
    networkInterfaceId String
    Indicates the network interface id like eni-xxxxxx. This field is conflict with instance_id.
    privateIp String
    Indicates an IP belongs to the network_interface_id. This field is conflict with instance_id.

    Import

    Eip association can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/eipAssociation:EipAssociation bar eip-41s6jwy4::ins-34jwj3
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.186 published on Thursday, Apr 24, 2025 by tencentcloudstack