Sandip Patel

Let's move from "Have to" to "Want to"

Menu
  • Home
  • TECH CORNER
    • AWS
    • Networking
  • Videos
  • Expert Talk Delivered
  • Projects
  • Publications
  • About Me
Menu

Install terraform on ubuntu and Create EC2 instance on AWS using terraform script

Posted on March 25, 2020October 7, 2020 by Sandip Patel

Open terminal and download terraform using the following command:

  1. sudo apt-get update
  2. wget https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip
  3. sudo unzip ./terraform_0.11.13_linux_amd64.zip -d /usr/local/bin/
  4. terraform -v

Now, create terraform script and run the following command to instance:

  1. nano terraform.tf
provider "aws" {
  region     = "rerion"
  access_key = "accesskey"
  secret_key = "secretkey"
}

resource "aws_instance" "example" {
  ami = "ami-8803e0f0"
  instance_type = "t2.micro"
}
  1. terraform init
  2. terraform plan
  3. terraform apply

Note: Enter yes after apply command.

OUTPUT:

You see that Ec2 instance is running in your AWS Console.

Follow Me

              

AWS Re: invent 2021 at Las Vegas

Achievements & Events

Faculty- Ambassador
Best Paper Presentation Award
AWS Academy Success Story on AWS official Blog
AWS Expert Talk 2020
USA-Conference
Paper Presentation
Conference-Team
AWS Expert Talk by IEEE 2020

RSS Recent Announcements

  • AWS Fargate for Amazon Elastic Kubernetes Service is now available in the Amazon Web Services China Beijing and Ningxia Regions June 24, 2022
  • Amazon EC2 Auto Scaling announces increased Auto Scaling group default limit per account June 24, 2022
  • Amazon EC2 G5 instances now available in additional regions June 23, 2022
  • Amazon EC2 C7g instances powered by AWS Graviton3 processors now available in US East (Ohio) and Europe (Ireland) June 23, 2022
  • Amazon Connect Wisdom now enables you to integrate agent assistance capabilities into custom agent applications June 23, 2022

Recent Posts

  • Deployment of Website Using AWS CICD pipeline & Fargate
  • Install terraform on ubuntu and Create EC2 instance on AWS using terraform script
  • Install Cloudwatch agent on on-premises Windows server
  • Install Cloudwatch agent on on-premises Linux server
  • Deploy Flask website using AWS CLI with AWS Lambda, AWS API Gateway and Zappa
March 2020
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031  
« Feb   Mar »
web counter
©2022 Sandip Patel | WordPress Theme by SuperbThemes