Imports a disk image from S3 as a Snapshot.
resource "aws_ebs_snapshot_import" "example" {
disk_container {
format = "VHD"
user_bucket {
s3_bucket = "disk-images"
s3_key = "source.vhd"
}
}
role_name = "disk-image-import"
tags = {
Name = "HelloWorld"
}
}
This resource supports the following arguments:
client_data
- (Optional) The client-specific data. Detailed below.description
- (Optional) The description string for the import snapshot task.disk_container
- (Required) Information about the disk container. Detailed below.encrypted
- (Optional) Specifies whether the destination snapshot of the imported image should be encrypted. The default KMS key for EBS is used unless you specify a non-default KMS key using KmsKeyId.kms_key_id
- (Optional) An identifier for the symmetric KMS key to use when creating the encrypted snapshot. This parameter is only required if you want to use a non-default KMS key; if this parameter is not specified, the default KMS key for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.storage_tier
- (Optional) The name of the storage tier. Valid values are archive
and standard
. Default value is standard
.permanent_restore
- (Optional) Indicates whether to permanently restore an archived snapshot.temporary_restore_days
- (Optional) Specifies the number of days for which to temporarily restore an archived snapshot. Required for temporary restores only. The snapshot will be automatically re-archived after this period.role_name
- (Optional) The name of the IAM Role the VM Import/Export service will assume. This role needs certain permissions. See https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-role. Default: vmimport
tags
- (Optional) A map of tags to assign to the snapshot.comment
- (Optional) A user-defined comment about the disk upload.upload_start
- (Optional) The time that the disk upload starts.upload_end
- (Optional) The time that the disk upload ends.upload_size
- (Optional) The size of the uploaded disk image, in GiB.description
- (Optional) The description of the disk image being imported.format
- (Required) The format of the disk image being imported. One of VHD
or VMDK
.url
- (Optional) The URL to the Amazon S3-based disk image being imported. It can either be a https URL (https://..) or an Amazon S3 URL (s3://..). One of url
or user_bucket
must be set.user_bucket
- (Optional) The Amazon S3 bucket for the disk image. One of url
or user_bucket
must be set. Detailed below.s3_bucket
- The name of the Amazon S3 bucket where the disk image is located.s3_key
- The file name of the disk image.create
- (Default 60m
)delete
- (Default 10m
)This resource exports the following attributes in addition to the arguments above:
arn
- Amazon Resource Name (ARN) of the EBS Snapshot.id
- The snapshot ID (e.g., snap-59fcb34e).owner_id
- The AWS account ID of the EBS snapshot owner.owner_alias
- Value from an Amazon-maintained list (amazon
, aws-marketplace
, microsoft
) of snapshot owners.volume_size
- The size of the drive in GiBs.data_encryption_key_id
- The data encryption key identifier for the snapshot.tags_all
- A map of tags assigned to the resource, including those inherited from the provider default_tags
configuration block.