Skip to content

Commit

Permalink
chore: (IAC-1196) resolving ssh file error
Browse files Browse the repository at this point in the history
  • Loading branch information
riragh committed Oct 25, 2023
1 parent 52710b9 commit 1fbac69
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 11 additions & 0 deletions linting-configs/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ plugin "terraform" {
rule "azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size" {
enabled = false
}

# We specify the versions and providers in the top level versions.tf.
# This stops it from throwing a warning when scanning our modules
# in viya4-iac-azure/modules/
rule "terraform_required_version" {
enabled = false
}

rule "terraform_required_providers" {
enabled = false
}
7 changes: 6 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
locals {

# Useful flags
# ssh_public_key = (var.create_jump_vm || var.storage_type == "standard"
# ? file(var.ssh_public_key)
# : null
# )

ssh_public_key = (var.create_jump_vm || var.storage_type == "standard"
? file(var.ssh_public_key)
? can(file(var.ssh_public_key)) ? file(var.ssh_public_key) : var.ssh_public_key != null ? length(var.ssh_public_key) > 0 ? var.ssh_public_key : null : null
: null
)

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ variable "fips_enabled" {
variable "ssh_public_key" {
description = "A custom ssh key to control access to the AKS cluster. Changing this forces a new resource to be created."
type = string
default = ""
default = null
}

variable "default_public_access_cidrs" {
Expand Down

0 comments on commit 1fbac69

Please sign in to comment.