@@ -10,7 +10,7 @@ import { CfnFileSystem, CfnMountTarget } from './efs.generated';
10
10
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html#cfn-elasticfilesystem-filesystem-lifecyclepolicies
11
11
*/
12
12
// tslint:enable
13
- export enum LifecyclePolicyProperty {
13
+ export enum LifecyclePolicy {
14
14
/**
15
15
* After 7 days of not being accessed.
16
16
*/
@@ -134,7 +134,7 @@ export interface FileSystemProps {
134
134
*
135
135
* @default - none
136
136
*/
137
- readonly lifecyclePolicy ?: LifecyclePolicyProperty ;
137
+ readonly lifecyclePolicy ?: LifecyclePolicy ;
138
138
139
139
/**
140
140
* Enum to mention the performance mode of the file system.
@@ -153,9 +153,9 @@ export interface FileSystemProps {
153
153
/**
154
154
* Provisioned throughput for the file system.
155
155
* This is a required property if the throughput mode is set to PROVISIONED.
156
- * Valid values are 1MiB/s -> 1GiB/s
156
+ * Must be at least 1MiB/s.
157
157
*
158
- * @default - None , errors out
158
+ * @default - none , errors out
159
159
*/
160
160
readonly provisionedThroughputPerSecond ?: Size ;
161
161
}
@@ -172,7 +172,7 @@ export interface FileSystemAttributes {
172
172
/**
173
173
* The File System's ID.
174
174
*/
175
- readonly fileSystemID : string ;
175
+ readonly fileSystemId : string ;
176
176
}
177
177
178
178
/**
@@ -192,7 +192,7 @@ export class FileSystem extends Resource implements IFileSystem {
192
192
*/
193
193
public static fromFileSystemAttributes ( scope : Construct , id : string , attrs : FileSystemAttributes ) : IFileSystem {
194
194
class Import extends Resource implements IFileSystem {
195
- public readonly fileSystemId = attrs . fileSystemID ;
195
+ public readonly fileSystemId = attrs . fileSystemId ;
196
196
public readonly connections = new ec2 . Connections ( {
197
197
securityGroups : [ attrs . securityGroup ] ,
198
198
defaultPort : ec2 . Port . tcp ( FileSystem . DEFAULT_PORT ) ,
@@ -223,23 +223,19 @@ export class FileSystem extends Resource implements IFileSystem {
223
223
constructor ( scope : Construct , id : string , props : FileSystemProps ) {
224
224
super ( scope , id ) ;
225
225
226
- if ( props . throughputMode === ThroughputMode . PROVISIONED ) {
227
- if ( props . provisionedThroughputPerSecond === undefined ) {
228
- throw new Error ( 'Property provisionedThroughputInMibps is required when throughputMode is PROVISIONED' ) ;
229
- } else if ( props . provisionedThroughputPerSecond . toMebibytes ( ) > 1024 ) {
230
- throw new Error ( 'Valid values for throughput are 1MiB/s - 1GiB/s. You can get this limit increased by contacting AWS Support.' ) ;
231
- }
226
+ if ( props . throughputMode === ThroughputMode . PROVISIONED && props . provisionedThroughputPerSecond === undefined ) {
227
+ throw new Error ( 'Property provisionedThroughputPerSecond is required when throughputMode is PROVISIONED' ) ;
232
228
}
233
229
234
230
const filesystem = new CfnFileSystem ( this , 'Resource' , {
235
231
encrypted : props . encrypted ,
236
232
kmsKeyId : ( props . kmsKey ? props . kmsKey . keyId : undefined ) ,
237
233
lifecyclePolicies : ( props . lifecyclePolicy ? Array . of ( {
238
- transitionToIa : LifecyclePolicyProperty [ props . lifecyclePolicy ] ,
234
+ transitionToIa : LifecyclePolicy [ props . lifecyclePolicy ] ,
239
235
} as CfnFileSystem . LifecyclePolicyProperty ) : undefined ) ,
240
236
performanceMode : props . performanceMode ,
241
237
throughputMode : props . throughputMode ,
242
- provisionedThroughputInMibps : props . provisionedThroughputPerSecond ? props . provisionedThroughputPerSecond . toMebibytes ( ) : undefined ,
238
+ provisionedThroughputInMibps : props . provisionedThroughputPerSecond ?. toMebibytes ( ) ,
243
239
} ) ;
244
240
245
241
this . fileSystemId = filesystem . ref ;
0 commit comments