Created
April 26, 2017 14:03
-
-
Save koenighotze/28eb1930148d8bc5192495e5e790e380 to your computer and use it in GitHub Desktop.
02_basic_ec2_including_ssh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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