8000 add use_elastic_ips setting · ryanplasma/attack_range@20e92c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
add use_elastic_ips setting
Browse files Browse the repository at this point in the history
  • Loading branch information
P4T12ICK committed Oct 14, 2022
1 parent 7953628 commit 20e92c3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions configs/attack_range_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ aws:
private_key_path: "~/.ssh/id_rsa"
cloudtrail: "0"
cloudtrail_sqs_queue: "https://sqs.us-west-2.amazonaws.com/111111111111/cloudtrail-cloud-attack-range"
use_elastic_ips: "1"
azure:
location: "West Europe"
subscription_id: "xxx"
Expand Down
2 changes: 1 addition & 1 deletion terraform/aws/modules/kali-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ resource "aws_instance" "kali_machine" {
}

resource "aws_eip" "kali_ip" {
count = var.kali_server.kali_server == "1" ? 1 : 0
count = (var.kali_server.kali_server == "1") && (var.aws.use_elastic_ips == "1") ? 1 : 0
instance = aws_instance.kali_machine[0].id
}
2 changes: 1 addition & 1 deletion terraform/aws/modules/linux-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ resource "aws_instance" "linux_server" {
}

resource "aws_eip" "linux_server_ip" {
count = length(var.linux_servers)
count = (var.aws.use_elastic_ips == "1") ? length(var.linux_servers) : 0
instance = aws_instance.linux_server[count.index].id
}
2 changes: 1 addition & 1 deletion terraform/aws/modules/nginx-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ resource "aws_instance" "nginx_server" {
}

resource "aws_eip" "nginx_server_ip" {
count = var.nginx_server.nginx_server == "1" ? 1 : 0
count = (var.nginx_server.nginx_server == "1") && (var.aws.use_elastic_ips == "1") ? 1 : 0
instance = aws_instance.nginx_server[count.index].id
}
2 changes: 1 addition & 1 deletion terraform/aws/modules/phantom-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ resource "aws_instance" "phantom-server" {
}

resource "aws_eip" "phantom_ip" {
count = var.phantom_server.phantom_server == "1" ? 1 : 0
count = (var.phantom_server.phantom_server == "1") && (var.aws.use_elastic_ips == "1") ? 1 : 0
instance = aws_instance.phantom-server[0].id
}
2 changes: 1 addition & 1 deletion terraform/aws/modules/splunk-server/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ resource "aws_instance" "splunk-server" {
}

resource "aws_eip" "splunk_ip" {
count = var.splunk_server.byo_splunk == "0" ? 1 : 0
count = (var.splunk_server.byo_splunk == "0") && (var.aws.use_elastic_ips == "1") ? 1 : 0
instance = aws_instance.splunk-server[0].id
}
2 changes: 1 addition & 1 deletion terraform/aws/modules/windows/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ EOF
}

resource "aws_eip" "windows_ip" {
count = length(var.windows_servers)
count = (var.aws.use_elastic_ips == "1") ? length(var.windows_servers) : 0
instance = aws_instance.windows_server[count.index].id
}

0 comments on commit 20e92c3

Please sign in to comment.
0