1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecp
  5. Instance
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.ecp.Instance

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Elastic Cloud Phone (ECP) Instance resource.

    For information about Elastic Cloud Phone (ECP) Instance and how to use it, see What is Instance.

    NOTE: Available since v1.158.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const default = alicloud.ecp.getZones({});
    const defaultGetInstanceTypes = alicloud.ecp.getInstanceTypes({});
    const defaultInteger = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: `${name}-${defaultInteger.result}`,
        cidrBlock: "192.168.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vswitchName: `${name}-${defaultInteger.result}`,
        vpcId: defaultNetwork.id,
        cidrBlock: "192.168.192.0/24",
        zoneId: _default.then(_default => _default.zones?.[0]?.zoneId),
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
        name: `${name}-${defaultInteger.result}`,
        vpcId: defaultNetwork.id,
    });
    const defaultKeyPair = new alicloud.ecp.KeyPair("default", {
        keyPairName: `${name}-${defaultInteger.result}`,
        publicKeyBody: "ssh-rsa AAAAB3Nza12345678qwertyuudsfsg",
    });
    const defaultInstance = new alicloud.ecp.Instance("default", {
        instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.instanceType),
        imageId: "android-image-release5501072_a11_20240530.raw",
        vswitchId: defaultSwitch.id,
        securityGroupId: defaultSecurityGroup.id,
        keyPairName: defaultKeyPair.keyPairName,
        vncPassword: "Ecp123",
        paymentType: "PayAsYouGo",
        instanceName: name,
        description: name,
        force: true,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.ecp.get_zones()
    default_get_instance_types = alicloud.ecp.get_instance_types()
    default_integer = random.index.Integer("default",
        min=10000,
        max=99999)
    default_network = alicloud.vpc.Network("default",
        vpc_name=f"{name}-{default_integer['result']}",
        cidr_block="192.168.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vswitch_name=f"{name}-{default_integer['result']}",
        vpc_id=default_network.id,
        cidr_block="192.168.192.0/24",
        zone_id=default.zones[0].zone_id)
    default_security_group = alicloud.ecs.SecurityGroup("default",
        name=f"{name}-{default_integer['result']}",
        vpc_id=default_network.id)
    default_key_pair = alicloud.ecp.KeyPair("default",
        key_pair_name=f"{name}-{default_integer['result']}",
        public_key_body="ssh-rsa AAAAB3Nza12345678qwertyuudsfsg")
    default_instance = alicloud.ecp.Instance("default",
        instance_type=default_get_instance_types.instance_types[0].instance_type,
        image_id="android-image-release5501072_a11_20240530.raw",
        vswitch_id=default_switch.id,
        security_group_id=default_security_group.id,
        key_pair_name=default_key_pair.key_pair_name,
        vnc_password="Ecp123",
        payment_type="PayAsYouGo",
        instance_name=name,
        description=name,
        force=True)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecp"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"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 := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := ecp.GetZones(ctx, &ecp.GetZonesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		defaultGetInstanceTypes, err := ecp.GetInstanceTypes(ctx, &ecp.GetInstanceTypesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			CidrBlock: pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VswitchName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("192.168.192.0/24"),
    			ZoneId:      pulumi.String(_default.Zones[0].ZoneId),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
    			Name:  pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultKeyPair, err := ecp.NewKeyPair(ctx, "default", &ecp.KeyPairArgs{
    			KeyPairName:   pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			PublicKeyBody: pulumi.String("ssh-rsa AAAAB3Nza12345678qwertyuudsfsg"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ecp.NewInstance(ctx, "default", &ecp.InstanceArgs{
    			InstanceType:    pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].InstanceType),
    			ImageId:         pulumi.String("android-image-release5501072_a11_20240530.raw"),
    			VswitchId:       defaultSwitch.ID(),
    			SecurityGroupId: defaultSecurityGroup.ID(),
    			KeyPairName:     defaultKeyPair.KeyPairName,
    			VncPassword:     pulumi.String("Ecp123"),
    			PaymentType:     pulumi.String("PayAsYouGo"),
    			InstanceName:    pulumi.String(name),
    			Description:     pulumi.String(name),
    			Force:           pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.Ecp.GetZones.Invoke();
    
        var defaultGetInstanceTypes = AliCloud.Ecp.GetInstanceTypes.Invoke();
    
        var defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = $"{name}-{defaultInteger.Result}",
            CidrBlock = "192.168.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VswitchName = $"{name}-{defaultInteger.Result}",
            VpcId = defaultNetwork.Id,
            CidrBlock = "192.168.192.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneId)),
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
        {
            Name = $"{name}-{defaultInteger.Result}",
            VpcId = defaultNetwork.Id,
        });
    
        var defaultKeyPair = new AliCloud.Ecp.KeyPair("default", new()
        {
            KeyPairName = $"{name}-{defaultInteger.Result}",
            PublicKeyBody = "ssh-rsa AAAAB3Nza12345678qwertyuudsfsg",
        });
    
        var defaultInstance = new AliCloud.Ecp.Instance("default", new()
        {
            InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.InstanceType),
            ImageId = "android-image-release5501072_a11_20240530.raw",
            VswitchId = defaultSwitch.Id,
            SecurityGroupId = defaultSecurityGroup.Id,
            KeyPairName = defaultKeyPair.KeyPairName,
            VncPassword = "Ecp123",
            PaymentType = "PayAsYouGo",
            InstanceName = name,
            Description = name,
            Force = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecp.EcpFunctions;
    import com.pulumi.alicloud.ecp.inputs.GetZonesArgs;
    import com.pulumi.alicloud.ecp.inputs.GetInstanceTypesArgs;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    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.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.ecp.KeyPair;
    import com.pulumi.alicloud.ecp.KeyPairArgs;
    import com.pulumi.alicloud.ecp.Instance;
    import com.pulumi.alicloud.ecp.InstanceArgs;
    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("terraform-example");
            final var default = EcpFunctions.getZones();
    
            final var defaultGetInstanceTypes = EcpFunctions.getInstanceTypes();
    
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(String.format("%s-%s", name,defaultInteger.result()))
                .cidrBlock("192.168.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vswitchName(String.format("%s-%s", name,defaultInteger.result()))
                .vpcId(defaultNetwork.id())
                .cidrBlock("192.168.192.0/24")
                .zoneId(default_.zones()[0].zoneId())
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
                .name(String.format("%s-%s", name,defaultInteger.result()))
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultKeyPair = new KeyPair("defaultKeyPair", KeyPairArgs.builder()
                .keyPairName(String.format("%s-%s", name,defaultInteger.result()))
                .publicKeyBody("ssh-rsa AAAAB3Nza12345678qwertyuudsfsg")
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
                .instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].instanceType()))
                .imageId("android-image-release5501072_a11_20240530.raw")
                .vswitchId(defaultSwitch.id())
                .securityGroupId(defaultSecurityGroup.id())
                .keyPairName(defaultKeyPair.keyPairName())
                .vncPassword("Ecp123")
                .paymentType("PayAsYouGo")
                .instanceName(name)
                .description(name)
                .force("true")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultInteger:
        type: random:integer
        name: default
        properties:
          min: 10000
          max: 99999
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}-${defaultInteger.result}
          cidrBlock: 192.168.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vswitchName: ${name}-${defaultInteger.result}
          vpcId: ${defaultNetwork.id}
          cidrBlock: 192.168.192.0/24
          zoneId: ${default.zones[0].zoneId}
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        name: default
        properties:
          name: ${name}-${defaultInteger.result}
          vpcId: ${defaultNetwork.id}
      defaultKeyPair:
        type: alicloud:ecp:KeyPair
        name: default
        properties:
          keyPairName: ${name}-${defaultInteger.result}
          publicKeyBody: ssh-rsa AAAAB3Nza12345678qwertyuudsfsg
      defaultInstance:
        type: alicloud:ecp:Instance
        name: default
        properties:
          instanceType: ${defaultGetInstanceTypes.instanceTypes[0].instanceType}
          imageId: android-image-release5501072_a11_20240530.raw
          vswitchId: ${defaultSwitch.id}
          securityGroupId: ${defaultSecurityGroup.id}
          keyPairName: ${defaultKeyPair.keyPairName}
          vncPassword: Ecp123
          paymentType: PayAsYouGo
          instanceName: ${name}
          description: ${name}
          force: 'true'
    variables:
      default:
        fn::invoke:
          Function: alicloud:ecp:getZones
          Arguments: {}
      defaultGetInstanceTypes:
        fn::invoke:
          Function: alicloud:ecp:getInstanceTypes
          Arguments: {}
    

    Create Instance Resource

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

    Constructor syntax

    new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);
    @overload
    def Instance(resource_name: str,
                 args: InstanceArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Instance(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 image_id: Optional[str] = None,
                 vswitch_id: Optional[str] = None,
                 security_group_id: Optional[str] = None,
                 instance_type: Optional[str] = None,
                 key_pair_name: Optional[str] = None,
                 force: Optional[bool] = None,
                 instance_name: Optional[str] = None,
                 eip_bandwidth: Optional[int] = None,
                 auto_pay: Optional[bool] = None,
                 payment_type: Optional[str] = None,
                 period: Optional[str] = None,
                 period_unit: Optional[str] = None,
                 resolution: Optional[str] = None,
                 description: Optional[str] = None,
                 status: Optional[str] = None,
                 vnc_password: Optional[str] = None,
                 auto_renew: Optional[bool] = None)
    func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)
    public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)
    public Instance(String name, InstanceArgs args)
    public Instance(String name, InstanceArgs args, CustomResourceOptions options)
    
    type: alicloud:ecp:Instance
    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 InstanceArgs
    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 InstanceArgs
    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 InstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceArgs
    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 exampleinstanceResourceResourceFromEcpinstance = new AliCloud.Ecp.Instance("exampleinstanceResourceResourceFromEcpinstance", new()
    {
        ImageId = "string",
        VswitchId = "string",
        SecurityGroupId = "string",
        InstanceType = "string",
        KeyPairName = "string",
        Force = false,
        InstanceName = "string",
        EipBandwidth = 0,
        AutoPay = false,
        PaymentType = "string",
        Period = "string",
        PeriodUnit = "string",
        Resolution = "string",
        Description = "string",
        Status = "string",
        VncPassword = "string",
        AutoRenew = false,
    });
    
    example, err := ecp.NewInstance(ctx, "exampleinstanceResourceResourceFromEcpinstance", &ecp.InstanceArgs{
    	ImageId:         pulumi.String("string"),
    	VswitchId:       pulumi.String("string"),
    	SecurityGroupId: pulumi.String("string"),
    	InstanceType:    pulumi.String("string"),
    	KeyPairName:     pulumi.String("string"),
    	Force:           pulumi.Bool(false),
    	InstanceName:    pulumi.String("string"),
    	EipBandwidth:    pulumi.Int(0),
    	AutoPay:         pulumi.Bool(false),
    	PaymentType:     pulumi.String("string"),
    	Period:          pulumi.String("string"),
    	PeriodUnit:      pulumi.String("string"),
    	Resolution:      pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	Status:          pulumi.String("string"),
    	VncPassword:     pulumi.String("string"),
    	AutoRenew:       pulumi.Bool(false),
    })
    
    var exampleinstanceResourceResourceFromEcpinstance = new Instance("exampleinstanceResourceResourceFromEcpinstance", InstanceArgs.builder()
        .imageId("string")
        .vswitchId("string")
        .securityGroupId("string")
        .instanceType("string")
        .keyPairName("string")
        .force(false)
        .instanceName("string")
        .eipBandwidth(0)
        .autoPay(false)
        .paymentType("string")
        .period("string")
        .periodUnit("string")
        .resolution("string")
        .description("string")
        .status("string")
        .vncPassword("string")
        .autoRenew(false)
        .build());
    
    exampleinstance_resource_resource_from_ecpinstance = alicloud.ecp.Instance("exampleinstanceResourceResourceFromEcpinstance",
        image_id="string",
        vswitch_id="string",
        security_group_id="string",
        instance_type="string",
        key_pair_name="string",
        force=False,
        instance_name="string",
        eip_bandwidth=0,
        auto_pay=False,
        payment_type="string",
        period="string",
        period_unit="string",
        resolution="string",
        description="string",
        status="string",
        vnc_password="string",
        auto_renew=False)
    
    const exampleinstanceResourceResourceFromEcpinstance = new alicloud.ecp.Instance("exampleinstanceResourceResourceFromEcpinstance", {
        imageId: "string",
        vswitchId: "string",
        securityGroupId: "string",
        instanceType: "string",
        keyPairName: "string",
        force: false,
        instanceName: "string",
        eipBandwidth: 0,
        autoPay: false,
        paymentType: "string",
        period: "string",
        periodUnit: "string",
        resolution: "string",
        description: "string",
        status: "string",
        vncPassword: "string",
        autoRenew: false,
    });
    
    type: alicloud:ecp:Instance
    properties:
        autoPay: false
        autoRenew: false
        description: string
        eipBandwidth: 0
        force: false
        imageId: string
        instanceName: string
        instanceType: string
        keyPairName: string
        paymentType: string
        period: string
        periodUnit: string
        resolution: string
        securityGroupId: string
        status: string
        vncPassword: string
        vswitchId: string
    

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

    ImageId string
    The ID of the image.
    InstanceType string
    The specifications of the ECP instance.
    SecurityGroupId string
    The ID of the security group.
    VswitchId string
    The ID of the vSwitch.
    AutoPay bool
    Specifies whether to enable the auto-payment feature. Valid values:
    AutoRenew bool
    Specifies whether to enable the auto-renewal feature. Valid values:
    Description string
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    EipBandwidth int
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    Force bool
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    InstanceName string
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    KeyPairName string
    The name of the key pair that you want to use to connect to the instance.
    PaymentType string
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    Period string
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    PeriodUnit string
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    Resolution string
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    Status string
    The status of the Instance. Valid values: Running, Stopped.
    VncPassword string
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    ImageId string
    The ID of the image.
    InstanceType string
    The specifications of the ECP instance.
    SecurityGroupId string
    The ID of the security group.
    VswitchId string
    The ID of the vSwitch.
    AutoPay bool
    Specifies whether to enable the auto-payment feature. Valid values:
    AutoRenew bool
    Specifies whether to enable the auto-renewal feature. Valid values:
    Description string
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    EipBandwidth int
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    Force bool
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    InstanceName string
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    KeyPairName string
    The name of the key pair that you want to use to connect to the instance.
    PaymentType string
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    Period string
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    PeriodUnit string
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    Resolution string
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    Status string
    The status of the Instance. Valid values: Running, Stopped.
    VncPassword string
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    imageId String
    The ID of the image.
    instanceType String
    The specifications of the ECP instance.
    securityGroupId String
    The ID of the security group.
    vswitchId String
    The ID of the vSwitch.
    autoPay Boolean
    Specifies whether to enable the auto-payment feature. Valid values:
    autoRenew Boolean
    Specifies whether to enable the auto-renewal feature. Valid values:
    description String
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eipBandwidth Integer
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force Boolean
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    instanceName String
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    keyPairName String
    The name of the key pair that you want to use to connect to the instance.
    paymentType String
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period String
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    periodUnit String
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution String
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    status String
    The status of the Instance. Valid values: Running, Stopped.
    vncPassword String
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    imageId string
    The ID of the image.
    instanceType string
    The specifications of the ECP instance.
    securityGroupId string
    The ID of the security group.
    vswitchId string
    The ID of the vSwitch.
    autoPay boolean
    Specifies whether to enable the auto-payment feature. Valid values:
    autoRenew boolean
    Specifies whether to enable the auto-renewal feature. Valid values:
    description string
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eipBandwidth number
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force boolean
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    instanceName string
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    keyPairName string
    The name of the key pair that you want to use to connect to the instance.
    paymentType string
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period string
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    periodUnit string
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution string
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    status string
    The status of the Instance. Valid values: Running, Stopped.
    vncPassword string
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    image_id str
    The ID of the image.
    instance_type str
    The specifications of the ECP instance.
    security_group_id str
    The ID of the security group.
    vswitch_id str
    The ID of the vSwitch.
    auto_pay bool
    Specifies whether to enable the auto-payment feature. Valid values:
    auto_renew bool
    Specifies whether to enable the auto-renewal feature. Valid values:
    description str
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eip_bandwidth int
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force bool
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    instance_name str
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    key_pair_name str
    The name of the key pair that you want to use to connect to the instance.
    payment_type str
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period str
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    period_unit str
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution str
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    status str
    The status of the Instance. Valid values: Running, Stopped.
    vnc_password str
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    imageId String
    The ID of the image.
    instanceType String
    The specifications of the ECP instance.
    securityGroupId String
    The ID of the security group.
    vswitchId String
    The ID of the vSwitch.
    autoPay Boolean
    Specifies whether to enable the auto-payment feature. Valid values:
    autoRenew Boolean
    Specifies whether to enable the auto-renewal feature. Valid values:
    description String
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eipBandwidth Number
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force Boolean
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    instanceName String
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    keyPairName String
    The name of the key pair that you want to use to connect to the instance.
    paymentType String
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period String
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    periodUnit String
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution String
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    status String
    The status of the Instance. Valid values: Running, Stopped.
    vncPassword String
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.

    Outputs

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

    Get an existing Instance 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?: InstanceState, opts?: CustomResourceOptions): Instance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_pay: Optional[bool] = None,
            auto_renew: Optional[bool] = None,
            description: Optional[str] = None,
            eip_bandwidth: Optional[int] = None,
            force: Optional[bool] = None,
            image_id: Optional[str] = None,
            instance_name: Optional[str] = None,
            instance_type: Optional[str] = None,
            key_pair_name: Optional[str] = None,
            payment_type: Optional[str] = None,
            period: Optional[str] = None,
            period_unit: Optional[str] = None,
            resolution: Optional[str] = None,
            security_group_id: Optional[str] = None,
            status: Optional[str] = None,
            vnc_password: Optional[str] = None,
            vswitch_id: Optional[str] = None) -> Instance
    func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
    public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
    public static Instance get(String name, Output<String> id, InstanceState 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:
    AutoPay bool
    Specifies whether to enable the auto-payment feature. Valid values:
    AutoRenew bool
    Specifies whether to enable the auto-renewal feature. Valid values:
    Description string
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    EipBandwidth int
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    Force bool
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    ImageId string
    The ID of the image.
    InstanceName string
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    InstanceType string
    The specifications of the ECP instance.
    KeyPairName string
    The name of the key pair that you want to use to connect to the instance.
    PaymentType string
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    Period string
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    PeriodUnit string
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    Resolution string
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    SecurityGroupId string
    The ID of the security group.
    Status string
    The status of the Instance. Valid values: Running, Stopped.
    VncPassword string
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    VswitchId string
    The ID of the vSwitch.
    AutoPay bool
    Specifies whether to enable the auto-payment feature. Valid values:
    AutoRenew bool
    Specifies whether to enable the auto-renewal feature. Valid values:
    Description string
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    EipBandwidth int
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    Force bool
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    ImageId string
    The ID of the image.
    InstanceName string
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    InstanceType string
    The specifications of the ECP instance.
    KeyPairName string
    The name of the key pair that you want to use to connect to the instance.
    PaymentType string
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    Period string
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    PeriodUnit string
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    Resolution string
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    SecurityGroupId string
    The ID of the security group.
    Status string
    The status of the Instance. Valid values: Running, Stopped.
    VncPassword string
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    VswitchId string
    The ID of the vSwitch.
    autoPay Boolean
    Specifies whether to enable the auto-payment feature. Valid values:
    autoRenew Boolean
    Specifies whether to enable the auto-renewal feature. Valid values:
    description String
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eipBandwidth Integer
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force Boolean
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    imageId String
    The ID of the image.
    instanceName String
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    instanceType String
    The specifications of the ECP instance.
    keyPairName String
    The name of the key pair that you want to use to connect to the instance.
    paymentType String
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period String
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    periodUnit String
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution String
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    securityGroupId String
    The ID of the security group.
    status String
    The status of the Instance. Valid values: Running, Stopped.
    vncPassword String
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    vswitchId String
    The ID of the vSwitch.
    autoPay boolean
    Specifies whether to enable the auto-payment feature. Valid values:
    autoRenew boolean
    Specifies whether to enable the auto-renewal feature. Valid values:
    description string
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eipBandwidth number
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force boolean
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    imageId string
    The ID of the image.
    instanceName string
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    instanceType string
    The specifications of the ECP instance.
    keyPairName string
    The name of the key pair that you want to use to connect to the instance.
    paymentType string
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period string
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    periodUnit string
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution string
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    securityGroupId string
    The ID of the security group.
    status string
    The status of the Instance. Valid values: Running, Stopped.
    vncPassword string
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    vswitchId string
    The ID of the vSwitch.
    auto_pay bool
    Specifies whether to enable the auto-payment feature. Valid values:
    auto_renew bool
    Specifies whether to enable the auto-renewal feature. Valid values:
    description str
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eip_bandwidth int
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force bool
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    image_id str
    The ID of the image.
    instance_name str
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    instance_type str
    The specifications of the ECP instance.
    key_pair_name str
    The name of the key pair that you want to use to connect to the instance.
    payment_type str
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period str
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    period_unit str
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution str
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    security_group_id str
    The ID of the security group.
    status str
    The status of the Instance. Valid values: Running, Stopped.
    vnc_password str
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    vswitch_id str
    The ID of the vSwitch.
    autoPay Boolean
    Specifies whether to enable the auto-payment feature. Valid values:
    autoRenew Boolean
    Specifies whether to enable the auto-renewal feature. Valid values:
    description String
    The description of the ECP instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
    eipBandwidth Number
    The bandwidth of the elastic IP address (EIP). NOTE: From version 1.232.0, eip_bandwidth cannot be modified.
    force Boolean
    Specifies whether to forcefully stop and release the instance. Default value: false. Valid values:
    imageId String
    The ID of the image.
    instanceName String
    The name of the ECP instance. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).
    instanceType String
    The specifications of the ECP instance.
    keyPairName String
    The name of the key pair that you want to use to connect to the instance.
    paymentType String
    The billing method of the ECP instance. Default value: PayAsYouGo. Valid values: PayAsYouGo,Subscription. NOTE: From version 1.232.0, payment_type cannot be modified.
    period String
    The subscription duration. Default value: 1. Valid values:

    • If period_unit is set to Month. Valid values: 1, 2, 3, and 6.
    • If period_unit is set to Year. Valid values: 1 to 5.
    periodUnit String
    The unit of the subscription duration. Default value: Month. Valid values: Month, Year.
    resolution String
    The resolution that you want to select for the ECP instance. NOTE: From version 1.232.0, resolution can be modified.
    securityGroupId String
    The ID of the security group.
    status String
    The status of the Instance. Valid values: Running, Stopped.
    vncPassword String
    The VNC password of the instance. The password must be 6 characters in length and can contain only uppercase letters, lowercase letters, and digits.
    vswitchId String
    The ID of the vSwitch.

    Import

    Elastic Cloud Phone (ECP) Instance can be imported using the id, e.g.

    $ pulumi import alicloud:ecp/instance:Instance 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.66.0 published on Friday, Nov 15, 2024 by Pulumi