Created
June 7, 2018 15:17
-
-
Save Gunisalvo/8806ab0d8c34e709af551946aa79d224 to your computer and use it in GitHub Desktop.
Revisions
-
Gunisalvo created this gist
Jun 7, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ provider "aws" { region = "us-east-2" } resource "aws_security_group" "uol_security" { name = "CKIT523-Group-[REPLACE WITH YOUR NAME]" #fixme! description = "Uol Security" ingress { from_port = 22 to_port = 22 protocol = "TCP" cidr_blocks = ["0.0.0.0/0"] } } data "aws_ami" "ubuntu" { most_recent = true filter { name = "name" values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"] } filter { name = "virtualization-type" values = ["hvm"] } owners = ["099720109477"] # Canonical } resource "aws_instance" "uol_ec2" { ami = "${data.aws_ami.ubuntu.id}" instance_type = "t2.medium" # As described on the assignment key_name = "CKIT523Key-[REPLACE WITH YOUR NAME]" #fixme! security_groups = [ "${aws_security_group.uol_security.name}" ] tags { Name = "CKIT523-[REPLACE WITH YOUR NAME]" #fixme! } }