Instance

class Instance : KotlinCustomResource

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

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.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("tf-example");
final var defaultZones = EcpFunctions.getZones();
final var defaultInstanceTypes = EcpFunctions.getInstanceTypes();
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.0.0.0/8")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.1.0.0/16")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].zoneId()))
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
var defaultKeyPair = new KeyPair("defaultKeyPair", KeyPairArgs.builder()
.keyPairName(name)
.publicKeyBody("ssh-rsa AAAAB3Nza12345678qwertyuudsfsg")
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.instanceName(name)
.description(name)
.keyPairName(defaultKeyPair.keyPairName())
.securityGroupId(defaultSecurityGroup.id())
.vswitchId(defaultSwitch.id())
.imageId("android_9_0_0_release_2851157_20211201.vhd")
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[1].instanceType()))
.vncPassword("Ecp123")
.paymentType("PayAsYouGo")
.build());
}
}

Import

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

$ pulumi import alicloud:ecp/instance:Instance example <id>

Properties

Link copied to clipboard
val autoPay: Output<Boolean>?

The auto pay.

Link copied to clipboard
val autoRenew: Output<Boolean>?

The auto renew.

Link copied to clipboard
val description: Output<String>?

Description of the instance. 2 to 256 English or Chinese characters in length and cannot start with http:// and https.

Link copied to clipboard
val eipBandwidth: Output<Int>?

The eip bandwidth.

Link copied to clipboard
val force: Output<Boolean>?

The force.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageId: Output<String>

The ID Of The Image.

Link copied to clipboard
val instanceName: Output<String>?

The name of the instance. It must be 2 to 128 characters in length and must start with an uppercase letter or Chinese. It cannot start with http:// or https. It can contain Chinese, English, numbers, half-width colons (:), underscores (_), half-width periods (.), or dashes (-). The default value is the InstanceId of the instance.

Link copied to clipboard
val instanceType: Output<String>

Instance Type.

Link copied to clipboard
val keyPairName: Output<String>?

The name of the key pair of the mobile phone instance.

Link copied to clipboard
val paymentType: Output<String>?

The payment type.Valid values: PayAsYouGo,Subscription

Link copied to clipboard
val period: Output<String>?

The period. It is valid when period_unit is 'Year'. Valid value: 1, 2, 3, 4, 5. It is valid when period_unit is 'Month'. Valid value: 1, 2, 3, 5

Link copied to clipboard
val periodUnit: Output<String>?

The duration unit that you will buy the resource. Valid value: Year,Month. Default to Month.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resolution: Output<String>

The selected resolution for the cloud mobile phone instance.

Link copied to clipboard
val securityGroupId: Output<String>

The ID of the security group. The security group is the same as that of the ECS instance.

Link copied to clipboard
val status: Output<String>

Instance status. Valid values: Running, Stopped.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vncPassword: Output<String>?

Cloud mobile phone VNC password. The password must be six characters in length and must contain only uppercase, lowercase English letters and Arabic numerals.

Link copied to clipboard
val vswitchId: Output<String>

The vswitch id.