class CfnFileSystem (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EFS.CfnFileSystem |
Java | software.amazon.awscdk.services.efs.CfnFileSystem |
Python | aws_cdk.aws_efs.CfnFileSystem |
TypeScript | @aws-cdk/aws-efs » CfnFileSystem |
Implements
IConstruct
, IConstruct
, IDependable
, IInspectable
A CloudFormation AWS::EFS::FileSystem
.
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 * as efs from '@aws-cdk/aws-efs';
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,
fileSystemTags: [{
key: 'key',
value: 'value',
}],
kmsKeyId: 'kmsKeyId',
lifecyclePolicies: [{
transitionToIa: 'transitionToIa',
transitionToPrimaryStorageClass: 'transitionToPrimaryStorageClass',
}],
performanceMode: 'performanceMode',
provisionedThroughputInMibps: 123,
throughputMode: 'throughputMode',
});
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
Cfn
— - resource properties.File System Props
Create a new AWS::EFS::FileSystem
.
Construct Props
Name | Type | Description |
---|---|---|
availability | string | Used to create a file system that uses One Zone storage classes. |
backup | IResolvable | Backup | Use the BackupPolicy to turn automatic backups on or off for the file system. |
bypass | boolean | IResolvable | (Optional) A boolean that specifies whether or not to bypass the FileSystemPolicy lockout safety check. |
encrypted? | boolean | IResolvable | A Boolean value that, if true, creates an encrypted file system. |
file | any | The FileSystemPolicy for the EFS file system. |
file | Elastic [] | Use to create one or more tags associated with the file system. |
kms | string | The ID of the AWS KMS key to be used to protect the encrypted file system. |
lifecycle | IResolvable | IResolvable | Lifecycle [] | An array of LifecyclePolicy objects that define the file system's LifecycleConfiguration object. |
performance | string | The performance mode of the file system. |
provisioned | number | The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. |
throughput | string | Specifies the throughput mode for the file system. |
availabilityZoneName?
Type:
string
(optional)
Used to create a file system that uses One Zone storage classes.
It specifies the AWS Availability Zone in which to create the file system. Use the format us-east-1a
to specify the Availability Zone. For more information about One Zone storage classes, see Using EFS storage classes in the Amazon EFS User Guide .
One Zone storage classes are not available in all Availability Zones in AWS Regions where Amazon EFS is available.
backupPolicy?
Type:
IResolvable
|
Backup
(optional)
Use the BackupPolicy
to turn automatic backups on or off for the file system.
bypassPolicyLockoutSafetyCheck?
Type:
boolean |
IResolvable
(optional)
(Optional) A boolean that specifies whether or not to bypass the FileSystemPolicy
lockout safety check.
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
.
encrypted?
Type:
boolean |
IResolvable
(optional)
A Boolean value that, if true, creates an encrypted file system.
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.
fileSystemPolicy?
Type:
any
(optional)
The FileSystemPolicy
for the EFS file system.
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 .
fileSystemTags?
Type:
Elastic
[]
(optional)
Use to create one or more tags associated with the file system.
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 .
kmsKeyId?
Type:
string
(optional)
The ID of the AWS KMS key to be used to protect the encrypted file system.
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.
lifecyclePolicies?
Type:
IResolvable
|
IResolvable
|
Lifecycle
[]
(optional)
An array of LifecyclePolicy
objects that define the file system's LifecycleConfiguration
object.
A LifecycleConfiguration
object informs EFS lifecycle management and intelligent tiering of the following:
- When to move files in the file system from primary storage to the IA storage class.
- When to move files that are in IA storage to primary storage.
Amazon EFS requires that each
LifecyclePolicy
object have only a single transition. This means that in a request body,LifecyclePolicies
needs to be structured as an array ofLifecyclePolicy
objects, one object for each transition,TransitionToIA
,TransitionToPrimaryStorageClass
. See the example requests in the following section for more information.
performanceMode?
Type:
string
(optional)
The performance mode of the file system.
We recommend generalPurpose
performance mode for most 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 file systems using One Zone storage classes.
provisionedThroughputInMibps?
Type:
number
(optional)
The throughput, measured in MiB/s, that you want to provision for a file system that you're creating.
Valid values are 1-1024. Required if ThroughputMode
is set to provisioned
. The upper limit for throughput is 1024 MiB/s. To increase this limit, contact AWS Support . For more information, see Amazon EFS quotas that you can increase in the Amazon EFS User Guide .
throughputMode?
Type:
string
(optional)
Specifies the throughput mode for the file system.
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 throughput in Provisioned Throughput mode 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
Name | Type | Description |
---|---|---|
attr | string | The Amazon Resource Name (ARN) of the EFS file system. |
attr | string | The ID of the EFS file system. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
file | any | The FileSystemPolicy for the EFS file system. |
logical | string | The logical ID for this CloudFormation stack element. |
node | Construct | The construct tree node associated with this construct. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
stack | Stack | The stack in which this element is defined. |
tags | Tag | Use to create one or more tags associated with the file system. |
availability | string | Used to create a file system that uses One Zone storage classes. |
backup | IResolvable | Backup | Use the BackupPolicy to turn automatic backups on or off for the file system. |
bypass | boolean | IResolvable | (Optional) A boolean that specifies whether or not to bypass the FileSystemPolicy lockout safety check. |
encrypted? | boolean | IResolvable | A Boolean value that, if true, creates an encrypted file system. |
kms | string | The ID of the AWS KMS key to be used to protect the encrypted file system. |
lifecycle | IResolvable | IResolvable | Lifecycle [] | An array of LifecyclePolicy objects that define the file system's LifecycleConfiguration object. |
performance | string | The performance mode of the file system. |
provisioned | number | The throughput, measured in MiB/s, that you want to provision for a file system that you're creating. |
throughput | string | Specifies the throughput mode for the file system. |
static CFN_RESOURCE_TYPE_NAME | string | The CloudFormation resource type name for this resource class. |
attrArn
Type:
string
The Amazon Resource Name (ARN) of the EFS file system.
Example: arn:aws:elasticfilesystem:us-west-2:1111333322228888:file-system/fs-0123456789abcdef8
attrFileSystemId
Type:
string
The ID of the EFS file system.
For example: fs-abcdef0123456789a
cfnOptions
Type:
ICfn
Options for this resource, such as condition, update policy etc.
cfnProperties
Type:
{ [string]: any }
cfnResourceType
Type:
string
AWS resource type.
creationStack
Type:
string[]
fileSystemPolicy
Type:
any
The FileSystemPolicy
for the EFS file system.
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 .
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:
Construct
The construct tree node associated with this construct.
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).
tags
Type:
Tag
Use to create one or more tags associated with the file system.
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 .
availabilityZoneName?
Type:
string
(optional)
Used to create a file system that uses One Zone storage classes.
It specifies the AWS Availability Zone in which to create the file system. Use the format us-east-1a
to specify the Availability Zone. For more information about One Zone storage classes, see Using EFS storage classes in the Amazon EFS User Guide .
One Zone storage classes are not available in all Availability Zones in AWS Regions where Amazon EFS is available.
backupPolicy?
Type:
IResolvable
|
Backup
(optional)
Use the BackupPolicy
to turn automatic backups on or off for the file system.
bypassPolicyLockoutSafetyCheck?
Type:
boolean |
IResolvable
(optional)
(Optional) A boolean that specifies whether or not to bypass the FileSystemPolicy
lockout safety check.
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
.
encrypted?
Type:
boolean |
IResolvable
(optional)
A Boolean value that, if true, creates an encrypted file system.
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.
kmsKeyId?
Type:
string
(optional)
The ID of the AWS KMS key to be used to protect the encrypted file system.
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.
lifecyclePolicies?
Type:
IResolvable
|
IResolvable
|
Lifecycle
[]
(optional)
An array of LifecyclePolicy
objects that define the file system's LifecycleConfiguration
object.
A LifecycleConfiguration
object informs EFS lifecycle management and intelligent tiering of the following:
- When to move files in the file system from primary storage to the IA storage class.
- When to move files that are in IA storage to primary storage.
Amazon EFS requires that each
LifecyclePolicy
object have only a single transition. This means that in a request body,LifecyclePolicies
needs to be structured as an array ofLifecyclePolicy
objects, one object for each transition,TransitionToIA
,TransitionToPrimaryStorageClass
. See the example requests in the following section for more information.
performanceMode?
Type:
string
(optional)
The performance mode of the file system.
We recommend generalPurpose
performance mode for most 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 file systems using One Zone storage classes.
provisionedThroughputInMibps?
Type:
number
(optional)
The throughput, measured in MiB/s, that you want to provision for a file system that you're creating.
Valid values are 1-1024. Required if ThroughputMode
is set to provisioned
. The upper limit for throughput is 1024 MiB/s. To increase this limit, contact AWS Support . For more information, see Amazon EFS quotas that you can increase in the Amazon EFS User Guide .
throughputMode?
Type:
string
(optional)
Specifies the throughput mode for the file system.
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 throughput in Provisioned Throughput mode 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
.
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
override | Overrides the auto-generated logical ID with a specific ID. |
to | Returns a string representation of this construct. |
protected render |
DeletionOverride(path)
addpublic addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
DependsOn(target)
addpublic addDependsOn(target: CfnResource): void
Parameters
- target
Cfn
Resource
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.
Metadata(key, value)
addpublic 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.)
Override(path, value)
addpublic 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.
PropertyDeletionOverride(propertyPath)
addpublic 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.
PropertyOverride(propertyPath, value)
addpublic 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)
.
RemovalPolicy(policy?, options?)
applypublic applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
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
).
Att(attributeName)
getpublic getAtt(attributeName: string): Reference
Parameters
- attributeName
string
— The name of the attribute.
Returns
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.
Metadata(key)
getpublic 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
Tree
— - tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
LogicalId(newLogicalId)
overridepublic 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.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
Properties(props)
protected renderprotected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }