This is the CDK code to deploy the backend infrastructure used for the front-end of the Local-Crontab python module.
API endpoint and api-key are into the config.json file in the local-crontab-web-converter. They are in clear-text . API calls are limited to 100/day 1/sec, so please do not abuse it.
https://docs.aws.amazon.com/cdk/latest/guide/sam.html
- Run your AWS CDK app and create an AWS CloudFormation template.
cdk synth --no-staging > template.yaml
- Find the logical ID for your Lambda function in template.yaml. It will look like MyFunction12345678, where 12345678 represents an 8-character unique ID that the AWS CDK generates for all resources.
sam local generate-event apigateway aws-proxy --body '{"cron":"0 10 * * *", "timezone":"America/Denver"}' --stage v1 --method POST --path utc-converter --resource None > apigateway-event-example.json
- Run the function by executing.
sam local invoke awslambda<ID> --profile <profile> --region <region> --event apigateway-event-example.json --debug
- Complete CORS --> example1
cdk ls
list all stacks in the appcdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk docs
open CDK documentation
Enjoy!
This repo is part of my projects group, called Cron-Converter. Its related repositories: