CfnFileSystem L1 construct
The AWS::EFS::FileSystem resource creates a new, empty file system in Amazon Elastic File System ( Amazon EFS ).
You must create a mount target ( AWS::EFS::MountTarget ) to mount your EFS file system on an Amazon EC2 or other AWS cloud compute resource.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_efs as efs } from 'aws-cdk-lib';
declare const fileSystemPolicy: any;
const cfnFileSystem = new efs.CfnFileSystem(this, 'MyCfnFileSystem', /* all optional props */ {
availabilityZoneName: 'availabilityZoneName',
backupPolicy: {
status: 'status',
},
bypassPolicyLockoutSafetyCheck: false,
encrypted: false,
fileSystemPolicy: fileSystemPolicy,
fileSystemProtection: {
replicationOverwriteProtection: 'replicationOverwriteProtection',
},
fileSystemTags: [{
key: 'key',
value: 'value',
}],
kmsKeyId: 'kmsKeyId',
lifecyclePolicies: [{
transitionToArchive: 'transitionToArchive',
transitionToIa: 'transitionToIa',
transitionToPrimaryStorageClass: 'transitionToPrimaryStorageClass',
}],
performanceMode: 'performanceMode',
provisionedThroughputInMibps: 123,
replicationConfiguration: {
destinations: [{
availabilityZoneName: 'availabilityZoneName',
fileSystemId: 'fileSystemId',
kmsKeyId: 'kmsKeyId',
region: 'region',
roleArn: 'roleArn',
status: 'status',
statusMessage: 'statusMessage',
}],
},
throughputMode: 'throughputMode',
});
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_efs as efs
# file_system_policy: Any
cfn_file_system = efs.CfnFileSystem(self, "MyCfnFileSystem",
availability_zone_name="availabilityZoneName",
backup_policy=efs.CfnFileSystem.BackupPolicyProperty(
status="status"
),
bypass_policy_lockout_safety_check=False,
encrypted=False,
file_system_policy=file_system_policy,
file_system_protection=efs.CfnFileSystem.FileSystemProtectionProperty(
replication_overwrite_protection="replicationOverwriteProtection"
),
file_system_tags=[efs.CfnFileSystem.ElasticFileSystemTagProperty(
key="key",
value="value"
)],
kms_key_id="kmsKeyId",
lifecycle_policies=[efs.CfnFileSystem.LifecyclePolicyProperty(
transition_to_archive="transitionToArchive",
transition_to_ia="transitionToIa",
transition_to_primary_storage_class="transitionToPrimaryStorageClass"
)],
performance_mode="performanceMode",
provisioned_throughput_in_mibps=123,
replication_configuration=efs.CfnFileSystem.ReplicationConfigurationProperty(
destinations=[efs.CfnFileSystem.ReplicationDestinationProperty(
availability_zone_name="availabilityZoneName",
file_system_id="fileSystemId",
kms_key_id="kmsKeyId",
region="region",
role_arn="roleArn",
status="status",
status_message="statusMessage"
)]
),
throughput_mode="throughputMode"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.efs.*;
Object fileSystemPolicy;
CfnFileSystem cfnFileSystem = CfnFileSystem.Builder.create(this, "MyCfnFileSystem")
.availabilityZoneName("availabilityZoneName")
.backupPolicy(BackupPolicyProperty.builder()
.status("status")
.build())
.bypassPolicyLockoutSafetyCheck(false)
.encrypted(false)
.fileSystemPolicy(fileSystemPolicy)
.fileSystemProtection(FileSystemProtectionProperty.builder()
.replicationOverwriteProtection("replicationOverwriteProtection")
.build())
.fileSystemTags(List.of(ElasticFileSystemTagProperty.builder()
.key("key")
.value("value")
.build()))
.kmsKeyId("kmsKeyId")
.lifecyclePolicies(List.of(LifecyclePolicyProperty.builder()
.transitionToArchive("transitionToArchive")
.transitionToIa("transitionToIa")
.transitionToPrimaryStorageClass("transitionToPrimaryStorageClass")
.build()))
.performanceMode("performanceMode")
.provisionedThroughputInMibps(123)
.replicationConfiguration(ReplicationConfigurationProperty.builder()
.destinations(List.of(ReplicationDestinationProperty.builder()
.availabilityZoneName("availabilityZoneName")
.fileSystemId("fileSystemId")
.kmsKeyId("kmsKeyId")
.region("region")
.roleArn("roleArn")
.status("status")
.statusMessage("statusMessage")
.build()))
.build())
.throughputMode("throughputMode")
.build();
// 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.EFS;
var fileSystemPolicy;
var cfnFileSystem = new CfnFileSystem(this, "MyCfnFileSystem", new CfnFileSystemProps {
AvailabilityZoneName = "availabilityZoneName",
BackupPolicy = new BackupPolicyProperty {
Status = "status"
},
BypassPolicyLockoutSafetyCheck = false,
Encrypted = false,
FileSystemPolicy = fileSystemPolicy,
FileSystemProtection = new FileSystemProtectionProperty {
ReplicationOverwriteProtection = "replicationOverwriteProtection"
},
FileSystemTags = new [] { new ElasticFileSystemTagProperty {
Key = "key",
Value = "value"
} },
KmsKeyId = "kmsKeyId",
LifecyclePolicies = new [] { new LifecyclePolicyProperty {
TransitionToArchive = "transitionToArchive",
TransitionToIa = "transitionToIa",
TransitionToPrimaryStorageClass = "transitionToPrimaryStorageClass"
} },
PerformanceMode = "performanceMode",
ProvisionedThroughputInMibps = 123,
ReplicationConfiguration = new ReplicationConfigurationProperty {
Destinations = new [] { new ReplicationDestinationProperty {
AvailabilityZoneName = "availabilityZoneName",
FileSystemId = "fileSystemId",
KmsKeyId = "kmsKeyId",
Region = "region",
RoleArn = "roleArn",
Status = "status",
StatusMessage = "statusMessage"
} }
},
ThroughputMode = "throughputMode"
});
// 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"
var fileSystemPolicy interface{}
cfnFileSystem := awscdk.Aws_efs.NewCfnFileSystem(this, jsii.String("MyCfnFileSystem"), &CfnFileSystemProps{
AvailabilityZoneName: jsii.String("availabilityZoneName"),
BackupPolicy: &BackupPolicyProperty{
Status: jsii.String("status"),
},
BypassPolicyLockoutSafetyCheck: jsii.Boolean(false),
Encrypted: jsii.Boolean(false),
FileSystemPolicy: fileSystemPolicy,
FileSystemProtection: &FileSystemProtectionProperty{
ReplicationOverwriteProtection: jsii.String("replicationOverwriteProtection"),
},
FileSystemTags: []ElasticFileSystemTagProperty{
&ElasticFileSystemTagProperty{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
KmsKeyId: jsii.String("kmsKeyId"),
LifecyclePolicies: []interface{}{
&LifecyclePolicyProperty{
TransitionToArchive: jsii.String("transitionToArchive"),
TransitionToIa: jsii.String("transitionToIa"),
TransitionToPrimaryStorageClass: jsii.String("transitionToPrimaryStorageClass"),
},
},
PerformanceMode: jsii.String("performanceMode"),
ProvisionedThroughputInMibps: jsii.Number(123),
ReplicationConfiguration: &ReplicationConfigurationProperty{
Destinations: []interface{}{
&ReplicationDestinationProperty{
AvailabilityZoneName: jsii.String("availabilityZoneName"),
FileSystemId: jsii.String("fileSystemId"),
KmsKeyId: jsii.String("kmsKeyId"),
Region: jsii.String("region"),
RoleArn: jsii.String("roleArn"),
Status: jsii.String("status"),
StatusMessage: jsii.String("statusMessage"),
},
},
},
ThroughputMode: jsii.String("throughputMode"),
})
Initializer
new CfnFileSystem(scope: Construct, id: string, props?: CfnFileSystemProps)
CfnFileSystem(scope: Construct, id: str, props: typing.Optional[CfnFileSystemProps] = None)
new CfnFileSystem(Construct scope, String id, CfnFileSystemProps props)
new CfnFileSystem(Construct scope, string id, CfnFileSystemProps? props = null)
NewCfnFileSystem(Scope Construct, Id *string, Props CfnFileSystemProps)
Construct Props
availabilityZoneNameoptionalstringavailability_zone_nameoptionalstravailabilityZoneNameoptionalStringAvailabilityZoneNameoptionalstringAvailabilityZoneNameoptional*string#notes
Use the format us-east-1a to specify the Availability Zone. For more information about One Zone file systems, see EFS file system types in the Amazon EFS User Guide .
One Zone file systems are not available in all Availability Zones in AWS Regions where Amazon EFS is available.
backupPolicyoptionalIResolvable | CfnFileSystem.BackupPolicyPropertybackup_policyoptionaltyping.Union[IResolvable, BackupPolicyProperty]backupPolicyoptionalIResolvableBackupPolicyoptionalIResolvableBackupPolicyoptionalinterface{}#bypassPolicyLockoutSafetyCheckoptionalboolean | IResolvablebypass_policy_lockout_safety_checkoptionaltyping.Union[bool, IResolvable]bypassPolicyLockoutSafetyCheckoptionalBooleanBypassPolicyLockoutSafetyCheckoptionalboolBypassPolicyLockoutSafetyCheckoptionalinterface{}#notes
The lockout safety check determines whether the policy in the request will lock out, or prevent, the IAM principal that is making the request from making future PutFileSystemPolicy requests on this file system. Set BypassPolicyLockoutSafetyCheck to True only when you intend to prevent the IAM principal that is making the request from making subsequent PutFileSystemPolicy requests on this file system. The default value is False .
encryptedoptionalboolean | IResolvableencryptedoptionaltyping.Union[bool, IResolvable]encryptedoptionalBooleanEncryptedoptionalboolEncryptedoptionalinterface{}#notes
When creating an encrypted file system, you have the option of specifying a KmsKeyId for an existing AWS KMS key . If you don't specify a KMS key , then the default KMS key for Amazon EFS , /aws/elasticfilesystem , is used to protect the encrypted file system.
fileSystemPolicyoptionalanyfile_system_policyoptionalAnyfileSystemPolicyoptionalObjectFileSystemPolicyoptionalobjectFileSystemPolicyoptionalinterface{}#notes
A file system policy is an IAM resource policy used to control NFS access to an EFS file system. For more information, see Using IAM to control NFS access to Amazon EFS in the Amazon EFS User Guide .
fileSystemProtectionoptionalIResolvable | CfnFileSystem.FileSystemProtectionPropertyfile_system_protectionoptionaltyping.Union[IResolvable, FileSystemProtectionProperty]fileSystemProtectionoptionalIResolvableFileSystemProtectionoptionalIResolvableFileSystemProtectionoptionalinterface{}#fileSystemTagsoptionalCfnFileSystem.ElasticFileSystemTagProperty[]file_system_tagsoptionaltyping.List[ElasticFileSystemTagProperty]fileSystemTagsoptionalList<ElasticFileSystemTagProperty>FileSystemTagsoptionalElasticFileSystemTagProperty[]FileSystemTagsoptional*[]ElasticFileSystemTagProperty#notes
Each tag is a user-defined key-value pair. Name your file system on creation by including a "Key":"Name","Value":"{value}" key-value pair. Each key must be unique. For more information, see Tagging AWS resources in the AWS General Reference Guide .
kmsKeyIdoptionalstring | IKeyRefkms_key_idoptionaltyping.Union[str, IKeyRef]kmsKeyIdoptionalStringKmsKeyIdoptionalstringKmsKeyIdoptionalinterface{}#notes
This parameter is only required if you want to use a nondefault KMS key . If this parameter is not specified, the default KMS key for Amazon EFS is used. This ID can be in one of the following formats:
- Key ID - A unique identifier of the key, for example
1234abcd-12ab-34cd-56ef-1234567890ab. - ARN - An Amazon Resource Name (ARN) for the key, for example
arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. - Key alias - A previously created display name for a key, for example
alias/projectKey1. - Key alias ARN - An ARN for a key alias, for example
arn:aws:kms:us-west-2:444455556666:alias/projectKey1.
If KmsKeyId is specified, the Encrypted parameter must be set to true.
lifecyclePoliciesoptionalIResolvable | IResolvable | CfnFileSystem.LifecyclePolicyProperty[]lifecycle_policiesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LifecyclePolicyProperty]]]lifecyclePoliciesoptionalIResolvableLifecyclePoliciesoptionalIResolvableLifecyclePoliciesoptionalinterface{}#notes
A LifecycleConfiguration object informs Lifecycle management of the following:
- When to move files in the file system from primary storage to IA storage.
- When to move files in the file system from primary storage or IA storage to Archive storage.
- When to move files that are in IA or Archive storage to primary storage.
Amazon EFS requires that each
LifecyclePolicyobject have only a single transition. This means that in a request body,LifecyclePoliciesneeds to be structured as an array ofLifecyclePolicyobjects, one object for each transition,TransitionToIA,TransitionToArchiveTransitionToPrimaryStorageClass. See the example requests in the following section for more information.
performanceModeoptionalstringperformance_modeoptionalstrperformanceModeoptionalStringPerformanceModeoptionalstringPerformanceModeoptional*string#notes
We recommend generalPurpose performance mode for all file systems. File systems using the maxIO performance mode can scale to higher levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file operations. The performance mode can't be changed after the file system has been created. The maxIO mode is not supported on One Zone file systems.
Due to the higher per-operation latencies with Max I/O, we recommend using General Purpose performance mode for all file systems.
Default is generalPurpose .
provisionedThroughputInMibpsoptionalnumberprovisioned_throughput_in_mibpsoptionalint | floatprovisionedThroughputInMibpsoptionalNumberProvisionedThroughputInMibpsoptionaldoubleProvisionedThroughputInMibpsoptional*float64#notes
Required if ThroughputMode is set to provisioned . Valid values are 1-3414 MiBps, with the upper limit depending on Region. To increase this limit, contact Support . For more information, see Amazon EFS quotas that you can increase in the Amazon EFS User Guide .
replicationConfigurationoptionalIResolvable | CfnFileSystem.ReplicationConfigurationPropertyreplication_configurationoptionaltyping.Union[IResolvable, ReplicationConfigurationProperty]replicationConfigurationoptionalIResolvableReplicationConfigurationoptionalIResolvableReplicationConfigurationoptionalinterface{}#throughputModeoptionalstringthroughput_modeoptionalstrthroughputModeoptionalStringThroughputModeoptionalstringThroughputModeoptional*string#notes
The mode can be bursting , provisioned , or elastic . If you set ThroughputMode to provisioned , you must also set a value for ProvisionedThroughputInMibps . After you create the file system, you can decrease your file system's Provisioned throughput or change between the throughput modes, with certain time restrictions. For more information, see Specifying throughput with provisioned mode in the Amazon EFS User Guide .
Default is bursting .
Properties
Example: arn:aws:elasticfilesystem:us-west-2:1111333322228888:file-system/fs-0123456789abcdef8
attrFileSystemIdstringattr_file_system_idstrattrFileSystemIdStringAttrFileSystemIdstringAttrFileSystemId*stringrequired#For example: fs-abcdef0123456789a
availabilityZoneNamemay be undefinedstringavailability_zone_namemay be undefinedstravailabilityZoneNamemay be undefinedStringAvailabilityZoneNamemay be undefinedstringAvailabilityZoneNamemay be undefined*string#backupPolicymay be undefinedIResolvable | CfnFileSystem.BackupPolicyPropertybackup_policymay be undefinedtyping.Union[IResolvable, BackupPolicyProperty]backupPolicymay be undefinedIResolvableBackupPolicymay be undefinedIResolvableBackupPolicymay be undefinedinterface{}#bypassPolicyLockoutSafetyCheckmay be undefinedboolean | IResolvablebypass_policy_lockout_safety_checkmay be undefinedtyping.Union[bool, IResolvable]bypassPolicyLockoutSafetyCheckmay be undefinedBooleanBypassPolicyLockoutSafetyCheckmay be undefinedboolBypassPolicyLockoutSafetyCheckmay be undefinedinterface{}#CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringrequiredstatic#cfnOptionsICfnResourceOptionscfn_optionsICfnResourceOptionscfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsCfnOptionsICfnResourceOptionsrequired#cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*stringrequired#creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#encryptedmay be undefinedboolean | IResolvableencryptedmay be undefinedtyping.Union[bool, IResolvable]encryptedmay be undefinedBooleanEncryptedmay be undefinedboolEncryptedmay be undefinedinterface{}#fileSystemPolicyanyfile_system_policyAnyfileSystemPolicyObjectFileSystemPolicyobjectFileSystemPolicyinterface{}required#fileSystemProtectionmay be undefinedIResolvable | CfnFileSystem.FileSystemProtectionPropertyfile_system_protectionmay be undefinedtyping.Union[IResolvable, FileSystemProtectionProperty]fileSystemProtectionmay be undefinedIResolvableFileSystemProtectionmay be undefinedIResolvableFileSystemProtectionmay be undefinedinterface{}#fileSystemRefFileSystemReferencefile_system_refFileSystemReferencefileSystemRefFileSystemReferenceFileSystemRefFileSystemReferenceFileSystemRefFileSystemReferencerequired#fileSystemTagsRawmay be undefinedCfnFileSystem.ElasticFileSystemTagProperty[]file_system_tags_rawmay be undefinedtyping.List[ElasticFileSystemTagProperty]fileSystemTagsRawmay be undefinedList<ElasticFileSystemTagProperty>FileSystemTagsRawmay be undefinedElasticFileSystemTagProperty[]FileSystemTagsRawmay be undefined*[]ElasticFileSystemTagProperty#kmsKeyIdmay be undefinedstringkms_key_idmay be undefinedstrkmsKeyIdmay be undefinedStringKmsKeyIdmay be undefinedstringKmsKeyIdmay be undefined*string#lifecyclePoliciesmay be undefinedIResolvable | IResolvable | CfnFileSystem.LifecyclePolicyProperty[]lifecycle_policiesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LifecyclePolicyProperty]]]lifecyclePoliciesmay be undefinedIResolvableLifecyclePoliciesmay be undefinedIResolvableLifecyclePoliciesmay be undefinedinterface{}#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).
performanceModemay be undefinedstringperformance_modemay be undefinedstrperformanceModemay be undefinedStringPerformanceModemay be undefinedstringPerformanceModemay be undefined*string#provisionedThroughputInMibpsmay be undefinednumberprovisioned_throughput_in_mibpsmay be undefinedint | floatprovisionedThroughputInMibpsmay be undefinedNumberProvisionedThroughputInMibpsmay be undefineddoubleProvisionedThroughputInMibpsmay be undefined*float64#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 }).
replicationConfigurationmay be undefinedIResolvable | CfnFileSystem.ReplicationConfigurationPropertyreplication_configurationmay be undefinedtyping.Union[IResolvable, ReplicationConfigurationProperty]replicationConfigurationmay be undefinedIResolvableReplicationConfigurationmay be undefinedIResolvableReplicationConfigurationmay be undefinedinterface{}#CfnElements must be defined within a stack scope (directly or indirectly).
throughputModemay be undefinedstringthroughput_modemay be undefinedstrthroughputModemay be undefinedStringThroughputModemay be undefinedstringThroughputModemay be undefined*string#Methods
addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#1 parameter
Parameters
pathpathpathpathPath— The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#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): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#notes
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): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#notes · 2 parameters
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.
Parameters
pathpathpathpathPath— - The path of the property, you can use dot notation to override values in complex types.valuevaluevaluevalueValue— - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#1 parameter
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#Syntactic sugar for addOverride("Properties.<...>", value).
2 parameters
Parameters
propertyPathproperty_pathpropertyPathpropertyPathPropertyPath— The path of the property.valuevaluevaluevalueValue— The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#notes
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): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#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.
1 parameter
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#notes
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:
arnForFileSystem(resource: IFileSystemRef): string@staticmethod def arn_for_file_system(resource: IFileSystemRef) -> strpublic static String arnForFileSystem(IFileSystemRef resource)public static string ArnForFileSystem(IFileSystemRef resource)func ArnForFileSystem(Resource IFileSystemRef) *stringstatic#cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#fromFileSystemArn(scope: Construct, id: string, arn: string): IFileSystemRef@staticmethod def from_file_system_arn(scope: Construct, id: str, arn: str) -> IFileSystemRefpublic static IFileSystemRef fromFileSystemArn(Construct scope, String id, String arn)public static IFileSystemRef FromFileSystemArn(Construct scope, string id, string arn)func FromFileSystemArn(Scope Construct, Id *string, Arn *string) IFileSystemRefstatic#fromFileSystemId(scope: Construct, id: string, fileSystemId: string): IFileSystemRef@staticmethod def from_file_system_id(scope: Construct, id: str, file_system_id: str) -> IFileSystemRefpublic static IFileSystemRef fromFileSystemId(Construct scope, String id, String fileSystemId)public static IFileSystemRef FromFileSystemId(Construct scope, string id, string fileSystemId)func FromFileSystemId(Scope Construct, Id *string, FileSystemId *string) IFileSystemRefstatic#getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.
1 parameter
Parameters
attributeNameattribute_nameattributeNameattributeNameAttributeName— The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#1 parameter
Parameters
inspectorinspectorinspectorinspectorInspector— tree inspector to collect and process attributes.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.
returns
Returns: The construct as a stack element or undefined if it is not a stack element.
isCfnFileSystem(x: any): boolean@staticmethod def is_cfn_file_system(x: Any) -> boolpublic static Boolean isCfnFileSystem(Object x)public static bool IsCfnFileSystem(object x)func IsCfnFileSystem(X interface{}) *boolstatic#isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
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
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#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): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#1 parameter
Parameters
newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId— The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#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): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#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): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#2 parameters
Parameters
targettargettargettargetTarget— The dependency to replace.newTargetnew_targetnewTargetnewTargetNewTarget— The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#returns
Returns: a string representation of this resource
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.