Skip to content

Instantly share code, notes, and snippets.

@khushi20218
Created September 6, 2020 13:44
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 khushi20218/517bf1a0b09e354d7bf6af06ca876019 to your computer and use it in GitHub Desktop.
Save khushi20218/517bf1a0b09e354d7bf6af06ca876019 to your computer and use it in GitHub Desktop.
# Security Group for DB
resource "aws_security_group" "allow_data_in_db" {
name = "allow_db"
description = "Allow WP to put data in DB"
vpc_id = data.aws_vpc.def_vpc.id
ingress {
description = "MySQL"
from_port = 3306
to_port = 3306
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "allow_wp_in_db"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment