Using Terraform to spin up EC2 instances and AWS Systems Manager configuration with Amazon SNS for automated security agents installation on the EC2 instances.

Bolaji A. Adetoye
5 min readJul 9, 2023

In this project, I deployed a set of EC2 instances in an automated way using Terraform and also installed a specific agent on all the instances in an automated way.

AWS systems manager and its component Command Run was used to install the security agent. I used the Amazon Simple Notification Service (SNS) to send email notifications informing the whole process status.

Architectural Diagram

These are the following steps taken to complete the project.

  1. Download any suitable code editor (VSCode was my chosen editor). You may download this here — https://code.visualstudio.com/download and install the Terraform extension for proper syntax highlighting and autocompletion.

2. Create a Terraform main.tf file using the VSCode. I chose to create the EC2 instances in the North Virginia region (us-east-1) using the default VPC and the subnets.

--

--

Bolaji A. Adetoye

IT Tech. Support | Aspiring MultiCloud & DevOps Engineer | AWS | Microsoft Azure | Google Cloud | Oracle Cloud