# CfnEC2Fleet

Specifies the configuration information to launch a fleet--or group--of instances.

An EC2 Fleet can launch multiple instance types across multiple Availability Zones, using the On-Demand Instance, Reserved Instance, and Spot Instance purchasing models together. Using EC2 Fleet, you can define separate On-Demand and Spot capacity targets, specify the instance types that work best for your applications, and specify how Amazon EC2 should distribute your fleet capacity within each purchasing model. For more information, see [Launching an EC2 Fleet](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html) in the *Amazon EC2 User Guide* .

Extends: Construct › CfnElement › CfnRefElement › CfnResource › CfnEC2Fleet
Implements: IInspectable, IEnvironmentAware, IEC2FleetRef, IConstruct, IDependable

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

## Example

```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 cfnEC2Fleet = new ec2.CfnEC2Fleet(this, 'MyCfnEC2Fleet', {
  launchTemplateConfigs: [{
    launchTemplateSpecification: {
      version: 'version',

      // the properties below are optional
      launchTemplateId: 'launchTemplateId',
      launchTemplateName: 'launchTemplateName',
      launchTemplateSpecificationUserData: 'launchTemplateSpecificationUserData',
    },
    overrides: [{
      availabilityZone: 'availabilityZone',
      availabilityZoneId: 'availabilityZoneId',
      blockDeviceMappings: [{
        deviceName: 'deviceName',
        ebs: {
          deleteOnTermination: false,
          encrypted: false,
          iops: 123,
          kmsKeyId: 'kmsKeyId',
          multiAvailabilityZoneConfiguration: {
            configurationType: 'configurationType',
            standbyAvailabilityZones: [{
              availabilityZone: 'availabilityZone',
              availabilityZoneId: 'availabilityZoneId',
            }],
          },
          snapshotId: 'snapshotId',
          volumeSize: 123,
          volumeType: 'volumeType',
        },
        noDevice: 'noDevice',
        virtualName: 'virtualName',
      }],
      iamInstanceProfile: {
        arn: 'arn',
        name: 'name',
      },
      instanceRequirements: {
        acceleratorCount: {
          max: 123,
          min: 123,
        },
        acceleratorManufacturers: ['acceleratorManufacturers'],
        acceleratorNames: ['acceleratorNames'],
        acceleratorTotalMemoryMiB: {
          max: 123,
          min: 123,
        },
        acceleratorTypes: ['acceleratorTypes'],
        allowedInstanceTypes: ['allowedInstanceTypes'],
        bareMetal: 'bareMetal',
        baselineEbsBandwidthMbps: {
          max: 123,
          min: 123,
        },
        baselinePerformanceFactors: {
          cpu: {
            references: [{
              instanceFamily: 'instanceFamily',
            }],
          },
        },
        burstablePerformance: 'burstablePerformance',
        cpuManufacturers: ['cpuManufacturers'],
        excludedInstanceTypes: ['excludedInstanceTypes'],
        instanceGenerations: ['instanceGenerations'],
        localStorage: 'localStorage',
        localStorageTypes: ['localStorageTypes'],
        maxSpotPriceAsPercentageOfOptimalOnDemandPrice: 123,
        memoryGiBPerVCpu: {
          max: 123,
          min: 123,
        },
        memoryMiB: {
          max: 123,
          min: 123,
        },
        networkBandwidthGbps: {
          max: 123,
          min: 123,
        },
        networkInterfaceCount: {
          max: 123,
          min: 123,
        },
        onDemandMaxPricePercentageOverLowestPrice: 123,
        requireEncryptionInTransit: false,
        requireHibernateSupport: false,
        spotMaxPricePercentageOverLowestPrice: 123,
        totalLocalStorageGb: {
          max: 123,
          min: 123,
        },
        vCpuCount: {
          max: 123,
          min: 123,
        },
      },
      instanceType: 'instanceType',
      keyName: 'keyName',
      maxPrice: 'maxPrice',
      metadataOptions: {
        httpEndpoint: 'httpEndpoint',
        httpPutResponseHopLimit: 123,
        httpTokens: 'httpTokens',
      },
      networkInterfaces: [{
        associatePublicIpAddress: false,
        deleteOnTermination: false,
        description: 'description',
        deviceIndex: 123,
        groups: ['groups'],
        interfaceType: 'interfaceType',
        ipv6AddressCount: 123,
        ipv6Addresses: [{
          ipv6Address: 'ipv6Address',
        }],
        networkCardIndex: 123,
        networkInterfaceId: 'networkInterfaceId',
        privateIpAddress: 'privateIpAddress',
        privateIpAddresses: [{
          primary: false,
          privateIpAddress: 'privateIpAddress',
        }],
        secondaryPrivateIpAddressCount: 123,
        subnetId: 'subnetId',
      }],
      placement: {
        affinity: 'affinity',
        availabilityZone: 'availabilityZone',
        groupName: 'groupName',
        hostId: 'hostId',
        hostResourceGroupArn: 'hostResourceGroupArn',
        partitionNumber: 123,
        spreadDomain: 'spreadDomain',
        tenancy: 'tenancy',
      },
      priority: 123,
      subnetId: 'subnetId',
      weightedCapacity: 123,
    }],
  }],
  targetCapacitySpecification: {
    totalTargetCapacity: 123,

    // the properties below are optional
    defaultTargetCapacityType: 'defaultTargetCapacityType',
    onDemandTargetCapacity: 123,
    spotTargetCapacity: 123,
    targetCapacityUnitType: 'targetCapacityUnitType',
  },

  // the properties below are optional
  context: 'context',
  excessCapacityTerminationPolicy: 'excessCapacityTerminationPolicy',
  onDemandOptions: {
    allocationStrategy: 'allocationStrategy',
    capacityReservationOptions: {
      usageStrategy: 'usageStrategy',
    },
    maxTotalPrice: 'maxTotalPrice',
    minTargetCapacity: 123,
    singleAvailabilityZone: false,
    singleInstanceType: false,
  },
  replaceUnhealthyInstances: false,
  reservedCapacityOptions: {
    allocationStrategy: 'allocationStrategy',
    capacityReservationTarget: {
      capacityReservationIds: ['capacityReservationIds'],
      capacityReservationResourceGroupArns: ['capacityReservationResourceGroupArns'],
    },
    reservationTypes: ['reservationTypes'],
    reservedCapacityFallbackOptions: {
      marketTypes: ['marketTypes'],
    },
  },
  spotOptions: {
    allocationStrategy: 'allocationStrategy',
    instanceInterruptionBehavior: 'instanceInterruptionBehavior',
    instancePoolsToUseCount: 123,
    maintenanceStrategies: {
      capacityRebalance: {
        replacementStrategy: 'replacementStrategy',
        terminationDelay: 123,
      },
    },
    maxTotalPrice: 'maxTotalPrice',
    minTargetCapacity: 123,
    singleAvailabilityZone: false,
    singleInstanceType: false,
  },
  tagSpecifications: [{
    resourceType: 'resourceType',
    tags: [{
      key: 'key',
      value: 'value',
    }],
  }],
  terminateInstancesWithExpiration: false,
  type: 'type',
  validFrom: 'validFrom',
  validUntil: 'validUntil',
});
```

## Initializer

```ts
new CfnEC2Fleet(scope: Construct, id: string, props: CfnEC2FleetProps)
```

## Construct Props

- `context`: string — Reserved.

- `excessCapacityTerminationPolicy`: string — Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

  Supported only for fleets of type `maintain` .

- `launchTemplateConfigs`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty.html)[] (required) — The configuration for the EC2 Fleet.

- `onDemandOptions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.OnDemandOptionsRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.OnDemandOptionsRequestProperty.html) — Describes the configuration of On-Demand Instances in an EC2 Fleet.

- `replaceUnhealthyInstances`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether EC2 Fleet should replace unhealthy Spot Instances.

  Supported only for fleets of type `maintain` . For more information, see [EC2 Fleet health checks](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks) in the *Amazon EC2 User Guide* .

- `reservedCapacityOptions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.ReservedCapacityOptionsRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.ReservedCapacityOptionsRequestProperty.html)

- `spotOptions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.SpotOptionsRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.SpotOptionsRequestProperty.html) — Describes the configuration of Spot Instances in an EC2 Fleet.

- `tagSpecifications`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.TagSpecificationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.TagSpecificationProperty.html)[] — The key-value pair for tagging the EC2 Fleet request on creation. For more information, see [Tag your resources](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources) .

  If the fleet type is `instant` , specify a resource type of `fleet` to tag the fleet or `instance` to tag the instances at launch.

  If the fleet type is `maintain` or `request` , specify a resource type of `fleet` to tag the fleet. You cannot specify a resource type of `instance` . To tag instances at launch, specify the tags in a [launch template](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template) .

- `targetCapacitySpecification`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.TargetCapacitySpecificationRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.TargetCapacitySpecificationRequestProperty.html) (required) — The number of units to request.

- `terminateInstancesWithExpiration`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether running instances should be terminated when the EC2 Fleet expires.

- `type`: string — The fleet type. The default value is `maintain` .

  - `maintain` - The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.
  - `request` - The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.
  - `instant` - The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.

  For more information, see [EC2 Fleet request types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-request-type.html) in the *Amazon EC2 User Guide* .

- `validFrom`: string — The start date and time of the request, in UTC format (for example, *YYYY* - *MM* - *DD* T *HH* : *MM* : *SS* Z).

  The default is to start fulfilling the request immediately.

- `validUntil`: string — The end date and time of the request, in UTC format (for example, *YYYY* - *MM* - *DD* T *HH* : *MM* : *SS* Z).

  At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.

## Properties

- `attrFleetId`: string — The ID of the EC2 Fleet.

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

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

- `cfnResourceType`: string — AWS resource type.

- `context`: string — Reserved.

- `creationStack`: string[]

- `ec2FleetRef`: [EC2FleetReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.EC2FleetReference.html) — A reference to a EC2Fleet resource.

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

- `excessCapacityTerminationPolicy`: string — Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

- `launchTemplateConfigs`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty.html)[] — The configuration for the EC2 Fleet.

- `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)`.

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

- `onDemandOptions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.OnDemandOptionsRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.OnDemandOptionsRequestProperty.html) — Describes the configuration of On-Demand Instances in an EC2 Fleet.

- `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 })`.

- `replaceUnhealthyInstances`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether EC2 Fleet should replace unhealthy Spot Instances.

- `reservedCapacityOptions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.ReservedCapacityOptionsRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.ReservedCapacityOptionsRequestProperty.html)

- `spotOptions`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.SpotOptionsRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.SpotOptionsRequestProperty.html) — Describes the configuration of Spot Instances in an EC2 Fleet.

- `stack`: [Stack](/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).

- `tagSpecifications`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.TagSpecificationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.TagSpecificationProperty.html)[] — The key-value pair for tagging the EC2 Fleet request on creation.

  For more information, see [Tag your resources](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources) .

- `targetCapacitySpecification`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnEC2Fleet.TargetCapacitySpecificationRequestProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnEC2Fleet.TargetCapacitySpecificationRequestProperty.html) — The number of units to request.

- `terminateInstancesWithExpiration`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether running instances should be terminated when the EC2 Fleet expires.

- `type`: string — The fleet type.

  The default value is `maintain` .

- `validFrom`: string — The start date and time of the request, in UTC format (for example, *YYYY* - *MM* - *DD* T *HH* : *MM* : *SS* Z).

- `validUntil`: string — The end date and time of the request, in UTC format (for example, *YYYY* - *MM* - *DD* T *HH* : *MM* : *SS* Z).

## 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:

- `arnForEC2Fleet(resource: IEC2FleetRef): string` (static)

- `cfnPropertyName(cdkPropertyName: string): string`

- `fromFleetId(scope: Construct, id: string, fleetId: string): IEC2FleetRef` (static) — Creates a new IEC2FleetRef from a fleetId.

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

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

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

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