An organization manages its multi-account environment using AWS Organizations. A SysOps administrator is configuring a deployment script on an Amazon EC2 instance in member Account A (). The EC2 instance is associated with an IAM instance profile that uses a role named `DeployerRole`.
The deployment script must launch new EC2 instances for an application tier and associate them with an existing IAM role named `ApplicationRole` in the same account. The administrator has attached the following IAM policy to the `DeployerRole`:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EC2RunInstances",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": "*"
},
{
"Sid": "AssumeApplicationRole",
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::123456789012:role/ApplicationRole"
}
]
}
At the organization root, a Service Control Policy (SCP) is attached that includes the following statement to prevent unauthorized IAM modifications:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceIAMGuardrails",
"Effect": "Deny",
"Action": [
"iam:Create*",
"iam:Delete*",
"iam:Update*"
],
"Resource": "*"
}
]
}
When the script executes, the attempt to launch the new EC2 instances fails with an `UnauthorizedOperation` error. Which action must the SysOps administrator take to resolve this issue and allow the script to successfully launch the instances?
- Modify the IAM policy attached to DeployerRole by replacing the 'AssumeApplicationRole' statement with a statement that allows the 'iam:PassRole' action on 'arn:aws:iam::123456789012:role/ApplicationRole'.Cevap
- BModify the trust policy of ApplicationRole to add the ARN of DeployerRole as a trusted principal, enabling DeployerRole to perform the 'sts:AssumeRole' action.
- CModify the trust policy of DeployerRole to allow the EC2 service principal ('ec2.amazonaws.com') to assume it, allowing the service to delegate permissions.
- DModify the SCP at the organization root to replace the deny statement for 'iam:Create*' with a statement that explicitly excludes 'iam:CreateInstanceProfile' via a NotAction element.