SimpleNVA: add the option to create additional files

This commit is contained in:
Simone Ruffilli 2022-10-25 18:07:38 +02:00
parent abf3911046
commit 0611d66be7
2 changed files with 18 additions and 2 deletions

View File

@ -21,7 +21,7 @@ locals {
network_interfaces = local.network_interfaces
}))
files = {
files = merge({
"/var/run/nva/ipprefix_by_netmask.sh" = {
content = file("${path.module}/files/ipprefix_by_netmask.sh")
owner = "root"
@ -32,7 +32,13 @@ locals {
owner = "root"
permissions = "0744"
}
}
}, {
for path, attrs in var.files : path => {
content = attrs.content,
owner = attrs.owner,
permissions = attrs.permissions
}
})
network_interfaces = [
for index, interface in var.network_interfaces : {

View File

@ -20,6 +20,16 @@ variable "cloud_config" {
default = null
}
variable "files" {
description = "Map of extra files to create on the instance, path as key. Owner and permissions will use defaults if null."
type = map(object({
content = string
owner = string
permissions = string
}))
default = {}
}
variable "enable_health_checks" {
description = "Configures routing to enable responses to health check probes."
type = bool