Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.