You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview
Hello, in order to modify some caracteristics of my instance during build I'm relying on calls with aws-cli from within the instance.
When using the iam_instance_profile parameter I'm expecting to not have to use hardcoded credentials, whenever it's through environement var or parameters.
Expect it's not the case, if the credentials are not explicitly pass through environement var or through the aws-cli parameters, the specified instance profile seems to not be able to catch the credentials.
Run a regular packer build using the above configuration lines.
Expected issue
Issue :
==> nat-instance.amazon-ebs.amz2arm64: Provisioning with shell script: /var/folders/76/jlvbjwjs15z0x9g1ywd4qns00000gq/T/packer-shell4084365834
==> nat-instance.amazon-ebs.amz2arm64:
==> nat-instance.amazon-ebs.amz2arm64: Unable to locate credentials. You can configure credentials by running "aws configure".
==> nat-instance.amazon-ebs.amz2arm64: Provisioning step had errors: Running the cleanup provisioner, if present...
Passing the variables directly through environement var seems to satisfyed the requirement of the cli and present a valid workaround without exposing the credentials too much (I expect once packer as finished it's work, the environement variables to disappear along side the ssh session).
I'm new to Packer and AWS in general, maybe this is an expected outcome and using instance profile do require to pass the credentials in a more obvious for the aws-cli to find them.
Although this seems to go against the AWS policy of using roles and profile rather than hardcoded values.
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview
Hello, in order to modify some caracteristics of my instance during build I'm relying on calls with aws-cli from within the instance.
When using the
iam_instance_profile
parameter I'm expecting to not have to use hardcoded credentials, whenever it's through environement var or parameters.Expect it's not the case, if the credentials are not explicitly pass through environement var or through the aws-cli parameters, the specified instance profile seems to not be able to catch the credentials.
Reproduction Steps
Using an aws-ebs source such as:
Running any aws-cli commands which require credentials such as :
Run a regular
packer build
using the above configuration lines.Expected issue
Issue :
Plugin and Packer version
Packer version: 1.9.4
Amazon plugin: packer-plugin-amazon_v1.3.0_x5.0_darwin_arm64
OS: Macos sonoma 13.3.1
Workaround
Passing the variables directly through environement var seems to satisfyed the requirement of the cli and present a valid workaround without exposing the credentials too much (I expect once packer as finished it's work, the environement variables to disappear along side the ssh session).
Disclaimer
I'm new to Packer and AWS in general, maybe this is an expected outcome and using instance profile do require to pass the credentials in a more obvious for the aws-cli to find them.
Although this seems to go against the AWS policy of using roles and profile rather than hardcoded values.
Log Fragments and crash.log files
Log extract:
The text was updated successfully, but these errors were encountered: