A company runs an application on an Amazon EC2 instance that needs to access objects in an Amazon S3 bucket. To adhere to security best practices, how should the Solutions Architect grant the necessary permissions?
-
A
Create an IAM user with S3 access permissions and store the access keys securely on the EC2 instance.
-
B
Create an IAM role with the necessary S3 permissions and attach it to the EC2 instance profile.
-
C
Generate a pre-signed URL for each object in the S3 bucket and embed them in the application code.
-
D
Configure the S3 bucket policy to allow public read access for the EC2 instance's public IP address.