1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CvmSyncImage
tencentcloud 1.82.56 published on Friday, Jan 16, 2026 by tencentcloudstack
tencentcloud logo
tencentcloud 1.82.56 published on Friday, Jan 16, 2026 by tencentcloudstack

    Provides a resource to create a cvm sync_image

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = tencentcloud.getImages({
        imageTypes: ["PRIVATE_IMAGE"],
        imageNameRegex: "MyImage",
    });
    const exampleCvmSyncImage = new tencentcloud.CvmSyncImage("example", {
        imageId: example.then(example => example.images?.[0]?.imageId),
        destinationRegions: [
            "ap-guangzhou",
            "ap-shanghai",
        ],
        encrypt: true,
        kmsKeyId: "f063c18b-654b-11ef-9d9f-525400d3a886",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.get_images(image_types=["PRIVATE_IMAGE"],
        image_name_regex="MyImage")
    example_cvm_sync_image = tencentcloud.CvmSyncImage("example",
        image_id=example.images[0].image_id,
        destination_regions=[
            "ap-guangzhou",
            "ap-shanghai",
        ],
        encrypt=True,
        kms_key_id="f063c18b-654b-11ef-9d9f-525400d3a886")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := tencentcloud.GetImages(ctx, &tencentcloud.GetImagesArgs{
    			ImageTypes: []string{
    				"PRIVATE_IMAGE",
    			},
    			ImageNameRegex: pulumi.StringRef("MyImage"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCvmSyncImage(ctx, "example", &tencentcloud.CvmSyncImageArgs{
    			ImageId: pulumi.String(example.Images[0].ImageId),
    			DestinationRegions: pulumi.StringArray{
    				pulumi.String("ap-guangzhou"),
    				pulumi.String("ap-shanghai"),
    			},
    			Encrypt:  pulumi.Bool(true),
    			KmsKeyId: pulumi.String("f063c18b-654b-11ef-9d9f-525400d3a886"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Tencentcloud.GetImages.Invoke(new()
        {
            ImageTypes = new[]
            {
                "PRIVATE_IMAGE",
            },
            ImageNameRegex = "MyImage",
        });
    
        var exampleCvmSyncImage = new Tencentcloud.CvmSyncImage("example", new()
        {
            ImageId = example.Apply(getImagesResult => getImagesResult.Images[0]?.ImageId),
            DestinationRegions = new[]
            {
                "ap-guangzhou",
                "ap-shanghai",
            },
            Encrypt = true,
            KmsKeyId = "f063c18b-654b-11ef-9d9f-525400d3a886",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetImagesArgs;
    import com.pulumi.tencentcloud.CvmSyncImage;
    import com.pulumi.tencentcloud.CvmSyncImageArgs;
    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 example = TencentcloudFunctions.getImages(GetImagesArgs.builder()
                .imageTypes("PRIVATE_IMAGE")
                .imageNameRegex("MyImage")
                .build());
    
            var exampleCvmSyncImage = new CvmSyncImage("exampleCvmSyncImage", CvmSyncImageArgs.builder()
                .imageId(example.images()[0].imageId())
                .destinationRegions(            
                    "ap-guangzhou",
                    "ap-shanghai")
                .encrypt(true)
                .kmsKeyId("f063c18b-654b-11ef-9d9f-525400d3a886")
                .build());
    
        }
    }
    
    resources:
      exampleCvmSyncImage:
        type: tencentcloud:CvmSyncImage
        name: example
        properties:
          imageId: ${example.images[0].imageId}
          destinationRegions:
            - ap-guangzhou
            - ap-shanghai
          encrypt: true
          kmsKeyId: f063c18b-654b-11ef-9d9f-525400d3a886
    variables:
      example:
        fn::invoke:
          function: tencentcloud:getImages
          arguments:
            imageTypes:
              - PRIVATE_IMAGE
            imageNameRegex: MyImage
    

    Create CvmSyncImage Resource

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

    Constructor syntax

    new CvmSyncImage(name: string, args: CvmSyncImageArgs, opts?: CustomResourceOptions);
    @overload
    def CvmSyncImage(resource_name: str,
                     args: CvmSyncImageArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CvmSyncImage(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     destination_regions: Optional[Sequence[str]] = None,
                     image_id: Optional[str] = None,
                     cvm_sync_image_id: Optional[str] = None,
                     dry_run: Optional[bool] = None,
                     encrypt: Optional[bool] = None,
                     image_name: Optional[str] = None,
                     image_set_required: Optional[bool] = None,
                     kms_key_id: Optional[str] = None)
    func NewCvmSyncImage(ctx *Context, name string, args CvmSyncImageArgs, opts ...ResourceOption) (*CvmSyncImage, error)
    public CvmSyncImage(string name, CvmSyncImageArgs args, CustomResourceOptions? opts = null)
    public CvmSyncImage(String name, CvmSyncImageArgs args)
    public CvmSyncImage(String name, CvmSyncImageArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CvmSyncImage
    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 CvmSyncImageArgs
    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 CvmSyncImageArgs
    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 CvmSyncImageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CvmSyncImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CvmSyncImageArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    DestinationRegions List<string>
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    ImageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    CvmSyncImageId string
    ID of the resource.
    DryRun bool
    Checks whether image synchronization can be initiated.
    Encrypt bool
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    ImageName string
    Destination image name.
    ImageSetRequired bool
    Whether to return the ID of image created in the destination region.
    KmsKeyId string
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    DestinationRegions []string
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    ImageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    CvmSyncImageId string
    ID of the resource.
    DryRun bool
    Checks whether image synchronization can be initiated.
    Encrypt bool
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    ImageName string
    Destination image name.
    ImageSetRequired bool
    Whether to return the ID of image created in the destination region.
    KmsKeyId string
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    destinationRegions List<String>
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    imageId String
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    cvmSyncImageId String
    ID of the resource.
    dryRun Boolean
    Checks whether image synchronization can be initiated.
    encrypt Boolean
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    imageName String
    Destination image name.
    imageSetRequired Boolean
    Whether to return the ID of image created in the destination region.
    kmsKeyId String
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    destinationRegions string[]
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    imageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    cvmSyncImageId string
    ID of the resource.
    dryRun boolean
    Checks whether image synchronization can be initiated.
    encrypt boolean
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    imageName string
    Destination image name.
    imageSetRequired boolean
    Whether to return the ID of image created in the destination region.
    kmsKeyId string
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    destination_regions Sequence[str]
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    image_id str
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    cvm_sync_image_id str
    ID of the resource.
    dry_run bool
    Checks whether image synchronization can be initiated.
    encrypt bool
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    image_name str
    Destination image name.
    image_set_required bool
    Whether to return the ID of image created in the destination region.
    kms_key_id str
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    destinationRegions List<String>
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    imageId String
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    cvmSyncImageId String
    ID of the resource.
    dryRun Boolean
    Checks whether image synchronization can be initiated.
    encrypt Boolean
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    imageName String
    Destination image name.
    imageSetRequired Boolean
    Whether to return the ID of image created in the destination region.
    kmsKeyId String
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CvmSyncImage resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    ImageSets List<CvmSyncImageImageSet>
    ID of the image created in the destination region.
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageSets []CvmSyncImageImageSet
    ID of the image created in the destination region.
    id String
    The provider-assigned unique ID for this managed resource.
    imageSets List<CvmSyncImageImageSet>
    ID of the image created in the destination region.
    id string
    The provider-assigned unique ID for this managed resource.
    imageSets CvmSyncImageImageSet[]
    ID of the image created in the destination region.
    id str
    The provider-assigned unique ID for this managed resource.
    image_sets Sequence[CvmSyncImageImageSet]
    ID of the image created in the destination region.
    id String
    The provider-assigned unique ID for this managed resource.
    imageSets List<Property Map>
    ID of the image created in the destination region.

    Look up Existing CvmSyncImage Resource

    Get an existing CvmSyncImage 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?: CvmSyncImageState, opts?: CustomResourceOptions): CvmSyncImage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cvm_sync_image_id: Optional[str] = None,
            destination_regions: Optional[Sequence[str]] = None,
            dry_run: Optional[bool] = None,
            encrypt: Optional[bool] = None,
            image_id: Optional[str] = None,
            image_name: Optional[str] = None,
            image_set_required: Optional[bool] = None,
            image_sets: Optional[Sequence[CvmSyncImageImageSetArgs]] = None,
            kms_key_id: Optional[str] = None) -> CvmSyncImage
    func GetCvmSyncImage(ctx *Context, name string, id IDInput, state *CvmSyncImageState, opts ...ResourceOption) (*CvmSyncImage, error)
    public static CvmSyncImage Get(string name, Input<string> id, CvmSyncImageState? state, CustomResourceOptions? opts = null)
    public static CvmSyncImage get(String name, Output<String> id, CvmSyncImageState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CvmSyncImage    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CvmSyncImageId string
    ID of the resource.
    DestinationRegions List<string>
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    DryRun bool
    Checks whether image synchronization can be initiated.
    Encrypt bool
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    ImageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    ImageName string
    Destination image name.
    ImageSetRequired bool
    Whether to return the ID of image created in the destination region.
    ImageSets List<CvmSyncImageImageSet>
    ID of the image created in the destination region.
    KmsKeyId string
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    CvmSyncImageId string
    ID of the resource.
    DestinationRegions []string
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    DryRun bool
    Checks whether image synchronization can be initiated.
    Encrypt bool
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    ImageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    ImageName string
    Destination image name.
    ImageSetRequired bool
    Whether to return the ID of image created in the destination region.
    ImageSets []CvmSyncImageImageSetArgs
    ID of the image created in the destination region.
    KmsKeyId string
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    cvmSyncImageId String
    ID of the resource.
    destinationRegions List<String>
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    dryRun Boolean
    Checks whether image synchronization can be initiated.
    encrypt Boolean
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    imageId String
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    imageName String
    Destination image name.
    imageSetRequired Boolean
    Whether to return the ID of image created in the destination region.
    imageSets List<CvmSyncImageImageSet>
    ID of the image created in the destination region.
    kmsKeyId String
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    cvmSyncImageId string
    ID of the resource.
    destinationRegions string[]
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    dryRun boolean
    Checks whether image synchronization can be initiated.
    encrypt boolean
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    imageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    imageName string
    Destination image name.
    imageSetRequired boolean
    Whether to return the ID of image created in the destination region.
    imageSets CvmSyncImageImageSet[]
    ID of the image created in the destination region.
    kmsKeyId string
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    cvm_sync_image_id str
    ID of the resource.
    destination_regions Sequence[str]
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    dry_run bool
    Checks whether image synchronization can be initiated.
    encrypt bool
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    image_id str
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    image_name str
    Destination image name.
    image_set_required bool
    Whether to return the ID of image created in the destination region.
    image_sets Sequence[CvmSyncImageImageSetArgs]
    ID of the image created in the destination region.
    kms_key_id str
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.
    cvmSyncImageId String
    ID of the resource.
    destinationRegions List<String>
    List of destination regions for synchronization. Limits: It must be a valid region. For a custom image, the destination region cannot be the source region. For a shared image, the destination region must be the source region, which indicates to create a copy of the image as a custom image in the same region.
    dryRun Boolean
    Checks whether image synchronization can be initiated.
    encrypt Boolean
    Whether to synchronize as an encrypted custom image. Default value is false. Synchronization to an encrypted custom image is only supported within the same region.
    imageId String
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    imageName String
    Destination image name.
    imageSetRequired Boolean
    Whether to return the ID of image created in the destination region.
    imageSets List<Property Map>
    ID of the image created in the destination region.
    kmsKeyId String
    KMS key ID used when synchronizing to an encrypted custom image. This parameter is valid only synchronizing to an encrypted image. If KmsKeyId is not specified, the default CBS cloud product KMS key is used.

    Supporting Types

    CvmSyncImageImageSet, CvmSyncImageImageSetArgs

    ImageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    Region string
    Region of the image.
    ImageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    Region string
    Region of the image.
    imageId String
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    region String
    Region of the image.
    imageId string
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    region string
    Region of the image.
    image_id str
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    region str
    Region of the image.
    imageId String
    Image ID. The specified image must meet the following requirement: the images must be in the NORMAL state.
    region String
    Region of the image.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.82.56 published on Friday, Jan 16, 2026 by tencentcloudstack
      Meet Neo: Your AI Platform Teammate