Skip to content

Instantly share code, notes, and snippets.

@koenighotze
Created April 26, 2017 14:03
Show Gist options
  • Save koenighotze/28eb1930148d8bc5192495e5e790e380 to your computer and use it in GitHub Desktop.
Save koenighotze/28eb1930148d8bc5192495e5e790e380 to your computer and use it in GitHub Desktop.
02_basic_ec2_including_ssh
provider "aws" {
region = "eu-west-1"
}
resource "aws_instance" "stage1" {
instance_type = "t2.micro"
ami = "ami-a8d2d7ce"
vpc_security_group_ids = ["${aws_security_group.stage1-sec-group.id}"]
key_name = "terraform-test-key"
tags {
Name = "stage1"
}
}
resource "aws_security_group" "stage1-sec-group" {
name = "Allow SSH"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
Name = "stage1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment