# CfnVolume

L1 construct · External

Specifies an Amazon Elastic Block Store (Amazon EBS) volume.

You can create an empty volume, a volume from a snapshot, or a volume copy from an existing source volume.

> - When you use AWS CloudFormation to update an Amazon EBS volume that modifies `Iops` , `Size` , or `VolumeType` , there is a cooldown period before another operation can occur. This can cause your stack to report being in `UPDATE_IN_PROGRESS` or `UPDATE_ROLLBACK_IN_PROGRESS` for long periods of time. Some common scenarios when you might encounter a cooldown period for Amazon EBS include:
>
> - You successfully update an Amazon EBS volume and the update succeeds. When you attempt another update within the cooldown window, that update will be subject to a cooldown period.
> - You successfully update an Amazon EBS volume and the update succeeds but another change in your `update-stack` call fails. The rollback will be subject to a cooldown period.
>
> For more information, see [Requirements for EBS volume modifications](https://docs.aws.amazon.com/ebs/latest/userguide/modify-volume-requirements.html) .
> - Amazon EBS does not support sizing down an Amazon EBS volume. AWS CloudFormation does not attempt to modify an Amazon EBS volume to a smaller size on rollback.

*DeletionPolicy attribute*

To control how AWS CloudFormation handles the volume when the stack is deleted, set a deletion policy for your volume. You can choose to retain the volume, to delete the volume, or to create a snapshot of the volume. For more information, see [DeletionPolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .

> If you set a deletion policy that creates a snapshot, all tags on the volume are included in the snapshot.

Extends: [Construct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Construct.html) › [CfnElement](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnElement.html) › [CfnRefElement](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnRefElement.html) › [CfnResource](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnResource.html) › CfnVolume
Implements: [IInspectable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IInspectable.html), [ITaggable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.ITaggable.html), [IEnvironmentAware](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.IEnvironmentAware.html), [IVolumeRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.IVolumeRef.html), [IConstruct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.IConstruct.html), IDependable

- CloudFormation: [`AWS::EC2::Volume`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-ec2-volume.html)
- Source: Generated at build time
- Type last changed: v2.252.0 · 30 Apr 2026

## Example

TypeScript:

```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 cfnVolume = new ec2.CfnVolume(this, 'MyCfnVolume', /* all optional props */ {
  autoEnableIo: false,
  availabilityZone: 'availabilityZone',
  availabilityZoneId: 'availabilityZoneId',
  encrypted: false,
  iops: 123,
  kmsKeyId: 'kmsKeyId',
  multiAttachEnabled: false,
  outpostArn: 'outpostArn',
  size: 123,
  snapshotId: 'snapshotId',
  sourceVolumeId: 'sourceVolumeId',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  throughput: 123,
  volumeInitializationRate: 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_ec2 as ec2

cfn_volume = ec2.CfnVolume(self, "MyCfnVolume",
    auto_enable_io=False,
    availability_zone="availabilityZone",
    availability_zone_id="availabilityZoneId",
    encrypted=False,
    iops=123,
    kms_key_id="kmsKeyId",
    multi_attach_enabled=False,
    outpost_arn="outpostArn",
    size=123,
    snapshot_id="snapshotId",
    source_volume_id="sourceVolumeId",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    throughput=123,
    volume_initialization_rate=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.ec2.*;

CfnVolume cfnVolume = CfnVolume.Builder.create(this, "MyCfnVolume")
        .autoEnableIo(false)
        .availabilityZone("availabilityZone")
        .availabilityZoneId("availabilityZoneId")
        .encrypted(false)
        .iops(123)
        .kmsKeyId("kmsKeyId")
        .multiAttachEnabled(false)
        .outpostArn("outpostArn")
        .size(123)
        .snapshotId("snapshotId")
        .sourceVolumeId("sourceVolumeId")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .throughput(123)
        .volumeInitializationRate(123)
        .volumeType("volumeType")
        .build();
```

C#:

```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.EC2;

var cfnVolume = new CfnVolume(this, "MyCfnVolume", new CfnVolumeProps {
    AutoEnableIo = false,
    AvailabilityZone = "availabilityZone",
    AvailabilityZoneId = "availabilityZoneId",
    Encrypted = false,
    Iops = 123,
    KmsKeyId = "kmsKeyId",
    MultiAttachEnabled = false,
    OutpostArn = "outpostArn",
    Size = 123,
    SnapshotId = "snapshotId",
    SourceVolumeId = "sourceVolumeId",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    Throughput = 123,
    VolumeInitializationRate = 123,
    VolumeType = "volumeType"
});
```

Go:

```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"

cfnVolume := awscdk.Aws_ec2.NewCfnVolume(this, jsii.String("MyCfnVolume"), &CfnVolumeProps{
	AutoEnableIo: jsii.Boolean(false),
	AvailabilityZone: jsii.String("availabilityZone"),
	AvailabilityZoneId: jsii.String("availabilityZoneId"),
	Encrypted: jsii.Boolean(false),
	Iops: jsii.Number(123),
	KmsKeyId: jsii.String("kmsKeyId"),
	MultiAttachEnabled: jsii.Boolean(false),
	OutpostArn: jsii.String("outpostArn"),
	Size: jsii.Number(123),
	SnapshotId: jsii.String("snapshotId"),
	SourceVolumeId: jsii.String("sourceVolumeId"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Throughput: jsii.Number(123),
	VolumeInitializationRate: jsii.Number(123),
	VolumeType: jsii.String("volumeType"),
})
```

## Initializer

TypeScript:

```ts
new CfnVolume(scope: Construct, id: string, props?: CfnVolumeProps)
```

Python:

```python
CfnVolume(scope: Construct, id: str, props: typing.Optional[CfnVolumeProps] = None)
```

Java:

```java
new CfnVolume(Construct scope, String id, CfnVolumeProps props)
```

C#:

```csharp
new CfnVolume(Construct scope, string id, CfnVolumeProps? props = null)
```

Go:

```go
NewCfnVolume(Scope Construct, Id *string, Props CfnVolumeProps)
```

## Construct Props

- `autoEnableIo`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether the volume is auto-enabled for I/O operations.

  By default, Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be made available immediately if it's impaired, you can configure the volume to automatically enable I/O.

- `availabilityZone`: string — The ID of the Availability Zone in which to create the volume. For example, `us-east-1a` .

  Either `AvailabilityZone` or `AvailabilityZoneId` must be specified, but not both.

  If you are creating a volume copy, omit this parameter. The volume copy is created in the same Availability Zone as the source volume.

- `availabilityZoneId`: string — The ID of the Availability Zone in which to create the volume. For example, `use1-az1` .

  Either `AvailabilityZone` or `AvailabilityZoneId` must be specified, but not both.

  If you are creating a volume copy, omit this parameter. The volume copy is created in the same Availability Zone as the source 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.

  The effect of setting the encryption state to `true` depends on the volume origin (new, from a snapshot, or from an existing volume), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see [Encryption by default](https://docs.aws.amazon.com/ebs/latest/userguide/work-with-ebs-encr.html#encryption-by-default) in the *Amazon EBS User Guide* .

  If you are creating a volume copy, omit this parameter. The volume is automatically encrypted with the same KMS key as the source volume. You can't copy unencrypted volumes.

- `iops`: number — The number of I/O operations per second (IOPS) to provision for the volume.

  Required for `io1` and `io2` volumes. Optional for `gp3` volumes. Omit for all other volume types.

  Valid ranges:

  - gp3: `3,000` ( *default* ) `- 80,000` IOPS
  - io1: `100 - 64,000` IOPS
  - io2: `100 - 256,000` IOPS

  > [Instances built on the Nitro System](https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html) can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.

- `kmsKeyId`: string — The identifier of the AWS KMS key to use for Amazon EBS encryption.

  If `KmsKeyId` is specified, the encrypted state must be `true` .

  If you omit this property and your account is enabled for encryption by default, or *Encrypted* is set to `true` , then the volume is encrypted using the default key specified for your account. If your account does not have a default key, then the volume is encrypted using the AWS managed key .

  Alternatively, if you want to specify a different key, you can specify one of the following:

  - Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
  - Key alias. Specify the alias for the key, prefixed with `alias/` . For example, for a key with the alias `my_cmk` , use `alias/my_cmk` . Or to specify the AWS managed key , use `alias/aws/ebs` .
  - Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
  - Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

  If you are creating a volume copy, omit this parameter. The volume is automatically encrypted with the same KMS key as the source volume. You can't copy unencrypted volumes.

- `multiAttachEnabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether Amazon EBS Multi-Attach is enabled.

  AWS CloudFormation does not currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach enabled volume.

- `outpostArn`: string — The Amazon Resource Name (ARN) of the Outpost on which to create the volume.

  If you intend to use a volume with an instance running on an outpost, then you must create the volume on the same outpost as the instance. You can't use a volume created in an AWS Region with an instance on an AWS outpost, or the other way around.

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

  - Required for new empty volumes.
  - Optional for volumes created from snapshots and volume copies. In this case, the size defaults to the size of the snapshot or source volume. You can optionally specify a size that is equal to or larger than the size of the source snapshot or volume.

  Supported volume sizes:

  - gp2: `1 - 16,384` GiB
  - gp3: `1 - 65,536` GiB
  - io1: `4 - 16,384` GiB
  - io2: `4 - 65,536` GiB
  - st1 and sc1: `125 - 16,384` GiB
  - standard: `1 - 1024` GiB

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

  Only specify to create a volume from a snapshot. To create a new empty volume, omit this parameter and specify a value for `Size` instead. To create a volume copy, omit this parameter and specify `SourceVolumeId` instead.

- `sourceVolumeId`: string — The ID of the source EBS volume to copy.

  When specified, the volume is created as an exact copy of the specified volume. Only specify to create a volume copy. To create a new empty volume or to create a volume from a snapshot, omit this parameter,

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags to apply to the volume during creation.

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

  This parameter is valid only for `gp3` volumes. The default value is 125.

  Valid Range: Minimum value of 125. Maximum value of 1000.

- `volumeInitializationRate`: number — Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.

  This is also known as *volume initialization* . Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.

  This parameter is supported only for volumes created from snapshots. Omit this parameter if:

  - You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation.

  > If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore.
  - You want to create a volume that is initialized at the default rate.

  For more information, see [Initialize Amazon EBS volumes](https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html) in the *Amazon EC2 User Guide* .

  Valid range: 100 - 300 MiB/s

- `volumeType`: string — The volume type. This parameter can be one of the following values:.

  - General Purpose SSD: `gp2` | `gp3`
  - Provisioned IOPS SSD: `io1` | `io2`
  - Throughput Optimized HDD: `st1`
  - Cold HDD: `sc1`
  - Magnetic: `standard`

  > Throughput Optimized HDD ( `st1` ) and Cold HDD ( `sc1` ) volumes can't be used as boot volumes.

  For more information, see [Amazon EBS volume types](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html) in the *Amazon EBS User Guide* .

  Default: `gp2`

## Properties

- `attrVolumeId`: string — The ID of the volume.

- `autoEnableIo`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether the volume is auto-enabled for I/O operations.

- `availabilityZone`: string — The ID of the Availability Zone in which to create the volume.

  For example, `us-east-1a` .

- `availabilityZoneId`: string — The ID of the Availability Zone in which to create the volume.

  For example, `use1-az1` .

- `CFN_RESOURCE_TYPE_NAME`: string (static) — The CloudFormation resource type name for this resource class.

- `cfnOptions`: [ICfnResourceOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.ICfnResourceOptions.html) — Options for this resource, such as condition, update policy etc.

- `cfnResourceType`: string — AWS resource type.

- `creationStack`: string[]

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

- `env`: [ResourceEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html)

- `iops`: number — The number of I/O operations per second (IOPS) to provision for the volume.

- `kmsKeyId`: string — The identifier of the AWS KMS key to use for Amazon EBS encryption.

- `logicalId`: string — The logical ID for this CloudFormation stack element.

  The logical ID of the element
  is calculated from the path of the resource node in the construct tree.

  To override this value, use `overrideLogicalId(newLogicalId)`.

- `multiAttachEnabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether Amazon EBS Multi-Attach is enabled.

- `node`: [Node](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `outpostArn`: string — The Amazon Resource Name (ARN) of the Outpost on which to create the volume.

- `ref`: string — Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

  If, by any chance, the intrinsic reference of a resource is not a string, you could
  coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.

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

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

- `sourceVolumeId`: string — The ID of the source EBS volume to copy.

- `stack`: [Stack](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this element is defined.

  CfnElements must be defined within a stack scope (directly or indirectly).

- `tags`: [TagManager](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.TagManager.html) — Tag Manager which manages the tags for this resource.

- `tagsRaw`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags to apply to the volume during creation.

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

- `volumeInitializationRate`: number — Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.

- `volumeRef`: [VolumeReference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.VolumeReference.html) — A reference to a Volume resource.

- `volumeType`: string — The volume type.

  This parameter can be one of the following values:.

## Methods

- `addDeletionOverride(path: string): void` — Syntactic sugar for `addOverride(path, undefined)`.

  **Parameters**

  - `path` — The path of the value to delete.

- `addDependency(target: CfnResource): void` — Use `addResourceDependency` instead.

  This method has been renamed to `addResourceDependency` to more clearly
  set it apart from `construct.node.addDependency`. See the documentation
  of that function for more details.

- `addDependsOn(target: CfnResource): void` — Use `addResourceDependency` instead.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method has been renamed to `addResourceDependency`, which makes it
  more clear that this method operates at a different level from the
  construct-level `construct.node.addDependency()` mechanism.

- `addMetadata(key: string, value: any): void` — Add a value to the CloudFormation Resource Metadata.

- `addOverride(path: string, value: any): void` — Adds an override to the synthesized CloudFormation resource.

  To add a
  property override, either use `addPropertyOverride` or prefix `path` with
  "Properties." (i.e. `Properties.TopicName`).

  If the override is nested, separate each nested level using a dot (.) in the path parameter.
  If there is an array as part of the nesting, specify the index in the path.

  To include a literal `.` in the property name, prefix with a `\`. In most
  programming languages you will need to write this as `"\\."` because the
  `\` itself will need to be escaped.

  For example,
  ```typescript
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
  cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
  ```
  would add the overrides
  ```json
  "Properties": {
    "GlobalSecondaryIndexes": [
      {
        "Projection": {
          "NonKeyAttributes": [ "myattribute" ]
          ...
        }
        ...
      },
      {
        "ProjectionType": "INCLUDE"
        ...
      },
    ]
    ...
  }
  ```

  The `value` argument to `addOverride` will not be processed or translated
  in any way. Pass raw JSON values in here with the correct capitalization
  for CloudFormation. If you pass CDK classes or structs, they will be
  rendered with lowercased key names, and CloudFormation will reject the
  template.

  **Parameters**

  - `path` — - The path of the property, you can use dot notation to override values in complex types.
  - `value` — - The value.

- `addPropertyDeletionOverride(propertyPath: string): void` — Adds an override that deletes the value of a property from the resource definition.

  **Parameters**

  - `propertyPath` — The path to the property.

- `addPropertyOverride(propertyPath: string, value: any): void` — Adds an override to a resource property.

  Syntactic sugar for `addOverride("Properties.<...>", value)`.

  **Parameters**

  - `propertyPath` — The path of the property.
  - `value` — The value.

- `addResourceDependency(target: CfnResource, reason?: string): void` — Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

  This can be used for resources across stacks (or nested stack) boundaries
  and the dependency will automatically be transferred to the relevant scope.

  This method only adds dependencies between L1 resources. If you are
  looking for a generic construct-to-construct dependency mechanism that works
  for all constructs including L2s, use `construct.node.addDependency` instead.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Sets the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  strength instead of the global default from the consuming stack's context.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void` — Sets the deletion policy of the resource based on the removal policy specified.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
  cases, a snapshot can be taken of the resource prior to deletion
  (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
  can be found in the following link:

- `arnForVolume(resource: IVolumeRef): string` (static)

- `cfnPropertyName(cdkPropertyName: string): string`

- `fromVolumeId(scope: Construct, id: string, volumeId: string): IVolumeRef` (static) — Creates a new IVolumeRef from a volumeId.

- `getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference` — Returns a token for an runtime attribute of this resource.

  Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
  in case there is no generated attribute.

  **Parameters**

  - `attributeName` — The name of the attribute.

- `getMetadata(key: string): any` — Retrieve a value value from the CloudFormation Resource Metadata.

- `inspect(inspector: TreeInspector): void` — Examines the CloudFormation resource and discloses attributes.

  **Parameters**

  - `inspector` — tree inspector to collect and process attributes.

- `isCfnElement(x: any): boolean` (static) — Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

  Uses duck-typing instead of `instanceof` to allow stack elements from different
  versions of this library to be included in the same stack.

  **Returns:** The construct as a stack element or undefined if it is not a stack element.

- `isCfnResource(x: any): boolean` (static) — Check whether the given object is a CfnResource.

- `isCfnVolume(x: any): boolean` (static) — Checks whether the given object is a CfnVolume.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `obtainDependencies(): Stack | CfnResource[]` — Retrieves an array of resources and stacks this resource depends on.

  For resources depended on directly, returns the `CfnResource` object. For
  dependencies on other stacks, returns the `Stack` object. The order of the
  array is not guaranteed.

- `overrideLogicalId(newLogicalId: string): void` — Overrides the auto-generated logical ID with a specific ID.

  **Parameters**

  - `newLogicalId` — The new logical ID to use for this stack element.

- `removeDependency(target: CfnResource): void` — Use `removeResourceDependency` instead

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `removeResourceDependency(target: CfnResource): void` — Indicates that this resource no longer depends on another resource.

  This can be used for resources across stacks (including nested stacks)
  and the dependency will automatically be removed from the relevant scope.

- `replaceDependency(target: CfnResource, newTarget: CfnResource): void` — Replaces one dependency with another.

  **Parameters**

  - `target` — The dependency to replace.
  - `newTarget` — The new dependency to add.

- `toString(): string` — Returns a string representation of this construct.

  **Returns:** a string representation of this resource

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
