Skip to content

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

Notifications You must be signed in to change notification settings

edo92/Aws-Ecs-BlueGreen-Deployment

Repository files navigation

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"