Last active
June 15, 2020 18:06
-
-
Save ricardoribas/1ba8fca01abd4bc5ae6d4be61bc7d668 to your computer and use it in GitHub Desktop.
ECS task definition to mount an EFS driver
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
taskDefinition: | |
DependsOn: | |
- ...otherDependencies | |
- efsVolume | |
Properties: | |
ContainerDefinitions: | |
- Image: jenkins/jenkins:lts | |
Memory: "2048" | |
Name: jenkins | |
MountPoints: | |
- SourceVolume: jenkinsVolume | |
ContainerPath: /var/jenkins_home | |
PortMappings: | |
- ContainerPort: 8080 | |
HostPort: 0 | |
Protocol: tcp | |
Volumes: | |
- Name: jenkinsVolume | |
DockerVolumeConfiguration: | |
Autoprovision: true | |
Scope: shared | |
Driver: local | |
DriverOpts: | |
type: nfs | |
device: !Sub "${efsVolume}.efs.${AWS::Region}.amazonaws.com:/" | |
o: !Sub "addr=${efsVolume}.efs.${AWS::Region}.amazonaws.com,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2" | |
TaskRoleArn: | |
Ref: taskDefinitionRole | |
Type: AWS::ECS::TaskDefinition | |
efsVolume: | |
DependsOn: | |
- vpc | |
Properties: | |
FileSystemTags: | |
- Key: "Name" | |
Value: "jenkins-file-system" | |
Type: AWS::EFS::FileSystem | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment