-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
4 changed files
with
60 additions
and
487 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
infrastructure/environments/cloudformation/full/common/general_key_access.yaml
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
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 |
Oops, something went wrong.