Skip to content

Instantly share code, notes, and snippets.

@elliottmurray
Created February 9, 2020 11:23
Show Gist options
  • Save elliottmurray/fd19cbcae6fe5100de427799614c19fe to your computer and use it in GitHub Desktop.
Save elliottmurray/fd19cbcae6fe5100de427799614c19fe to your computer and use it in GitHub Desktop.
HelloWorldFunctionRole:
Type: 'AWS::IAM::Role'
Properties:
RoleName: "managed-cr-role"
Path: '/'
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- sts:AssumeRole
Principal:
Service:
- 'lambda.amazonaws.com'
Policies:
- PolicyName: "LogPolicy"
PolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Action:
- 'events:*'
- 'logs:CreateLogGroup'
- 'logs:CreateLogStream'
- 'logs:PutLogEvents'
Resource:
- !Sub "arn:aws:events:${AWS::Region}:${AWS::AccountId}:rule/MyCustomResource*"
- !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*"
- !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*:*"
- PolicyName: "AddPermission"
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- lambda:AddPermission
Resource: "*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment