Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ storage:
path: '/etc/mount1'
efs:
id:
from_cfn: stack-fs-12345
from_cfn: stack-fs-12345
externalEFSVolume2:
path: '/etc/mount2'
efs:
id:
from_cfn: stack-fs-12345

# Optional fields for more advanced use-cases.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ Metadata:
path: '/etc/mount1'
efs:
id:
from_cfn: stack-fs-12345
from_cfn: stack-fs-12345
externalEFSVolume2:
path: '/etc/mount2'
efs:
id:
from_cfn: stack-fs-12345

# Optional fields for more advanced use-cases.
#
Expand Down Expand Up @@ -190,7 +195,7 @@ Resources:
yourtopicyourtopicfifoURL: !Ref yourtopicyourtopicfifoEventsQueue
nonfifotopicnonfifotopicURL: !Ref nonfifotopicnonfifotopicEventsQueue
- Name: COPILOT_MOUNT_POINTS
Value: '{"externalEFSVolume":"/etc/mount1"}'
Value: '{"externalEFSVolume":"/etc/mount1","externalEFSVolume2":"/etc/mount2"}'
EnvironmentFiles:
- !If
- HasEnvFile
Expand All @@ -207,6 +212,9 @@ Resources:
- ContainerPath: '/etc/mount1'
ReadOnly: true
SourceVolume: externalEFSVolume
- ContainerPath: '/etc/mount2'
ReadOnly: true
SourceVolume: externalEFSVolume2
Volumes:
- Name: externalEFSVolume
EFSVolumeConfiguration:
Expand All @@ -215,6 +223,13 @@ Resources:
TransitEncryption: ENABLED
AuthorizationConfig:
IAM: DISABLED
- Name: externalEFSVolume2
EFSVolumeConfiguration:
FilesystemId: !ImportValue 'stack-fs-12345'
RootDirectory: '/'
TransitEncryption: ENABLED
AuthorizationConfig:
IAM: DISABLED
ExecutionRole:
Metadata:
'aws:copilot:description': 'An IAM Role for the Fargate agent to make AWS API calls on your behalf'
Expand Down Expand Up @@ -319,7 +334,16 @@ Resources:
- Effect: 'Allow'
Action: ["logs:CreateLogStream", "logs:DescribeLogGroups", "logs:DescribeLogStreams", "logs:PutLogEvents"]
Resource: "*"
- PolicyName: !Join ['', ['GrantEFSAccess', !ImportValue 'stack-fs-12345']]
- PolicyName: !Join ['', ['GrantEFSAccess', !ImportValue 'stack-fs-12345', '-0']]
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: 'Allow'
Action:
- 'elasticfilesystem:ClientMount'
Resource:
- !Join ['/', [!Sub 'arn:${AWS::Partition}:elasticfilesystem:${AWS::Region}:${AWS::AccountId}:file-system', !ImportValue 'stack-fs-12345']]
- PolicyName: !Join ['', ['GrantEFSAccess', !ImportValue 'stack-fs-12345', '-1']]
PolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ TaskRole:
Resource: "*"
{{- end }}
{{- if .Storage}}
{{- range $EFS := .Storage.EFSPerms}}
{{- range $i, $EFS := .Storage.EFSPerms}}
{{- if not $EFS.FilesystemID.RequiresImport}}
- PolicyName: 'GrantEFSAccess{{$EFS.FilesystemID.Value}}'
- PolicyName: 'GrantEFSAccess{{$EFS.FilesystemID.Value}}-{{$i}}'
{{- else}}
- PolicyName: !Join ['',[ 'GrantEFSAccess', !ImportValue {{$EFS.FilesystemID.Value}}]]
- PolicyName: !Join ['',[ 'GrantEFSAccess', !ImportValue {{$EFS.FilesystemID.Value}}, '-{{$i}}']]
{{- end}}
PolicyDocument:
Version: '2012-10-17'
Expand Down