Skip to content

Instantly share code, notes, and snippets.

@mschirbel
Created May 13, 2019 02:57
Show Gist options
  • Save mschirbel/5c631c340be799cd5571b883e431f106 to your computer and use it in GitHub Desktop.
Save mschirbel/5c631c340be799cd5571b883e431f106 to your computer and use it in GitHub Desktop.
resource "aws_instance" "nat" {
ami = "ami-0669a96e355eac82f"
availability_zone = "sa-east-1a"
instance_type = "m1.small"
key_name = "${var.aws_key_name}"
vpc_security_group_ids = ["${aws_security_group.nat.id}"]
subnet_id = "${aws_subnet.sa-east-1a-public.id}"
associate_public_ip_address = true
source_dest_check = false
tags {
Name = "VPC NAT"
}
}
resource "aws_instance" "web-1" {
ami = "${lookup(var.amis, var.aws_region)}"
availability_zone = "sa-east-1a"
instance_type = "m1.small"
key_name = "${var.aws_key_name}"
vpc_security_group_ids = ["${aws_security_group.web.id}"]
subnet_id = "${aws_subnet.sa-east-1a-public.id}"
associate_public_ip_address = true
source_dest_check = false
tags {
Name = "Web Server 1"
}
}
resource "aws_instance" "db-1" {
ami = "${lookup(var.amis, var.aws_region)}"
availability_zone = "sa-east-1a"
instance_type = "m1.small"
key_name = "${var.aws_key_name}"
vpc_security_group_ids = ["${aws_security_group.db.id}"]
subnet_id = "${aws_subnet.sa-east-1a-private.id}"
source_dest_check = false
tags {
Name = "DB Server 1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment