Skip to content

Instantly share code, notes, and snippets.

@hexmode
Created November 26, 2015 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hexmode/0fdcb1173b8c4ff0838d to your computer and use it in GitHub Desktop.
Save hexmode/0fdcb1173b8c4ff0838d to your computer and use it in GitHub Desktop.
provider "aws" {
access_key = ""
secret_key = ""
region = "us-east-1"
}
resource "aws_vpc" "main" {
cidr_block = "10.0.1.0/24"
}
resource "aws_subnet" "main" {
vpc_id = "${aws_vpc.main.id}"
cidr_block = "10.0.1.0/24"
tags {
Name = "Main"
}
}
resource "aws_instance" "example" {
ami = "ami-d05e75b8"
instance_type = "t2.micro"
subnet_id = "${aws_subnet.main.id}"
}
resource "aws_eip" "ip" {
vpc = "${aws_vpc.main.id}"
instance = "${aws_instance.example.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment