# BlockDeviceMappingProperty

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_opsworks as opsworks } from 'aws-cdk-lib';
const blockDeviceMappingProperty: opsworks.CfnInstance.BlockDeviceMappingProperty = {
  deviceName: 'deviceName',
  ebs: {
    deleteOnTermination: false,
    iops: 123,
    snapshotId: 'snapshotId',
    volumeSize: 123,
    volumeType: 'volumeType',
  },
  noDevice: 'noDevice',
  virtualName: 'virtualName',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_opsworks as opsworks

block_device_mapping_property = opsworks.CfnInstance.BlockDeviceMappingProperty(
    device_name="deviceName",
    ebs=opsworks.CfnInstance.EbsBlockDeviceProperty(
        delete_on_termination=False,
        iops=123,
        snapshot_id="snapshotId",
        volume_size=123,
        volume_type="volumeType"
    ),
    no_device="noDevice",
    virtual_name="virtualName"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.opsworks.*;

BlockDeviceMappingProperty blockDeviceMappingProperty = BlockDeviceMappingProperty.builder()
        .deviceName("deviceName")
        .ebs(EbsBlockDeviceProperty.builder()
                .deleteOnTermination(false)
                .iops(123)
                .snapshotId("snapshotId")
                .volumeSize(123)
                .volumeType("volumeType")
                .build())
        .noDevice("noDevice")
        .virtualName("virtualName")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.OpsWorks;

var blockDeviceMappingProperty = new BlockDeviceMappingProperty {
    DeviceName = "deviceName",
    Ebs = new EbsBlockDeviceProperty {
        DeleteOnTermination = false,
        Iops = 123,
        SnapshotId = "snapshotId",
        VolumeSize = 123,
        VolumeType = "volumeType"
    },
    NoDevice = "noDevice",
    VirtualName = "virtualName"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

blockDeviceMappingProperty := &BlockDeviceMappingProperty{
	DeviceName: jsii.String("deviceName"),
	Ebs: &EbsBlockDeviceProperty{
		DeleteOnTermination: jsii.Boolean(false),
		Iops: jsii.Number(123),
		SnapshotId: jsii.String("snapshotId"),
		VolumeSize: jsii.Number(123),
		VolumeType: jsii.String("volumeType"),
	},
	NoDevice: jsii.String("noDevice"),
	VirtualName: jsii.String("virtualName"),
}
```

## Properties

- `deviceName`: string — The device name that is exposed to the instance, such as `/dev/sdh` .

  For the root device, you can use the explicit device name or you can set this parameter to `ROOT_DEVICE` and OpsWorks Stacks will provide the correct device name.

- `ebs`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInstance.EbsBlockDeviceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_opsworks.CfnInstance.EbsBlockDeviceProperty.html) — An `EBSBlockDevice` that defines how to configure an Amazon EBS volume when the instance is launched.

  You can specify either the `VirtualName` or `Ebs` , but not both.

- `noDevice`: string — Suppresses the specified device included in the AMI's block device mapping.

- `virtualName`: string — The virtual device name.

  For more information, see [BlockDeviceMapping](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) . You can specify either the `VirtualName` or `Ebs` , but not both.
