AWS, Cloud Computing

3 Mins Read

How to Deploy Infrastructure using AWS Code Pipeline

Voiced by Amazon Polly

AWS Code Pipeline: An overview

Are you eager to know how to Deploy Infrastructure with AWS Code Pipeline?AWS Code Pipeline is a Continuous Integration and Continuous Delivery service that can be used for fast and reliable infrastructure deployment and updates. It can automate and standardize the provisioning of the Infrastructure required to deploy your applications; Rapid Infrastructure modification can also be done whenever required with less human intervention. The Code Pipeline has multiple stages: source, build, and deploy. We will be deploying and modifying Infrastructure using CloudFormation templates for EC2 instances. 

Customized Cloud Solutions to Drive your Business Success

  • Cloud Migration
  • Devops
  • AIML & IoT
Know More

Services for provisioning the Infrastructure

Below are the services we will be using to automate our Infrastructure provisioning.

CloudFormation– This service is used for deploying Infrastructure as a code. We will use two templates, one for initial deployment and another for updating the Infrastructure. During the Code Deploy stage, we will select CloudFormation Stack to provision the resources defined in the template.

 

Simple Storage Service (S3) – The CloudFormation template would be uploaded and stored in an S3 bucket. This bucket would be used as a source while creating Code Pipeline.

 

Code Pipeline- We will build an automated process for provisioning and updating our Infrastructure using this service.

Steps to create a Code Pipeline for Infrastructure Deployment.

Below are the steps to follow;

Pre-requisites: Two CloudFormation templates (One template to create an EC2 instance with one Elastic IP and a Security group associated with it. Second template with some modifications in the security group rules)

Execution Steps-

  1. In the AWS console, open the S3 service and create a bucket with versioning enabled.
  2. Zip both the CloudFormation templates and upload the first template to the bucket. (Remember the name of the Zip file uploaded in a bucket and also the name of the template with the extension present within that zip file (e.g., zip, which consists of a template named ec2.yaml)
  3. Now open the Code Pipeline console page.
  4. Click on the ‘Create Pipeline’
  5. Enter the name for the pipeline, keep all values as default (as shown in Figure 1.1), and then click ‘Next.’

Deploy AWS Code Pipeline-step-1

        Figure:1.1

  1. On the Source Stage page, select the Source Provider as ‘Amazon S3’. Then select the bucket created in earlier steps, provide the zip file name (as shown in Figure 1.2), and click ‘Next.’

            Figure:1.2

  2. On the Build Stage page, Click on ‘Skip Build stage’ and then click on ‘Skip’
  3. Now, on the Deploy stage, select Deploy provider as ‘AWS CloudFormation’ and enter other information as shown in Figure 1.3 (the yaml is the template within the zip file in the S3 bucket). Select the ‘local execution role’ and then click ‘Next.’
  4. Review and Click on ‘Create Pipeline’

            Figure:1.3

  5. This step will deploy the EC2 instance using the Code Pipeline service. Once the deployment, it will show the success of stages, as shown in Figure 1.4

            Figure:1.4

Updating the deployed Infrastructure

To update the existing Infrastructure deployed using the Code Pipeline service, follow the below-given steps.

  • Create a zip file of a modified template file with the same file name as zip.
  • Upload the updated zip file in the same source bucket selected earlier while creating the pipeline.
  • Observe the pipeline for the update process. (As shown in figure 1.5)
  • Once the update is successful, observe the changes in the EC2 security groups.

 

Conclusion

Thus, we can conclude that with how to deploy Infrastructure with AWS Code Pipeline or provision your Infrastructure quickly and reliably using the CI/CD process, then we can use the Code Pipeline service.

You can read more about AWS Code Pipeline from official AWS site.

Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.

  • Cloud Training
  • Customized Training
  • Experiential Learning
Read More

About CloudThat

CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.

CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 850k+ professionals in 600+ cloud certifications and completed 500+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training PartnerAWS Migration PartnerAWS Data and Analytics PartnerAWS DevOps Competency PartnerAWS GenAI Competency PartnerAmazon QuickSight Service Delivery PartnerAmazon EKS Service Delivery Partner AWS Microsoft Workload PartnersAmazon EC2 Service Delivery PartnerAmazon ECS Service Delivery PartnerAWS Glue Service Delivery PartnerAmazon Redshift Service Delivery PartnerAWS Control Tower Service Delivery PartnerAWS WAF Service Delivery PartnerAmazon CloudFront Service Delivery PartnerAmazon OpenSearch Service Delivery PartnerAWS DMS Service Delivery PartnerAWS Systems Manager Service Delivery PartnerAmazon RDS Service Delivery PartnerAWS CloudFormation Service Delivery PartnerAWS ConfigAmazon EMR and many more.

WRITTEN BY Abhijit Dilip Powar

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!