Deploying a Domain Controller on a EC2 instance with Terraform
Provisioning and setting a domain controller Server in AWS

Deploying a Domain Controller on a EC2 instance with Terraform

In this article we will imagine that you were assigned to develop an environment that provides a 𝕸𝖎𝖈𝖗𝖔𝖘𝖔𝖋𝖙 𝖉𝖔𝖒𝖆𝖎𝖓 𝖈𝖔𝖓𝖙𝖗𝖔𝖑𝖑𝖊𝖗 running on an Elastic Compute Cloud (EC2) instance in a VPC.

Networking and compute components

  • VPC
  • EC2
  • Routing
  • Internet access
  • Subnets
  • Security groups

For this scenario, the diagram below have been provided to be used as a reference by the Cloud Solutions Architect team .

Aucun texte alternatif pour cette image

Our objective here is to use build it entirely with infrastructure as a code (IaaC) using Terraform.

What is Terraform?

Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files.

In a future post, we'll improve the configuration of the EC2 components with ansible.

What is VPC?

Amazon Virtual Private Cloud (Amazon VPC) is a service that lets you launch AWS resources in a logically isolated virtual network that you define.

What is EC2

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. 

What is AWS Internet gateway?

An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet.

What is AWS subnet?

Subnetwork or subnet is a logical subdivision of an IP network

What is a security group in AWS?

security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. ... If you don't specify a security group, Amazon EC2 uses the default security group. You can add rules to each security group that allow traffic to or from its associated instances.

There were several functions, arguments and expressions of Terraform used in the above project:

provider

variables and outputs

modules

resources

count

types and values

random_string

join

splat expression

for expression

cidrsubnet

templatefile

You can find the repository for this project here

I would like to thanks Derek Morgan creator of the course "More Than Certified in Terraform" the best course on terraform. If you want to connect with him and ask questions about his course, contact him via LinkedIn Derek Morgan.

#terraform #automation #devops


To view or add a comment, sign in

More articles by Nicanor FOPING

Others also viewed

Explore content categories