A SysOps administrator with the IAM user name `ManagerUser` in Account A () needs to launch an Amazon EC2 instance that runs automated deployment scripts. The scripts will create IAM roles and attach permissions policies. The instance must run with an IAM instance profile associated with the IAM role named `DeploymentWorkerRole`.
An organization-level Service Control Policy (SCP) is attached to the Organizational Unit (OU) containing Account A:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestrictRoleCreation",
"Effect": "Deny",
"Action": [
"iam:CreateRole",
"iam:AttachRolePolicy"
],
"Resource": "*",
"Condition": {
"ArnNotEquals": {
"aws:PrincipalARN": "arn:aws:iam::111122223333:role/DeploymentWorkerRole"
}
}
}
]
}
`ManagerUser` has an IAM policy attached that grants full access to EC2 and Auto Scaling (`ec2:*` and `autoscaling:*`). When `ManagerUser` attempts to launch the EC2 instance using the AWS CLI and specifies the `DeploymentWorkerRole` instance profile, the operation fails with an `UnauthorizedOperation` error.
Which configuration change is required to resolve this issue and successfully launch the EC2 instance?
- AThe trust policy of the DeploymentWorkerRole must be updated to allow the ManagerUser principal to perform the sts:AssumeRole action.
- BThe KMS key policy of the default key used for EBS encryption must be updated to allow the ManagerUser to perform the kms:Decrypt and kms:GenerateDataKey actions.
- The administrator's IAM policy must be updated to grant the iam:PassRole permission for the DeploymentWorkerRole resource.Answer
- DThe route table for the subnet must be updated to associate a gateway endpoint for S3 and EC2, resolving the connectivity failure.