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
| @startuml | |
| skin rose | |
| autonumber | |
| title Customer Order Workflow on Website | |
| actor Customer | |
| participant Website | |
| participant OrderService | |
| participant CustomerService |
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
| { | |
| "Comment": "A description of my state machine", | |
| "StartAt": "Add Order Entry", | |
| "States": { | |
| "Add Order Entry": { | |
| "Type": "Task", | |
| "Resource": "arn:aws:states:::dynamodb:putItem", | |
| "Parameters": { | |
| "TableName": "CustomerOrdersTable", | |
| "Item": { |
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
| Pre-Reqs | |
| --- | |
| 1) CDK | |
| 2) NPM | |
| 3) A Github repository | |
| 1. Run this command | |
| export CDK_NEW_BOOTSTRAP=1 | |
| npx cdk bootstrap aws://<YOUR_ACCONT_ID>/<YOUR_REGION> --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess aws://<YOUR_ACCONT_ID>/<YOUR_REGION> |
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
| { | |
| "Comment": "A description of my state machine", | |
| "StartAt": "Choice", | |
| "States": { | |
| "Choice": { | |
| "Type": "Choice", | |
| "Choices": [ | |
| { | |
| "Variable": "$.type", | |
| "StringEquals": "PURCHASE", |
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
| IAM Policies | |
| --- | |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "VisualEditor0", | |
| "Effect": "Allow", | |
| "Action": "secretsmanager:GetSecretValue", | |
| "Resource": "*" |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "VisualEditor0", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "cloudformation:DescribeStacks", | |
| "cloudformation:CreateChangeSet", | |
| "cloudformation:DescribeChangeSet", |
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
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "PublicReadGetObject", | |
| "Effect": "Allow", | |
| "Principal": "*", | |
| "Action": [ | |
| "s3:GetObject" | |
| ], |
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
| Connect & Disconnect | |
| --- | |
| import json | |
| def lambda_handler(event, context): | |
| print(event) | |
| print("****") | |
| print(context) | |
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
| lambda function | |
| ---- | |
| exports.handler = async (event) => { | |
| console.log(event) | |
| const customerId = event.pathParameters.customerId; | |
| const customer = {'customerId': customerId, 'customerName': "Customer " + customerId }; | |
| const response = { | |
| statusCode: 200, | |
| // Uncomment below to enable CORS requests | |
| headers: { |
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
| DemoHandler | |
| --- | |
| def lambda_handler(event, context): | |
| print(event) | |
| return "hello, world!!" | |
| DemoAuthorizer | |
| --- |
NewerOlder