Skip to content

Commit

Permalink
Fixed http provider issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Frichetten committed Jan 3, 2023
1 parent bb30dee commit 317d369
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions aws/cicdont/attackbox.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ resource "aws_security_group" "allow_inbound" {
from_port = 26
to_port = 65535
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.player_ip.body)}/32", "${aws_instance.target_service.public_ip}/32"]
cidr_blocks = ["${chomp(data.http.player_ip.response_body)}/32", "${aws_instance.target_service.public_ip}/32"]
}

ingress {
description = "Allow SSH"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.player_ip.body)}/32"]
cidr_blocks = ["${chomp(data.http.player_ip.response_body)}/32"]
}

egress {
Expand Down Expand Up @@ -64,4 +64,4 @@ resource "aws_instance" "attackbox" {
tags = {
Name = "attackbox"
}
}
}
4 changes: 4 additions & 0 deletions aws/cicdont/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ terraform {
source = "hashicorp/aws"
version = "~> 3.74.1"
}
http = {
source = "hashicorp/http"
version = "~> 3.2.1"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion aws/cicdont/target_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "aws_security_group" "allow_http" {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.player_ip.body)}/32"]
cidr_blocks = ["${chomp(data.http.player_ip.response_body)}/32"]
}

egress {
Expand Down

0 comments on commit 317d369

Please sign in to comment.