aws-cdk-lib.aws_fsx.CfnFileSystem

class CfnFileSystem (construct)

LanguageType name
.NETAmazon.CDK.AWS.FSx.CfnFileSystem
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsfsx#CfnFileSystem
Javasoftware.amazon.awscdk.services.fsx.CfnFileSystem
Pythonaws_cdk.aws_fsx.CfnFileSystem
TypeScript aws-cdk-lib » aws_fsx » CfnFileSystem

Implements IConstruct, IDependable, IInspectable

A CloudFormation AWS::FSx::FileSystem.

The AWS::FSx::FileSystem resource is an Amazon FSx resource type that specifies an Amazon FSx file system. You can create any of the following supported file system types:

  • Amazon FSx for Lustre
  • Amazon FSx for NetApp ONTAP
  • Amazon FSx for OpenZFS
  • Amazon FSx for Windows File Server

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_fsx as fsx } from 'aws-cdk-lib';
const cfnFileSystem = new fsx.CfnFileSystem(this, 'MyCfnFileSystem', {
  fileSystemType: 'fileSystemType',
  subnetIds: ['subnetIds'],

  // the properties below are optional
  backupId: 'backupId',
  fileSystemTypeVersion: 'fileSystemTypeVersion',
  kmsKeyId: 'kmsKeyId',
  lustreConfiguration: {
    autoImportPolicy: 'autoImportPolicy',
    automaticBackupRetentionDays: 123,
    copyTagsToBackups: false,
    dailyAutomaticBackupStartTime: 'dailyAutomaticBackupStartTime',
    dataCompressionType: 'dataCompressionType',
    deploymentType: 'deploymentType',
    driveCacheType: 'driveCacheType',
    exportPath: 'exportPath',
    importedFileChunkSize: 123,
    importPath: 'importPath',
    perUnitStorageThroughput: 123,
    weeklyMaintenanceStartTime: 'weeklyMaintenanceStartTime',
  },
  ontapConfiguration: {
    deploymentType: 'deploymentType',

    // the properties below are optional
    automaticBackupRetentionDays: 123,
    dailyAutomaticBackupStartTime: 'dailyAutomaticBackupStartTime',
    diskIopsConfiguration: {
      iops: 123,
      mode: 'mode',
    },
    endpointIpAddressRange: 'endpointIpAddressRange',
    fsxAdminPassword: 'fsxAdminPassword',
    preferredSubnetId: 'preferredSubnetId',
    routeTableIds: ['routeTableIds'],
    throughputCapacity: 123,
    weeklyMaintenanceStartTime: 'weeklyMaintenanceStartTime',
  },
  openZfsConfiguration: {
    deploymentType: 'deploymentType',

    // the properties below are optional
    automaticBackupRetentionDays: 123,
    copyTagsToBackups: false,
    copyTagsToVolumes: false,
    dailyAutomaticBackupStartTime: 'dailyAutomaticBackupStartTime',
    diskIopsConfiguration: {
      iops: 123,
      mode: 'mode',
    },
    options: ['options'],
    rootVolumeConfiguration: {
      copyTagsToSnapshots: false,
      dataCompressionType: 'dataCompressionType',
      nfsExports: [{
        clientConfigurations: [{
          clients: 'clients',
          options: ['options'],
        }],
      }],
      readOnly: false,
      recordSizeKiB: 123,
      userAndGroupQuotas: [{
        id: 123,
        storageCapacityQuotaGiB: 123,
        type: 'type',
      }],
    },
    throughputCapacity: 123,
    weeklyMaintenanceStartTime: 'weeklyMaintenanceStartTime',
  },
  securityGroupIds: ['securityGroupIds'],
  storageCapacity: 123,
  storageType: 'storageType',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  windowsConfiguration: {
    throughputCapacity: 123,

    // the properties below are optional
    activeDirectoryId: 'activeDirectoryId',
    aliases: ['aliases'],
    auditLogConfiguration: {
      fileAccessAuditLogLevel: 'fileAccessAuditLogLevel',
      fileShareAccessAuditLogLevel: 'fileShareAccessAuditLogLevel',

      // the properties below are optional
      auditLogDestination: 'auditLogDestination',
    },
    automaticBackupRetentionDays: 123,
    copyTagsToBackups: false,
    dailyAutomaticBackupStartTime: 'dailyAutomaticBackupStartTime',
    deploymentType: 'deploymentType',
    preferredSubnetId: 'preferredSubnetId',
    selfManagedActiveDirectoryConfiguration: {
      dnsIps: ['dnsIps'],
      domainName: 'domainName',
      fileSystemAdministratorsGroup: 'fileSystemAdministratorsGroup',
      organizationalUnitDistinguishedName: 'organizationalUnitDistinguishedName',
      password: 'password',
      userName: 'userName',
    },
    weeklyMaintenanceStartTime: 'weeklyMaintenanceStartTime',
  },
});

Initializer

new CfnFileSystem(scope: Construct, id: string, props: CfnFileSystemProps)

Parameters

  • scope Construct — - scope in which this resource is defined.
  • id string — - scoped id of the resource.
  • props CfnFileSystemProps — - resource properties.

Create a new AWS::FSx::FileSystem.

Construct Props

NameTypeDescription
fileSystemTypestringThe type of Amazon FSx file system, which can be LUSTRE , WINDOWS , ONTAP , or OPENZFS .
subnetIdsstring[]Specifies the IDs of the subnets that the file system will be accessible from.
backupId?stringThe ID of the file system backup that you are using to create a file system.
fileSystemTypeVersion?string(Optional) For FSx for Lustre file systems, sets the Lustre version for the file system that you're creating.
kmsKeyId?stringThe ID of the AWS Key Management Service ( AWS KMS ) key used to encrypt Amazon FSx file system data.
lustreConfiguration?IResolvable | LustreConfigurationPropertyThe Lustre configuration for the file system being created.
ontapConfiguration?IResolvable | OntapConfigurationPropertyThe ONTAP configuration properties of the FSx for ONTAP file system that you are creating.
openZfsConfiguration?IResolvable | OpenZFSConfigurationPropertyThe Amazon FSx for OpenZFS configuration properties for the file system that you are creating.
securityGroupIds?string[]A list of IDs specifying the security groups to apply to all network interfaces created for file system access.
storageCapacity?numberSets the storage capacity of the file system that you're creating.
storageType?stringSets the storage type for the file system that you're creating. Valid values are SSD and HDD .
tags?CfnTag[]An array of key-value pairs to apply to this resource.
windowsConfiguration?IResolvable | WindowsConfigurationPropertyThe configuration object for the Microsoft Windows file system you are creating.

fileSystemType

Type: string

The type of Amazon FSx file system, which can be LUSTRE , WINDOWS , ONTAP , or OPENZFS .


subnetIds

Type: string[]

Specifies the IDs of the subnets that the file system will be accessible from.

For Windows and ONTAP MULTI_AZ_1 deployment types,provide exactly two subnet IDs, one for the preferred file server and one for the standby file server. You specify one of these subnets as the preferred subnet using the WindowsConfiguration > PreferredSubnetID or OntapConfiguration > PreferredSubnetID properties. For more information about Multi-AZ file system configuration, see Availability and durability: Single-AZ and Multi-AZ file systems in the Amazon FSx for Windows User Guide and Availability and durability in the Amazon FSx for ONTAP User Guide .

For Windows SINGLE_AZ_1 and SINGLE_AZ_2 and all Lustre deployment types, provide exactly one subnet ID. The file server is launched in that subnet's Availability Zone.


backupId?

Type: string (optional)

The ID of the file system backup that you are using to create a file system.

For more information, see CreateFileSystemFromBackup .


fileSystemTypeVersion?

Type: string (optional)

(Optional) For FSx for Lustre file systems, sets the Lustre version for the file system that you're creating.

Valid values are 2.10 and 2.12 :

  • 2.10 is supported by the Scratch and Persistent_1 Lustre deployment types.
  • 2.12 is supported by all Lustre deployment types. 2.12 is required when setting FSx for Lustre DeploymentType to PERSISTENT_2 .

Default value = 2.10 , except when DeploymentType is set to PERSISTENT_2 , then the default is 2.12 .

If you set FileSystemTypeVersion to 2.10 for a PERSISTENT_2 Lustre deployment type, the CreateFileSystem operation fails.


kmsKeyId?

Type: string (optional)

The ID of the AWS Key Management Service ( AWS KMS ) key used to encrypt Amazon FSx file system data.

Used as follows with Amazon FSx file system types:

  • Amazon FSx for Lustre PERSISTENT_1 and PERSISTENT_2 deployment types only.

SCRATCH_1 and SCRATCH_2 types are encrypted using the Amazon FSx service AWS KMS key for your account.

  • Amazon FSx for NetApp ONTAP
  • Amazon FSx for OpenZFS
  • Amazon FSx for Windows File Server

lustreConfiguration?

Type: IResolvable | LustreConfigurationProperty (optional)

The Lustre configuration for the file system being created.

The following parameters are not supported for file systems with a data repository association.

  • AutoImportPolicy
  • ExportPath
  • ImportedChunkSize
  • ImportPath

ontapConfiguration?

Type: IResolvable | OntapConfigurationProperty (optional)

The ONTAP configuration properties of the FSx for ONTAP file system that you are creating.


openZfsConfiguration?

Type: IResolvable | OpenZFSConfigurationProperty (optional)

The Amazon FSx for OpenZFS configuration properties for the file system that you are creating.


securityGroupIds?

Type: string[] (optional)

A list of IDs specifying the security groups to apply to all network interfaces created for file system access.

This list isn't returned in later requests to describe the file system.


storageCapacity?

Type: number (optional)

Sets the storage capacity of the file system that you're creating.

StorageCapacity is required if you are creating a new file system.

FSx for Lustre file systems - The amount of storage capacity that you can configure depends on the value that you set for StorageType and the Lustre DeploymentType , as follows:

  • For SCRATCH_2 , PERSISTENT_2 and PERSISTENT_1 deployment types using SSD storage type, the valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.
  • For PERSISTENT_1 HDD file systems, valid values are increments of 6000 GiB for 12 MB/s/TiB file systems and increments of 1800 GiB for 40 MB/s/TiB file systems.
  • For SCRATCH_1 deployment type, valid values are 1200 GiB, 2400 GiB, and increments of 3600 GiB.

FSx for ONTAP file systems - The amount of storage capacity that you can configure is from 1024 GiB up to 196,608 GiB (192 TiB).

FSx for OpenZFS file systems - The amount of storage capacity that you can configure is from 64 GiB up to 524,288 GiB (512 TiB). If you are creating a file system from a backup, you can specify a storage capacity equal to or greater than the original file system's storage capacity.

FSx for Windows File Server file systems - The amount of storage capacity that you can configure depends on the value that you set for StorageType as follows:

  • For SSD storage, valid values are 32 GiB-65,536 GiB (64 TiB).
  • For HDD storage, valid values are 2000 GiB-65,536 GiB (64 TiB).

storageType?

Type: string (optional)

Sets the storage type for the file system that you're creating. Valid values are SSD and HDD .

  • Set to SSD to use solid state drive storage. SSD is supported on all Windows, Lustre, ONTAP, and OpenZFS deployment types.
  • Set to HDD to use hard disk drive storage. HDD is supported on SINGLE_AZ_2 and MULTI_AZ_1 Windows file system deployment types, and on PERSISTENT_1 Lustre file system deployment types.

Default value is SSD . For more information, see Storage type options in the FSx for Windows File Server User Guide and Multiple storage options in the FSx for Lustre User Guide .


tags?

Type: CfnTag[] (optional)

An array of key-value pairs to apply to this resource.

For more information, see Tag .


windowsConfiguration?

Type: IResolvable | WindowsConfigurationProperty (optional)

The configuration object for the Microsoft Windows file system you are creating.

This value is required if FileSystemType is set to WINDOWS .

Properties

NameTypeDescription
attrDnsNamestringReturns the FSx for Windows file system's DNSName.
attrLustreMountNamestringReturns the Lustre file system's LustreMountName .
attrResourceArnstringReturns the Amazon Resource Name (ARN) for the Amazon FSx file system.
attrRootVolumeIdstringReturns the root volume ID of the FSx for OpenZFS file system.
cfnOptionsICfnResourceOptionsOptions for this resource, such as condition, update policy etc.
cfnProperties{ [string]: any }
cfnResourceTypestringAWS resource type.
creationStackstring[]
fileSystemTypestringThe type of Amazon FSx file system, which can be LUSTRE , WINDOWS , ONTAP , or OPENZFS .
logicalIdstringThe logical ID for this CloudFormation stack element.
nodeNodeThe tree node.
refstringReturn a string that will be resolved to a CloudFormation { Ref } for this element.
stackStackThe stack in which this element is defined.
subnetIdsstring[]Specifies the IDs of the subnets that the file system will be accessible from.
tagsTagManagerAn array of key-value pairs to apply to this resource.
backupId?stringThe ID of the file system backup that you are using to create a file system.
fileSystemTypeVersion?string(Optional) For FSx for Lustre file systems, sets the Lustre version for the file system that you're creating.
kmsKeyId?stringThe ID of the AWS Key Management Service ( AWS KMS ) key used to encrypt Amazon FSx file system data.
lustreConfiguration?IResolvable | LustreConfigurationPropertyThe Lustre configuration for the file system being created.
ontapConfiguration?IResolvable | OntapConfigurationPropertyThe ONTAP configuration properties of the FSx for ONTAP file system that you are creating.
openZfsConfiguration?IResolvable | OpenZFSConfigurationPropertyThe Amazon FSx for OpenZFS configuration properties for the file system that you are creating.
securityGroupIds?string[]A list of IDs specifying the security groups to apply to all network interfaces created for file system access.
storageCapacity?numberSets the storage capacity of the file system that you're creating.
storageType?stringSets the storage type for the file system that you're creating. Valid values are SSD and HDD .
windowsConfiguration?IResolvable | WindowsConfigurationPropertyThe configuration object for the Microsoft Windows file system you are creating.
static CFN_RESOURCE_TYPE_NAMEstringThe CloudFormation resource type name for this resource class.

attrDnsName

Type: string

Returns the FSx for Windows file system's DNSName.

Example: amznfsxp1honlek.corp.example.com


attrLustreMountName

Type: string

Returns the Lustre file system's LustreMountName .

Example for SCRATCH_1 deployment types: This value is always fsx .

Example for SCRATCH_2 and PERSISTENT deployment types: 2p3fhbmv


attrResourceArn

Type: string

Returns the Amazon Resource Name (ARN) for the Amazon FSx file system.

Example: arn:aws:fsx:us-east-2:111122223333:file-system/fs-0123abcd56789ef0a


attrRootVolumeId

Type: string

Returns the root volume ID of the FSx for OpenZFS file system.

Example: fsvol-0123456789abcdefa


cfnOptions

Type: ICfnResourceOptions

Options for this resource, such as condition, update policy etc.


cfnProperties

Type: { [string]: any }


cfnResourceType

Type: string

AWS resource type.


creationStack

Type: string[]


fileSystemType

Type: string

The type of Amazon FSx file system, which can be LUSTRE , WINDOWS , ONTAP , or OPENZFS .


logicalId

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

Type: Node

The tree node.


ref

Type: 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 }).


stack

Type: Stack

The stack in which this element is defined.

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


subnetIds

Type: string[]

Specifies the IDs of the subnets that the file system will be accessible from.

For Windows and ONTAP MULTI_AZ_1 deployment types,provide exactly two subnet IDs, one for the preferred file server and one for the standby file server. You specify one of these subnets as the preferred subnet using the WindowsConfiguration > PreferredSubnetID or OntapConfiguration > PreferredSubnetID properties. For more information about Multi-AZ file system configuration, see Availability and durability: Single-AZ and Multi-AZ file systems in the Amazon FSx for Windows User Guide and Availability and durability in the Amazon FSx for ONTAP User Guide .

For Windows SINGLE_AZ_1 and SINGLE_AZ_2 and all Lustre deployment types, provide exactly one subnet ID. The file server is launched in that subnet's Availability Zone.


tags

Type: TagManager

An array of key-value pairs to apply to this resource.

For more information, see Tag .


backupId?

Type: string (optional)

The ID of the file system backup that you are using to create a file system.

For more information, see CreateFileSystemFromBackup .


fileSystemTypeVersion?

Type: string (optional)

(Optional) For FSx for Lustre file systems, sets the Lustre version for the file system that you're creating.

Valid values are 2.10 and 2.12 :

  • 2.10 is supported by the Scratch and Persistent_1 Lustre deployment types.
  • 2.12 is supported by all Lustre deployment types. 2.12 is required when setting FSx for Lustre DeploymentType to PERSISTENT_2 .

Default value = 2.10 , except when DeploymentType is set to PERSISTENT_2 , then the default is 2.12 .

If you set FileSystemTypeVersion to 2.10 for a PERSISTENT_2 Lustre deployment type, the CreateFileSystem operation fails.


kmsKeyId?

Type: string (optional)

The ID of the AWS Key Management Service ( AWS KMS ) key used to encrypt Amazon FSx file system data.

Used as follows with Amazon FSx file system types:

  • Amazon FSx for Lustre PERSISTENT_1 and PERSISTENT_2 deployment types only.

SCRATCH_1 and SCRATCH_2 types are encrypted using the Amazon FSx service AWS KMS key for your account.

  • Amazon FSx for NetApp ONTAP
  • Amazon FSx for OpenZFS
  • Amazon FSx for Windows File Server

lustreConfiguration?

Type: IResolvable | LustreConfigurationProperty (optional)

The Lustre configuration for the file system being created.

The following parameters are not supported for file systems with a data repository association.

  • AutoImportPolicy
  • ExportPath
  • ImportedChunkSize
  • ImportPath

ontapConfiguration?

Type: IResolvable | OntapConfigurationProperty (optional)

The ONTAP configuration properties of the FSx for ONTAP file system that you are creating.


openZfsConfiguration?

Type: IResolvable | OpenZFSConfigurationProperty (optional)

The Amazon FSx for OpenZFS configuration properties for the file system that you are creating.


securityGroupIds?

Type: string[] (optional)

A list of IDs specifying the security groups to apply to all network interfaces created for file system access.

This list isn't returned in later requests to describe the file system.


storageCapacity?

Type: number (optional)

Sets the storage capacity of the file system that you're creating.

StorageCapacity is required if you are creating a new file system.

FSx for Lustre file systems - The amount of storage capacity that you can configure depends on the value that you set for StorageType and the Lustre DeploymentType , as follows:

  • For SCRATCH_2 , PERSISTENT_2 and PERSISTENT_1 deployment types using SSD storage type, the valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.
  • For PERSISTENT_1 HDD file systems, valid values are increments of 6000 GiB for 12 MB/s/TiB file systems and increments of 1800 GiB for 40 MB/s/TiB file systems.
  • For SCRATCH_1 deployment type, valid values are 1200 GiB, 2400 GiB, and increments of 3600 GiB.

FSx for ONTAP file systems - The amount of storage capacity that you can configure is from 1024 GiB up to 196,608 GiB (192 TiB).

FSx for OpenZFS file systems - The amount of storage capacity that you can configure is from 64 GiB up to 524,288 GiB (512 TiB). If you are creating a file system from a backup, you can specify a storage capacity equal to or greater than the original file system's storage capacity.

FSx for Windows File Server file systems - The amount of storage capacity that you can configure depends on the value that you set for StorageType as follows:

  • For SSD storage, valid values are 32 GiB-65,536 GiB (64 TiB).
  • For HDD storage, valid values are 2000 GiB-65,536 GiB (64 TiB).

storageType?

Type: string (optional)

Sets the storage type for the file system that you're creating. Valid values are SSD and HDD .

  • Set to SSD to use solid state drive storage. SSD is supported on all Windows, Lustre, ONTAP, and OpenZFS deployment types.
  • Set to HDD to use hard disk drive storage. HDD is supported on SINGLE_AZ_2 and MULTI_AZ_1 Windows file system deployment types, and on PERSISTENT_1 Lustre file system deployment types.

Default value is SSD . For more information, see Storage type options in the FSx for Windows File Server User Guide and Multiple storage options in the FSx for Lustre User Guide .


windowsConfiguration?

Type: IResolvable | WindowsConfigurationProperty (optional)

The configuration object for the Microsoft Windows file system you are creating.

This value is required if FileSystemType is set to WINDOWS .


static CFN_RESOURCE_TYPE_NAME

Type: string

The CloudFormation resource type name for this resource class.

Methods

NameDescription
addDeletionOverride(path)Syntactic sugar for addOverride(path, undefined).
addDependency(target)Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addDependsOn(target)⚠️Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)Add a value to the CloudFormation Resource Metadata.
addOverride(path, value)Adds an override to the synthesized CloudFormation resource.
addPropertyDeletionOverride(propertyPath)Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)Adds an override to a resource property.
applyRemovalPolicy(policy?, options?)Sets the deletion policy of the resource based on the removal policy specified.
getAtt(attributeName, typeHint?)Returns a token for an runtime attribute of this resource.
getMetadata(key)Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector)Examines the CloudFormation resource and discloses attributes.
obtainDependencies()Retrieves an array of resources this resource depends on.
obtainResourceDependencies()Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)Indicates that this resource no longer depends on another resource.
replaceDependency(target, newTarget)Replaces one dependency with another.
toString()Returns a string representation of this construct.
protected renderProperties(props)

addDeletionOverride(path)

public addDeletionOverride(path: string): void

Parameters

  • path string — The path of the value to delete.

Syntactic sugar for addOverride(path, undefined).


addDependency(target)

public addDependency(target: CfnResource): void

Parameters

  • target CfnResource

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.


addDependsOn(target)⚠️

public addDependsOn(target: CfnResource): void

⚠️ Deprecated: use addDependency

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.


addMetadata(key, value)

public addMetadata(key: string, value: any): void

Parameters

  • key string
  • value any

Add a value to the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


addOverride(path, value)

public addOverride(path: string, value: any): void

Parameters

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

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,

cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

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


addPropertyDeletionOverride(propertyPath)

public addPropertyDeletionOverride(propertyPath: string): void

Parameters

  • propertyPath string — The path to the property.

Adds an override that deletes the value of a property from the resource definition.


addPropertyOverride(propertyPath, value)

public addPropertyOverride(propertyPath: string, value: any): void

Parameters

  • propertyPath string — The path of the property.
  • value any — The value.

Adds an override to a resource property.

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


applyRemovalPolicy(policy?, options?)

public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void

Parameters

  • policy RemovalPolicy
  • options RemovalPolicyOptions

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:

See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options


getAtt(attributeName, typeHint?)

public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference

Parameters

  • attributeName string — The name of the attribute.
  • typeHint ResolutionTypeHint

Returns

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


getMetadata(key)

public getMetadata(key: string): any

Parameters

  • key string

Returns

  • any

Retrieve a value value from the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


inspect(inspector)

public inspect(inspector: TreeInspector): void

Parameters

  • inspector TreeInspector — - tree inspector to collect and process attributes.

Examines the CloudFormation resource and discloses attributes.


obtainDependencies()

public obtainDependencies(): Stack &#124; CfnResource[]

Returns

  • Stack | CfnResource[]

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.


obtainResourceDependencies()

public obtainResourceDependencies(): CfnResource[]

Returns

  • CfnResource[]

Get a shallow copy of dependencies between this resource and other resources in the same stack.


overrideLogicalId(newLogicalId)

public overrideLogicalId(newLogicalId: string): void

Parameters

  • newLogicalId string — The new logical ID to use for this stack element.

Overrides the auto-generated logical ID with a specific ID.


removeDependency(target)

public removeDependency(target: CfnResource): void

Parameters

  • target CfnResource

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, newTarget)

public replaceDependency(target: CfnResource, newTarget: CfnResource): void

Parameters

  • target CfnResource — The dependency to replace.
  • newTarget CfnResource — The new dependency to add.

Replaces one dependency with another.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected renderProperties(props)

protected renderProperties(props: { [string]: any }): { [string]: any }

Parameters

  • props { [string]: any }

Returns

  • { [string]: any }