Which combination of steps will meet these requirements?
(Choose two.)
Create an IAM role that has the appropriate permissions for S3 buckets Add the IAM role to an instance profile.
Update the launch template to include the IAM instance profile.
Create an IAM user that has the appropriate permissions for Amazon S3 Generate a secret key and token.
Create a trust anchor and profile Attach the IAM role to the profile.
Update the launch template Modify the user data to use the new secret key and token.
Explanations:
Creating an IAM role with appropriate S3 permissions allows the EC2 instances to access the necessary S3 buckets while adhering to the principle of least privilege. The IAM role can be assumed by EC2 instances, granting them temporary security credentials. Adding this role to an instance profile is essential for the EC2 instances to assume the role.
Updating the launch template to include the IAM instance profile ensures that every EC2 instance launched from the Auto Scaling group automatically receives the necessary permissions defined in the IAM role. This is crucial for providing the instances with the required access to S3 without hardcoding any credentials.
Creating an IAM user with permissions for S3 and generating a secret key and token is not aligned with the requirement for using temporary security credentials. IAM users and their associated access keys are long-term credentials and do not support the principle of least privilege in the context of EC2 instance operations.
While creating a trust anchor and profile is relevant in IAM, this option does not directly apply to the scenario of deploying EC2 instances with an IAM role. Instead, attaching the IAM role to an instance profile directly allows EC2 instances to assume the role without needing an additional trust anchor or profile.
Modifying the user data to use a new secret key and token is unnecessary and not a recommended practice. User data scripts are typically used for configuration and initialization of instances, not for handling IAM credentials. Instead, IAM roles provide temporary security credentials automatically, negating the need for hardcoded keys in user data.