# Device

A container instance host device.

Used as argument in: [LinuxParameters.addDevices](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.LinuxParameters.html#adddevices)

- Source: [`aws-batch/lib/linux-parameters.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-batch/lib/linux-parameters.ts#L165)
- Type last changed: v2.96.0 · 13 Sep 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_batch as batch } from 'aws-cdk-lib';
const device: batch.Device = {
  hostPath: 'hostPath',

  // the properties below are optional
  containerPath: 'containerPath',
  permissions: [batch.DevicePermission.READ],
};
```

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_batch as batch

device = batch.Device(
    host_path="hostPath",

    # the properties below are optional
    container_path="containerPath",
    permissions=[batch.DevicePermission.READ]
)
```

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.batch.*;

Device device = Device.builder()
        .hostPath("hostPath")

        // the properties below are optional
        .containerPath("containerPath")
        .permissions(List.of(DevicePermission.READ))
        .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.Batch;

var device = new Device {
    HostPath = "hostPath",

    // the properties below are optional
    ContainerPath = "containerPath",
    Permissions = new [] { DevicePermission.READ }
};
```

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"

device := &Device{
	HostPath: jsii.String("hostPath"),

	// the properties below are optional
	ContainerPath: jsii.String("containerPath"),
	Permissions: []DevicePermission{
		awscdk.Aws_batch.DevicePermission_READ,
	},
}
```

## Properties

- `containerPath`: string — The path inside the container at which to expose the host device.

  **Default:** Same path as the host

- `hostPath`: string (required) — The path for the device on the host container instance.

- `permissions`: [DevicePermission](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.DevicePermission.html)[] = Readonly — The explicit permissions to provide to the container for the device.

  By default, the container has permissions for read, write, and mknod for the device.
