
Answer-first summary for fast verification
Answer: By creating an IAM role with permissions for required S3 API calls and associating it with the EC2 instance.
The most secure and AWS-recommended way to transfer files from an EC2 instance to an S3 bucket is to create an IAM role with the necessary permissions for the required S3 API calls, and then associate that role with the EC2 instance. This allows the application running on the instance to access S3 securely, without the need to manage and store static access keys, which can be less secure. Therefore, the correct answer is C.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can a developer securely transfer files from an EC2 instance to an S3 bucket?
A
By creating an IAM user and storing its access key in the application's environment variables.
B
By creating an IAM role with an access key and storing it in the application's environment variables.
C
By creating an IAM role with permissions for required S3 API calls and associating it with the EC2 instance.
D
By configuring an S3 bucket policy to grant access to the EC2 instance ID.
No comments yet.