Create a Pipeline Using the AWS Code Pipeline Console
In this demonstration, you’ll perform a simple walkthrough of a two-stage pipeline using the CodePipeline console.
Join the DZone community and get the full member experience.Join For Free
using the aws console is often the best way to get familiar with the concepts around any new aws service. the console is also a good way to view the status of resource configuration and attributes. in posts on provisioning aws codepipeline with cloudformation and mocking aws codepipeline pipelines with lambda , you became familiar with how to automate the provisioning of pipelines in codepipeline using cloudformation — along with many other aws resources. in this post, you’ll take a step back and go over the steps of manually creating a simple pipeline using the aws console.
create an application and deployment in codedeploy
to create an application and deployment, go to the aws console and launch the codedeploy service. choose sample deployment and click next step .
on the next page, choose amazon linux as the operating system, then choose your ec2 key pair from the drop down and you’ll want to keep the name and codedeploydemo defaults for tag key and value . finally, click launch instances . you’ll need to wait several minutes while codedeploy launches a cloudformation stack that provisions three ec2 instances and installs the codedeploy agent on each of these instances. once the instances have been launched, click next step .
enter an application name (or just use the default name) and click next step . click next step from the revision page. from the deployment group page, accept the defaults and click next step . from the service role page, select an iam role with access to codedeploy resources (this should have been previously created when you launched the ec2 instances for codedeploy). click next step . review the deployment configuration and click next step . from the review page, click deploy now .
access the application deployed by codedeploy
by going through these steps, you will launch a deployment of a simple web application across three ec2 instances. check the codedeploy console for deployment status. once everything is successful, choose, click view all instances and click on the one of the links in the in instance id column to bring up the ec2 console. from the details pane, copy the public ip and paste it into your browser. you should see a page that says something similar to “ congratulations. this application was deployed using aws codedeploy. ”.
upload an application distribution to s3
next, you will download the codepipeline/codedeploy application distribution by going to the link to the codepipeline/codedeploy distribution provided in the resources section in this post. upload the zip file to an s3 bucket in your aws account and make note of your bucket name and key as you will be using it when creating a pipeline in codepipeline. make sure you enable versioning on the s3 bucket by selecting properties for the bucket, clicking on versioning and then enable versioning .
create a pipeline
once this is a complete, go to the codepipeline console and click create pipeline . enter your pipeline name and click next step . choose amazon s3 as the source provider followed by the s3 location of the location (e.g. s3://stelligent-tmp/aws-codepipeline-s3-aws-codedeploy_linux.zip where stelligent-tmp is the bucket name and aws-codepipeline-s3-aws-codedeploy_linux.zip is the key) where you uploaded the zip file located in github. click next step . choose no build as the build provider and click next step . from the beta page , choose aws codedeploy as the deployment provider and enter the application name and deployment group that you defined when create the sample codedeploy deployment. click next step .
choose aws-codepipeline-service as your iam role name (or another role that has proper access to the codepipeline services) on the aws service role page and click next step . review your pipeline and click create pipeline .
access the application deployed by codedeploy and orchestrated by codepipeline
from the codepipeline console you can monitor the stages and actions for this simple two-stage pipeline. once it successfully completes, refresh the page where you copied the url when setting up codepipeline. you should see a message similar to “ congratulations! you have successfully created a pipeline that retrieved this source application from an amazon s3 bucket and deployed it to three amazon ec2 instances using aws codedeploy .” you’ve successfully orchestrated a codedeploy deployment that deploy a simple application from an s3 bucket.
delete your pipeline
from the codepipeline console , select the pipeline you created and click edit . then, click delete and enter the name of the pipeline you’d like to delete. you can delete your codedeploy application and cloudformation stacks as well.
Published at DZone with permission of Paul Duvall, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.