Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

short issue description #1043

Closed
shahid23-dev opened this issue Mar 28, 2024 · 7 comments
Closed

short issue description #1043

shahid23-dev opened this issue Mar 28, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@shahid23-dev
Copy link

shahid23-dev commented Mar 28, 2024

Describe the bug

Error: Could not assume role with OIDC: No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com

Expected Behavior

should able to configure

Current Behavior

Error: Could not assume role with OIDC: No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com

Reproduction Steps

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::******:oidc-provider/token.actions.githubusercontent.com/"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com/:aud": "sts.amazonaws.com"
},
"StringLike": {
"token.actions.githubusercontent.com/:sub": "repo:shahid23-dev/shahid-project:
"
}
}
}
]
}

Sample workflow to access AWS resources when workflow is tied to branch

The workflow Creates static website using aws s3

name: s3 workflow
on:
push
env:
BUCKET_NAME : "shahid-terraform-bucket"
AWS_REGION : "us-east-1"

permission can be added at job level or workflow level

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
S3PackageUpload:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Git clone the repository
uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::*********:role/github-actions-role
role-session-name: github-actions-role
aws-region: ${{ env.AWS_REGION }}
# Upload a file to AWS s3
- name: Copy index.html to s3
run: |
aws s3 cp ./index.html s3://${{ env.BUCKET_NAME }}/

Possible Solution

No response

Additional Information/Context

No response

@shahid23-dev shahid23-dev added bug Something isn't working needs-triage This issue still needs to be triaged labels Mar 28, 2024
@BogdanDarius
Copy link

BogdanDarius commented Mar 28, 2024

@zhavir
Copy link

zhavir commented Mar 28, 2024

I've also the same issue. I've followed the full guide, step by step. Workflow is returning Error: Could not assume role with OIDC: The requested DurationSeconds exceeds the MaxSessionDuration set for this role.

@zhavir
Copy link

zhavir commented Mar 28, 2024

probably I've find out the issue @shahid23-dev. You must provide the same time, or below, the one configured inside Maximum session duration of your Github Role. For example if you have set as Maximum session duration = 1h, you also need to specify in your github workflow role-duration-seconds: 1200

@tim-finnigan tim-finnigan self-assigned this Mar 29, 2024
@tim-finnigan tim-finnigan added investigating and removed needs-triage This issue still needs to be triaged labels Mar 29, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out and commenting here - @shahid23-dev does the suggestion in the above comment resolve your issue?

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 5 days. and removed investigating labels Mar 29, 2024
@tim-finnigan tim-finnigan removed their assignment Mar 29, 2024
@shahid23-dev
Copy link
Author

probably I've find out the issue @shahid23-dev. You must provide the same time, or below, the one configured inside Maximum session duration of your Github Role. For example if you have set as Maximum session duration = 1h, you also need to specify in your github workflow role-duration-seconds: 1200

thanks dude. it helped

@shahid23-dev
Copy link
Author

Thanks for reaching out and commenting here - @shahid23-dev does the suggestion in the above comment resolve your issue?

resolved , Thanks :)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 5 days. label Mar 30, 2024
@tim-finnigan tim-finnigan self-assigned this Mar 30, 2024
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants