From 0fa5264e868a7f4ac89edb15f7a015c689b8f74f Mon Sep 17 00:00:00 2001 From: Ric Featherstone Date: Mon, 8 Jan 2024 12:54:56 +0000 Subject: [PATCH] style(terraform): terraform fmt --- .trivy-config/.trivyignore | 2 ++ terraform/modules/ansible-config/ansible-config.tf | 4 ++-- .../modules/ansible-config/ansible-inventory.tf | 2 +- terraform/modules/cluster/cloud-config.tf | 2 +- terraform/modules/cluster/locals.tf | 2 +- .../cluster/modules/instance-group/instances.tf | 2 +- terraform/modules/cluster/variables.tf | 4 ++-- terraform/modules/ssh-config/ssh-config.tf | 14 +++++++------- terraform/workspaces/simulator-iam/main.tf | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.trivy-config/.trivyignore b/.trivy-config/.trivyignore index 11c06c2d..53e5e7bb 100644 --- a/.trivy-config/.trivyignore +++ b/.trivy-config/.trivyignore @@ -26,3 +26,5 @@ CVE-2022-32149 # packer being non-responsive isn't a worry and responses # from github shouldn't be an issue CVE-2023-49568 +## Ignoring as it has not been patched in the upstream binary +GHSA-9763-4f94-gfch diff --git a/terraform/modules/ansible-config/ansible-config.tf b/terraform/modules/ansible-config/ansible-config.tf index 96c5d6e7..a7902aea 100644 --- a/terraform/modules/ansible-config/ansible-config.tf +++ b/terraform/modules/ansible-config/ansible-config.tf @@ -1,11 +1,11 @@ locals { ansible_config = templatefile("${path.module}/templates/ansible.cfg", { - roles_path = var.ansible_roles_path + roles_path = var.ansible_roles_path ssh_config_filename = var.ssh_config_filename }) } resource "local_file" "ansible_cfg" { - content = local.ansible_config + content = local.ansible_config filename = format("%s/%s", var.ansible_config_dir, var.ansible_config_filename) } diff --git a/terraform/modules/ansible-config/ansible-inventory.tf b/terraform/modules/ansible-config/ansible-inventory.tf index fc352cf6..30f400b7 100644 --- a/terraform/modules/ansible-config/ansible-inventory.tf +++ b/terraform/modules/ansible-config/ansible-inventory.tf @@ -5,6 +5,6 @@ locals { } resource "local_file" "ansible_inventory" { - content = local.ansible_inventory + content = local.ansible_inventory filename = format("%s/%s", var.ansible_config_dir, var.ansible_inventory_filename) } diff --git a/terraform/modules/cluster/cloud-config.tf b/terraform/modules/cluster/cloud-config.tf index e1982ad5..35e57ad8 100644 --- a/terraform/modules/cluster/cloud-config.tf +++ b/terraform/modules/cluster/cloud-config.tf @@ -1,6 +1,6 @@ data "template_file" "cloud_config" { template = file("${path.module}/templates/cloud-config.yaml") - vars = { + vars = { player_public_key = tls_private_key.player.public_key_openssh } } diff --git a/terraform/modules/cluster/locals.tf b/terraform/modules/cluster/locals.tf index 51615459..815b35d6 100644 --- a/terraform/modules/cluster/locals.tf +++ b/terraform/modules/cluster/locals.tf @@ -7,7 +7,7 @@ locals { instances = merge([for i in module.instances : i.instances]...) hosts_by_group = merge([ - for i, g in var.instance_groups: + for i, g in var.instance_groups : { format("%s", lower(var.instance_groups[i].name)) = keys(module.instances[i].instances) } ]...) } diff --git a/terraform/modules/cluster/modules/instance-group/instances.tf b/terraform/modules/cluster/modules/instance-group/instances.tf index e5351ba9..525ee28e 100644 --- a/terraform/modules/cluster/modules/instance-group/instances.tf +++ b/terraform/modules/cluster/modules/instance-group/instances.tf @@ -8,7 +8,7 @@ resource "aws_instance" "instance" { subnet_id = var.subnet_id associate_public_ip_address = var.associate_public_ip_address hibernation = true - vpc_security_group_ids = [ + vpc_security_group_ids = [ var.security_group_id, ] diff --git a/terraform/modules/cluster/variables.tf b/terraform/modules/cluster/variables.tf index 89fa94c2..bedcbe26 100644 --- a/terraform/modules/cluster/variables.tf +++ b/terraform/modules/cluster/variables.tf @@ -39,12 +39,12 @@ variable "bastion_volume_size" { variable "bastion_ssh_ingress" { description = "List of CIDR blocks to grant ssh access to bastion." - type = list(string) + type = list(string) } variable "instance_groups" { description = "" - type = list(object({ + type = list(object({ name = string count = number ami_id = string diff --git a/terraform/modules/ssh-config/ssh-config.tf b/terraform/modules/ssh-config/ssh-config.tf index 8fe96110..20491c71 100644 --- a/terraform/modules/ssh-config/ssh-config.tf +++ b/terraform/modules/ssh-config/ssh-config.tf @@ -1,16 +1,16 @@ locals { ssh_config = templatefile("${path.module}/templates/ssh_config", { - bastion_ip = var.bastion_ip - instances = var.instances - ssh_user = var.ssh_user - ssh_force_tty = var.ssh_force_tty + bastion_ip = var.bastion_ip + instances = var.instances + ssh_user = var.ssh_user + ssh_force_tty = var.ssh_force_tty ssh_identity_file = var.ssh_identity_file - ssh_known_hosts = var.ssh_known_hosts_file + ssh_known_hosts = var.ssh_known_hosts_file }) } resource "local_file" "ssh_config" { - content = local.ssh_config - filename = format("%s/%s", var.ssh_config_dir, var.ssh_config_file) + content = local.ssh_config + filename = format("%s/%s", var.ssh_config_dir, var.ssh_config_file) file_permission = "0600" } diff --git a/terraform/workspaces/simulator-iam/main.tf b/terraform/workspaces/simulator-iam/main.tf index ad7f7667..d7f66d2d 100644 --- a/terraform/workspaces/simulator-iam/main.tf +++ b/terraform/workspaces/simulator-iam/main.tf @@ -15,7 +15,7 @@ data "aws_iam_policy_document" "simulator_assume_role" { ] principals { - type = "AWS" + type = "AWS" identifiers = [ "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root", ]