Created
November 27, 2018 23:04
-
-
Save adrianhall/252433d9e4a243e527f6d067575ce0f3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
ElasticSearchStreamingLambdaIAMRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: ${self:custom.api}-ESStreamingLambdaRole | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: Allow | |
Principal: | |
Service: "lambda.amazonaws.com" | |
Action: "sts:AssumeRole" | |
Policies: | |
- PolicyName: ElasticSearchAccess | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Action: | |
- "es:ESHttpPost" | |
Effect: Allow | |
Resource: | |
- "arn:aws:es:#{AWS::Region}:#{AWS::AccountId}:domain/${self:custom.es_domain}/_bulk" | |
- PolicyName: DynamoDBStreamAccess | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Action: | |
- "dynamodb:DescribeStream" | |
- "dynamodb:GetRecords" | |
- "dynamodb:GetShardIterator" | |
- "dynamodb:ListStreams" | |
Effect: Allow | |
Resource: | |
- { Fn::GetAtt: [ DynamoDBTable, StreamArn ]} | |
- 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