tencentcloud.CvmSyncImage
Explore with Pulumi AI
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:
- Destination
Regions 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.
- Image
Id string - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - Cvm
Sync stringImage Id - ID of the resource.
- Dry
Run bool - Checks whether image synchronization can be initiated.
- Image
Name string - Destination image name.
- Image
Set boolRequired - Whether to return the ID of image created in the destination region.
- Destination
Regions []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.
- Image
Id string - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - Cvm
Sync stringImage Id - ID of the resource.
- Dry
Run bool - Checks whether image synchronization can be initiated.
- Image
Name string - Destination image name.
- Image
Set boolRequired - Whether to return the ID of image created in the destination region.
- destination
Regions 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.
- image
Id String - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - cvm
Sync StringImage Id - ID of the resource.
- dry
Run Boolean - Checks whether image synchronization can be initiated.
- image
Name String - Destination image name.
- image
Set BooleanRequired - Whether to return the ID of image created in the destination region.
- destination
Regions 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.
- image
Id string - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - cvm
Sync stringImage Id - ID of the resource.
- dry
Run boolean - Checks whether image synchronization can be initiated.
- image
Name string - Destination image name.
- image
Set booleanRequired - 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_ strimage_ id - ID of the resource.
- dry_
run bool - Checks whether image synchronization can be initiated.
- image_
name str - Destination image name.
- image_
set_ boolrequired - Whether to return the ID of image created in the destination region.
- destination
Regions 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.
- image
Id String - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - cvm
Sync StringImage Id - ID of the resource.
- dry
Run Boolean - Checks whether image synchronization can be initiated.
- image
Name String - Destination image name.
- image
Set BooleanRequired - 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.
- Cvm
Sync stringImage Id - ID of the resource.
- Destination
Regions 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.
- Dry
Run bool - Checks whether image synchronization can be initiated.
- Image
Id string - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - Image
Name string - Destination image name.
- Image
Set boolRequired - Whether to return the ID of image created in the destination region.
- Cvm
Sync stringImage Id - ID of the resource.
- Destination
Regions []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.
- Dry
Run bool - Checks whether image synchronization can be initiated.
- Image
Id string - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - Image
Name string - Destination image name.
- Image
Set boolRequired - Whether to return the ID of image created in the destination region.
- cvm
Sync StringImage Id - ID of the resource.
- destination
Regions 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.
- dry
Run Boolean - Checks whether image synchronization can be initiated.
- image
Id String - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - image
Name String - Destination image name.
- image
Set BooleanRequired - Whether to return the ID of image created in the destination region.
- cvm
Sync stringImage Id - ID of the resource.
- destination
Regions 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.
- dry
Run boolean - Checks whether image synchronization can be initiated.
- image
Id string - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - image
Name string - Destination image name.
- image
Set booleanRequired - Whether to return the ID of image created in the destination region.
- cvm_
sync_ strimage_ id - 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_ boolrequired - Whether to return the ID of image created in the destination region.
- cvm
Sync StringImage Id - ID of the resource.
- destination
Regions 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.
- dry
Run Boolean - Checks whether image synchronization can be initiated.
- image
Id String - Image ID. The specified image must meet the following requirement: the images must be in the
NORMAL
state. - image
Name String - Destination image name.
- image
Set BooleanRequired - 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.