Skip to content

Instantly share code, notes, and snippets.

@lawliet89
Created September 4, 2018 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lawliet89/ad5aba366bb8391cfc232dcd7ffff73b to your computer and use it in GitHub Desktop.
Save lawliet89/ad5aba366bb8391cfc232dcd7ffff73b to your computer and use it in GitHub Desktop.
Terraform Demo Snippets
resource "aws_security_group" "instance" {
name = "${var.name}"
vpc_id = "${var.vpc_id}"
tags = "${merge(var.tags, map("Name", "${var.name}"))}"
}
resource "aws_security_group_rule" "ssh_inbound" {
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${var.ssh_cidr_blocks}"]
security_group_id = "${aws_security_group.instance.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment