The packer program use your credentials to make API directly. Nor
credentials is passed to the EC2 instance launched. The canonical way of
giving it AWS API access is by using iam_instance_profile.
See https://packer.io/docs/builders/amazon-ebs.html#iam_instance_profile
On Wed, Oct 9, 2019,
The documentation is a bit vague about how credential passing works. I've
given the packer server all of the credentials it needs for the amazon ebs
builder including iam:passrole for * resources in its instance profile, and
I removed all other references to IAM from the json template. I