Created
October 6, 2017 07:47
-
-
Save cangoektas/71e4b3f3f3e16677efb2df6e803d0c79 to your computer and use it in GitHub Desktop.
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
AWSTemplateFormatVersion: '2010-09-09' | |
Resources: | |
LambdaBasicExecutionRole: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: '2012-10-17' | |
Statement: | |
- Effect: Allow | |
Principal: | |
Service: lambda.amazonaws.com | |
Action: sts:AssumeRole | |
ManagedPolicyArns: | |
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole | |
Hello: | |
Type: AWS::Lambda::Function | |
Properties: | |
Code: | |
S3Bucket: unique-bucket-name-1234 | |
S3Key: name-of-your-deployment-package.zip | |
Handler: handler.hello | |
Role: | |
Fn::GetAtt: | |
- LambdaBasicExecutionRole | |
- Arn | |
Runtime: nodejs6.10 | |
EventRule: | |
Type: AWS::Events::Rule | |
Properties: | |
ScheduleExpression: cron(*/5 * * * ? *) | |
State: ENABLED | |
Targets: | |
- Arn: | |
Fn::GetAtt: | |
- Hello | |
- Arn | |
Id: HelloTarget | |
PermissionForEventsToInvokeLambda: | |
Type: AWS::Lambda::Permission | |
Properties: | |
FunctionName: | |
Ref: Hello | |
Action: lambda:InvokeFunction | |
Principal: events.amazonaws.com | |
SourceArn: | |
Fn::GetAtt: | |
- EventRule | |
- Arn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment