Skip to content

Commit

Permalink
style(terraform): terraform fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ric Featherstone authored and prit342 committed Jan 9, 2024
1 parent 3c85566 commit 0fa5264
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .trivy-config/.trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions terraform/modules/ansible-config/ansible-config.tf
Original file line number Diff line number Diff line change
@@ -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)
}
2 changes: 1 addition & 1 deletion terraform/modules/ansible-config/ansible-inventory.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion terraform/modules/cluster/cloud-config.tf
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion terraform/modules/cluster/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
]...)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]

Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions terraform/modules/ssh-config/ssh-config.tf
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion terraform/workspaces/simulator-iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down

0 comments on commit 0fa5264

Please sign in to comment.