![](/img/trans.png)
[英]AWS AssumeRole - User is not authorized to perform: sts:AssumeRole on resource
[英]AWS, GitHub Action: User is not authorized to perform: sts:AssumeRole on resource(CodePipeline)
我希望得到 AWS 專家的一些幫助。 我將使用 GitHub 操作執行 AWS CodePipeline。 我正在關注這個例子,我已經為此設置了角色。 但是我測試的時候,出現了這樣的錯誤。
“錯誤:用戶:arn:aws:iam:: :user/lms-test 無權執行:sts:AssumeRole 資源:arn:aws:codepipeline:us-west-1: :lms-test”
為了修復這個錯誤,我還添加了sts:AssumRole
到當前用戶(lms-test),但仍然是同樣的錯誤。 我期待着解決這個問題。
感謝您的時間和考慮。
您的可信策略中缺少某些內容。 改變它如下:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::xxxxxxxxxxx: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:[your-org]/[your-repo]:*"
}
}
}
]
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.