Skip to content

Commit

Permalink
Feat/frontend key access (#132)
Browse files Browse the repository at this point in the history
* Initial setup to modify user groups and connect to the cognito trigger

* Removed lambda trigger to stick with base case that's like-for-like with current setup

* removed role lambda as unused in this iteration
  • Loading branch information
cyramic authored Dec 2, 2024
1 parent dda2ebc commit 5788a15
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 487 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
AWSTemplateFormatVersion: 2010-09-09
Description: |
This template adds cognito triggers to handle post-authentication tasks
Parameters:
DataStoreLocationArn:
Description: The S3 Bucket users will have access to for uploading files
Type: String
CognitoUserPool:
Description: ID of the User Pool to add the triggers to
Type: String
Environment:
Type: String
Description: |
Determines the type of environment. "stag" and "prod" are the two valid strings. Stag will auto-deploy
new versions, while prod will only deploy the cached versions and updates will need to be applied through
infrastructure updates.
Default: prod

Resources:
FrontendUser:
Type: AWS::IAM::User
Properties:
UserName: "frontend-hosting-user"

GeneralUserPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: GeneralUserPolicy
Users:
- !Ref FrontendUser
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "s3:DeleteObject"
- "s3:GetObject"
- "s3:ListBucket"
- "s3:PutObject"
- "s3:PutObjectAcl"
Resource:
- !Sub "${DataStoreLocationArn}"
- !Sub "${DataStoreLocationArn}/*"


AccessKey:
Type: AWS::IAM::AccessKey
Properties:
UserName:
Ref: FrontendUser

Outputs:
AccessKeyId:
Description: "AWS Access Key ID"
Value: !Ref AccessKey
SecretAccessKey:
Description: "AWS Secret Access Key"
Value: !GetAtt AccessKey.SecretAccessKey
Loading

0 comments on commit 5788a15

Please sign in to comment.