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
| { | |
| "Effect":"Allow", | |
| "Principal":{ | |
| "AWS":"<SUBSCRIBER_ACCOUNT_ID>" | |
| }, | |
| "Action":"sns:Subscribe", | |
| "Resource":"arn:aws:sns:<REGION>:<PUBLISHER_ACCOUNT_ID>:<TOPIC_NAME>" | |
| } |
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 Policy | |
| --- | |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": [ | |
| "rds-db:connect" | |
| ], |
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
| 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
| AWS Kinesis PutRecord Documentation | |
| ---- | |
| https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html | |
| Trust Policy for API Gateway | |
| ---- | |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { |
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
| import json | |
| import boto3 | |
| kinesis = boto3.client('kinesis') | |
| def lambda_handler(event, context): | |
| # PutRecord API Example | |
| # --------------------- | |
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
| import json | |
| import boto3 | |
| client = boto3.client('rekognition') | |
| # Permissions Required | |
| # s3:GetObject | |
| # rekognition:DetectFaces | |
| # DetectFaces API Documentation - https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectFaces.html |
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
| Config | |
| --- | |
| { | |
| "customerIds": ["1", "2", "3"] | |
| } | |
| Validator | |
| --- | |
| { | |
| "$schema": "http://json-schema.org/draft-04/schema#", |
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
| SELECT | |
| Item.OrderId.S as OrderId, | |
| Item.CustomerId.S as CustomerId, | |
| Item.OrderDate.S as OrderDate, | |
| Item.State.S as State, | |
| Item.TotalAmount.N as TotalAmount, | |
| Item.CancelledReasons.L as CancelledReasons, | |
| Item.CancellationMetadata.M as CancellationMetadata | |
| FROM data; |