-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What is the feature/fix? A new way to have a persistent volume can be accessed between services (across instances and AZs). The EFS resource will allocate a new EFS volume that can be linked to services and used in the volumes. ### Add screenshot or video (optional) ``` resources: sharedvolume: type: efs options: path: "/bitnami" environment: - PORT=3000 - ENVIRONMENT=master services: web: build: . port: 3000 volumes: - /my/shared/data - /var/www/html - /sys/fs/cgroup/:/host/sys/fs/cgroup/ - /proc/:/host/proc/ - /var/run/docker.sock:/var/run/docker.sock - testvolume:/app - sharedvolume:/bitnami resources: - sharedvolume ``` ### Does it has a breaking change? No. ### How to use/test it? Install a rack with the RC version (to be created, declare the EFS resource, link the resource in the service and use it in the volumes. You can see a snippet above. ### Checklist - [ ] New coverage tests - [ ] Unit tests passing - [ ] E2E tests passing - [ ] E2E downgrade/update test passing - [ ] Documentation updated - [ ] No warnings or errors on Deepsource/Codecov
- Loading branch information
Showing
8 changed files
with
477 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Conditions": { | ||
"Encrypted": { | ||
"Fn::Equals": [ | ||
{ | ||
"Ref": "Encrypted" | ||
}, | ||
"true" | ||
] | ||
} | ||
}, | ||
"Parameters": { | ||
"AutoMinorVersionUpgrade": { | ||
"Type": "String", | ||
"Default": "" | ||
}, | ||
"Encrypted": { | ||
"Type": "String", | ||
"Default": "false", | ||
"AllowedValues": [ | ||
"true", | ||
"false" | ||
] | ||
}, | ||
"OwnerGid": { | ||
"Type": "String", | ||
"Default": "1000" | ||
}, | ||
"OwnerUid": { | ||
"Type": "String", | ||
"Default": "1000" | ||
}, | ||
"Password": { | ||
"Type": "String", | ||
"Default": "" | ||
}, | ||
"Path": { | ||
"Type": "String", | ||
"Default": "/" | ||
}, | ||
"Permissions": { | ||
"Type": "String", | ||
"Default": "0777" | ||
}, | ||
"Rack": { | ||
"Type": "String" | ||
} | ||
}, | ||
"Outputs": { | ||
"AccessPointId": { | ||
"Value": { | ||
"Fn::GetAtt": [ | ||
"AccessPoint", | ||
"AccessPointId" | ||
] | ||
} | ||
}, | ||
"FileSystemId": { | ||
"Value": { | ||
"Fn::GetAtt": [ | ||
"FileSystem", | ||
"FileSystemId" | ||
] | ||
} | ||
} | ||
}, | ||
"Resources": { | ||
"AccessPoint": { | ||
"Type": "AWS::EFS::AccessPoint", | ||
"Properties": { | ||
"FileSystemId": { | ||
"Ref": "FileSystem" | ||
}, | ||
"RootDirectory": { | ||
"CreationInfo": { | ||
"OwnerGid": { "Ref": "OwnerGid" }, | ||
"OwnerUid": { "Ref": "OwnerUid" }, | ||
"Permissions": { "Ref": "Permissions" } | ||
}, | ||
"Path": { | ||
"Ref": "Path" | ||
} | ||
} | ||
} | ||
}, | ||
"EncryptionKey": { | ||
"Type": "AWS::KMS::Key", | ||
"Condition": "Encrypted", | ||
"Properties": { | ||
"Description": { | ||
"Ref": "AWS::StackName" | ||
}, | ||
"KeyPolicy": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "Allow administration of the key", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": { | ||
"Fn::Sub": "arn:${AWS::Partition}:iam::${AWS::AccountId}:root" | ||
} | ||
}, | ||
"Action": [ | ||
"kms:*" | ||
], | ||
"Resource": "*" | ||
} | ||
] | ||
}, | ||
"PendingWindowInDays": "7" | ||
} | ||
}, | ||
"FileSystem": { | ||
"Type": "AWS::EFS::FileSystem", | ||
"Properties": { | ||
"Encrypted": { | ||
"Ref": "Encrypted" | ||
}, | ||
"FileSystemTags": [ | ||
{ | ||
"Key": "Rack", | ||
"Value": { | ||
"Ref": "Rack" | ||
} | ||
} | ||
], | ||
"KmsKeyId": { | ||
"Fn::If": [ | ||
"Encrypted", | ||
{ | ||
"Ref": "EncryptionKey" | ||
}, | ||
{ | ||
"Ref": "AWS::NoValue" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MountTargetSecurityGroup": { | ||
"Type": "AWS::EC2::SecurityGroup", | ||
"Properties": { | ||
"GroupDescription": { | ||
"Fn::Sub": "${Rack} ${AWS::StackName} EFS SG" | ||
}, | ||
"VpcId": { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": "${Rack}:Vpc" | ||
} | ||
}, | ||
"SecurityGroupIngress": [ | ||
{ | ||
"IpProtocol": "tcp", | ||
"FromPort": 2049, | ||
"ToPort": 2049, | ||
"CidrIp": { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": "${Rack}:VpcCidr" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"MountTarget0": { | ||
"Type": "AWS::EFS::MountTarget", | ||
"Properties": { | ||
"FileSystemId": { | ||
"Ref": "FileSystem" | ||
}, | ||
"SubnetId": { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": "${Rack}:Subnet0" | ||
} | ||
}, | ||
"SecurityGroups": [ | ||
{ | ||
"Ref": "MountTargetSecurityGroup" | ||
} | ||
] | ||
} | ||
}, | ||
"MountTarget1": { | ||
"Type": "AWS::EFS::MountTarget", | ||
"Properties": { | ||
"FileSystemId": { | ||
"Ref": "FileSystem" | ||
}, | ||
"SubnetId": { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": "${Rack}:Subnet1" | ||
} | ||
}, | ||
"SecurityGroups": [ | ||
{ | ||
"Ref": "MountTargetSecurityGroup" | ||
} | ||
] | ||
} | ||
}, | ||
{{ if .ThirdAvailabilityZone }} | ||
"MountTarget2": { | ||
"Type": "AWS::EFS::MountTarget", | ||
"Properties": { | ||
"FileSystemId": { | ||
"Ref": "FileSystem" | ||
}, | ||
"SubnetId": { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": "${Rack}:Subnet2" | ||
} | ||
}, | ||
"SecurityGroups": [ | ||
{ | ||
"Ref": "MountTargetSecurityGroup" | ||
} | ||
] | ||
} | ||
} | ||
{{ end }} | ||
} | ||
} |
Oops, something went wrong.