When using fromrawdata in PynamoDB, you have to pass in the DynamoDB dict structure ({“attributename”: {“S”: “value”}), not a plain dictionary. When 6.0.0 comes out, there will…
Posts for: #Aws
Logging from Custom Docker Code in Sagemaker
Unlike in AWS Lambda code, in Sagemaker training jobs using custom Python code in Docker containers logging won’t work unless a stream handler is specifically added to the logger.
SAGEMAKER_PROGRAM in Custom Dockerfile
At the end of a Dockerfile that defines a container for a Sagemaker training job, you have to define the SAGEMAKERPROGRAM environment variable. It needs to point directly to…
Deploying an Updated Image to Lambda Function
Redeploying a CDK stack with a Lambda function that relies on a Docker image in ECR won’t necessarily update the function with a newly pushed image. Instead, use the Lambda…
Raising Exceptions from Lambda to API Gateway Caller
You can send exception feedback from a Lambda to an API Gateway API either by raising a Python exception and handling it via a mapping template, or return a specific set of…
Including Assets from Parent Directories in Dockerized Lambda Functions with CDK
If you have a Docker based Lambda that is defined in some directory and there are assets that the Lambda needs in the parent directory, fromimageasset() takes directory and…
Asynchronous Lambda Invocation
In order to invoke a Lambda asynchronously, pass InvocationType=“Event” to the invoke call. This is useful for, among other things, a hub/message routing Lambda that calls…
Catching and Responding To Failures in AWS Step Functions
To handle errors within a Step Function, you can use a Catch block that hands off execution to an Error State. This State can be a Task type, which can (among other things)…
CDK Deployment Troubleshooting
There are a number of avenues to explore for troubleshooting a CDK deployment.
API Gateway URL Construction
This is the construction of the base URL of an API Gateway API: https://{restapiid}.execute-api.{region}.amazonaws.com/{stagename}/