Implementation of a set of EC2 instances using Terraform and AWS Systems Manager configuration with Amazon Simple Notification Service for automated installation of security officers

Will Peixoto
2 min readAug 9, 2023

--

cloud project

In this project based on a real-world scenario, I acted as DevSecOps Engineer, and I deployed a set of EC2 instances and infrastructure in an automated way using Terraform (infrastructure as code — IaC). Also, it was necessary to install a specific security agent on all these instances in an automated way.

solution architecture

As already mentioned in a previous post, Terraform provisions the entire structure of the project from the definitions contained in the file main.tf.

main.ft file

After defining the infrastructure elements, just run some Terraform commands so that everything is created and ready to use:

init and plan commands

At the end of the execution of the plan command, everything that Terraform will provision — if you confirm the execution plan that is displayed on the screen. I confirmed and it started to create all the necessary infrastructure for the execution of this project.

Terraform in action

Once I provisioned the infrastructure, AWS System Manager and its component Command Run were used to install the security agents in an automated way. I used the Amazon Simple Notification Service — SNS to send an email informing the whole process status.

When executing a set of commands in a shell to install the security agents in the 2 instances created (it could be 1000 at once, or more… ), I was notified by e-mail about the execution status.

e-mails sent by Amazon SNS

Nice =)

--

--

No responses yet