Skip to content

Benn1440/Terraform_IAC_task

Repository files navigation

Terraform Infrastructure as Code with AWS

Terraform is an open-source infrastructure-as-code software tool created by HashiCorp. With Terraform we can automate Infrastructure to provision and manage resources in any cloud or data center.

https://www.terraform.io/

https://developer.hashicorp.com/terraform?product_intent=terraform

For this project, an AWS IAM User was created with Administrator access.

image

On Visual Studio code there was the need to install the AWS Toolkits and Terraform extension, and after that login with the already generated Access key ID & Secret access key.

Which generated various AWS resource Templates in our selected Region.

image

AWS Providers

Terraform uses a provider to interface with the Application Programming Interface (API) of any infrastructure you are trying to build available to the cloud service provider. ## https://registry.terraform.io/providers/hashicorp/aws/latest/docs

Link to Architectural Diagram

https://lucid.app/lucidchart/d1b12868-4942-44dd-a6eb-a2639c3e9bc7/edit?invitationId=inv_c8a5d7bb-0a33-48e1-aa84-17e6eb487a99&page=0_0#

image

Terraform Init

Running the terraform init within the working directory, terraform checks the provider's file installs required hashicorp files and then creates Two(2) extra files .terraform.lock.hcl ensures that the selected version is frozen, Which helps to avoid issues in cases of upgrade and a .exe file.

image

Terraform plan

This displays, snippets of the resources to be created.

Screenshot 2024-07-24 at 09 16 16 Screenshot 2024-07-24 at 09 18 04 Screenshot 2024-07-24 at 09 18 57 image image image image image

Output of terraform plan

  • terraform plan -out=tfplan -json > tfplan.json
image

#All created resources on the AWS dashboard are in the images folder.

Terraform apply -auto-approve

Create the resources and state files.

image image

Terraform Destroy

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published