Terraform Version
Terraform v0.15.0-beta2
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.33.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0
Terraform Configuration Files
located here:
https://github.com/surfd4wg/terraform_rsadecrypt_debug
Debug Output
terraform.log located here:
Crash Output
terraform init - passes.
terraform plan - Error: Invalid Function Argument
│
│ on outputs.tf line 20, in output “Admin_Password_rsadecrypted”:
│ 20: value = rsadecrypt(aws_instance.winrm.*.password_data, file(var.private_key_path))
│ ├────────────────
│ │ aws_instance.winrm is tuple with 2 elements
│
│ Invalid value for “ciphertext” parameter: string required.
Expected Behavior
The output of Admin_Password_rsadecrypted should be the decrypted password. This works without the count variable in the aws_instance block in main.tf. Adding the .*. to Admin_Password_rsadecrypted causes it to Error. If I have count = 2 Windows Servers, I would expect the output to display the Windows Administrator password for both servers.
Actual Behavior
Invalid ciphertext error message.
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
terraform init
-
terraform plan
also, if you comment out the Admin_Password_decrypted line in outputs.tf, you will see that Admin_Password outputs the correct base64 encoded string.
Additional Context
Because Admin_Password outputs the correct base64 string, I believe adding the .*. for the count variable, somehow causes rsadecrypt to not accept the value.
References
Originally posted as a bug, but was asked to redirect to this community.
Looking for help.
Thank you