Question

Difficulty: EasyIAM Policies, Roles, and Service Control Policies (SCPs)

A SysOps administrator is launching a new Amazon EC2 instance that must run an application that accesses an Amazon S3 bucket. An IAM role with the necessary S3 permissions has already been created. The administrator needs to configure the EC2 instance to run the application using this role.

Which two actions are required to successfully complete this configuration? (Select TWO.)

  1. Associate the IAM role with an instance profile, and attach the instance profile to the EC2 instance.Answer
  2. Ensure the administrator's IAM user identity is granted the iam:PassRole permission for the specific IAM role.Answer
  3. C
    Ensure the administrator's IAM user identity is granted the sts:AssumeRole permission for the specific IAM role.
  4. D
    Update the trust policy of the IAM role to allow the administrator's IAM user identity to assume the role.

Answer

The correct actions are associating the IAM role with an instance profile to attach it to the EC2 instance, and ensuring the administrator's IAM user identity has the iam:PassRole permission.
To configure an EC2 instance to run an application with specific IAM permissions, you must wrap the IAM role inside an instance profile and attach it to the EC2 instance. Furthermore, the administrator who performs this attachment must possess the iam:PassRole permission to authorize passing the role to the EC2 service.

Step-by-Step Solution

1
Determine how roles are attached to EC2 instances.
EC2 instances require an instance profile wrapper to hold the IAM role.
The EC2 service uses instance profiles to pass role credentials to the instance's metadata service.
2
Determine the required user permissions for delegating the role.
The user launching or configuring the instance must have the iam:PassRole permission.
To prevent unauthorized delegation of administrative privileges, AWS requires that users have explicit permission to pass roles to services.

Key Concept

Delegating AWS permissions to EC2 instances using Instance Profiles and the iam:PassRole permission
Rate this question