pulumi_wasm_providers_aws_mini::ec2

Module volume_attachment

source
Expand description

Provides an AWS EBS Volume Attachment as a top level resource, to attach and detach volumes from AWS Instances.

NOTE on EBS block devices: If you use ebs_block_device on an aws.ec2.Instance, this provider will assume management over the full set of non-root EBS block devices for the instance, and treats additional block devices as drift. For this reason, ebs_block_device cannot be mixed with external aws.ebs.Volume + aws.ec2.VolumeAttachment resources for a given instance.

§Example Usage

resources:
  ebsAtt:
    type: aws:ec2:VolumeAttachment
    name: ebs_att
    properties:
      deviceName: /dev/sdh
      volumeId: ${example.id}
      instanceId: ${web.id}
  web:
    type: aws:ec2:Instance
    properties:
      ami: ami-21f78e11
      availabilityZone: us-west-2a
      instanceType: t2.micro
      tags:
        Name: HelloWorld
  example:
    type: aws:ebs:Volume
    properties:
      availabilityZone: us-west-2a
      size: 1

§Import

Using pulumi import, import EBS Volume Attachments using DEVICE_NAME:VOLUME_ID:INSTANCE_ID. For example:

$ pulumi import aws:ec2/volumeAttachment:VolumeAttachment example /dev/sdh:vol-049df61146c4d7901:i-12345678

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments