This has been fixed in the newer versions. I've tested using 1.6.4 and which is working perfectly. --- Best regards, Gowtham 07798838879
===================== Learn from mistakes.... Please consider the environment before printing this email - Thanks On Fri, Jan 29, 2021 at 12:06 PM Gowtham <[email protected]> wrote: > 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 > > > After following > https://www.packer.io/docs/from-1.5/functions/contextual/aws_secretsmanager, > have tried to use the local but which is throwing an "Unknown root level > key". > > 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 > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CADB0oFwQtxjyq_yQ7GZEuyUcifRTWFmfd_2HMj6YktK_QMCyMw%40mail.gmail.com.
