A developer is setting up a new AWS CodeBuild project to build and package a containerized application. The developer creates an IAM role named CodeBuildDeploymentRole and attaches the AWSCodeBuildDeveloperAccess managed policy. When the developer initiates a build run, the build fails immediately during the setup phase with the error message: "CodeBuild is not authorized to perform: sts:AssumeRole on the specified credentials role". Which action should the developer take to resolve this failure?
- AAdd a statement to the trust policy of the CodeBuildDeploymentRole that allows the codepipeline.amazonaws.com service principal to assume the role.
- Modify the trust relationship of the CodeBuildDeploymentRole to allow the codebuild.amazonaws.com service principal to perform the sts:AssumeRole action.Cevap
- CAttach an inline permission policy to the CodeBuildDeploymentRole that explicitly allows the sts:AssumeRole action on the role's own ARN.
- DExecute the aws cloudformation continue-update-rollback command to bypass the IAM error and allow the build to proceed.
Cevap
Modify the trust relationship of the CodeBuildDeploymentRole to allow the codebuild.amazonaws.com service principal to perform the sts:AssumeRole action.
The correct answer is to modify the trust relationship of the role to allow the codebuild.amazonaws.com service principal to perform the sts:AssumeRole action. For any AWS service to assume an IAM role, the role's trust policy must explicitly permit the service's principal to perform the sts:AssumeRole API call.
Adım Adım Çözüm
Anahtar Kavram
IAM Service Roles and Trust Relationships
Tahmini Süre:2m 0s