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

tencentcloud.Image

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provide a resource to manage image.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const imageSnap = new tencentcloud.Image("imageSnap", {
        forcePoweroff: true,
        imageDescription: "create image with snapshot",
        imageName: "image-snapshot-keep",
        snapshotIds: [
            "snap-nbp3xy1d",
            "snap-nvzu3dmh",
        ],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    image_snap = tencentcloud.Image("imageSnap",
        force_poweroff=True,
        image_description="create image with snapshot",
        image_name="image-snapshot-keep",
        snapshot_ids=[
            "snap-nbp3xy1d",
            "snap-nvzu3dmh",
        ])
    
    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 {
    		_, err := tencentcloud.NewImage(ctx, "imageSnap", &tencentcloud.ImageArgs{
    			ForcePoweroff:    pulumi.Bool(true),
    			ImageDescription: pulumi.String("create image with snapshot"),
    			ImageName:        pulumi.String("image-snapshot-keep"),
    			SnapshotIds: pulumi.StringArray{
    				pulumi.String("snap-nbp3xy1d"),
    				pulumi.String("snap-nvzu3dmh"),
    			},
    		})
    		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 imageSnap = new Tencentcloud.Image("imageSnap", new()
        {
            ForcePoweroff = true,
            ImageDescription = "create image with snapshot",
            ImageName = "image-snapshot-keep",
            SnapshotIds = new[]
            {
                "snap-nbp3xy1d",
                "snap-nvzu3dmh",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Image;
    import com.pulumi.tencentcloud.ImageArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var imageSnap = new Image("imageSnap", ImageArgs.builder()
                .forcePoweroff(true)
                .imageDescription("create image with snapshot")
                .imageName("image-snapshot-keep")
                .snapshotIds(            
                    "snap-nbp3xy1d",
                    "snap-nvzu3dmh")
                .build());
    
        }
    }
    
    resources:
      imageSnap:
        type: tencentcloud:Image
        properties:
          forcePoweroff: true
          imageDescription: create image with snapshot
          imageName: image-snapshot-keep
          snapshotIds:
            - snap-nbp3xy1d
            - snap-nvzu3dmh
    

    Use image family

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const imageFamily = new tencentcloud.Image("imageFamily", {
        dataDiskIds: [],
        imageDescription: "create image with snapshot 12323",
        imageFamily: "business-daily-update",
        imageName: "image-family-test123",
        snapshotIds: ["snap-7uuvrcoj"],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    image_family = tencentcloud.Image("imageFamily",
        data_disk_ids=[],
        image_description="create image with snapshot 12323",
        image_family="business-daily-update",
        image_name="image-family-test123",
        snapshot_ids=["snap-7uuvrcoj"])
    
    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 {
    		_, err := tencentcloud.NewImage(ctx, "imageFamily", &tencentcloud.ImageArgs{
    			DataDiskIds:      pulumi.StringArray{},
    			ImageDescription: pulumi.String("create image with snapshot 12323"),
    			ImageFamily:      pulumi.String("business-daily-update"),
    			ImageName:        pulumi.String("image-family-test123"),
    			SnapshotIds: pulumi.StringArray{
    				pulumi.String("snap-7uuvrcoj"),
    			},
    		})
    		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 imageFamily = new Tencentcloud.Image("imageFamily", new()
        {
            DataDiskIds = new[] {},
            ImageDescription = "create image with snapshot 12323",
            ImageFamily = "business-daily-update",
            ImageName = "image-family-test123",
            SnapshotIds = new[]
            {
                "snap-7uuvrcoj",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Image;
    import com.pulumi.tencentcloud.ImageArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var imageFamily = new Image("imageFamily", ImageArgs.builder()
                .dataDiskIds()
                .imageDescription("create image with snapshot 12323")
                .imageFamily("business-daily-update")
                .imageName("image-family-test123")
                .snapshotIds("snap-7uuvrcoj")
                .build());
    
        }
    }
    
    resources:
      imageFamily:
        type: tencentcloud:Image
        properties:
          dataDiskIds: []
          imageDescription: create image with snapshot 12323
          imageFamily: business-daily-update
          imageName: image-family-test123
          snapshotIds:
            - snap-7uuvrcoj
    

    Create Image Resource

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

    Constructor syntax

    new Image(name: string, args: ImageArgs, opts?: CustomResourceOptions);
    @overload
    def Image(resource_name: str,
              args: ImageArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Image(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              image_name: Optional[str] = None,
              data_disk_ids: Optional[Sequence[str]] = None,
              force_poweroff: Optional[bool] = None,
              image_description: Optional[str] = None,
              image_family: Optional[str] = None,
              image_id: Optional[str] = None,
              instance_id: Optional[str] = None,
              snapshot_ids: Optional[Sequence[str]] = None,
              sysprep: Optional[bool] = None,
              tags: Optional[Mapping[str, str]] = None)
    func NewImage(ctx *Context, name string, args ImageArgs, opts ...ResourceOption) (*Image, error)
    public Image(string name, ImageArgs args, CustomResourceOptions? opts = null)
    public Image(String name, ImageArgs args)
    public Image(String name, ImageArgs args, CustomResourceOptions options)
    
    type: tencentcloud:Image
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ImageArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ImageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ImageArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Image Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Image resource accepts the following input properties:

    ImageName string
    Image name.
    DataDiskIds List<string>
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    ForcePoweroff bool
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    ImageDescription string
    Image Description.
    ImageFamily string
    Set image family. Example value: business-daily-update.
    ImageId string
    ID of the resource.
    InstanceId string
    Cloud server instance ID.
    SnapshotIds List<string>
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    Sysprep bool
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    Tags Dictionary<string, string>
    Tags of the image.
    ImageName string
    Image name.
    DataDiskIds []string
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    ForcePoweroff bool
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    ImageDescription string
    Image Description.
    ImageFamily string
    Set image family. Example value: business-daily-update.
    ImageId string
    ID of the resource.
    InstanceId string
    Cloud server instance ID.
    SnapshotIds []string
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    Sysprep bool
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    Tags map[string]string
    Tags of the image.
    imageName String
    Image name.
    dataDiskIds List<String>
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    forcePoweroff Boolean
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    imageDescription String
    Image Description.
    imageFamily String
    Set image family. Example value: business-daily-update.
    imageId String
    ID of the resource.
    instanceId String
    Cloud server instance ID.
    snapshotIds List<String>
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep Boolean
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags Map<String,String>
    Tags of the image.
    imageName string
    Image name.
    dataDiskIds string[]
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    forcePoweroff boolean
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    imageDescription string
    Image Description.
    imageFamily string
    Set image family. Example value: business-daily-update.
    imageId string
    ID of the resource.
    instanceId string
    Cloud server instance ID.
    snapshotIds string[]
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep boolean
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags {[key: string]: string}
    Tags of the image.
    image_name str
    Image name.
    data_disk_ids Sequence[str]
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    force_poweroff bool
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    image_description str
    Image Description.
    image_family str
    Set image family. Example value: business-daily-update.
    image_id str
    ID of the resource.
    instance_id str
    Cloud server instance ID.
    snapshot_ids Sequence[str]
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep bool
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags Mapping[str, str]
    Tags of the image.
    imageName String
    Image name.
    dataDiskIds List<String>
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    forcePoweroff Boolean
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    imageDescription String
    Image Description.
    imageFamily String
    Set image family. Example value: business-daily-update.
    imageId String
    ID of the resource.
    instanceId String
    Cloud server instance ID.
    snapshotIds List<String>
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep Boolean
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags Map<String>
    Tags of the image.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Image 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 Image Resource

    Get an existing Image resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ImageState, opts?: CustomResourceOptions): Image
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data_disk_ids: Optional[Sequence[str]] = None,
            force_poweroff: Optional[bool] = None,
            image_description: Optional[str] = None,
            image_family: Optional[str] = None,
            image_id: Optional[str] = None,
            image_name: Optional[str] = None,
            instance_id: Optional[str] = None,
            snapshot_ids: Optional[Sequence[str]] = None,
            sysprep: Optional[bool] = None,
            tags: Optional[Mapping[str, str]] = None) -> Image
    func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
    public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)
    public static Image get(String name, Output<String> id, ImageState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:Image    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DataDiskIds List<string>
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    ForcePoweroff bool
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    ImageDescription string
    Image Description.
    ImageFamily string
    Set image family. Example value: business-daily-update.
    ImageId string
    ID of the resource.
    ImageName string
    Image name.
    InstanceId string
    Cloud server instance ID.
    SnapshotIds List<string>
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    Sysprep bool
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    Tags Dictionary<string, string>
    Tags of the image.
    DataDiskIds []string
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    ForcePoweroff bool
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    ImageDescription string
    Image Description.
    ImageFamily string
    Set image family. Example value: business-daily-update.
    ImageId string
    ID of the resource.
    ImageName string
    Image name.
    InstanceId string
    Cloud server instance ID.
    SnapshotIds []string
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    Sysprep bool
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    Tags map[string]string
    Tags of the image.
    dataDiskIds List<String>
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    forcePoweroff Boolean
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    imageDescription String
    Image Description.
    imageFamily String
    Set image family. Example value: business-daily-update.
    imageId String
    ID of the resource.
    imageName String
    Image name.
    instanceId String
    Cloud server instance ID.
    snapshotIds List<String>
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep Boolean
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags Map<String,String>
    Tags of the image.
    dataDiskIds string[]
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    forcePoweroff boolean
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    imageDescription string
    Image Description.
    imageFamily string
    Set image family. Example value: business-daily-update.
    imageId string
    ID of the resource.
    imageName string
    Image name.
    instanceId string
    Cloud server instance ID.
    snapshotIds string[]
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep boolean
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags {[key: string]: string}
    Tags of the image.
    data_disk_ids Sequence[str]
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    force_poweroff bool
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    image_description str
    Image Description.
    image_family str
    Set image family. Example value: business-daily-update.
    image_id str
    ID of the resource.
    image_name str
    Image name.
    instance_id str
    Cloud server instance ID.
    snapshot_ids Sequence[str]
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep bool
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags Mapping[str, str]
    Tags of the image.
    dataDiskIds List<String>
    Cloud disk ID list, When creating a whole machine image based on an instance, specify the data disk ID contained in the image.
    forcePoweroff Boolean
    Set whether to force shutdown during mirroring. The default value is false, when set to true, it means that the mirror will be made after shutdown.
    imageDescription String
    Image Description.
    imageFamily String
    Set image family. Example value: business-daily-update.
    imageId String
    ID of the resource.
    imageName String
    Image name.
    instanceId String
    Cloud server instance ID.
    snapshotIds List<String>
    Cloud disk snapshot ID list; creating a mirror based on a snapshot must include a system disk snapshot. It cannot be passed in simultaneously with InstanceId.
    sysprep Boolean
    Sysprep function under Windows. When creating a Windows image, you can select true or false to enable or disable the Syspre function.
    tags Map<String>
    Tags of the image.

    Import

    image instance can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/image:Image image_snap img-gf7jspk6
    

    To learn more about importing existing cloud resources, see Importing resources.

    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