alicloud.cloudphone.Image
Explore with Pulumi AI
Provides a Cloud Phone Image resource.
Cloud phone image.
For information about Cloud Phone Image and how to use it, see What is Image.
NOTE: Available since v1.243.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const defaultjZ1gi0 = new alicloud.cloudphone.Policy("defaultjZ1gi0", {});
const defaultYHMlTO = new alicloud.cloudphoneinstance.Group("defaultYHMlTO", {
instanceGroupSpec: "acp.basic.small",
policyGroupId: defaultjZ1gi0.id,
instanceGroupName: "AutoCreateGroupName",
period: 1,
numberOfInstances: 1,
chargeType: "PostPaid",
imageId: "imgc-075cllfeuazh03tg9",
periodUnit: "Hour",
autoRenew: false,
amount: 1,
autoPay: false,
gpuAcceleration: false,
});
const default04hhXk = new alicloud.cloudphoneinstance.CloudPhoneInstance("default04hhXk", {
androidInstanceGroupId: defaultYHMlTO.id,
androidInstanceName: "CreateInstanceName",
});
const _default = new alicloud.cloudphone.Image("default", {
imageName: "ImageName",
instanceId: default04hhXk.id,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
defaultj_z1gi0 = alicloud.cloudphone.Policy("defaultjZ1gi0")
default_yh_ml_to = alicloud.cloudphoneinstance.Group("defaultYHMlTO",
instance_group_spec="acp.basic.small",
policy_group_id=defaultj_z1gi0.id,
instance_group_name="AutoCreateGroupName",
period=1,
number_of_instances=1,
charge_type="PostPaid",
image_id="imgc-075cllfeuazh03tg9",
period_unit="Hour",
auto_renew=False,
amount=1,
auto_pay=False,
gpu_acceleration=False)
default04hh_xk = alicloud.cloudphoneinstance.CloudPhoneInstance("default04hhXk",
android_instance_group_id=default_yh_ml_to.id,
android_instance_name="CreateInstanceName")
default = alicloud.cloudphone.Image("default",
image_name="ImageName",
instance_id=default04hh_xk.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudphone"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudphoneinstance"
"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
}
defaultjZ1gi0, err := cloudphone.NewPolicy(ctx, "defaultjZ1gi0", nil)
if err != nil {
return err
}
defaultYHMlTO, err := cloudphoneinstance.NewGroup(ctx, "defaultYHMlTO", &cloudphoneinstance.GroupArgs{
InstanceGroupSpec: pulumi.String("acp.basic.small"),
PolicyGroupId: defaultjZ1gi0.ID(),
InstanceGroupName: pulumi.String("AutoCreateGroupName"),
Period: pulumi.Int(1),
NumberOfInstances: pulumi.Int(1),
ChargeType: pulumi.String("PostPaid"),
ImageId: pulumi.String("imgc-075cllfeuazh03tg9"),
PeriodUnit: pulumi.String("Hour"),
AutoRenew: pulumi.Bool(false),
Amount: pulumi.Int(1),
AutoPay: pulumi.Bool(false),
GpuAcceleration: pulumi.Bool(false),
})
if err != nil {
return err
}
default04hhXk, err := cloudphoneinstance.NewCloudPhoneInstance(ctx, "default04hhXk", &cloudphoneinstance.CloudPhoneInstanceArgs{
AndroidInstanceGroupId: defaultYHMlTO.ID(),
AndroidInstanceName: pulumi.String("CreateInstanceName"),
})
if err != nil {
return err
}
_, err = cloudphone.NewImage(ctx, "default", &cloudphone.ImageArgs{
ImageName: pulumi.String("ImageName"),
InstanceId: default04hhXk.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var defaultjZ1gi0 = new AliCloud.CloudPhone.Policy("defaultjZ1gi0");
var defaultYHMlTO = new AliCloud.CloudPhoneInstance.Group("defaultYHMlTO", new()
{
InstanceGroupSpec = "acp.basic.small",
PolicyGroupId = defaultjZ1gi0.Id,
InstanceGroupName = "AutoCreateGroupName",
Period = 1,
NumberOfInstances = 1,
ChargeType = "PostPaid",
ImageId = "imgc-075cllfeuazh03tg9",
PeriodUnit = "Hour",
AutoRenew = false,
Amount = 1,
AutoPay = false,
GpuAcceleration = false,
});
var default04hhXk = new AliCloud.CloudPhoneInstance.CloudPhoneInstance("default04hhXk", new()
{
AndroidInstanceGroupId = defaultYHMlTO.Id,
AndroidInstanceName = "CreateInstanceName",
});
var @default = new AliCloud.CloudPhone.Image("default", new()
{
ImageName = "ImageName",
InstanceId = default04hhXk.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudphone.Policy;
import com.pulumi.alicloud.cloudphoneinstance.Group;
import com.pulumi.alicloud.cloudphoneinstance.GroupArgs;
import com.pulumi.alicloud.cloudphoneinstance.CloudPhoneInstance;
import com.pulumi.alicloud.cloudphoneinstance.CloudPhoneInstanceArgs;
import com.pulumi.alicloud.cloudphone.Image;
import com.pulumi.alicloud.cloudphone.ImageArgs;
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");
var defaultjZ1gi0 = new Policy("defaultjZ1gi0");
var defaultYHMlTO = new Group("defaultYHMlTO", GroupArgs.builder()
.instanceGroupSpec("acp.basic.small")
.policyGroupId(defaultjZ1gi0.id())
.instanceGroupName("AutoCreateGroupName")
.period("1")
.numberOfInstances("1")
.chargeType("PostPaid")
.imageId("imgc-075cllfeuazh03tg9")
.periodUnit("Hour")
.autoRenew(false)
.amount("1")
.autoPay(false)
.gpuAcceleration(false)
.build());
var default04hhXk = new CloudPhoneInstance("default04hhXk", CloudPhoneInstanceArgs.builder()
.androidInstanceGroupId(defaultYHMlTO.id())
.androidInstanceName("CreateInstanceName")
.build());
var default_ = new Image("default", ImageArgs.builder()
.imageName("ImageName")
.instanceId(default04hhXk.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultjZ1gi0:
type: alicloud:cloudphone:Policy
defaultYHMlTO:
type: alicloud:cloudphoneinstance:Group
properties:
instanceGroupSpec: acp.basic.small
policyGroupId: ${defaultjZ1gi0.id}
instanceGroupName: AutoCreateGroupName
period: '1'
numberOfInstances: '1'
chargeType: PostPaid
imageId: imgc-075cllfeuazh03tg9
periodUnit: Hour
autoRenew: false
amount: '1'
autoPay: false
gpuAcceleration: false
default04hhXk:
type: alicloud:cloudphoneinstance:CloudPhoneInstance
properties:
androidInstanceGroupId: ${defaultYHMlTO.id}
androidInstanceName: CreateInstanceName
default:
type: alicloud:cloudphone:Image
properties:
imageName: ImageName
instanceId: ${default04hhXk.id}
Create Image Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Image(name: string, args: ImageArgs, opts?: CustomResourceOptions);
@overload
def Image(resource_name: str,
args: ImageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Image(resource_name: str,
opts: Optional[ResourceOptions] = None,
image_name: Optional[str] = None,
instance_id: Optional[str] = None)
func NewImage(ctx *Context, name string, args ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs args, CustomResourceOptions? opts = null)
type: alicloud:cloudphone:Image
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 ImageArgs
- 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 ImageArgs
- 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 ImageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ImageArgs
- 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 imageResource = new AliCloud.CloudPhone.Image("imageResource", new()
{
ImageName = "string",
InstanceId = "string",
});
example, err := cloudphone.NewImage(ctx, "imageResource", &cloudphone.ImageArgs{
ImageName: pulumi.String("string"),
InstanceId: pulumi.String("string"),
})
var imageResource = new Image("imageResource", ImageArgs.builder()
.imageName("string")
.instanceId("string")
.build());
image_resource = alicloud.cloudphone.Image("imageResource",
image_name="string",
instance_id="string")
const imageResource = new alicloud.cloudphone.Image("imageResource", {
imageName: "string",
instanceId: "string",
});
type: alicloud:cloudphone:Image
properties:
imageName: string
instanceId: string
Image 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 Image resource accepts the following input properties:
- Image
Name string - The image name.
- Instance
Id string - The instance ID.
- Image
Name string - The image name.
- Instance
Id string - The instance ID.
- image
Name String - The image name.
- instance
Id String - The instance ID.
- image
Name string - The image name.
- instance
Id string - The instance ID.
- image_
name str - The image name.
- instance_
id str - The instance ID.
- image
Name String - The image name.
- instance
Id String - The instance ID.
Outputs
All input properties are implicitly available as output properties. Additionally, the Image resource produces the following output properties:
Look up Existing Image Resource
Get an existing Image 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?: ImageState, opts?: CustomResourceOptions): Image
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
image_name: Optional[str] = None,
instance_id: Optional[str] = None,
status: Optional[str] = None) -> Image
func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)
public static Image get(String name, Output<String> id, ImageState state, CustomResourceOptions options)
resources: _: type: alicloud:cloudphone:Image 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.
- Image
Name string - The image name.
- Instance
Id string - The instance ID.
- Status string
- The status of the mirror.
- Image
Name string - The image name.
- Instance
Id string - The instance ID.
- Status string
- The status of the mirror.
- image
Name String - The image name.
- instance
Id String - The instance ID.
- status String
- The status of the mirror.
- image
Name string - The image name.
- instance
Id string - The instance ID.
- status string
- The status of the mirror.
- image_
name str - The image name.
- instance_
id str - The instance ID.
- status str
- The status of the mirror.
- image
Name String - The image name.
- instance
Id String - The instance ID.
- status String
- The status of the mirror.
Import
Cloud Phone Image can be imported using the id, e.g.
$ pulumi import alicloud:cloudphone/image:Image 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.