-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathinputs.tf
66 lines (55 loc) · 1.95 KB
/
inputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
## Provision a Nessus Scanner ##
variable "scanner_name" {
description = "The name of your Nessus scanner as it will appear in the Tenable.io web UI. Defaults to the AWS instance name."
type = string
default = null
}
variable "tenable_linking_key" {
description = "The linking code from tenable.io — Go to Scans > Scanners in the web UI and find the Linking Key there"
type = string
}
variable "vpc_id" {
description = "The VPC with which security groups will be associated"
type = string
}
variable "subnet_id" {
description = "Subnet in which the server and related objects will be created"
type = string
}
variable "instance_type" {
description = "The type of instance, e.g. m3.large, c3.2xlarge, etc. to be spun up"
type = string
default = "m5.xlarge"
}
variable "instance_name" {
description = "The name of the instance as it appears in the aws instance list. Overrides any name passed in instance_tags."
type = string
default = null
}
variable "instance_tags" {
description = "A map of tags to apply to the instance"
type = map(any)
default = {}
}
variable "use_eip" {
description = "Whether or not to use an Elastic IP address with the Nessus scanner. Defaults to true because the documentation says it is required."
type = bool
default = true
}
variable "extra_filters" {
description = "Additional filters for the AMI search"
type = list(object({
name = string
values = list(string)
}))
default = []
}
## Process some inputs into a map of tags, then use those instead
locals {
instance_name = coalesce(
var.instance_name, # Prefer explicit name input
lookup(var.instance_tags, "Name", null), # Allow naming with tags
"nessus-scanner" # Default instance name
)
instance_tags = merge(var.instance_tags, { "Name" = local.instance_name }) # The right-most map's value always wins
}