Skip to content
Permalink
Browse files

Updated README and cleaned up Cloudformation Template

  • Loading branch information...
nrdio committed Apr 15, 2018
1 parent be5c7e3 commit c8f5e1b5e6fe6ae48106d563e9e56b72951c8ace
Showing with 21 additions and 25 deletions.
  1. +2 −2 README.md
  2. +19 −23 cloudformation-template.yaml
@@ -11,7 +11,7 @@ This [template](cloudformation-template.yaml) creates a CloudFormation stack com


This template is intended to jump start Lambda development by putting otherwise extensive and fragmented information together.
Additional information is available at [Shift from Containers to Serverless Computing using AWS Lambda](http://woodo.space/shift-from-containers-to-serverless-computing-using-aws-lambda/)
Additional information is available at [Shift from Containers to Serverless Computing using AWS Lambda - Part 2](https://woodo.space/post/shift-from-containers-to-serverless-computing-using-aws-lambda-part-2/)

## How to run?

@@ -42,7 +42,7 @@ Please copy SNS topic(AWS::SNS::Topic) ARN (PhysicalResourceId) from list of res
Now you can publish a message to SNS topic using following command. Lambda should persist the event in Dynamoddb table.

```
aws sns publish --topic-arn your-sns-topic-arn --message '{"name": "Foo", "iban": "NL38FRBK0292964727", "phoneNumber": "+31000000000"}'
aws sns publish --topic-arn <your-sns-topic-arn> --message '{"name": "Foo", "iban": "NL38FRBK0292964727"}'
```


@@ -15,37 +15,37 @@ Resources:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: Account
LambdaInvokePermission:
Type: 'AWS::Lambda::Permission'
Function:
Type: 'AWS::Lambda::Function'
Properties:
Action: 'lambda:InvokeFunction'
Principal: sns.amazonaws.com
FunctionName: !GetAtt
- FunctionTopicSubscription
Handler: index.handler
Runtime: nodejs8.10
Code: .
Role: !GetAtt
- LambdaExecutionRole
- Arn
SourceArn: !Ref Topic
Timeout: '30'
DependsOn:
- LambdaExecutionRole
Subscription:
Type: 'AWS::SNS::Subscription'
Properties:
Endpoint: !GetAtt
- FunctionTopicSubscription
- Function
- Arn
Protocol: lambda
TopicArn: !Ref Topic
DependsOn:
- FunctionTopicSubscription
FunctionTopicSubscription:
Type: 'AWS::Lambda::Function'
- Function
LambdaInvokePermission:
Type: 'AWS::Lambda::Permission'
Properties:
Handler: index.handler
Runtime: nodejs8.10
Code: .
Role: !GetAtt
- LambdaExecutionRole
Action: 'lambda:InvokeFunction'
Principal: sns.amazonaws.com
FunctionName: !GetAtt
- Function
- Arn
Timeout: '30'
DependsOn:
- LambdaExecutionRole
SourceArn: !Ref Topic
LambdaExecutionRole:
Type: 'AWS::IAM::Role'
Properties:
@@ -68,11 +68,7 @@ Resources:
Resource: !Ref Topic
Effect: Allow
- Action:
- 'dynamodb:DeleteItem'
- 'dynamodb:GetItem'
- 'dynamodb:PutItem'
- 'dynamodb:Scan'
- 'dynamodb:UpdateItem'
Resource: !GetAtt
- DynamoDBTable
- Arn

0 comments on commit c8f5e1b

Please sign in to comment.
You can’t perform that action at this time.