Skip to content

Resource: awsEbsSnapshotImport

Imports a disk image from S3 as a Snapshot.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.ebsSnapshotImport.EbsSnapshotImport(this, "example", {
  diskContainer: {
    format: "VHD",
    userBucket: {
      s3Bucket: "disk-images",
      s3Key: "source.vhd",
    },
  },
  roleName: "disk-image-import",
  tags: {
    Name: "HelloWorld",
  },
});

Argument Reference

The following arguments are supported:

  • clientData - (Optional) The client-specific data. Detailed below.
  • description - (Optional) The description string for the import snapshot task.
  • diskContainer - (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.
  • kmsKeyId - (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.
  • storageTier - (Optional) The name of the storage tier. Valid values are archive and standard. Default value is standard.
  • permanentRestore - (Optional) Indicates whether to permanently restore an archived snapshot.
  • temporaryRestoreDays - (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.
  • roleName - (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.

client_data Configuration Block

  • comment - (Optional) A user-defined comment about the disk upload.
  • uploadStart - (Optional) The time that the disk upload starts.
  • uploadEnd - (Optional) The time that the disk upload ends.
  • uploadSize - (Optional) The size of the uploaded disk image, in GiB.

disk_container Configuration Block

  • 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 userBucket must be set.
  • userBucket - (Optional) The Amazon S3 bucket for the disk image. One of url or userBucket must be set. Detailed below.

user_bucket Configuration Block

  • s3Bucket - The name of the Amazon S3 bucket where the disk image is located.
  • s3Key - The file name of the disk image.

Timeouts

Configuration options:

  • create - (Default 60M)
  • delete - (Default 10M)

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - Amazon Resource Name (ARN) of the EBS Snapshot.
  • id - The snapshot ID (e.g., snap-59fcb34e).
  • ownerId - The AWS account ID of the EBS snapshot owner.
  • ownerAlias - Value from an Amazon-maintained list (amazon, awsMarketplace, microsoft) of snapshot owners.
  • volumeSize - The size of the drive in GiBs.
  • dataEncryptionKeyId - The data encryption key identifier for the snapshot.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.