Created
July 13, 2017 21:29
-
-
Save doron2402/9b40bf08dc13c9d56b905c9a8202bb4c to your computer and use it in GitHub Desktop.
AWS Cloud Formation sam.yaml
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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Parameters: | |
NotificationEmail: | |
Type: String | |
Resources: | |
CloudTrailEventProcessing: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: handler | |
Runtime: runtime | |
Timeout: 10 | |
MemorySize: 1024 | |
Policies: | |
Statement: | |
- Effect: Allow | |
Action: s3:GetObject | |
Resource: !Sub 'arn:aws:s3:::${Bucket}/*' | |
- Effect: Allow | |
Action: sns:Publish | |
Resource: !Ref Topic | |
Events: | |
PhotoUpload: | |
Type: S3 | |
Properties: | |
Bucket: !Ref Bucket | |
Events: s3:ObjectCreated:* | |
Environment: | |
Variables: | |
SNS_TOPIC_ARN: !Ref Topic | |
Bucket: | |
Type: AWS::S3::Bucket | |
Trail: | |
Type: AWS::CloudTrail::Trail | |
Properties: | |
IsLogging: true | |
S3BucketName: !Ref Bucket | |
Topic: | |
Type: AWS::SNS::Topic | |
Properties: | |
Subscription: | |
- Protocol: email | |
Endpoint: !Ref NotificationEmail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment