edo92 / Aws-Ecs-BlueGreen-Deployment

Aws Ecs with blue/green deployment pipeline, using aws cdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aws Ecs Blue Green Deployment


Aws elastic container service with blue/green deployment.



Resources

🔑   Github Oauth Token

Create secret manager for github token

   aws secretsmanager create-secret --name demoapp/gitSourcetoken --secret-string <GITHUB_TOKEN>

Or

   aws secretsmanager update-secret --secret-id demoapp/gitSourcetoken --secret-string <GITHUB_TOKEN>

📜   Aws Credentials

Export local environmental variables

   export AWS_ACCESS_KEY_ID=<XXXX>
   export AWS_SECRET_ACCESS_KEY=<XXXX>
   export AWS_DEFAULT_REGION=<XXXX>

⚙️   Configuration

Configure credentials in config.json

    "settings": {
      "applicationName": "<App Name>",
      "familyName": "<Family Name>",
      "clusterName": "<Cluster Name>"
    },

    // React app source code
   "project_source": {
      "branch": "main",
      "owner": "<OWNER>",
      "repo": "<REPO>",
      "secretToken": "<setup in next step>",
    },

    // Cdk infrastructure code
   "cdk_source": {
      "branch": "main",
      "owner": "<OWNER>",
      "repo": "<REPO>",
      "secretToken": "<setup in next step>",
    }

🔨   Get Started

  • Install
   npm install
  • deploy
   cdk deploy


⚠️   Issues


Initial deployment

  On Initial Deployment: Cdk pipeline will fail to prevent repeate deployment


Import alias path not found

   alias cdk="npx aws-cdk"

About

Aws Ecs with blue/green deployment pipeline, using aws cdk


Languages

Language:TypeScript 79.0%Language:Python 20.6%Language:JavaScript 0.5%