{"id":13505658,"url":"https://github.com/rix0rrr/cdk-ecs-demo","last_synced_at":"2025-12-30T06:35:21.828Z","repository":{"id":41793903,"uuid":"186411887","full_name":"rix0rrr/cdk-ecs-demo","owner":"rix0rrr","description":"Sample code for an ECS application definition using CDK","archived":false,"fork":false,"pushed_at":"2022-12-09T02:32:34.000Z","size":257,"stargazers_count":41,"open_issues_count":9,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-01T03:32:40.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rix0rrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-13T12:05:43.000Z","updated_at":"2024-08-20T09:28:27.000Z","dependencies_parsed_at":"2023-01-25T10:32:25.130Z","dependency_job_id":null,"html_url":"https://github.com/rix0rrr/cdk-ecs-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rix0rrr%2Fcdk-ecs-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rix0rrr%2Fcdk-ecs-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rix0rrr%2Fcdk-ecs-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rix0rrr%2Fcdk-ecs-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rix0rrr","download_url":"https://codeload.github.com/rix0rrr/cdk-ecs-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"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":[],"created_at":"2024-08-01T00:01:11.244Z","updated_at":"2025-12-30T06:35:21.804Z","avatar_url":"https://github.com/rix0rrr.png","language":"TypeScript","funding_links":[],"categories":["Training Materials and Sample Code"],"sub_categories":["Multi-accounts setup"],"readme":"# Demo of deploying ECS application using CDK\n\nThis repository shows how an asset-based ECS application written in CDK can be\ndeployed, both directly from your developer desktop for testing as well as\nautomatically using a pipeline in production.\n\nDemo written against CDK **0.31.0**.\n\n## Explanation\n\nThe application contains 4 stacks:\n\n- **ClusterStack**: a stack with a VPC and an ECS cluster, needs to be manually deployed (that is not a best practice, but it is the current state of this example).\n- **HttpServiceStack**: a *development* instance of the stack defining the ECS service. This stack uses an AssetImage, meaning it will build and push the ECS image in the repository when deployed.\n- **ProdHttpServiceStack**: a *production* instance of the stack defining the ECS service. This stack takes the Docker image as a pipeline input, to be supplied at deployment time.\n- **CodePipelineStack**: a stack defining an ECR repository and a CodePipeline which will build both the CDK app and the Docker image, then finally deploy the combination through CloudFormation.\n\n### Pipeline\n\nThe pipeline looks like this:\n\n```\n┌──────────────┐               \n│    SOURCE    │               \n│              │               \n│    GitHub    │               \n└──────────────┘               \n        │                      \n        ├──────────────┐       \n        │              │       \n        ▽              ▽       \n┌──────────────┬──────────────┐\n│    BUILD     │    BUILD     │\n│              │              │\n│ DockerBuild  │   CdkBuild   │\n└──────────────┴──────────────┘\n        │              │       \n        ├──────────────┘       \n        │                      \n        ▽                      \n┌──────────────┐               \n│    DEPLOY    │               \n│              │               \n│  CFN_Deploy  │               \n└──────────────┘               \n```\n\n## To deploy manually (using asset, for development purposes)\n\n```ts\nnpm run build\nnpx cdk deploy HttpServiceStack\n```\n\n## To deploy using CI/CD\n\nFork this repository to your own repository, update the repository name in\n`lib/code-pipeline-stack.ts`, and deploy the pipeline so:\n\n```ts\nnpm run build\nnpx cdk deploy CodePipelineStack\n```\n\nNOTE: It would probably be better to parameterize the pipeline source, but this example\nis simplified somewhat for understandability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frix0rrr%2Fcdk-ecs-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frix0rrr%2Fcdk-ecs-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frix0rrr%2Fcdk-ecs-demo/lists"}