Question
A company uses several AWS CloudFormation stacks to handle the deployment of a suite of applications. The leader of the company's application development team notices that the stack deployments fail with permission errors when some team members try to deploy the stacks. However, other team members can deploy the stacks successfully.
The team members access the account by assuming a role that has a specific set of permissions that are necessary for the job responsibilities of the team members. All team members have permissions to perform operations on the stacks.
Which combination of steps will ensure consistent deployment of the stacks MOST securely? (Choose three.)
- A. Create a service role that has a composite principal that contains each service that needs the necessary permissions. Configure the role to allow the sts:AssumeRole action.
- B. Create a service role that has cloudformation.amazonaws.com as the service principal. Configure the role to allow the sts:AssumeRole action. Correct
- C. For each required set of permissions, add a separate policy to the role to allow those permissions. Add the ARN of each CloudFormation stack in the resource field of each policy.
- D. For each required set of permissions, add a separate policy to the role to allow those permissions. Add the ARN of each service that needs the permissions in the resource field of the corresponding policy. Correct
- E. Update each stack to use the service role. Correct
- F. Add a policy to each member role to allow the iam:PassRole action. Set the policy's resource field to the ARN of the service role.
Explanation
B, D and E are correct. A CloudFormation service role uses cloudformation.amazonaws.com as the trusted service principal (B). The role gets the permissions that stack operations need, split into separate policies that are scoped to the resources each one needs (D). Each stack is then updated to use the service role (E). CloudFormation then makes every stack call with the role's credentials, not with the caller's credentials, so deployments behave the same no matter which team member runs them. A composite principal (A) trusts more services than needed. Scoping the policies only to stack ARNs (C) does not grant permissions on the resources the stacks create. Giving every member role iam:PassRole (F) is not needed: once a service role is attached to a stack, any user who can operate on that stack uses the role even without iam:PassRole, so adding it widens permissions for no benefit.