File upload functionality for own interiors (#39)

This commit is contained in:
Niklas Fondberg
2021-09-13 13:38:53 +02:00
committed by GitHub
parent 0a4be2b081
commit 84bed9a7ce
15 changed files with 2275 additions and 4 deletions
+34
View File
@@ -87,6 +87,12 @@ Parameters:
GitHubUser:
Type: String
# Buckets
ImagesBucket:
Type: String
UploadBucket:
Type: String
Resources:
Cluster:
Type: AWS::ECS::Cluster
@@ -149,6 +155,32 @@ Resources:
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy'
- arn:aws:iam::aws:policy/AmazonSSMReadOnlyAccess
TaskRoleAccessPolicy:
Type: 'AWS::IAM::ManagedPolicy'
Properties:
Description: Create access policies for the container task
Path: /
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- s3:*
Resource: !Sub arn:aws:s3:::${ImagesBucket}/*
- Effect: Allow
Action:
- s3:*
Resource: !Sub arn:aws:s3:::${ImagesBucket}
- Effect: Allow
Action:
- s3:*
Resource: !Sub arn:aws:s3:::${UploadBucket}/*
- Effect: Allow
Action:
- s3:*
Resource: !Sub arn:aws:s3:::${UploadBucket}
# A role for the containers
TaskRole:
Type: AWS::IAM::Role
@@ -160,6 +192,8 @@ Resources:
Principal:
Service: ecs-tasks.amazonaws.com
Action: 'sts:AssumeRole'
ManagedPolicyArns:
- !Ref TaskRoleAccessPolicy
# A role needed for auto scaling
AutoScalingRole: