rancher / tf-rancher-up

MIT License
14 stars 5 forks source link

AWS RKE2 upstream deployment error #120

Open ajithijk opened 4 months ago

ajithijk commented 4 months ago

While trying to deploy an upstream RKE2 on was, the below error is shown.

│ Warning: Value for undeclared variable │ │ The root module does not declare a variable named "ssh_private_key_path" but a value was found in file "terraform.tfvars". If you meant to use this value, add a "variable" block to the configuration. │ │ To silence these warnings, use TFVAR... environment variables to provide certain "global" settings to all configurations in your organization. To reduce the verbosity of these warnings, use the │ -compact-warnings option. ╵

Invalid attribute in provider configuration

with module.rancher_install.provider["registry.terraform.io/hashicorp/kubernetes"], on ../../../../modules/rancher/provider.tf line 7, in provider "kubernetes": 7: provider "kubernetes" {

'config_path' refers to an invalid path: "/Users/ajithrajan/RancherLabs/tf-aws-rke2-6may/tf-rancher-up/recipes/upstream/aws/rke2/ajithr6may_kube_config.yml": stat /Users/ajithrajan/RancherLabs/tf-aws-rke2-6may/tf-rancher-up/recipes/upstream/aws/rke2/ajithr6may_kube_config.yml: no such file or directory

╷ │ Error: Invalid function argument │ │ on variables.tf line 82, in variable "rancher_password": │ 82: condition = length(var.rancher_password) >= 12 │ ├──────────────── │ │ while calling length(value) │ │ var.rancher_password is null │ │ Invalid value for "value" parameter: argument must not be null. ╵ ╷ │ Error: Invalid function argument │ │ on ../../../../modules/infra/aws/outputs.tf line 29, in output "ssh_key": │ 29: value = var.create_ssh_key_pair ? tls_private_key.ssh_private_key[0].private_key_openssh : (var.ssh_key_pair_path != null ? file(pathexpand(var.ssh_key_pair_path)) : var.ssh_key) │ ├──────────────── │ │ while calling file(path) │ │ var.ssh_key_pair_path is "/Users/ajithrajan/RancherLabs/tf-aws-rke2-6may/tf-rancher-up/recipes/upstream/aws/rke2/ajithr6may-ssh_private_key.pem" │ │ Invalid value for "path" parameter: no file exists at "/Users/ajithrajan/RancherLabs/tf-aws-rke2-6may/tf-rancher-up/recipes/upstream/aws/rke2/ajithr6may-ssh_private_key.pem"; this function works only with files │ that are distributed as part of the configuration source code, so if this file will be created by a resource in this configuration you must instead obtain this result from an attribute of that resource. ╵

ajithijk commented 4 months ago

rancher_password error is not shown if we uncomment the default value in terrform.tfvars and set that variable but that shouldn't be the case.

zaggash commented 4 months ago

Dup of https://github.com/rancherlabs/tf-rancher-up/issues/119

dkeightley commented 3 months ago

Sharing the comment from #119, if we can verify this, the changes in this PR might need reviewing.