I use AWS CDK for setting my stack and deploying, it all works fine when testing with the remote API endpoints.
However, to be able to run and test it locally with SAM I generated a template for it using the cdk synth
by running this command
cdk synth --no-staging MyLambdaAPIStack > .local/template.yml --profile [AWS_CONFIG_PROFILE]
Using the generated template I'm able to start the API locally with the SAM command below
$ sam local start-api -t .local/template.yml --profile [AWS_CONFIG_PROFILE]
This starts the app on http://127.0.0.1:3000/
Testing my endpoint locally I get the error below
"message": "Requested resource not found",
"code": "ResourceNotFoundException",
PLEASE NOTE:
I understand I can also start a local DynamoDB with Docker but that requires me to manually recreate the tables and populate them with data
I'm looking for a solution that will enable me to use the remote DynamoDB OR dynamically create my tables using my existing stack template.
Any potential suggestion is appreciated.