On July the 12th, 2018, Amazon announced the availability of Provisioned throughput for EFS volumes. This is a very valuable feature for anybody using EFS. Unfortunately, it can only be enabled through the
Console or the API. Although the Console is nice for playing around, it is not suitable for engineering solutions on AWS. With this custom provider you can specify provisioned throughput for EFS in CloudFormation, 4 days after the release!
On August the 8th, we discovered that the properties ThroughputMode
and ProvisionedThroughputInMibs
can now be set in AWS::EFS::FileSystem, making this provider obsolete!
How do you add provisioned throughput?
It was quite easy: you specified a CloudFormation resource of the type Custom::EfsProvisionedThroughput, as follows:
## Obsolete now. just specify ThroughputMode and ProvisionedThroughputInMibs on AWS::EFS::FileSystem
EfsProvisionedThroughput:
Type: Custom::EfsProvisionedThroughput
Properties:
FileSystemId: !Ref EFS
ThroughputMode: provisioned
ProvisionedThroughputInMibs: 1024.0
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-efs-provisioned-throughput-provider'
After the deployment, the EFS has the provisioned throughput. When the resource is deleted, the throughput mode is restored to ‘bursting’
Installation
To install this custom resource, type:
aws cloudformation create-stack \
--capabilities CAPABILITY_IAM \
--stack-name cfn-efs-provisioned-throughput-provider \
--template-body file://cloudformation/cfn-resource-provider.yaml
aws cloudformation wait stack-create-complete --stack-name cfn-efs-provisioned-throughput-provider
This CloudFormation template will use our pre-packaged provider from s3://binxio-public-${AWS::Region}/lambdas/cfn-efs-provisioned-throughput-provider-1.0.1.zip
.
Conclusion
With this custom provider you can specify provisioned throughput for EFS in CloudFormation. Although creating this temporary custom provider
cost less than 2 hours, it is not the ideal solution. It has to be created, installed and decommissioned when Amazon finally adds the properties
ThroughputMode
and ProvisionedThroughputInMibs
to the AWS::EFS::FileSystem.
If it helps, I would like to offer AWS our services to ensure that CloudFormation is always on-par with the API before the feature is released.