alicloud.ecs.ImageCopy
Explore with Pulumi AI
Copies a custom image from one region to another. You can use copied images to perform operations in the target region, such as creating instances (RunInstances) and replacing system disks (ReplaceSystemDisk).
NOTE: You can only copy the custom image when it is in the Available state.
NOTE: You can only copy the image belonging to your Alibaba Cloud account. Images cannot be copied from one account to another.
NOTE: If the copying is not completed, you cannot call DeleteImage to delete the image but you can call CancelCopyImage to cancel the copying.
NOTE: Available in 1.66.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const sh = new alicloud.Provider("sh", {region: "cn-shanghai"});
const hz = new alicloud.Provider("hz", {region: "cn-hangzhou"});
const defaultZones = alicloud.getZones({
availableResourceCreation: "Instance",
});
const defaultInstanceTypes = alicloud.ecs.getInstanceTypes({
instanceTypeFamily: "ecs.sn1ne",
});
const defaultImages = alicloud.ecs.getImages({
nameRegex: "^ubuntu_[0-9]+_[0-9]+_x64*",
owners: "system",
});
const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
vpcName: "terraform-example",
cidrBlock: "172.17.3.0/24",
}, {
provider: alicloud.hz,
});
const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
vswitchName: "terraform-example",
cidrBlock: "172.17.3.0/24",
vpcId: defaultNetwork.id,
zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
}, {
provider: alicloud.hz,
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {vpcId: defaultNetwork.id}, {
provider: alicloud.hz,
});
const defaultInstance = new alicloud.ecs.Instance("defaultInstance", {
availabilityZone: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
instanceName: "terraform-example",
securityGroups: [defaultSecurityGroup.id],
vswitchId: defaultSwitch.id,
instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.ids?.[0]),
imageId: defaultImages.then(defaultImages => defaultImages.ids?.[0]),
internetMaxBandwidthOut: 10,
}, {
provider: alicloud.hz,
});
const defaultImage = new alicloud.ecs.Image("defaultImage", {
instanceId: defaultInstance.id,
imageName: "terraform-example",
description: "terraform-example",
}, {
provider: alicloud.hz,
});
const defaultImageCopy = new alicloud.ecs.ImageCopy("defaultImageCopy", {
sourceImageId: defaultImage.id,
sourceRegionId: "cn-hangzhou",
imageName: "terraform-example",
description: "terraform-example",
tags: {
FinanceDept: "FinanceDeptJoshua",
},
}, {
provider: alicloud.sh,
});
import pulumi
import pulumi_alicloud as alicloud
sh = alicloud.Provider("sh", region="cn-shanghai")
hz = alicloud.Provider("hz", region="cn-hangzhou")
default_zones = alicloud.get_zones(available_resource_creation="Instance")
default_instance_types = alicloud.ecs.get_instance_types(instance_type_family="ecs.sn1ne")
default_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
owners="system")
default_network = alicloud.vpc.Network("defaultNetwork",
vpc_name="terraform-example",
cidr_block="172.17.3.0/24",
opts=pulumi.ResourceOptions(provider=alicloud["hz"]))
default_switch = alicloud.vpc.Switch("defaultSwitch",
vswitch_name="terraform-example",
cidr_block="172.17.3.0/24",
vpc_id=default_network.id,
zone_id=default_zones.zones[0].id,
opts=pulumi.ResourceOptions(provider=alicloud["hz"]))
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id,
opts=pulumi.ResourceOptions(provider=alicloud["hz"]))
default_instance = alicloud.ecs.Instance("defaultInstance",
availability_zone=default_zones.zones[0].id,
instance_name="terraform-example",
security_groups=[default_security_group.id],
vswitch_id=default_switch.id,
instance_type=default_instance_types.ids[0],
image_id=default_images.ids[0],
internet_max_bandwidth_out=10,
opts=pulumi.ResourceOptions(provider=alicloud["hz"]))
default_image = alicloud.ecs.Image("defaultImage",
instance_id=default_instance.id,
image_name="terraform-example",
description="terraform-example",
opts=pulumi.ResourceOptions(provider=alicloud["hz"]))
default_image_copy = alicloud.ecs.ImageCopy("defaultImageCopy",
source_image_id=default_image.id,
source_region_id="cn-hangzhou",
image_name="terraform-example",
description="terraform-example",
tags={
"FinanceDept": "FinanceDeptJoshua",
},
opts=pulumi.ResourceOptions(provider=alicloud["sh"]))
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := alicloud.NewProvider(ctx, "sh", &alicloud.ProviderArgs{
Region: pulumi.String("cn-shanghai"),
})
if err != nil {
return err
}
_, err = alicloud.NewProvider(ctx, "hz", &alicloud.ProviderArgs{
Region: pulumi.String("cn-hangzhou"),
})
if err != nil {
return err
}
defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("Instance"),
}, nil)
if err != nil {
return err
}
defaultInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
InstanceTypeFamily: pulumi.StringRef("ecs.sn1ne"),
}, nil)
if err != nil {
return err
}
defaultImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
NameRegex: pulumi.StringRef("^ubuntu_[0-9]+_[0-9]+_x64*"),
Owners: pulumi.StringRef("system"),
}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.17.3.0/24"),
}, pulumi.Provider(alicloud.Hz))
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
VswitchName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.17.3.0/24"),
VpcId: defaultNetwork.ID(),
ZoneId: pulumi.String(defaultZones.Zones[0].Id),
}, pulumi.Provider(alicloud.Hz))
if err != nil {
return err
}
defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "defaultSecurityGroup", &ecs.SecurityGroupArgs{
VpcId: defaultNetwork.ID(),
}, pulumi.Provider(alicloud.Hz))
if err != nil {
return err
}
defaultInstance, err := ecs.NewInstance(ctx, "defaultInstance", &ecs.InstanceArgs{
AvailabilityZone: pulumi.String(defaultZones.Zones[0].Id),
InstanceName: pulumi.String("terraform-example"),
SecurityGroups: pulumi.StringArray{
defaultSecurityGroup.ID(),
},
VswitchId: defaultSwitch.ID(),
InstanceType: pulumi.String(defaultInstanceTypes.Ids[0]),
ImageId: pulumi.String(defaultImages.Ids[0]),
InternetMaxBandwidthOut: pulumi.Int(10),
}, pulumi.Provider(alicloud.Hz))
if err != nil {
return err
}
defaultImage, err := ecs.NewImage(ctx, "defaultImage", &ecs.ImageArgs{
InstanceId: defaultInstance.ID(),
ImageName: pulumi.String("terraform-example"),
Description: pulumi.String("terraform-example"),
}, pulumi.Provider(alicloud.Hz))
if err != nil {
return err
}
_, err = ecs.NewImageCopy(ctx, "defaultImageCopy", &ecs.ImageCopyArgs{
SourceImageId: defaultImage.ID(),
SourceRegionId: pulumi.String("cn-hangzhou"),
ImageName: pulumi.String("terraform-example"),
Description: pulumi.String("terraform-example"),
Tags: pulumi.Map{
"FinanceDept": pulumi.Any("FinanceDeptJoshua"),
},
}, pulumi.Provider(alicloud.Sh))
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 sh = new AliCloud.Provider("sh", new()
{
Region = "cn-shanghai",
});
var hz = new AliCloud.Provider("hz", new()
{
Region = "cn-hangzhou",
});
var defaultZones = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "Instance",
});
var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
InstanceTypeFamily = "ecs.sn1ne",
});
var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
{
NameRegex = "^ubuntu_[0-9]+_[0-9]+_x64*",
Owners = "system",
});
var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
{
VpcName = "terraform-example",
CidrBlock = "172.17.3.0/24",
}, new CustomResourceOptions
{
Provider = alicloud.Hz,
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
{
VswitchName = "terraform-example",
CidrBlock = "172.17.3.0/24",
VpcId = defaultNetwork.Id,
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
}, new CustomResourceOptions
{
Provider = alicloud.Hz,
});
var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
{
VpcId = defaultNetwork.Id,
}, new CustomResourceOptions
{
Provider = alicloud.Hz,
});
var defaultInstance = new AliCloud.Ecs.Instance("defaultInstance", new()
{
AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
InstanceName = "terraform-example",
SecurityGroups = new[]
{
defaultSecurityGroup.Id,
},
VswitchId = defaultSwitch.Id,
InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Ids[0]),
ImageId = defaultImages.Apply(getImagesResult => getImagesResult.Ids[0]),
InternetMaxBandwidthOut = 10,
}, new CustomResourceOptions
{
Provider = alicloud.Hz,
});
var defaultImage = new AliCloud.Ecs.Image("defaultImage", new()
{
InstanceId = defaultInstance.Id,
ImageName = "terraform-example",
Description = "terraform-example",
}, new CustomResourceOptions
{
Provider = alicloud.Hz,
});
var defaultImageCopy = new AliCloud.Ecs.ImageCopy("defaultImageCopy", new()
{
SourceImageId = defaultImage.Id,
SourceRegionId = "cn-hangzhou",
ImageName = "terraform-example",
Description = "terraform-example",
Tags =
{
{ "FinanceDept", "FinanceDeptJoshua" },
},
}, new CustomResourceOptions
{
Provider = alicloud.Sh,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.Provider;
import com.pulumi.alicloud.ProviderArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
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.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.ecs.Image;
import com.pulumi.alicloud.ecs.ImageArgs;
import com.pulumi.alicloud.ecs.ImageCopy;
import com.pulumi.alicloud.ecs.ImageCopyArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
var sh = new Provider("sh", ProviderArgs.builder()
.region("cn-shanghai")
.build());
var hz = new Provider("hz", ProviderArgs.builder()
.region("cn-hangzhou")
.build());
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("Instance")
.build());
final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.instanceTypeFamily("ecs.sn1ne")
.build());
final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
.owners("system")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.17.3.0/24")
.build(), CustomResourceOptions.builder()
.provider(alicloud.hz())
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.17.3.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build(), CustomResourceOptions.builder()
.provider(alicloud.hz())
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build(), CustomResourceOptions.builder()
.provider(alicloud.hz())
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.instanceName("terraform-example")
.securityGroups(defaultSecurityGroup.id())
.vswitchId(defaultSwitch.id())
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.ids()[0]))
.imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.ids()[0]))
.internetMaxBandwidthOut(10)
.build(), CustomResourceOptions.builder()
.provider(alicloud.hz())
.build());
var defaultImage = new Image("defaultImage", ImageArgs.builder()
.instanceId(defaultInstance.id())
.imageName("terraform-example")
.description("terraform-example")
.build(), CustomResourceOptions.builder()
.provider(alicloud.hz())
.build());
var defaultImageCopy = new ImageCopy("defaultImageCopy", ImageCopyArgs.builder()
.sourceImageId(defaultImage.id())
.sourceRegionId("cn-hangzhou")
.imageName("terraform-example")
.description("terraform-example")
.tags(Map.of("FinanceDept", "FinanceDeptJoshua"))
.build(), CustomResourceOptions.builder()
.provider(alicloud.sh())
.build());
}
}
resources:
sh:
type: pulumi:providers:alicloud
properties:
region: cn-shanghai
hz:
type: pulumi:providers:alicloud
properties:
region: cn-hangzhou
defaultNetwork:
type: alicloud:vpc:Network
properties:
vpcName: terraform-example
cidrBlock: 172.17.3.0/24
options:
provider: ${alicloud.hz}
defaultSwitch:
type: alicloud:vpc:Switch
properties:
vswitchName: terraform-example
cidrBlock: 172.17.3.0/24
vpcId: ${defaultNetwork.id}
zoneId: ${defaultZones.zones[0].id}
options:
provider: ${alicloud.hz}
defaultSecurityGroup:
type: alicloud:ecs:SecurityGroup
properties:
vpcId: ${defaultNetwork.id}
options:
provider: ${alicloud.hz}
defaultInstance:
type: alicloud:ecs:Instance
properties:
availabilityZone: ${defaultZones.zones[0].id}
instanceName: terraform-example
securityGroups:
- ${defaultSecurityGroup.id}
vswitchId: ${defaultSwitch.id}
instanceType: ${defaultInstanceTypes.ids[0]}
imageId: ${defaultImages.ids[0]}
internetMaxBandwidthOut: 10
options:
provider: ${alicloud.hz}
defaultImage:
type: alicloud:ecs:Image
properties:
instanceId: ${defaultInstance.id}
imageName: terraform-example
description: terraform-example
options:
provider: ${alicloud.hz}
defaultImageCopy:
type: alicloud:ecs:ImageCopy
properties:
sourceImageId: ${defaultImage.id}
sourceRegionId: cn-hangzhou
imageName: terraform-example
description: terraform-example
tags:
FinanceDept: FinanceDeptJoshua
options:
provider: ${alicloud.sh}
variables:
defaultZones:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: Instance
defaultInstanceTypes:
fn::invoke:
Function: alicloud:ecs:getInstanceTypes
Arguments:
instanceTypeFamily: ecs.sn1ne
defaultImages:
fn::invoke:
Function: alicloud:ecs:getImages
Arguments:
nameRegex: ^ubuntu_[0-9]+_[0-9]+_x64*
owners: system
Attributes Reference0
The following attributes are exported:
id
- ID of the image.
Create ImageCopy Resource
new ImageCopy(name: string, args: ImageCopyArgs, opts?: CustomResourceOptions);
@overload
def ImageCopy(resource_name: str,
opts: Optional[ResourceOptions] = None,
delete_auto_snapshot: Optional[bool] = None,
description: Optional[str] = None,
encrypted: Optional[bool] = None,
force: Optional[bool] = None,
image_name: Optional[str] = None,
kms_key_id: Optional[str] = None,
name: Optional[str] = None,
source_image_id: Optional[str] = None,
source_region_id: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None)
@overload
def ImageCopy(resource_name: str,
args: ImageCopyArgs,
opts: Optional[ResourceOptions] = None)
func NewImageCopy(ctx *Context, name string, args ImageCopyArgs, opts ...ResourceOption) (*ImageCopy, error)
public ImageCopy(string name, ImageCopyArgs args, CustomResourceOptions? opts = null)
public ImageCopy(String name, ImageCopyArgs args)
public ImageCopy(String name, ImageCopyArgs args, CustomResourceOptions options)
type: alicloud:ecs:ImageCopy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageCopyArgs
- 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 ImageCopyArgs
- 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 ImageCopyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageCopyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ImageCopyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ImageCopy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ImageCopy resource accepts the following input properties:
- Source
Image stringId - The source image ID.
- Source
Region stringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Delete
Auto boolSnapshot - Description string
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
- Indicates whether to encrypt the image.
- Force bool
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- Image
Name string - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId - Key ID used to encrypt the image.
- Name string
- Dictionary<string, object>
- The tag value of an image. The value of N ranges from 1 to 20.
- Source
Image stringId - The source image ID.
- Source
Region stringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Delete
Auto boolSnapshot - Description string
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
- Indicates whether to encrypt the image.
- Force bool
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- Image
Name string - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId - Key ID used to encrypt the image.
- Name string
- map[string]interface{}
- The tag value of an image. The value of N ranges from 1 to 20.
- source
Image StringId - The source image ID.
- source
Region StringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- delete
Auto BooleanSnapshot - description String
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted Boolean
- Indicates whether to encrypt the image.
- force Boolean
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image
Name String - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key StringId - Key ID used to encrypt the image.
- name String
- Map<String,Object>
- The tag value of an image. The value of N ranges from 1 to 20.
- source
Image stringId - The source image ID.
- source
Region stringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- delete
Auto booleanSnapshot - description string
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted boolean
- Indicates whether to encrypt the image.
- force boolean
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image
Name string - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key stringId - Key ID used to encrypt the image.
- name string
- {[key: string]: any}
- The tag value of an image. The value of N ranges from 1 to 20.
- source_
image_ strid - The source image ID.
- source_
region_ strid - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- delete_
auto_ boolsnapshot - description str
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted bool
- Indicates whether to encrypt the image.
- force bool
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image_
name str - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms_
key_ strid - Key ID used to encrypt the image.
- name str
- Mapping[str, Any]
- The tag value of an image. The value of N ranges from 1 to 20.
- source
Image StringId - The source image ID.
- source
Region StringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- delete
Auto BooleanSnapshot - description String
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted Boolean
- Indicates whether to encrypt the image.
- force Boolean
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image
Name String - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key StringId - Key ID used to encrypt the image.
- name String
- Map<Any>
- The tag value of an image. The value of N ranges from 1 to 20.
Outputs
All input properties are implicitly available as output properties. Additionally, the ImageCopy 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 ImageCopy Resource
Get an existing ImageCopy 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?: ImageCopyState, opts?: CustomResourceOptions): ImageCopy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
delete_auto_snapshot: Optional[bool] = None,
description: Optional[str] = None,
encrypted: Optional[bool] = None,
force: Optional[bool] = None,
image_name: Optional[str] = None,
kms_key_id: Optional[str] = None,
name: Optional[str] = None,
source_image_id: Optional[str] = None,
source_region_id: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None) -> ImageCopy
func GetImageCopy(ctx *Context, name string, id IDInput, state *ImageCopyState, opts ...ResourceOption) (*ImageCopy, error)
public static ImageCopy Get(string name, Input<string> id, ImageCopyState? state, CustomResourceOptions? opts = null)
public static ImageCopy get(String name, Output<String> id, ImageCopyState 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.
- Delete
Auto boolSnapshot - Description string
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
- Indicates whether to encrypt the image.
- Force bool
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- Image
Name string - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId - Key ID used to encrypt the image.
- Name string
- Source
Image stringId - The source image ID.
- Source
Region stringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Dictionary<string, object>
- The tag value of an image. The value of N ranges from 1 to 20.
- Delete
Auto boolSnapshot - Description string
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- Encrypted bool
- Indicates whether to encrypt the image.
- Force bool
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- Image
Name string - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- Kms
Key stringId - Key ID used to encrypt the image.
- Name string
- Source
Image stringId - The source image ID.
- Source
Region stringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- map[string]interface{}
- The tag value of an image. The value of N ranges from 1 to 20.
- delete
Auto BooleanSnapshot - description String
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted Boolean
- Indicates whether to encrypt the image.
- force Boolean
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image
Name String - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key StringId - Key ID used to encrypt the image.
- name String
- source
Image StringId - The source image ID.
- source
Region StringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Map<String,Object>
- The tag value of an image. The value of N ranges from 1 to 20.
- delete
Auto booleanSnapshot - description string
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted boolean
- Indicates whether to encrypt the image.
- force boolean
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image
Name string - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key stringId - Key ID used to encrypt the image.
- name string
- source
Image stringId - The source image ID.
- source
Region stringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- {[key: string]: any}
- The tag value of an image. The value of N ranges from 1 to 20.
- delete_
auto_ boolsnapshot - description str
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted bool
- Indicates whether to encrypt the image.
- force bool
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image_
name str - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms_
key_ strid - Key ID used to encrypt the image.
- name str
- source_
image_ strid - The source image ID.
- source_
region_ strid - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Mapping[str, Any]
- The tag value of an image. The value of N ranges from 1 to 20.
- delete
Auto BooleanSnapshot - description String
- The description of the image. It must be 2 to 256 characters in length and must not start with http:// or https://. Default value: null.
- encrypted Boolean
- Indicates whether to encrypt the image.
- force Boolean
- Indicates whether to force delete the custom image, Default is
false
.- true:Force deletes the custom image, regardless of whether the image is currently being used by other instances.
- false:Verifies that the image is not currently in use by any other instances before deleting the image.
- image
Name String - The image name. It must be 2 to 128 characters in length, and must begin with a letter or Chinese character (beginning with http:// or https:// is not allowed). It can contain digits, colons (:), underscores (_), or hyphens (-). Default value: null.
- kms
Key StringId - Key ID used to encrypt the image.
- name String
- source
Image StringId - The source image ID.
- source
Region StringId - The ID of the region to which the source custom image belongs. You can call DescribeRegions to view the latest regions of Alibaba Cloud.
- Map<Any>
- The tag value of an image. The value of N ranges from 1 to 20.
Import
image can be imported using the id, e.g.
$ pulumi import alicloud:ecs/imageCopy:ImageCopy default m-uf66871ape***yg1q***
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.