Skip to content
Paul Duvall edited this page Mar 19, 2020 · 15 revisions

1.3 Launch a CloudFormation stack that deploys a simple deployment pipeline

Review and ensure that you have setup your development environment before going through the steps below.

Solution Architecture

  1. From AWS Cloud9, create a directory and file:
mkdir ~/environment/ceoa/codecommit-files
cd ~/environment/ceoa/codecommit-files
aws s3 mb s3://ceoa-13-$(aws sts get-caller-identity --output text --query 'Account')
touch ceoa-1-pipeline-cfn.yml
  1. Copy the contents from ceoa-1-pipeline-cfn.yml to your local ceoa-1-pipeline-cfn.yml file in Cloud9 and save it.

Sync the files with your S3 bucket

In this section, you will zip and upload all of the source files to the S3 bucket you created when setting up your development environment. This way the ceoa-1-pipeline-cfn.yml template initializes the CodeCommit repository that is automatically provisioned by the stack.

From your AWS Cloud9 environment, type the following:

cd ~/environment/ceoa/codecommit-files
zip ceoa-1-examples.zip *.*
aws s3 sync ~/environment/ceoa/codecommit-files s3://ceoa-13-$(aws sts get-caller-identity --output text --query 'Account')

Launch the Stack

From your AWS Cloud9 environment, type the following:

aws cloudformation create-stack --stack-name ceoa-1-pipeline-cfn --template-body file:///home/ec2-user/environment/ceoa/codecommit-files/ceoa-1-pipeline-cfn.yml --parameters ParameterKey=EmailAddress,ParameterValue=fake-email@fake-fake-fake-email.com ParameterKey=CodeCommitS3Bucket,ParameterValue=ceoa-$(aws sts get-caller-identity --output text --query 'Account') ParameterKey=CodeCommitS3Key,ParameterValue=ceoa-1-examples.zip --capabilities CAPABILITY_NAMED_IAM --disable-rollback

Launch the Deployment Pipeline

  1. Once the CloudFormation stack is successful, select the checkbox next to the stack and click the Outputs tab.
  2. From the Outputs tab, click on the PipelineUrl output.

Get pipeline metadata

Get the generated pipeline name by going to CodePipeline Console.

From AWS Cloud9 terminal, type the following (replacing YOURPIPELINENAME with the generated name):

aws codepipeline get-pipeline --name YOURPIPELINENAME

Cleanup

Go to Cleanup to remove any resources you created in this sublesson.

Clone this wiki locally