|
@@ -13,28 +13,28 @@ data "aws_kms_key" "ebs-key" {
|
|
|
key_id = "alias/ebs_root_encrypt_decrypt"
|
|
|
}
|
|
|
|
|
|
-resource "aws_network_interface" "nessus-receiver-interface" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+resource "aws_network_interface" "nessus-manager-interface" {
|
|
|
+ count = var.nessus_manager_count
|
|
|
subnet_id = var.public_subnets[count.index % 3]
|
|
|
- security_groups = [ data.aws_security_group.typical-host.id, aws_security_group.nessus_receiver.id ]
|
|
|
- description = "nessus-receiver-${count.index}"
|
|
|
- tags = merge(var.standard_tags, var.tags, { Name = "nessus-receiver-${count.index}" })
|
|
|
+ security_groups = [ data.aws_security_group.typical-host.id, aws_security_group.nessus_manager.id ]
|
|
|
+ description = "nessus-manager-${count.index}"
|
|
|
+ tags = merge(var.standard_tags, var.tags, { Name = "nessus-manager-${count.index}" })
|
|
|
}
|
|
|
|
|
|
resource "aws_eip" "instance" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+ count = var.nessus_manager_count
|
|
|
vpc = true
|
|
|
- tags = merge(var.standard_tags, var.tags, { Name = "nessus-receiver-${count.index}" })
|
|
|
+ tags = merge(var.standard_tags, var.tags, { Name = "nessus-manager-${count.index}" })
|
|
|
}
|
|
|
|
|
|
resource "aws_eip_association" "instance" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
- network_interface_id = aws_network_interface.nessus-receiver-interface[count.index].id
|
|
|
+ count = var.nessus_manager_count
|
|
|
+ network_interface_id = aws_network_interface.nessus-manager-interface[count.index].id
|
|
|
allocation_id = aws_eip.instance[count.index].id
|
|
|
}
|
|
|
|
|
|
-resource "aws_instance" "nessus-receiver-instance" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+resource "aws_instance" "nessus-manager-instance" {
|
|
|
+ count = var.nessus_manager_count
|
|
|
tenancy = "default"
|
|
|
ebs_optimized = true
|
|
|
disable_api_termination = var.instance_termination_protection
|
|
@@ -138,21 +138,21 @@ resource "aws_instance" "nessus-receiver-instance" {
|
|
|
|
|
|
network_interface {
|
|
|
device_index = 0
|
|
|
- network_interface_id = aws_network_interface.nessus-receiver-interface[count.index].id
|
|
|
+ network_interface_id = aws_network_interface.nessus-manager-interface[count.index].id
|
|
|
}
|
|
|
|
|
|
user_data = data.template_cloudinit_config.cloud-init[count.index].rendered
|
|
|
- tags = merge( var.standard_tags, var.tags, { Name = "nessus-receiver-${count.index}" })
|
|
|
- volume_tags = merge( var.standard_tags, var.tags, { Name = "nessus-receiver-${count.index}" })
|
|
|
+ tags = merge( var.standard_tags, var.tags, { Name = "nessus-manager-${count.index}" })
|
|
|
+ volume_tags = merge( var.standard_tags, var.tags, { Name = "nessus-manager-${count.index}" })
|
|
|
}
|
|
|
|
|
|
data "template_file" "cloud-init" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+ count = var.nessus_manager_count
|
|
|
template = file("${path.module}/cloud-init/cloud-init.tpl")
|
|
|
|
|
|
vars = {
|
|
|
- hostname = "nessus-receiver-${count.index}"
|
|
|
- fqdn = "nessus-receiver-${count.index}.${var.dns_info["private"]["zone"]}"
|
|
|
+ hostname = "nessus-manager-${count.index}"
|
|
|
+ fqdn = "nessus-manager-${count.index}.${var.dns_info["private"]["zone"]}"
|
|
|
environment = var.environment
|
|
|
salt_master = var.salt_master
|
|
|
proxy = var.proxy
|
|
@@ -165,7 +165,7 @@ data "template_file" "cloud-init" {
|
|
|
# Render a multi-part cloud-init config making use of the part
|
|
|
# above, and other source files
|
|
|
data "template_cloudinit_config" "cloud-init" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+ count = var.nessus_manager_count
|
|
|
gzip = true
|
|
|
base64_encode = true
|
|
|
|
|
@@ -183,12 +183,12 @@ data "template_cloudinit_config" "cloud-init" {
|
|
|
#}
|
|
|
}
|
|
|
|
|
|
-module "private_dns_record_nessus-receiver" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+module "private_dns_record_nessus-manager" {
|
|
|
+ count = var.nessus_manager_count
|
|
|
source = "../../../submodules/dns/private_A_record"
|
|
|
|
|
|
- name = "nessus-receiver-${count.index}"
|
|
|
- ip_addresses = [ aws_instance.nessus-receiver-instance[count.index].private_ip ]
|
|
|
+ name = "nessus-manager-${count.index}"
|
|
|
+ ip_addresses = [ aws_instance.nessus-manager-instance[count.index].private_ip ]
|
|
|
dns_info = var.dns_info
|
|
|
reverse_enabled = var.reverse_enabled
|
|
|
|
|
@@ -197,11 +197,11 @@ module "private_dns_record_nessus-receiver" {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-module "public_dns_record_nessus-receiver" {
|
|
|
- count = var.nessus_receiver_count
|
|
|
+module "public_dns_record_nessus-manager" {
|
|
|
+ count = var.nessus_manager_count
|
|
|
source = "../../../submodules/dns/public_A_record"
|
|
|
|
|
|
- name = "nessus-receiver-${count.index}"
|
|
|
+ name = "nessus-manager-${count.index}"
|
|
|
ip_addresses = [ aws_eip.instance[count.index].public_ip ]
|
|
|
dns_info = var.dns_info
|
|
|
|