Fix terraform fmt

This commit is contained in:
Dalton Hubble 2020-03-31 21:42:51 -07:00
parent bbbaf949f9
commit 3c1be7b0e0
13 changed files with 40 additions and 40 deletions

View File

@ -31,15 +31,15 @@ resource "aws_route_table" "default" {
}
resource "aws_route" "egress-ipv4" {
route_table_id = aws_route_table.default.id
route_table_id = aws_route_table.default.id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.gateway.id
gateway_id = aws_internet_gateway.gateway.id
}
resource "aws_route" "egress-ipv6" {
route_table_id = aws_route_table.default.id
route_table_id = aws_route_table.default.id
destination_ipv6_cidr_block = "::/0"
gateway_id = aws_internet_gateway.gateway.id
gateway_id = aws_internet_gateway.gateway.id
}
# Subnets (one per availability zone)

View File

@ -18,7 +18,7 @@ module "workers" {
ssh_authorized_key = var.ssh_authorized_key
service_cidr = var.service_cidr
cluster_domain_suffix = var.cluster_domain_suffix
snippets = var.worker_snippets
snippets = var.worker_snippets
node_labels = var.worker_node_labels
}

View File

@ -31,15 +31,15 @@ resource "aws_route_table" "default" {
}
resource "aws_route" "egress-ipv4" {
route_table_id = aws_route_table.default.id
route_table_id = aws_route_table.default.id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.gateway.id
gateway_id = aws_internet_gateway.gateway.id
}
resource "aws_route" "egress-ipv6" {
route_table_id = aws_route_table.default.id
route_table_id = aws_route_table.default.id
destination_ipv6_cidr_block = "::/0"
gateway_id = aws_internet_gateway.gateway.id
gateway_id = aws_internet_gateway.gateway.id
}
# Subnets (one per availability zone)

View File

@ -65,9 +65,9 @@ resource "azurerm_linux_virtual_machine" "controllers" {
for_each = local.flavor == "flatcar" ? [1] : []
content {
name = local.channel
name = local.channel
publisher = "kinvolk"
product = "flatcar-container-linux"
product = "flatcar-container-linux"
}
}

View File

@ -19,6 +19,6 @@ module "workers" {
ssh_authorized_key = var.ssh_authorized_key
service_cidr = var.service_cidr
cluster_domain_suffix = var.cluster_domain_suffix
snippets = var.worker_snippets
snippets = var.worker_snippets
node_labels = var.worker_node_labels
}

View File

@ -9,19 +9,19 @@ locals {
resource "azurerm_linux_virtual_machine_scale_set" "workers" {
resource_group_name = var.resource_group_name
name = "${var.name}-worker"
location = var.region
sku = var.vm_type
name = "${var.name}-worker"
location = var.region
sku = var.vm_type
instances = var.worker_count
# instance name prefix for instances in the set
computer_name_prefix = "${var.name}-worker"
computer_name_prefix = "${var.name}-worker"
single_placement_group = false
custom_data = base64encode(data.ct_config.worker-ignition.rendered)
custom_data = base64encode(data.ct_config.worker-ignition.rendered)
# storage
os_disk {
storage_account_type = "Standard_LRS"
caching = "ReadWrite"
caching = "ReadWrite"
}
source_image_reference {
@ -36,16 +36,16 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" {
for_each = local.flavor == "flatcar" ? [1] : []
content {
name = local.channel
name = local.channel
publisher = "kinvolk"
product = "flatcar-container-linux"
product = "flatcar-container-linux"
}
}
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too
admin_username = "core"
admin_ssh_key {
username = "core"
username = "core"
public_key = var.ssh_authorized_key
}

View File

@ -144,7 +144,7 @@ data "ct_config" "controller-ignitions" {
count = length(var.controllers)
content = data.template_file.controller-configs.*.rendered[count.index]
pretty_print = false
snippets = lookup(var.snippets, var.controllers.*.name[count.index], [])
snippets = lookup(var.snippets, var.controllers.*.name[count.index], [])
}
data "template_file" "controller-configs" {
@ -174,7 +174,7 @@ data "ct_config" "worker-ignitions" {
count = length(var.workers)
content = data.template_file.worker-configs.*.rendered[count.index]
pretty_print = false
snippets = lookup(var.snippets, var.workers.*.name[count.index], [])
snippets = lookup(var.snippets, var.workers.*.name[count.index], [])
}
data "template_file" "worker-configs" {

View File

@ -56,15 +56,15 @@ variable "snippets" {
}
variable "worker_node_labels" {
type = map(list(string))
type = map(list(string))
description = "Map from worker names to lists of initial node labels"
default = {}
default = {}
}
variable "worker_node_taints" {
type = map(list(string))
type = map(list(string))
description = "Map from worker names to lists of initial node taints"
default = {}
default = {}
}
# configuration

View File

@ -48,8 +48,8 @@ resource "matchbox_profile" "controllers" {
data "ct_config" "controller-ignitions" {
count = length(var.controllers)
content = data.template_file.controller-configs.*.rendered[count.index]
strict = true
content = data.template_file.controller-configs.*.rendered[count.index]
strict = true
snippets = lookup(var.snippets, var.controllers.*.name[count.index], [])
}
@ -84,8 +84,8 @@ resource "matchbox_profile" "workers" {
data "ct_config" "worker-ignitions" {
count = length(var.workers)
content = data.template_file.worker-configs.*.rendered[count.index]
strict = true
content = data.template_file.worker-configs.*.rendered[count.index]
strict = true
snippets = lookup(var.snippets, var.workers.*.name[count.index], [])
}

View File

@ -57,15 +57,15 @@ variable "snippets" {
}
variable "worker_node_labels" {
type = map(list(string))
type = map(list(string))
description = "Map from worker names to lists of initial node labels"
default = {}
default = {}
}
variable "worker_node_taints" {
type = map(list(string))
type = map(list(string))
description = "Map from worker names to lists of initial node taints"
default = {}
default = {}
}
# configuration

View File

@ -1,5 +1,5 @@
locals {
official_images = ["coreos-stable", "coreos-beta", "coreos-alpha"]
official_images = ["coreos-stable", "coreos-beta", "coreos-alpha"]
is_official_image = contains(local.official_images, var.os_image)
}

View File

@ -17,7 +17,7 @@ module "workers" {
ssh_authorized_key = var.ssh_authorized_key
service_cidr = var.service_cidr
cluster_domain_suffix = var.cluster_domain_suffix
snippets = var.worker_snippets
snippets = var.worker_snippets
node_labels = var.worker_node_labels
}

View File

@ -71,9 +71,9 @@ resource "google_compute_instance_template" "worker" {
# Worker Ignition config
data "ct_config" "worker-ignition" {
content = data.template_file.worker-config.rendered
strict = true
snippets = var.snippets
content = data.template_file.worker-config.rendered
strict = true
snippets = var.snippets
}
# Worker Fedora CoreOS config