# CfnVolumeAttachmentProps

Properties for defining a `CfnVolumeAttachment`.

Extends: CfnVolumeAttachmentProps
Used as props by: CfnVolumeAttachment

- Source: Generated code
- Type last changed: v2.238.0 · 9 Feb 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnVolumeAttachmentProps: ec2.CfnVolumeAttachmentProps = {
  instanceId: 'instanceId',
  volumeId: 'volumeId',

  // the properties below are optional
  device: 'device',
  ebsCardIndex: 123,
};
```

## Properties

- `device`: string — The device name (for example, `/dev/sdh` or `xvdh` ).

- `ebsCardIndex`: number — The index of the EBS card.

  Some instance types support multiple EBS cards. The default EBS card index is 0.

- `instanceId`: string | [IInstanceRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.IInstanceRef.html) (required) — The ID of the instance to which the volume attaches.

  This value can be a reference to an [`AWS::EC2::Instance`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) resource, or it can be the physical ID of an existing EC2 instance.

- `volumeId`: string | [IVolumeRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.IVolumeRef.html) (required) — The ID of the Amazon EBS volume.

  The volume and instance must be within the same Availability Zone. This value can be a reference to an [`AWS::EC2::Volume`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html) resource, or it can be the volume ID of an existing Amazon EBS volume.
