Skip to content

Instantly share code, notes, and snippets.

@startuml
skin rose
autonumber
title Customer Order Workflow on Website
actor Customer
participant Website
participant OrderService
participant CustomerService
{
"Records": [
{
"eventVersion": "2.0",
"eventSource": "aws:s3",
"awsRegion": "us-east-1",
"eventTime": "1970-01-01T00:00:00.000Z",
"eventName": "ObjectCreated:Put",
"userIdentity": {
"principalId": "EXAMPLE"
import boto3
import json
bedrock = boto3.client(
service_name='bedrock-runtime',
region_name='us-east-1'
)
input = {
{
"Comment": "A description of my state machine",
"StartAt": "Choice",
"States": {
"Choice": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.type",
"StringEquals": "PURCHASE",
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;
Config
---
{
"customerIds": ["1", "2", "3"]
}
Validator
---
{
"$schema": "http://json-schema.org/draft-04/schema#",
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
import json
import boto3
kinesis = boto3.client('kinesis')
def lambda_handler(event, context):
# PutRecord API Example
# ---------------------
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": [
{
IAM Policies
---
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "secretsmanager:GetSecretValue",
"Resource": "*"