-
Notifications
You must be signed in to change notification settings - Fork 548
Description
New Issue description
I would like to use this action to generate a session token based on an IAM User. This can be done by using the GetSessionToken API call
Original Issue
Hi, i've been trying to get the aws credentials initialized for a job and then run a terraform init on a s3 backend for the terraform state.
after running the configure-aws-credentials action there is no AWS_SESSION_TOKEN set.
I dumped the env var to validate :
AWS_DEFAULT_REGION=ca-central-1
AWS_REGION=ca-central-1
AWS_SECRET_ACCESS_KEY=***
AWS_ACCESS_KEY_ID=***
so when I get to running terraform it tells me : Error: error configuring S3 Backend: IAM Role xxxxx cannot be assumed.
When I look at the code, the function exportCredentials is where this env variable is set but, it is only referenced in two locations.
-
inside the assume role context , called with :
exportCredentials(roleCredentials); -
early in the run function to export the accesKeyId and secretAccessKey env variables.
if I am not assuming a role, sessionToken is never initialized it seems and never exported.
am I missing something? pretty new to actions so any help will be appreciated!