1.3 - PaulDuvall/aws-compliance-workshop GitHub Wiki
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.
- From AWS Cloud9, create a directory and file:
mkdir ~/environment/ccoa/codecommit-files
cd ~/environment/ccoa/codecommit-files
touch ccoa-1-pipeline-cfn.yml
- Copy the source contents from the ccoa-1-pipeline.yml file and save it to your local file in your Cloud9 environment called ccoa-1-pipeline.yml.
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 ccoa-1-pipeline.yml template initializes the CodeCommit repository that is automatically provisioned by the stack.
From your AWS Cloud9 environment, type the following:
cd ~/environment/ccoa/codecommit-files
zip ccoa-1-examples.zip *.*
aws s3 sync ~/environment/ccoa/codecommit-files s3://ccoa-$(aws sts get-caller-identity --output text --query 'Account')
Launch the Stack
From your AWS Cloud9 environment, type the following (replacing [email protected]
with the appropriate value):
aws cloudformation create-stack --stack-name ccoa-1-pipeline-cfn --template-body file:///home/ec2-user/environment/ccoa/codecommit-files/ccoa-1-pipeline-cfn.yml --parameters ParameterKey=EmailAddress,[email protected] ParameterKey=CodeCommitS3Bucket,ParameterValue=ccoa-$(aws sts get-caller-identity --output text --query 'Account') ParameterKey=CodeCommitS3Key,ParameterValue=ccoa-1-examples.zip --capabilities CAPABILITY_NAMED_IAM --disable-rollback
Launch the Deployment Pipeline
- Once the CloudFormation stack is successful, select the checkbox next to the stack and click the Outputs tab.
- 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
Additional Resources
- Download the pipeline-example.yml CloudFormation template.
Cleanup
Go to Cleanup to remove any resources you created in this sublesson.