When I run this : awsv packer build -var sm_rt_auth_token_name=rt-token-NE2sQX -var aws_region=us-east-1 -var builder_instance_type=t2.micro eks-node.pkr.hcl
I get this error :
Error: Error in function call
on eks-node.pkr.hcl line 42:
(source code not available)
with var.sm_rt_auth_token_name as “rt-token-NE2sQX”.
Call to function “aws_secretsmanager” failed: MissingRegion: could not find
region configuration.
As an artifact of the way the AWS plugin is built, I don’t think the region information gets shared between the AWS builder and this secretsmanager function.
Since you’re in HCL, I’d recommend using the secrets manager data source instead: Secrets Manager - Data Source | Packer by HashiCorp, which allows you to define the authentication inside the data source so that it doesn’t get lost.