Which solution will meet this requirement?
Create access keys to access the DynamoDB table. Assign the access keys to the EC2 instance profile.
Create an EC2 key pair to access the DynamoDB table. Assign the key pair to the EC2 instance profile.
Create an IAM user to access the DynamoDB table. Assign the IAM user to the EC2 instance profile.
Create an IAM role to access the DynamoDB table. Assign the IAM role to the EC2 instance profile.
Explanations:
Access keys are used for IAM users or applications. They are not intended to be directly assigned to EC2 instance profiles. An EC2 instance profile requires an IAM role.
EC2 key pairs are used for SSH access to EC2 instances, not for granting permissions to access DynamoDB. Key pairs do not relate to IAM roles or permissions for DynamoDB.
An IAM user cannot be directly assigned to an EC2 instance profile. EC2 instance profiles require IAM roles, not individual IAM users.
IAM roles are used to assign permissions to EC2 instances. By assigning an IAM role with the appropriate DynamoDB permissions to the EC2 instance profile, the application can access the DynamoDB table.