Answers for "terraform main.tf"

0

terraform main.tf

# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}

# Configure the AWS Provider
provider "aws" {
  region = "us-east-1"
    access_key = "your_key"
  secret_key = "secret_key"
}
/*

 resource "aws_instance" "first-server" {
  ami           = "ami-0885b1f6bd170450c"
  instance_type = "t2.micro"
  
  tags = {
    Name = "test-instance"
  }
}

*/



/*

resource "aws_vpc" "first-vpc" {
  cidr_block = "10.0.0.0/16"

  tags = {
    Name = "production"
  }

}



resource "aws_subnet" "subnet-1" {
  vpc_id     = aws_vpc.first-vpc.id
  cidr_block = "10.0.1.0/24"

  tags = {
    Name = "prod-subnet"
  }
}

 */
Posted by: Guest on October-07-2021

Browse Popular Code Answers by Language