{"id":24375213,"url":"https://github.com/enricopesce/awsome-pipeline","last_synced_at":"2025-04-10T19:25:58.242Z","repository":{"id":42805191,"uuid":"243726886","full_name":"enricopesce/AWSome-pipeline","owner":"enricopesce","description":"A stable and fully supported continuous delivery service for AWS ECS Fargate implemented with AWS CDK ","archived":false,"fork":false,"pushed_at":"2023-01-07T04:44:59.000Z","size":4961,"stargazers_count":22,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T17:02:03.807Z","etag":null,"topics":["aws","aws-cdk","cdk","ci","continous-integration","docker","docker-image","ecs-fargate","fargate","iac","infrastructure-as-code","infrastructure-automation","infrastructure-is-code","pipeline"],"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/enricopesce.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":"2020-02-28T09:37:37.000Z","updated_at":"2022-02-22T16:56:16.000Z","dependencies_parsed_at":"2023-02-06T12:15:50.584Z","dependency_job_id":null,"html_url":"https://github.com/enricopesce/AWSome-pipeline","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enricopesce%2FAWSome-pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enricopesce%2FAWSome-pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enricopesce%2FAWSome-pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enricopesce%2FAWSome-pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enricopesce","download_url":"https://codeload.github.com/enricopesce/AWSome-pipeline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281388,"owners_count":21077423,"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","aws-cdk","cdk","ci","continous-integration","docker","docker-image","ecs-fargate","fargate","iac","infrastructure-as-code","infrastructure-automation","infrastructure-is-code","pipeline"],"created_at":"2025-01-19T05:54:17.180Z","updated_at":"2025-04-10T19:25:58.215Z","avatar_url":"https://github.com/enricopesce.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWSome Pipeline\n\n\u003e Example how with [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) you can deploy a continuous delivery\n\u003e pipeline using [AWS CodePipeline](https://aws.amazon.com/codepipeline/), [AWS CodeBuild](https://aws.amazon.com/codebuild/) and\n\u003e [AWS Fargate](https://aws.amazon.com/fargate/).\n\u003e I have included all the best practices with a strong focus on the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle).\n\u003e The infrastructure code is written in [TypeScript](https://www.typescriptlang.org/). The infrastructure is a [sidecar](https://aws.amazon.com/blogs/compute/nginx-reverse-proxy-sidecar-container-on-amazon-ecs/)\n\u003e with [Nginx](http://nginx.org/) as proxy and a [Flask](https://palletsprojects.com/p/flask/) \"hello world\" application on [Gunicorn](https://gunicorn.org/)\n\n## Folder structure\n\n```bash\ncode\ndocker\ninfrastructure\n```\n\n### code directory\n\ndedicated to Flask code\n\n### docker directory\n\ndedicated to Docker definitions: sidecard of Nginx + Gunicorn\n\n### infrastructure directory\n\ndedicated to AWS CDK infrastructure definition\n\n## Installation and requirements\n\n```bash\ncd infrastructure\n```\n\n### Install the CDK framework\n\n```bash\nnpm install -g aws-cdk\n```\n\n### Install the dependencies\n\n```bash\nnpm install\n```\n\n### Authenticate in your AWS account:\n\nFollow this guide: [Configuring the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\n\n### Configure GitHub Token\n\nCreate a [personal access token in GitHub](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)\nand store it in [AWS SecretsManager](https://aws.amazon.com/secrets-manager/).\nNeeded to configure your repo webhooks.\n\n```bash\naws secretsmanager create-secret \\\n    --name my_secret_token \\\n    --secret-string yourtokenhereyourtokenhere \\\n    --region eu-west-1\n```\n\n## Usage\n\nThe first step is to exporting the AWS variables to obtain the rights:\n\n```bash\nexport AWS_PROFILE=\"profilename\"\nexport AWS_DEFAULT_REGION=\"eu-west-1\"\n```\n\n### Configuring the application\n\nedit the app_config.json file for defining the project name and the existing VPC\n\n```json\n{\n    \"PROJECT_NAME\": \"awsome\",\n    \"VPC_NAME\": \"default\"\n}\n```\n\n### Deploy the pipeline an get the codepipeline endpoint\n\nYou can create a continuous integration service bonded to your current git branch.\n\nSuppose that you are in the master branch:\n\n```bash\ngit branch --show-current\nmaster\n```\n\nYou can create the pipeline triggerable from any commit to master branch:\n\n```bash\ncdk deploy \"*\" --context tier=pipeline\n\n ✅  awsome-master-pipeline\n\nOutputs:\nawsome-master-pipeline.LinkCodePipelinePage = https://eu-west-1.console.aws.amazon.com/codesuite/codepipeline/pipelines/awsome-master-pipeline-PipelineC660917D-11U99LG5Y4H4V/view?region=eu-west-1\n```\n\nThe pipeline after the creation and by every commits in the branch will be triggered. It launches the staging env, after a manual approval, the production env.\n\nAlternatively you can deploy staging env directly without passing by codepipeline and get the staging http endpoints:\n\n```bash\ncdk deploy \"*\" --context tier=stg\n\n ✅  awsome-master-stg-app\n\nOutputs:\nawsome-master-stg-app.fargateLoadBalancerDNSB13ECB0B = awsom-farga-1KNVPTS0GNV8J-XXXXXXXXX.eu-west-1.elb.amazonaws.com\nawsome-master-stg-app.LinkEcsClusterPage = https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/clusters/awsome-master-stg-app-cluster611F8AFF-okLxuoDdfc1o/fargateServices\nawsome-master-stg-app.LinkCLoudWatchDashboard = https://eu-west-1.console.aws.amazon.com/cloudwatch//home?region=eu-west-1#dashboards:name=awsome-dashboard-stg-app\nawsome-master-stg-app.fargateServiceURL145CCBE8 = http://awsom-farga-1KNVPTS0GNV8J-XXXXXXXXX.eu-west-1.elb.amazonaws.com\n```\n\nor you can deploy the production env and get the production http endpoints:\n\n```bash\ncdk deploy \"*\" --context tier=prd\n ✅  awsome-master-prd-app\n\nOutputs:\nawsome-master-prd-app.fargateLoadBalancerDNSB13ECB0B = awsom-farga-1KNVPTS0GNV8J-XXXXXXXXX.eu-west-1.elb.amazonaws.com\nawsome-master-prd-app.LinkEcsClusterPage = https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/clusters/awsome-master-prd-app-cluster611F8AFF-okLxuoDdfc1o/fargateServices\nawsome-master-prd-app.LinkCLoudWatchDashboard = https://eu-west-1.console.aws.amazon.com/cloudwatch//home?region=eu-west-1#dashboards:name=awsome-master-prd-app\nawsome-master-prd-app.fargateServiceURL145CCBE8 = http://awsom-farga-1KNVPTS0GNV8J-XXXXXXXXX.eu-west-1.elb.amazonaws.com\n```\n\n## Customize the application code\n\nYou can customize the code inside the docker/code directory\n\n## PLEASE GIVE ME FEEDBACKS\n\n## OPEN A GITHUB ISSUE FOR FIX OR REQUEST\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenricopesce%2Fawsome-pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenricopesce%2Fawsome-pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenricopesce%2Fawsome-pipeline/lists"}