AWS Certified Solutions Architect - Associate Practice Questions

AWS Certified Solutions Architect - Associate (SAA-C03) exam preparation

AWS Certified Solutions Architect - Associate practice questions in English: 180 questions with explanations. The mock exam has 65 questions and 130 minutes.

AWS Certified Solutions Architect - Associate free question 2 / 10 · Domain 1: Design Secure Architectures

An application on an EC2 instance accesses S3 through the IAM role in its instance profile. The team wants to switch the permissions the application uses to those of a different, separately prepared role right away. Which method matches the EC2 page?

  1. Attach a second IAM role to the instance to add the permissions
  2. Remove the role from the current instance profile and put the new role in it
  3. Place the access keys of an IAM user that has the new permissions on the instance and have the application use them
  4. Replace the instance profile with one that contains the new role
Show the answer and explanation

Answer: D

Why this is correct
The EC2 IAM roles page says that to update the permissions of an instance, you replace the instance profile. It does not recommend removing the role from an instance profile, because the change can take up to an hour to take effect. An instance can have one role attached, and the same role can be attached to many instances.

Why the other options are wrong
"Attach a second IAM role to the instance to add the permissions" … An instance can have one IAM role attached, and an instance profile can contain one role. You cannot add a second one.
"Remove the role from the current instance profile and put the new role in it" … The page does not recommend removing a role from an instance profile, because the change can take up to an hour to take effect. To switch right away, replace the whole profile.
"Place the access keys of an IAM user that has the new permissions on the instance and have the application use them" … IAM roles exist so that you do not have to distribute and manage credentials for applications. Placing access keys on the instance leaves you responsible for distributing and rotating long-term credentials.

Key point
An instance profile is a container for an IAM role, and when you create a role in the console, a profile with the same name is created automatically. Changing a role's permissions affects every instance that has the role attached. Before production, IAM Access Analyzer can generate a policy that narrows a role's permissions based on its access activity.

Go to the AWS Certified Solutions Architect - Associate practice app (10 free questions; purchase unlocks all questions)

See the full practice set