I have created an instance with instance profile associated. I am trying to run packer on the instance without using access and secret key, hence I am using the profile option.
However, the packer requires a profile name, but the instance profile doesn't create a profile name and also doesn't create credentials under ~/.aws.
I can see the access and secret key associated via the AWS CLI, however it doesn't have a profile name.
[ec2-user@ip-172-31-19-132 ~]$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************3IO2 iam-role
secret_key ****************cFvD iam-role
region ap-southeast-2 imds
As I understand from this answer, access and secret keys are rotated frequently, I am wondering how can I set the profile name to the credentials permanently, so I can refer that in packer.