# CfnVolumeProps

Properties for defining a `CfnVolume`.

Used as props by: [CfnVolume](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_workspacesinstances.CfnVolume.html)

- Source: Generated at build time
- Type last changed: v2.203.0 · 1 Jul 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_workspacesinstances as workspacesinstances } from 'aws-cdk-lib';
const cfnVolumeProps: workspacesinstances.CfnVolumeProps = {
  availabilityZone: 'availabilityZone',

  // the properties below are optional
  encrypted: false,
  iops: 123,
  kmsKeyId: 'kmsKeyId',
  sizeInGb: 123,
  snapshotId: 'snapshotId',
  tagSpecifications: [{
    resourceType: 'resourceType',
    tags: [{
      key: 'key',
      value: 'value',
    }],
  }],
  throughput: 123,
  volumeType: 'volumeType',
};
```

Python:

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

cfn_volume_props = workspacesinstances.CfnVolumeProps(
    availability_zone="availabilityZone",

    # the properties below are optional
    encrypted=False,
    iops=123,
    kms_key_id="kmsKeyId",
    size_in_gb=123,
    snapshot_id="snapshotId",
    tag_specifications=[workspacesinstances.CfnVolume.TagSpecificationProperty(
        resource_type="resourceType",
        tags=[CfnTag(
            key="key",
            value="value"
        )]
    )],
    throughput=123,
    volume_type="volumeType"
)
```

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

CfnVolumeProps cfnVolumeProps = CfnVolumeProps.builder()
        .availabilityZone("availabilityZone")

        // the properties below are optional
        .encrypted(false)
        .iops(123)
        .kmsKeyId("kmsKeyId")
        .sizeInGb(123)
        .snapshotId("snapshotId")
        .tagSpecifications(List.of(TagSpecificationProperty.builder()
                .resourceType("resourceType")
                .tags(List.of(CfnTag.builder()
                        .key("key")
                        .value("value")
                        .build()))
                .build()))
        .throughput(123)
        .volumeType("volumeType")
        .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.WorkspacesInstances;

var cfnVolumeProps = new CfnVolumeProps {
    AvailabilityZone = "availabilityZone",

    // the properties below are optional
    Encrypted = false,
    Iops = 123,
    KmsKeyId = "kmsKeyId",
    SizeInGb = 123,
    SnapshotId = "snapshotId",
    TagSpecifications = new [] { new TagSpecificationProperty {
        ResourceType = "resourceType",
        Tags = new [] { new CfnTag {
            Key = "key",
            Value = "value"
        } }
    } },
    Throughput = 123,
    VolumeType = "volumeType"
};
```

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"

cfnVolumeProps := &CfnVolumeProps{
	AvailabilityZone: jsii.String("availabilityZone"),

	// the properties below are optional
	Encrypted: jsii.Boolean(false),
	Iops: jsii.Number(123),
	KmsKeyId: jsii.String("kmsKeyId"),
	SizeInGb: jsii.Number(123),
	SnapshotId: jsii.String("snapshotId"),
	TagSpecifications: []interface{}{
		&TagSpecificationProperty{
			ResourceType: jsii.String("resourceType"),
			Tags: []CfnTag{
				&CfnTag{
					Key: jsii.String("key"),
					Value: jsii.String("value"),
				},
			},
		},
	},
	Throughput: jsii.Number(123),
	VolumeType: jsii.String("volumeType"),
}
```

## Properties

- `availabilityZone`: string (required) — The Availability Zone in which to create the volume.

- `encrypted`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether the volume should be encrypted.

- `iops`: number — The number of I/O operations per second (IOPS).

- `kmsKeyId`: string — The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for Amazon EBS encryption.

- `sizeInGb`: number — The size of the volume, in GiBs.

- `snapshotId`: string — The snapshot from which to create the volume.

- `tagSpecifications`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVolume.TagSpecificationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_workspacesinstances.CfnVolume.TagSpecificationProperty.html)[] — The tags passed to EBS volume.

- `throughput`: number — The throughput to provision for a volume, with a maximum of 1,000 MiB/s.

- `volumeType`: string — The volume type.
