AWS Fundamentals Logo
AWS Fundamentals
AWS::EC2::VolumeAttachment

EC2 VolumeAttachment

Attaches an Amazon EBS volume to a running instance and exposes it to the instance with the specified device name. Before this resource can be deleted (and therefore the volume detached), you must first unmount the volume in the instance. Failure to do so results in the volume being stuck in the busy state while it is trying to detach, which could possibly damage the file system or the data it contains. If an Amazon EBS volume is the root device of an instance, it cannot be detached while t...

Properties

4 configurable properties. 2 required. Click a row to see details.

Filter:
PropertyTypeFlags
InstanceId
string
RequiredCreate-only
VolumeId
string
RequiredCreate-only
Device
string
Create-only
EbsCardIndex
integer
Create-only

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::VolumeAttachment

Resources:
  MyResource:
    Type: AWS::EC2::VolumeAttachment
    Properties:
      VolumeId: "my-volumeid"
      InstanceId: "my-instanceid"

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

create

ec2:AttachVolumeec2:DescribeVolumes

read

ec2:DescribeVolumes

delete

ec2:DetachVolumeec2:DescribeVolumes

list

ec2:DescribeVolumes

Get the EC2 Cheat Sheet

Everything you need to know about EC2 on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceEC2
Properties4
Required2
TaggingNot supported
Primary IDVolumeId

Supported Operations

CreateReadDeleteList

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

DeviceInstanceIdVolumeIdEbsCardIndex

External Links