Skip to content

Repository files navigation

EC2 CloudFormation with YAML

Project Overview

This project was developed as part of the Cloud Services module at CCT College Dublin.

The objective of this work was to demonstrate the use of Infrastructure as Code (IaC) using AWS CloudFormation and YAML templates.

The templates were used to create and update AWS infrastructure in a controlled and repeatable way. Instead of manually creating resources in the AWS Console, the infrastructure was defined in YAML files and deployed through CloudFormation stacks.

The project also demonstrates the use of CloudFormation Change Sets, which allow infrastructure changes to be reviewed before being applied.


Scenario

This work was part of a proof-of-concept cloud solution for a fictional medical start-up called Medi-Advice.

Medi-Advice wanted to modernise its infrastructure and reduce manual configuration. CloudFormation was used to show how AWS resources can be created, updated and managed using templates.

The infrastructure created during this task included:

  • EC2 instance
  • Security Group
  • SSH access rule
  • HTTP access rule
  • EBS volume
  • EBS volume attachment
  • S3 bucket

CloudFormation Templates

The repository includes several YAML templates showing different stages of the infrastructure deployment.

1a EC2 Template

The initial template creates a basic EC2 instance and a Security Group allowing SSH access on port 22.

This demonstrates the first CloudFormation stack deployment.

1a EC2 Template with HTTP

This updated template adds an additional inbound rule to allow HTTP access on port 80.

This demonstrates how a Change Set can be used to update an existing stack safely.

2a EC2 Template

This template extends the infrastructure by adding an EBS volume and attaching it to the EC2 instance.

Resources included:

  • EC2 instance
  • Security Group
  • EBS volume
  • Volume attachment

3a EC2 Template

This template adds an Amazon S3 bucket while keeping the previous infrastructure resources.

Resources included:

  • EC2 instance
  • Security Group
  • EBS volume
  • EBS volume attachment
  • S3 bucket

AWS Resources Used

The project uses the following AWS resources:

Amazon EC2

Amazon EC2 was used to create a Linux virtual machine in AWS.

Security Groups

Security Groups were used to control inbound traffic to the EC2 instance.

Rules included:

  • SSH access on port 22
  • HTTP access on port 80

Amazon EBS

Amazon EBS was used to create a 10 GB storage volume attached to the EC2 instance.

Amazon S3

Amazon S3 was used to create a storage bucket through CloudFormation.

AWS CloudFormation

CloudFormation was used to define, deploy and update the infrastructure using YAML templates.

Change Sets

Change Sets were used to preview infrastructure updates before executing them.

This helped reduce risk by showing what CloudFormation would change before applying the update.


Technologies Used

  • AWS CloudFormation
  • YAML
  • Amazon EC2
  • Amazon EBS
  • Amazon S3
  • AWS Security Groups
  • CloudFormation Change Sets
  • Infrastructure as Code

Key Learning Outcomes

This project demonstrates:

  • Creating AWS infrastructure using YAML templates
  • Using CloudFormation stacks
  • Updating infrastructure with Change Sets
  • Creating EC2 instances through Infrastructure as Code
  • Configuring Security Group inbound rules
  • Adding HTTP access to an existing stack
  • Creating and attaching an EBS volume
  • Adding an S3 bucket through CloudFormation
  • Understanding repeatable and automated cloud deployment

Security Note

Private key files such as .pem files should not be uploaded to GitHub.

Before committing this project, make sure any private key file is removed from the repository and add the following rule to .gitignore:

*.pem

This helps prevent accidental exposure of private SSH keys.


Academic Context

This project was completed as part of the Cloud Services module at CCT College Dublin.

It forms part of a larger proof-of-concept cloud solution for Medi-Advice, where AWS services were used to demonstrate cloud hosting, automation, scalability and infrastructure modernisation.


Author

This project was developed by Thiago Goncalves da Costa as part of the Bachelor of Science in Computing and Information Technology at CCT College Dublin.

During my studies, I used the institutional GitHub account associated with my student email:

2022161@student.cct.ie

Since institutional accounts and student emails may be deactivated after graduation, this repository was migrated to my personal GitHub account:

https://github.com/ThiagoGoncos

This ensures long-term preservation of the project, commit history, and academic work completed during the degree program.

About

AWS CloudFormation YAML templates for deploying and updating EC2 infrastructure with Security Groups, HTTP access, EBS volume attachment, S3 bucket creation and Change Sets for the Cloud Services module at CCT College.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages