1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. EipPublicAddressAdjust
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.EipPublicAddressAdjust

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a eip public_address_adjust

    NOTE: This interface is used to change the IP address. It supports changing the common public IP of the CVM instance and the EIP of the monthly bandwidth. address_id and instance_id cannot exist at the same time. When address_id is passed, only the EIP of the monthly bandwidth is supported.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    // create vpc
    const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
    // create vpc subnet
    const subnet = new tencentcloud.Subnet("subnet", {
        vpcId: vpc.vpcId,
        availabilityZone: "ap-guangzhou-6",
        cidrBlock: "10.0.20.0/28",
        isMulticast: false,
    });
    // create cvm
    const exampleInstance = new tencentcloud.Instance("exampleInstance", {
        instanceName: "tf_example",
        availabilityZone: "ap-guangzhou-6",
        imageId: "img-9qrfy1xt",
        instanceType: "SA3.MEDIUM4",
        systemDiskType: "CLOUD_HSSD",
        systemDiskSize: 100,
        hostname: "example",
        projectId: 0,
        vpcId: vpc.vpcId,
        subnetId: subnet.subnetId,
        allocatePublicIp: true,
        internetMaxBandwidthOut: 10,
        dataDisks: [{
            dataDiskType: "CLOUD_HSSD",
            dataDiskSize: 50,
            encrypt: false,
        }],
        tags: {
            tagKey: "tagValue",
        },
    });
    // create eip
    const exampleEip = new tencentcloud.Eip("exampleEip", {});
    const exampleEipPublicAddressAdjust = new tencentcloud.EipPublicAddressAdjust("exampleEipPublicAddressAdjust", {
        instanceId: exampleInstance.instanceId,
        addressId: exampleEip.eipId,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    # create vpc
    vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
    # create vpc subnet
    subnet = tencentcloud.Subnet("subnet",
        vpc_id=vpc.vpc_id,
        availability_zone="ap-guangzhou-6",
        cidr_block="10.0.20.0/28",
        is_multicast=False)
    # create cvm
    example_instance = tencentcloud.Instance("exampleInstance",
        instance_name="tf_example",
        availability_zone="ap-guangzhou-6",
        image_id="img-9qrfy1xt",
        instance_type="SA3.MEDIUM4",
        system_disk_type="CLOUD_HSSD",
        system_disk_size=100,
        hostname="example",
        project_id=0,
        vpc_id=vpc.vpc_id,
        subnet_id=subnet.subnet_id,
        allocate_public_ip=True,
        internet_max_bandwidth_out=10,
        data_disks=[{
            "data_disk_type": "CLOUD_HSSD",
            "data_disk_size": 50,
            "encrypt": False,
        }],
        tags={
            "tagKey": "tagValue",
        })
    # create eip
    example_eip = tencentcloud.Eip("exampleEip")
    example_eip_public_address_adjust = tencentcloud.EipPublicAddressAdjust("exampleEipPublicAddressAdjust",
        instance_id=example_instance.instance_id,
        address_id=example_eip.eip_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 {
    		// create vpc
    		vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		// create vpc subnet
    		subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
    			VpcId:            vpc.VpcId,
    			AvailabilityZone: pulumi.String("ap-guangzhou-6"),
    			CidrBlock:        pulumi.String("10.0.20.0/28"),
    			IsMulticast:      pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		// create cvm
    		exampleInstance, err := tencentcloud.NewInstance(ctx, "exampleInstance", &tencentcloud.InstanceArgs{
    			InstanceName:            pulumi.String("tf_example"),
    			AvailabilityZone:        pulumi.String("ap-guangzhou-6"),
    			ImageId:                 pulumi.String("img-9qrfy1xt"),
    			InstanceType:            pulumi.String("SA3.MEDIUM4"),
    			SystemDiskType:          pulumi.String("CLOUD_HSSD"),
    			SystemDiskSize:          pulumi.Float64(100),
    			Hostname:                pulumi.String("example"),
    			ProjectId:               pulumi.Float64(0),
    			VpcId:                   vpc.VpcId,
    			SubnetId:                subnet.SubnetId,
    			AllocatePublicIp:        pulumi.Bool(true),
    			InternetMaxBandwidthOut: pulumi.Float64(10),
    			DataDisks: tencentcloud.InstanceDataDiskArray{
    				&tencentcloud.InstanceDataDiskArgs{
    					DataDiskType: pulumi.String("CLOUD_HSSD"),
    					DataDiskSize: pulumi.Float64(50),
    					Encrypt:      pulumi.Bool(false),
    				},
    			},
    			Tags: pulumi.StringMap{
    				"tagKey": pulumi.String("tagValue"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// create eip
    		exampleEip, err := tencentcloud.NewEip(ctx, "exampleEip", nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewEipPublicAddressAdjust(ctx, "exampleEipPublicAddressAdjust", &tencentcloud.EipPublicAddressAdjustArgs{
    			InstanceId: exampleInstance.InstanceId,
    			AddressId:  exampleEip.EipId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        // create vpc
        var vpc = new Tencentcloud.Vpc("vpc", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        // create vpc subnet
        var subnet = new Tencentcloud.Subnet("subnet", new()
        {
            VpcId = vpc.VpcId,
            AvailabilityZone = "ap-guangzhou-6",
            CidrBlock = "10.0.20.0/28",
            IsMulticast = false,
        });
    
        // create cvm
        var exampleInstance = new Tencentcloud.Instance("exampleInstance", new()
        {
            InstanceName = "tf_example",
            AvailabilityZone = "ap-guangzhou-6",
            ImageId = "img-9qrfy1xt",
            InstanceType = "SA3.MEDIUM4",
            SystemDiskType = "CLOUD_HSSD",
            SystemDiskSize = 100,
            Hostname = "example",
            ProjectId = 0,
            VpcId = vpc.VpcId,
            SubnetId = subnet.SubnetId,
            AllocatePublicIp = true,
            InternetMaxBandwidthOut = 10,
            DataDisks = new[]
            {
                new Tencentcloud.Inputs.InstanceDataDiskArgs
                {
                    DataDiskType = "CLOUD_HSSD",
                    DataDiskSize = 50,
                    Encrypt = false,
                },
            },
            Tags = 
            {
                { "tagKey", "tagValue" },
            },
        });
    
        // create eip
        var exampleEip = new Tencentcloud.Eip("exampleEip");
    
        var exampleEipPublicAddressAdjust = new Tencentcloud.EipPublicAddressAdjust("exampleEipPublicAddressAdjust", new()
        {
            InstanceId = exampleInstance.InstanceId,
            AddressId = exampleEip.EipId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.Subnet;
    import com.pulumi.tencentcloud.SubnetArgs;
    import com.pulumi.tencentcloud.Instance;
    import com.pulumi.tencentcloud.InstanceArgs;
    import com.pulumi.tencentcloud.inputs.InstanceDataDiskArgs;
    import com.pulumi.tencentcloud.Eip;
    import com.pulumi.tencentcloud.EipPublicAddressAdjust;
    import com.pulumi.tencentcloud.EipPublicAddressAdjustArgs;
    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) {
            // create vpc
            var vpc = new Vpc("vpc", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            // create vpc subnet
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .vpcId(vpc.vpcId())
                .availabilityZone("ap-guangzhou-6")
                .cidrBlock("10.0.20.0/28")
                .isMulticast(false)
                .build());
    
            // create cvm
            var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
                .instanceName("tf_example")
                .availabilityZone("ap-guangzhou-6")
                .imageId("img-9qrfy1xt")
                .instanceType("SA3.MEDIUM4")
                .systemDiskType("CLOUD_HSSD")
                .systemDiskSize(100)
                .hostname("example")
                .projectId(0)
                .vpcId(vpc.vpcId())
                .subnetId(subnet.subnetId())
                .allocatePublicIp(true)
                .internetMaxBandwidthOut(10)
                .dataDisks(InstanceDataDiskArgs.builder()
                    .dataDiskType("CLOUD_HSSD")
                    .dataDiskSize(50)
                    .encrypt(false)
                    .build())
                .tags(Map.of("tagKey", "tagValue"))
                .build());
    
            // create eip
            var exampleEip = new Eip("exampleEip");
    
            var exampleEipPublicAddressAdjust = new EipPublicAddressAdjust("exampleEipPublicAddressAdjust", EipPublicAddressAdjustArgs.builder()
                .instanceId(exampleInstance.instanceId())
                .addressId(exampleEip.eipId())
                .build());
    
        }
    }
    
    resources:
      # create vpc
      vpc:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      # create vpc subnet
      subnet:
        type: tencentcloud:Subnet
        properties:
          vpcId: ${vpc.vpcId}
          availabilityZone: ap-guangzhou-6
          cidrBlock: 10.0.20.0/28
          isMulticast: false
      # create cvm
      exampleInstance:
        type: tencentcloud:Instance
        properties:
          instanceName: tf_example
          availabilityZone: ap-guangzhou-6
          imageId: img-9qrfy1xt
          instanceType: SA3.MEDIUM4
          systemDiskType: CLOUD_HSSD
          systemDiskSize: 100
          hostname: example
          projectId: 0
          vpcId: ${vpc.vpcId}
          subnetId: ${subnet.subnetId}
          allocatePublicIp: true
          internetMaxBandwidthOut: 10
          dataDisks:
            - dataDiskType: CLOUD_HSSD
              dataDiskSize: 50
              encrypt: false
          tags:
            tagKey: tagValue
      # create eip
      exampleEip:
        type: tencentcloud:Eip
      exampleEipPublicAddressAdjust:
        type: tencentcloud:EipPublicAddressAdjust
        properties:
          instanceId: ${exampleInstance.instanceId}
          addressId: ${exampleEip.eipId}
    

    Create EipPublicAddressAdjust Resource

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

    Constructor syntax

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

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

    AddressId string
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    EipPublicAddressAdjustId string
    ID of the resource.
    InstanceId string
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    AddressId string
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    EipPublicAddressAdjustId string
    ID of the resource.
    InstanceId string
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    addressId String
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eipPublicAddressAdjustId String
    ID of the resource.
    instanceId String
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    addressId string
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eipPublicAddressAdjustId string
    ID of the resource.
    instanceId string
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    address_id str
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eip_public_address_adjust_id str
    ID of the resource.
    instance_id str
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    addressId String
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eipPublicAddressAdjustId String
    ID of the resource.
    instanceId String
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EipPublicAddressAdjust 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 EipPublicAddressAdjust Resource

    Get an existing EipPublicAddressAdjust 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?: EipPublicAddressAdjustState, opts?: CustomResourceOptions): EipPublicAddressAdjust
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            address_id: Optional[str] = None,
            eip_public_address_adjust_id: Optional[str] = None,
            instance_id: Optional[str] = None) -> EipPublicAddressAdjust
    func GetEipPublicAddressAdjust(ctx *Context, name string, id IDInput, state *EipPublicAddressAdjustState, opts ...ResourceOption) (*EipPublicAddressAdjust, error)
    public static EipPublicAddressAdjust Get(string name, Input<string> id, EipPublicAddressAdjustState? state, CustomResourceOptions? opts = null)
    public static EipPublicAddressAdjust get(String name, Output<String> id, EipPublicAddressAdjustState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:EipPublicAddressAdjust    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:
    AddressId string
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    EipPublicAddressAdjustId string
    ID of the resource.
    InstanceId string
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    AddressId string
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    EipPublicAddressAdjustId string
    ID of the resource.
    InstanceId string
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    addressId String
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eipPublicAddressAdjustId String
    ID of the resource.
    instanceId String
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    addressId string
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eipPublicAddressAdjustId string
    ID of the resource.
    instanceId string
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    address_id str
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eip_public_address_adjust_id str
    ID of the resource.
    instance_id str
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.
    addressId String
    A unique ID that identifies an EIP instance. The unique ID of EIP is in the form:eip-erft45fu.
    eipPublicAddressAdjustId String
    ID of the resource.
    instanceId String
    A unique ID that identifies the CVM instance. The unique ID of CVM is in the form:ins-osckfnm7.

    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.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack