{"id":15866941,"url":"https://github.com/pacovk/cdk-terraform-tutorial","last_synced_at":"2025-04-01T21:22:56.289Z","repository":{"id":234597399,"uuid":"730733177","full_name":"PacoVK/cdk-terraform-tutorial","owner":"PacoVK","description":"A CDK portation of the official Terraform Lambda + ApiGateway tutorial ","archived":false,"fork":false,"pushed_at":"2023-12-12T15:00:46.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T13:56:10.591Z","etag":null,"topics":["aws","cdk","lambda","serverless","terraform","tutorial"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PacoVK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-12-12T14:56:43.000Z","updated_at":"2023-12-12T15:47:58.000Z","dependencies_parsed_at":"2024-04-20T00:49:59.400Z","dependency_job_id":"2313b8b4-ffe7-4f93-834c-a3b1dcf7d501","html_url":"https://github.com/PacoVK/cdk-terraform-tutorial","commit_stats":null,"previous_names":["pacovk/cdk-terraform-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacoVK%2Fcdk-terraform-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacoVK%2Fcdk-terraform-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacoVK%2Fcdk-terraform-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PacoVK%2Fcdk-terraform-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PacoVK","download_url":"https://codeload.github.com/PacoVK/cdk-terraform-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246710546,"owners_count":20821425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cdk","lambda","serverless","terraform","tutorial"],"created_at":"2024-10-05T23:40:34.797Z","updated_at":"2025-04-01T21:22:56.264Z","avatar_url":"https://github.com/PacoVK.png","language":"TypeScript","readme":"# Hashicorp Terraform tutorial for AWS Lambda and API Gateway in CDK for TypeScript\n\nThis is project is the CDK for TypeScript implementation for the [official Terraform tutorial](https://developer.hashicorp.com/terraform/tutorials/aws/lambda-api-gateway) to deploy Lambda along with an API Gateway.\n\n## Differences with the Terraform tutorial\n\n- The API Gateway in CDK does **not** enable API Gateway logging. This is enabled in the Terraform tutorial.\n  The reason is that for ApiGatewayV2, the logging is not supported yet. See [here](https://github.com/aws/aws-cdk/issues/11100).\n\n## Prerequisites\n\n- Access to an AWS account\n- NodeJS \u003c= 20.x\n\n## Project overview\n\nThe `cdk.json` file tells the CDK Toolkit how to execute your app.\n\n### Bootstrap\n\n1. Install dependencies\n\n   ```bash\n   yarn install\n   ```\n\n   or using npm\n\n   ```bash\n   npm install\n   ```\n\n2. Bootstrap your AWS account\n\n   Similar to Terraform S3 backend, CDK also requires a S3 bucket to store deployment assets, like Lambda sources.\n   If you did not deploy any CDK app in the target region/ account before, you need to bootstrap your AWS account first.\n\n   ```bash\n   AWS_PROFILE=\u003cyour AWS profile\u003e yarn cdk bootstrap\n   ```\n\n   or using npm\n\n   ```bash\n   AWS_PROFILE=\u003cyour AWS profile\u003e npm run cdk bootstrap\n   ```\n\n## Useful commands if you use yarn\n\n- `yarn build` compile typescript to js\n- `yarn watch` watch for changes and compile\n- `yarn test` perform the jest unit tests\n- `AWS_PROFILE=\u003cyour AWS profile\u003e yarn cdk deploy` deploy this stack to your default AWS account/region\n- `AWS_PROFILE=\u003cyour AWS profile\u003e yarn cdk diff` compare deployed stack with current state\n- `AWS_PROFILE=\u003cyour AWS profile\u003e yarn cdk synth` emits the synthesized CloudFormation template\n\n## Useful commands if you use npm\n\n- `npm run build` compile typescript to js\n- `npm run watch` watch for changes and compile\n- `npm run test` perform the jest unit tests\n- `AWS_PROFILE=\u003cyour AWS profile\u003e npm run cdk deploy` deploy this stack to your default AWS account/region\n- `AWS_PROFILE=\u003cyour AWS profile\u003e npm run cdk diff` compare deployed stack with current state\n- `AWS_PROFILE=\u003cyour AWS profile\u003e npm run cdk synth` emits the synthesized CloudFormation template\n\n## Cleanup\n\nTo destroy the stack, run:\n\n```bash\nAWS_PROFILE=\u003cyour AWS profile\u003e yarn cdk destroy\n```\n\nor using npm\n\n```bash\nAWS_PROFILE=\u003cyour AWS profile\u003e npm run cdk destroy\n```\n\n## Troubleshooting\n\nError similar to:\n\n```\n❌ Deployment failed: Error: CdkTerraformTutorialStack: SSM parameter /cdk-bootstrap/hnb659fds/version not found. Has the environment been bootstrapped? Please run 'cdk bootstrap' (see https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html)\n```\n\nensure to run `cdk bootstrap` as described in the [Bootstrap](#bootstrap) section.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacovk%2Fcdk-terraform-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacovk%2Fcdk-terraform-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacovk%2Fcdk-terraform-tutorial/lists"}