Giter Site home page Giter Site logo

terraform_three_tier_project's Introduction

terraform_three_tier_project

to create a secured 3 tier infrastructure in aws Step-01: Introduction Understand basic Terraform Commands terraform init terraform validate terraform plan terraform apply terraform destroy Step-02: Review terraform manifest for EC2 Instance Pre-Conditions-1: Ensure you have default-vpc in that respective region Pre-Conditions-2: Ensure AMI you are provisioning exists in that region if not update AMI ID Pre-Conditions-3: Verify your AWS Credentials in $HOME/.aws/credentials

Terraform Settings Block

terraform { required_providers { aws = { source = "hashicorp/aws" #version = "~> 3.21" # Optional but recommended in production } } }

Provider Block

provider "aws" { profile = "default" # AWS Credentials Profile configured on your local desktop terminal $HOME/.aws/credentials region = "us-east-1" }

Resource Block

resource "aws_instance" "ec2demo" { ami = "ami-04d29b6f966df1537" # Amazon Linux in us-east-1, update as per your region instance_type = "t2.micro" } Step-03: Terraform Core Commands

Initialize Terraform

terraform init

Terraform Validate

terraform validate

Terraform Plan to Verify what it is going to create / update / destroy

terraform plan

Terraform Apply to Create EC2 Instance

terraform apply Step-04: Verify the EC2 Instance in AWS Management Console Go to AWS Management Console -> Services -> EC2 Verify newly created EC2 instance Step-05: Destroy Infrastructure

Destroy EC2 Instance

terraform destroy

Delete Terraform files

rm -rf .terraform* rm -rf terraform.tfstate* Step-08: Conclusion Re-iterate what we have learned in this section Learned about Important Terraform Commands terraform init terraform validate terraform plan terraform apply terraform destroy

terraform_three_tier_project's People

Contributors

alexiangwa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.