You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: "Whether to return the ID of image created in the destination region.",
59
60
},
61
+
62
+
"encrypt": {
63
+
Optional: true,
64
+
ForceNew: true,
65
+
Type: schema.TypeBool,
66
+
Description: "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.",
67
+
},
68
+
69
+
"kms_key_id": {
70
+
Optional: true,
71
+
ForceNew: true,
72
+
Type: schema.TypeString,
73
+
Description: "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.",
74
+
},
75
+
76
+
"image_set": {
77
+
Computed: true,
78
+
Type: schema.TypeSet,
79
+
Elem: &schema.Schema{
80
+
Type: schema.TypeString,
81
+
},
82
+
Description: "ID of the image created in the destination region.",
83
+
},
60
84
},
61
85
}
62
86
}
@@ -67,6 +91,7 @@ func resourceTencentCloudCvmSyncImageCreate(d *schema.ResourceData, meta interfa
67
91
68
92
logId:=tccommon.GetLogId(tccommon.ContextNil)
69
93
request:=cvm.NewSyncImagesRequest()
94
+
response:=cvm.NewSyncImagesResponse()
70
95
imageId:=d.Get("image_id").(string)
71
96
request.ImageIds= []*string{&imageId}
72
97
@@ -78,34 +103,50 @@ func resourceTencentCloudCvmSyncImageCreate(d *schema.ResourceData, meta interfa
78
103
}
79
104
}
80
105
81
-
ifv, _:=d.GetOk("dry_run"); v!=nil {
106
+
ifv, ok:=d.GetOkExists("dry_run"); ok {
82
107
request.DryRun=helper.Bool(v.(bool))
83
108
}
84
109
85
110
ifv, ok:=d.GetOk("image_name"); ok {
86
111
request.ImageName=helper.String(v.(string))
87
112
}
88
113
89
-
ifv, _:=d.GetOk("image_set_required"); v!=nil {
114
+
ifv, ok:=d.GetOkExists("image_set_required"); ok {
@@ -32,14 +34,16 @@ The following arguments are supported:
32
34
*`destination_regions` - (Required, Set: [`String`], ForceNew) 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.
33
35
*`image_id` - (Required, String, ForceNew) Image ID. The specified image must meet the following requirement: the images must be in the `NORMAL` state.
34
36
*`dry_run` - (Optional, Bool, ForceNew) Checks whether image synchronization can be initiated.
37
+
*`encrypt` - (Optional, Bool, ForceNew) 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_set_required` - (Optional, Bool, ForceNew) Whether to return the ID of image created in the destination region.
40
+
*`kms_key_id` - (Optional, String, ForceNew) 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.
37
41
38
42
## Attributes Reference
39
43
40
44
In addition to all arguments above, the following attributes are exported:
41
45
42
46
*`id` - ID of the resource.
43
-
47
+
*`image_set` - ID of the image created in the destination region.
0 commit comments