tencentcloud.Image
Explore with Pulumi AI
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)
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:
- Image
Name string - Image name.
- Data
Disk List<string>Ids - 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 string - Image Description.
- Image
Family string - Set image family. Example value:
business-daily-update
. - Image
Id string - ID of the resource.
- Instance
Id string - Cloud server instance ID.
- Snapshot
Ids 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.
- Dictionary<string, string>
- Tags of the image.
- Image
Name string - Image name.
- Data
Disk []stringIds - 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 string - Image Description.
- Image
Family string - Set image family. Example value:
business-daily-update
. - Image
Id string - ID of the resource.
- Instance
Id string - Cloud server instance ID.
- Snapshot
Ids []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.
- map[string]string
- Tags of the image.
- image
Name String - Image name.
- data
Disk List<String>Ids - 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 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. - image
Description String - Image Description.
- image
Family String - Set image family. Example value:
business-daily-update
. - image
Id String - ID of the resource.
- instance
Id String - Cloud server instance ID.
- snapshot
Ids 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.
- Map<String,String>
- Tags of the image.
- image
Name string - Image name.
- data
Disk string[]Ids - 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 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. - image
Description string - Image Description.
- image
Family string - Set image family. Example value:
business-daily-update
. - image
Id string - ID of the resource.
- instance
Id string - Cloud server instance ID.
- snapshot
Ids 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.
- {[key: string]: string}
- Tags of the image.
- image_
name str - Image name.
- data_
disk_ Sequence[str]ids - 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.
- Mapping[str, str]
- Tags of the image.
- image
Name String - Image name.
- data
Disk List<String>Ids - 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 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. - image
Description String - Image Description.
- image
Family String - Set image family. Example value:
business-daily-update
. - image
Id String - ID of the resource.
- instance
Id String - Cloud server instance ID.
- snapshot
Ids 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.
- 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.
- Data
Disk List<string>Ids - 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 string - Image Description.
- Image
Family string - Set image family. Example value:
business-daily-update
. - Image
Id string - ID of the resource.
- Image
Name string - Image name.
- Instance
Id string - Cloud server instance ID.
- Snapshot
Ids 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.
- Dictionary<string, string>
- Tags of the image.
- Data
Disk []stringIds - 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 string - Image Description.
- Image
Family string - Set image family. Example value:
business-daily-update
. - Image
Id string - ID of the resource.
- Image
Name string - Image name.
- Instance
Id string - Cloud server instance ID.
- Snapshot
Ids []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.
- map[string]string
- Tags of the image.
- data
Disk List<String>Ids - 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 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. - image
Description String - Image Description.
- image
Family String - Set image family. Example value:
business-daily-update
. - image
Id String - ID of the resource.
- image
Name String - Image name.
- instance
Id String - Cloud server instance ID.
- snapshot
Ids 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.
- Map<String,String>
- Tags of the image.
- data
Disk string[]Ids - 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 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. - image
Description string - Image Description.
- image
Family string - Set image family. Example value:
business-daily-update
. - image
Id string - ID of the resource.
- image
Name string - Image name.
- instance
Id string - Cloud server instance ID.
- snapshot
Ids 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.
- {[key: string]: string}
- Tags of the image.
- data_
disk_ Sequence[str]ids - 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.
- Mapping[str, str]
- Tags of the image.
- data
Disk List<String>Ids - 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 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. - image
Description String - Image Description.
- image
Family String - Set image family. Example value:
business-daily-update
. - image
Id String - ID of the resource.
- image
Name String - Image name.
- instance
Id String - Cloud server instance ID.
- snapshot
Ids 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.
- 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.