Skip to content

Support option to generate session token based on IAM User #370

@semora81

Description

@semora81

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.

  1. inside the assume role context , called with :
    exportCredentials(roleCredentials);

  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/smallThis issue will take less than a day of effort to fixfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions