Skip to content

Instantly share code, notes, and snippets.

@santiagopoli
Last active March 19, 2018 15:36
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 santiagopoli/7255f9bd20ce8b37fe00348fb4d59ef1 to your computer and use it in GitHub Desktop.
Save santiagopoli/7255f9bd20ce8b37fe00348fb4d59ef1 to your computer and use it in GitHub Desktop.
Terraform Blue Green / Security Groups
resource "aws_security_group" "terraform-blue-green" {
description = "Terraform Blue/Green"
vpc_id = "${var.vpc_id}"
name = "terraform-blue-green-v${var.infrastructure_version}"
tags {
Name = "Terraform Blue/Green (v${var.infrastructure_version})"
}
}
resource "aws_security_group_rule" "terraform-blue-green-inbound" {
type = "ingress"
security_group_id = "${aws_security_group.terraform-blue-green.id}"
from_port = -1
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_security_group_rule" "terraform-blue-green-outbound" {
type = "egress"
security_group_id = "${aws_security_group.terraform-blue-green.id}"
from_port = -1
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment