Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created December 12, 2018 23:31
Show Gist options
  • Save adrianhall/931fd6bc9beac7f0fe9a3e106312f57a to your computer and use it in GitHub Desktop.
Save adrianhall/931fd6bc9beac7f0fe9a3e106312f57a to your computer and use it in GitHub Desktop.
AWSAppSyncS3LambdaIAMRole:
Type: AWS::IAM::Role
Properties:
RoleName: ${self:custom.api}-AWSAppSyncS3LambdaIAMRole
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: "lambda.amazonaws.com"
Action: "sts:AssumeRole"
Policies:
- PolicyName: S3Access
PolicyDocument:
Version: "2012-10-17"
Statement:
- Action:
- "s3:GetObject"
Effect: Allow
Resource:
- { Fn::GetAtt: [ FileStorage, Arn ]}
- { Fn::Join: [ "/", [{ Fn::GetAtt: [ FileStorage, Arn ]}, "*" ]]}
- PolicyName: CloudWatchLogsAccess
PolicyDocument:
Version: "2012-10-17"
Statement:
- Action:
- "logs:CreateLogGroup"
- "logs:CreateLogStream"
- "logs:PutLogEvents"
Effect: Allow
Resource:
- "arn:aws:logs:#{AWS::Region}:#{AWS::AccountId}:*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment