Tech-Modernization / blog_serverless_conversion_elastic_beanstalk_codepipeline

0 stars 0 forks source link

Summary

This repo include the followings:

Features of the Elastic Beanstalk environment:

Features of the codepipeline:

Create the elastic beanstalk application and environment, and get the application and environment Ids

aws cloudformation deploy --stack-name <elastic beanstalk stack name> --template-file elasticBeanStalk_setup.yml \
        --capabilities CAPABILITY_IAM \
        --parameter-overrides \
        SolutionStackName="64bit Amazon Linux 2018.03 v4.14.1 running Node.js" \
        NotificationEmail=<youremail@yourcom.com> \
        EC2KeyName=<ec2_sshkeypair_name>

aws cloudformation describe-stacks --stack-name <stack_name> | jq ".Stacks[0].Outputs[]"

Create the codepipeline

aws cloudformation deploy --stack-name <codepipeline stack name> --template-file codepipeline_template.yml \
        --capabilities CAPABILITY_IAM \
        --parameter-overrides \
        GitHubUser=<user> \
        GitHubRepo=<repo> \
        GitHubBranch=<branch> \
        GitHubToken=<personal token> \
        ElasticBeanstalkApplication="application ID from earlier step" \
        ElasticBeanstalkEnvironment="environment ID from earlier step" \
        CloudWatchLogGroup=<codebuild log group> \
        CloudWatchLogStream=<codebuild log stream>

Test deployed application

After pipeline creation, there will be an initial release. Open the URL for the Elastic Beanstalk environment to verify that the application is running.

Update the application

Push a change to the application repo branch, the codepipeline should execute.