{"id":21459304,"url":"https://github.com/shazi7804/aws-cdk-intro-workshop","last_synced_at":"2026-06-23T13:32:27.784Z","repository":{"id":42734268,"uuid":"283175476","full_name":"shazi7804/aws-cdk-intro-workshop","owner":"shazi7804","description":"For example, fork CDK Workshop demo step-by-step.","archived":false,"fork":false,"pushed_at":"2023-01-06T12:40:36.000Z","size":1149,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-29T03:10:29.703Z","etag":null,"topics":["aws","cdk","intro","workshop"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shazi7804.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-28T10:11:43.000Z","updated_at":"2020-07-29T01:28:25.000Z","dependencies_parsed_at":"2023-02-06T02:46:49.013Z","dependency_job_id":null,"html_url":"https://github.com/shazi7804/aws-cdk-intro-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shazi7804/aws-cdk-intro-workshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shazi7804%2Faws-cdk-intro-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shazi7804%2Faws-cdk-intro-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shazi7804%2Faws-cdk-intro-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shazi7804%2Faws-cdk-intro-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shazi7804","download_url":"https://codeload.github.com/shazi7804/aws-cdk-intro-workshop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shazi7804%2Faws-cdk-intro-workshop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34691786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","intro","workshop"],"created_at":"2024-11-23T06:28:23.935Z","updated_at":"2026-06-23T13:32:27.766Z","avatar_url":"https://github.com/shazi7804.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CDK Intro WorkShop of Typescript\n\nFor example, fork [CDK Workshop](https://cdkworkshop.com/) demo step-by-step.\n\n## Environment\n\n- [AWS Cloud9](https://aws.amazon.com/cloud9/)\n\n## CDK commands\n\n- [cdk init](#cdk-project-initial)\n- [cdk synth](#cdk-synth)\n- [cdk doctor](#cdk-doctor)\n- [cdk diff](#cdk-diff)\n- [cdk bootstrap](#cdk-bootstrap)\n- [cdk deploy](#cdk-deploy)\n- [cdk destroy](#cleanup)\n\n## WorkShop\n\n**If you not use `Cloud9` environment, please this step first [How to install CDK](#how-to-install-aws-cdk)**\n\n### CDK Project initial \n\n1. Checking your environment and up to date version.\n\n```\n$ cdk --version\n```\n\n2. Create an empty directory on your system\n\n```\n$ mkdir cdk-intro-workshop \u0026\u0026 cd cdk-intro-workshop\n```\n\n3. We will `use cdk init` to create a new TypeScript CDK project:\n\n```\n$ cdk init sample-app --language typescript\n```\n\n### Project Structure\n\n```bash\n.\n├── bin\n│   └── cdk-workshop.ts\n├── cdk.json\n├── jest.config.js\n├── lib\n│   └── cdk-workshop-stack.ts\n├── package.json\n├── package-lock.json\n├── README.md\n├── test\n│   └── cdk-workshop.test.ts\n└── tsconfig.json\n```\n\n- `lib/cdk-workshop-stack.ts` is where your CDK application’s main stack is defined. This is the file we’ll be spending most of our time in.\n- `bin/cdk-workshop.ts` is the entrypoint of the CDK application. It will load the stack defined in `lib/cdk-workshop-stack.ts`\n- `package.json` is your npm module manifest. It includes information like the name of your app, version, dependencies and build scripts like “watch” and “build” (`package-lock.json` is maintained by npm)\n- `cdk.json` tells the toolkit how to run your app. In our case it will be `\"npx ts-node bin/cdk-workshop.ts\"`\n- `tsconfig.json` your project’s typescript configuration\n- `.gitignore` and `.npmignore` tell git and npm which files to include/exclude from source control and when publishing this module to the package manager.\n- `node_modules` is maintained by npm and includes all your project’s dependencies.\n\n### cdk synth\n\nAWS CDK apps are effectively only a definition of your infrastructure using code. When CDK apps are executed, they produce (or “synthesize”, in CDK parlance) an AWS CloudFormation template for each stack defined in your application.\n\n```\n$ cdk synth\n```\n\nWill output the following CloudFormation template:\n\n```\nResources:\n  CdkWorkshopQueue50D9D426:\n    Type: AWS::SQS::Queue\n    Properties:\n      VisibilityTimeout: 300\n    Metadata:\n      aws:cdk:path: CdkWorkshopStack/CdkWorkshopQueue/Resource\n  CdkWorkshopQueuePolicyAF2494A5:\n    Type: AWS::SQS::QueuePolicy\n    Properties:\n      PolicyDocument:\n        Statement:\n          - Action: sqs:SendMessage\n            Condition:\n              ArnEquals:\n                aws:SourceArn:\n                  Ref: CdkWorkshopTopicD368A42F\n```\n\nAs you can see, this template includes four resources:\n\n- **AWS::SQS::Queue** - our queue\n- **AWS::SNS::Topic** - our topic\n- **AWS::SNS::Subscription** - the subscription between the queue and the topic\n- **AWS::SQS::QueuePolicy** - the IAM policy which allows this topic to send messages to the queue\n\n### cdk doctor\n\nInspect the current command-line environment and configurations, and collect information that can be useful for troubleshooting problems. It is usually a good idea to include the information provided by this command when submitting a bug report.\n\n```\n$ cdk doctor\n```\n\nWill output the environment informations.\n\n```\nℹ️ CDK Version: 1.51.0 (build 8c2d53c)\nℹ️ AWS environment variables:\n  - AWS_CLOUDWATCH_HOME = /opt/aws/apitools/mon\n  - AWS_PATH = /opt/aws\n  - AWS_AUTO_SCALING_HOME = /opt/aws/apitools/as\n  - AWS_ELB_HOME = /opt/aws/apitools/elb\nℹ️ No CDK environment variables\n```\n\n### cdk diff\n\nBefore deploy, confirm the difference before and after changes.\n\n```\n$ cdk diff\n```\n\nWill output the following resources changes:\n\n```diff\nStack CdkWorkshopStack\nIAM Statement Changes\n┌───┬─────────────────┬────────┬─────────────────┬─────────────────┬────────────────────┐\n│   │ Resource        │ Effect │ Action          │ Principal       │ Condition          │\n├───┼─────────────────┼────────┼─────────────────┼─────────────────┼────────────────────┤\n│ + │ ${CdkWorkshopQu │ Allow  │ sqs:SendMessage │ Service:sns.ama │ \"ArnEquals\": {     │\n│   │ eue.Arn}        │        │                 │ zonaws.com      │   \"aws:SourceArn\": │\n│   │                 │        │                 │                 │  \"${CdkWorkshopTop │\n│   │                 │        │                 │                 │ ic}\"               │\n│   │                 │        │                 │                 │ }                  │\n└───┴─────────────────┴────────┴─────────────────┴─────────────────┴────────────────────┘\n(NOTE: There may be security-related changes not in this list. See https://github.com/aws/aws-cdk/issues/1299)\n\nConditions\n... skip\n\nResources\n[+] AWS::SQS::Queue CdkWorkshopQueue CdkWorkshopQueue50D9D426 \n[+] AWS::SQS::QueuePolicy CdkWorkshopQueue/Policy CdkWorkshopQueuePolicyAF2494A5 \n[+] AWS::SNS::Subscription CdkWorkshopQueue/CdkWorkshopStackCdkWorkshopTopicD7BE9643 CdkWorkshopQueueCdkWorkshopStackCdkWorkshopTopicD7BE96438B5AD106 \n[+] AWS::SNS::Topic CdkWorkshopTopic CdkWorkshopTopicD368A42F\n```\n\n### cdk bootstrap\n\nBootstrapping an environment\n\nThe first time you deploy an AWS CDK app into an environment (account/region), you’ll need to install a “bootstrap stack”. This stack includes resources that are needed for the toolkit’s operation. For example, the stack includes an S3 bucket that is used to store templates and assets during the deployment process.\n\n```\n$ cdk bootstrap\n```\n\nThen:\n\n```\n   Bootstrapping environment aws://\u003cyour_account_id\u003e/us-east-1...\nCDKToolkit: creating CloudFormation changeset...\n   Environment aws://\u003cyour_account_id\u003e/us-east-1 bootstrapped.\n```\n\n### cdk deploy\n\nLet’s deploy\n\n```\n$ cdk deploy\n```\n\nYou should see a warning like the following:\n\n```\nIAM Statement Changes\n┌───┬────────────────────┬────────┬────────────────────┬────────────────────┬───────────────────────┐\n│   │ Resource           │ Effect │ Action             │ Principal          │ Condition             │\n├───┼────────────────────┼────────┼────────────────────┼────────────────────┼───────────────────────┤\n│ + │ ${CdkWorkshopQueue │ Allow  │ sqs:SendMessage    │ Service:sns.amazon │ \"ArnEquals\": {        │\n│   │ .Arn}              │        │                    │ aws.com            │   \"aws:SourceArn\": \"$ │\n│   │                    │        │                    │                    │ {CdkWorkshopTopic}\"   │\n│   │                    │        │                    │                    │ }                     │\n└───┴────────────────────┴────────┴────────────────────┴────────────────────┴───────────────────────┘\n(NOTE: There may be security-related changes not in this list. See https://github.com/aws/aws-cdk/issues/1299)\n\nDo you wish to deploy these changes (y/n)? y\n```\n\nThis is warning you that deploying the app entails some risk. Since we need to allow the topic to send messages to the queue, enter **y** to deploy the stack and create the resources.\n\nOutput should look like the following, where ACCOUNT-ID is your account ID, REGION is the region in which you created the app, and STACK-ID is the unique identifier for your stack:\n\n```\nCdkWorkshopStack: deploying...\nCdkWorkshopStack: creating CloudFormation changeset...\n\n   CdkWorkshopStack\n\nStack ARN:\narn:aws ...\n```\n\n## Confirm your stack\n\n- CloudFormation\n\n![](img/confirm_cloudformation.png)\n\n- SQS\n\n![](img/confirm_sqs.png)\n\n## Cleanup\n\nTo avoid unexpected charges to your account, make sure you clean up your CDK stack.\n\nYou can either delete the stack through the AWS CloudFormation console or use `cdk destroy`:\n\n```\n$ cdk destory \n```\n\n## How to install AWS CDK\n\n[AWS Cloud Development Kit (AWS CDK)](https://github.com/aws/aws-cdk)\n\nInstall or update the [AWS CDK CLI] from npm (requires [Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/)). We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/)\n⚠️ versions `13.0.0` to `13.6.0` are not supported due to compatibility issues with our dependencies.\n\n```bash\n$ npm i -g aws-cdk\n```\n\n## References\n\n- [CDK Workshop](https://cdkworkshop.com/)\n- [Examples](https://github.com/aws-samples/aws-cdk-examples)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshazi7804%2Faws-cdk-intro-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshazi7804%2Faws-cdk-intro-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshazi7804%2Faws-cdk-intro-workshop/lists"}