1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. CvmSyncImage
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.CvmSyncImage

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 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 exampleImages = tencentcloud.getImages({
        imageTypes: ["PRIVATE_IMAGE"],
        imageNameRegex: "MyImage",
    });
    const exampleCvmSyncImage = new tencentcloud.CvmSyncImage("exampleCvmSyncImage", {
        imageId: exampleImages.then(exampleImages => exampleImages.images?.[0]?.imageId),
        destinationRegions: [
            "ap-guangzhou",
            "ap-shanghai",
        ],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_images = tencentcloud.get_images(image_types=["PRIVATE_IMAGE"],
        image_name_regex="MyImage")
    example_cvm_sync_image = tencentcloud.CvmSyncImage("exampleCvmSyncImage",
        image_id=example_images.images[0].image_id,
        destination_regions=[
            "ap-guangzhou",
            "ap-shanghai",
        ])
    
    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 {
    		exampleImages, err := tencentcloud.GetImages(ctx, &tencentcloud.GetImagesArgs{
    			ImageTypes: []string{
    				"PRIVATE_IMAGE",
    			},
    			ImageNameRegex: pulumi.StringRef("MyImage"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewCvmSyncImage(ctx, "exampleCvmSyncImage", &tencentcloud.CvmSyncImageArgs{
    			ImageId: pulumi.String(exampleImages.Images[0].ImageId),
    			DestinationRegions: pulumi.StringArray{
    				pulumi.String("ap-guangzhou"),
    				pulumi.String("ap-shanghai"),
    			},
    		})
    		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 exampleImages = Tencentcloud.GetImages.Invoke(new()
        {
            ImageTypes = new[]
            {
                "PRIVATE_IMAGE",
            },
            ImageNameRegex = "MyImage",
        });
    
        var exampleCvmSyncImage = new Tencentcloud.CvmSyncImage("exampleCvmSyncImage", new()
        {
            ImageId = exampleImages.Apply(getImagesResult => getImagesResult.Images[0]?.ImageId),
            DestinationRegions = new[]
            {
                "ap-guangzhou",
                "ap-shanghai",
            },
        });
    
    });
    
    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 exampleImages = TencentcloudFunctions.getImages(GetImagesArgs.builder()
                .imageTypes("PRIVATE_IMAGE")
                .imageNameRegex("MyImage")
                .build());
    
            var exampleCvmSyncImage = new CvmSyncImage("exampleCvmSyncImage", CvmSyncImageArgs.builder()
                .imageId(exampleImages.applyValue(getImagesResult -> getImagesResult.images()[0].imageId()))
                .destinationRegions(            
                    "ap-guangzhou",
                    "ap-shanghai")
                .build());
    
        }
    }
    
    resources:
      exampleCvmSyncImage:
        type: tencentcloud:CvmSyncImage
        properties:
          imageId: ${exampleImages.images[0].imageId}
          destinationRegions:
            - ap-guangzhou
            - ap-shanghai
    variables:
      exampleImages:
        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,
                     image_name: Optional[str] = None,
                     image_set_required: Optional[bool] = 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.
    ImageName string
    Destination image name.
    ImageSetRequired bool
    Whether to return the ID of image created in the destination region.
    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.
    ImageName string
    Destination image name.
    ImageSetRequired bool
    Whether to return the ID of image created in the destination region.
    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.
    imageName String
    Destination image name.
    imageSetRequired Boolean
    Whether to return the ID of image created in the destination region.
    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.
    imageName string
    Destination image name.
    imageSetRequired boolean
    Whether to return the ID of image created in the destination region.
    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.
    image_name str
    Destination image name.
    image_set_required bool
    Whether to return the ID of image created in the destination region.
    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.
    imageName String
    Destination image name.
    imageSetRequired Boolean
    Whether to return the ID of image created in the destination region.

    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.
    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 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,
            image_id: Optional[str] = None,
            image_name: Optional[str] = None,
            image_set_required: Optional[bool] = 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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack