Coder Social home page Coder Social logo

terraform's Introduction

Terraform

terraform--provision resources in cloud providers -- made by hashicorp

--infrastructure as a code ...............................

  1. launch ec2
  2. wget link on linux https://www.terraform.io/downloads.html and copy link of 64 and paste it to ec2-linux instance
  3. unzip the zipped file (sudo yum install -y unzip in case of rhel)
  4. echo $"export PATH=$PATH:$(pwd)" >> ~/.bash_profile --send current directory and save it to bash_profile
  5. source ~/.bash_profile --to load the .bash_profile
  6. type terraform , you will see information
  7. mkdir terraform-lab and go inside it
  8. vi ec2.tf (tf is extention for terraform)
  •  provider "aws" {
       access_key = "***"
       secret_key = "***"
       region     = "us-east-1"
     }
    
     resource "aws_instance" "example" {
       count         = 2
       ami           = "ami-2757f631"
       instance_type = "t2.micro"
    
    
       tags {
         Name = "test-instance"
       }
     }
    
  1. go to Iam, click on user, and go to security credentials and create access key and make changes to ec2.tf
  2. note: ami must be specific to region
  3. note: once you have aws-cli setup(aws configure) you neednot to provide access_key, secret_key and region. 13.ls , you will see ec2.tf
  4. initialize the terraform by command -- terraform init
  5. terraform apply ---- and write yes
  6. note: the user should have ec2fullaccess.
  7. you can see the changes made by going to ec2-instances, just above ami you need to add count = 2 if you want 2 more machines or so.
  8. you can even destroy the changes using command -- terraform destroy

terraform's People

Contributors

rbngtm1 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.