Team,
Am using variables block to get the secret from the secret manager and which is working fine. When my secrets having multiple keys it's not able to fetch the correct one. I've tried to mention the key ( example vsphere_passwd) while calling the secrets in variable but it's not working.
My initial code is:(Pasted only the relevant section)
"variables": {
"vsphere_uid" : "{{ aws_secretsmanager `vsphere_service_account` }}",
"vm_superuser_passwd" : "{{ aws_secretsmanager (`vm-superuser-password`, `password`) }}",
}
➜ git:(packer/centos7) ✗ PACKER_LOG_PATH="packerlog.txt" PACKER_LOG=1 AWS_REGION=us-east-1 packer build -var 'vsphere_vm_name=test' centos7.json
Error initializing core: error interpolating default value for 'vm_superuser_passwd': template: root:1: unexpected "," in operand
The code is : (Pasted only the relevant section)
```
"locals": {
"secret" : "{{ aws_secretsmanager(\"vm-user-password\", \"password\") }}"
},
The error is :
```
➜ onprem_packer git:(packer/centos7) ✗ AWS_REGION=us-east-1 packer build -var 'vsphere_vm_name=test' centos7.json
Failed to parse template: 1 error occurred:
* Unknown root level key in template: 'locals'
==> Builds finished but no artifacts were created.
➜ onprem_packer git:(packer/centos7) ✗ packer --version
1.5.6
```
Any suggestions?
---
Best regards,
Gowtham
07798838879
=====================
Learn from mistakes....
Please consider the environment before printing this email - Thanks