Skip to content

Commit

Permalink
rename cloudflare security group rule to account for ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Sep 12, 2024
1 parent 33877e5 commit 3613c8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aws/cloudflare-sg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "aws_security_group" "cloudflare_https" {
vpc_id = var.vpc_id
}

resource "aws_security_group_rule" "cloudflare_ipv4" {
resource "aws_security_group_rule" "cloudflare" {
type = "ingress"
from_port = 443
to_port = 443
Expand All @@ -15,6 +15,11 @@ resource "aws_security_group_rule" "cloudflare_ipv4" {
ipv6_cidr_blocks = split("\n", trimspace(data.http.cloudflare_ipv6.response_body))
}

moved {
from = aws_security_group_rule.cloudflare_ipv4
to = aws_security_group_rule.cloudflare
}

data "http" "cloudflare_ipv4" {
url = "https://www.cloudflare.com/ips-v4"
}
Expand Down

0 comments on commit 3613c8d

Please sign in to comment.