Skip to content

Commit

Permalink
Fixing policies and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matteofigus committed May 29, 2020
1 parent cd22dc4 commit 2b46a06
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/cfn/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Globals:
MIN_CONFIDENCE: !Ref MinConfidence
OBJECTS_OF_INTEREST_LABELS: !Join [",", !Ref ObjectsOfInterestLabels]
REGION: !Ref AWS::Region
VERSION: '0.2'
VERSION: '0.3'
Api:
EndpointConfiguration: REGIONAL
Cors:
Expand Down Expand Up @@ -114,7 +114,7 @@ Resources:
- AllowedHeaders: ['*']
AllowedMethods: [GET]
AllowedOrigins: ['*']
Id: !Sub RekogCorsRule
Id: RekogCorsRule
MaxAge: 3600

WebUIBucketReadPolicy:
Expand Down Expand Up @@ -245,7 +245,7 @@ Resources:
Properties:
Handler: index.handler
CodeUri: ../backend/functions/setup/
Description: !Sub Custom Lambda resource for the Virtual Proctor Cloudformation Stack
Description: Custom Lambda resource for the Virtual Proctor Cloudformation Stack
Environment:
Variables:
COLLECTION_ID: !Ref ResourcePrefix
Expand All @@ -258,12 +258,24 @@ Resources:
REGION: !Ref AWS::Region
TO_BUCKET: !Ref WebUIBucket
Policies:
- RekognitionWriteOnlyAccessPolicy:
CollectionId: !Ref ResourcePrefix
- S3WritePolicy:
BucketName: !Ref WebUIBucket
- S3ReadPolicy:
BucketName: !Sub solution-builders-${AWS::Region}
- Statement:
- Effect: Allow
Action:
- s3:PutObject*
- s3:DeleteObject*
- s3:ListBucket*
- s3:ListObject*
Resource:
- !Sub arn:aws:s3:::${WebUIBucket}
- !Sub arn:aws:s3:::${WebUIBucket}/*
- Effect: Allow
Action: s3:GetObject
Resource: !Sub arn:aws:s3:::solution-builders-${AWS::Region}/*
- Effect: Allow
Action:
- rekognition:CreateCollection
- rekognition:DeleteCollection
Resource: !Sub arn:aws:rekognition:${AWS::Region}:${AWS::AccountId}:collection/${ResourcePrefix}

FacesTable:
Type: AWS::DynamoDB::Table
Expand Down

0 comments on commit 2b46a06

Please sign in to comment.