A SysOps administrator is configuring an Amazon EC2 Image Builder pipeline in Account A () to build custom machine images. The pipeline is configured to run using an IAM role named `ImageBuilderPipelineExecutionRole`. During the build process, the pipeline launches an EC2 instance that must run with an IAM instance profile associated with the IAM role `ImageBuilderBuildRole`. When the pipeline is executed, it fails during the build phase with an Access Denied error when attempting to launch the EC2 build instance. The `ImageBuilderPipelineExecutionRole` permissions policy contains permissions for `imagebuilder:*` and `ec2:*` actions but does not contain any other permissions. Which modification to the IAM policies will resolve this error?
- AAdd `sts:AssumeRole` permissions for the `ImageBuilderBuildRole` resource to the `ImageBuilderPipelineExecutionRole` permissions policy.
- BModify the trust policy of `ImageBuilderBuildRole` to allow the `ImageBuilderPipelineExecutionRole` to perform the `sts:AssumeRole` action.
- Add `iam:PassRole` permissions for the `ImageBuilderBuildRole` resource to the `ImageBuilderPipelineExecutionRole` permissions policy.Cevap
- DAttach a policy to `ImageBuilderBuildRole` allowing it to perform the `sts:AssumeRole` action on the `ImageBuilderPipelineExecutionRole` resource.
Cevap
Add `iam:PassRole` permissions for the `ImageBuilderBuildRole` resource to the `ImageBuilderPipelineExecutionRole` permissions policy.
To launch an Amazon EC2 instance with an IAM role associated, the principal launching the instance (in this case, the EC2 Image Builder pipeline execution role) must have `iam:PassRole` permissions on the role being passed to the instance (`ImageBuilderBuildRole`). This allows the pipeline to safely delegate the role to the EC2 service for the build instance.
Adım Adım Çözüm
Anahtar Kavram
IAM Role Delegation and the PassRole Permission
Tahmini Süre:2m 0s