# AttachVolumeToInstanceParameters Object

## Description

Specifies parameters to use when attaching an EBS volume to an EC2 instance.

## Properties

### deviceName

Name of the device to attach the volume as. For example, `/dev/xvda1`.

Type: `string`

Required: Yes

### instanceId

ID of the EC2 instance to which the EBS volume will be attached. Required when `instanceIdentificationMethod` is `by-instance-id`.

Type: `string`

Required: Conditional

### instanceIdentificationMethod

Method of identifying the EC2 instance to which attach the volume.

Type: `string`

Valid Values:

* `by-instance-id`

Required: Yes

### isDetachExistingDevice

Indicates whether an existing device previously using the specified device name should be detached first. If a device is already using the specified device name, and this field is `false`, then the volume cannot be attached.

Type: `boolean`

Required: No

Default: `false`

### IsStopInstance

Indicates whether the target EC2 instance should be stopped when attaching the EBS volume.

Type: `boolean`

Required: No

Default: `false`

## Sample JSON

```javascript
{
    "instanceIdentificationMethod": "by-instance-id",
    "instanceId": "i-00000000",
    "deviceName": "/dev/xvda1",
    "isDetachExistingDevice": true,
    "isStopInstance": true
}
```
