aws-samples / aws-samples/agents4energy

Deploy workflow fails: AWS_ROLE_ARN secret not configured (Credentials could not be loaded)

Open
#186 3 comments 0 reactions 1 assignee Claimed by @waltmayf View on GitHub
Dominant language
TypeScript
Stars
48
Forks
68
PR merge metrics
No merged PRs in 30d

Description

### Summary

After fixing #181 (setting the `AWS_REGION` repo variable), the `Deploy` workflow now gets past the region issue but still fails at the same **Configure AWS credentials** step, for a new reason:

```
##[error]Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers
```

### Evidence

Manually triggered a fresh run on `main` to verify the fix for #181:
https://github.com/aws-samples/agents4energy/actions/runs/28952434939

Log shows `aws-region: us-east-1` resolved correctly this time, but the OIDC role assumption fails:

```
env:
AWS_REGION: us-east-1
...
##[error]Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers
```

### Root cause

`deploy.yml` passes `role-to-assume: ${{ secrets.AWS_ROLE_ARN }}` into `aws-actions/configure-aws-credentials@v4`. The `AWS_ROLE_ARN` repository secret is not set, so the role-to-assume input is empty and OIDC credential loading fails.

Same pattern exists in `.github/workflows/delete-branch-stack.yml:56`.

### Fix

Run `scripts/setup-deploy-role.ts` (already in the repo) against the target AWS account — it creates the OIDC provider + deploy IAM role and sets both the `AWS_ROLE_ARN` secret and `AWS_REGION` variable on the repo. Requires repo admin access and AWS credentials with IAM/STS write access, which I don't have.

Related to #181 (same workflow, same step, next failure in the chain).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.