Skip to content

kimisme9386/aws-codedeploy-with-autoscaling-infra

Repository files navigation

Build Status

AWS CodeDeploy for AWS Auto Scaling within AWS CDK to build AWS infrastructure.

The repository is AWS CodeDeploy infrastructure as code, the other repository is application revisions for CodeDeploy. They are a couple.

The application revisions is php lumen project. If you want to use others, feel free to clone it and modify.

Preparation

  • AWS account
  • Travis ci account
  • AWS CDK

if you want to build on your local environment, it's necessary.

Build on Travis CI

Create IAM user for creating AWS infrastructure

The IAM user must have enough permissions to create IAM user, IAM role, autoscaling group, codedeploy application, codedeploy deployment group and so on...

Attach AdministratorAccess policy to the IAM user is the simplest.

Set environment variable of AWS IAM credential on Travis CI dashboard

On Environment Variables section of settings, set environment variable of AWS IAM credential according to previous step.

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION

Check result

  • Travis CI build pass or fail
  • Cloudformation stack status in the AWS Management Console

CodeDeploy Deployment

CodeDeploy Deployment (application revisions) refer to aws-codedeploy-with-autoscaling-app repository

What is next

Integrating CodeDeploy with Elastic Load Balancing