Which policy must the developer modify to allow the instances to write these objects?
The IAM policy that is attached to the EC2 instance profile role
The session policy that is applied to the EC2 instance role session
The AWS Key Management Service (AWS KMS) key policy that is attached to the EC2 instance profile role
The Amazon VPC endpoint policy
Explanations:
The IAM policy attached to the EC2 instance profile role grants the necessary permissions for the EC2 instances to access AWS services, including writing objects to an S3 bucket. The developer needs to modify this policy to include the required S3 actions.
The session policy applies only to the current session of the IAM role but does not control the permissions granted to the EC2 instance profile role itself. Modifying it won’t grant the instances the necessary permissions.
The AWS KMS key policy is relevant if the S3 bucket objects are encrypted with KMS. However, it does not grant permission to the EC2 instance to write objects to S3. Permissions must be set at the IAM role level.
The Amazon VPC endpoint policy controls access to AWS services via a VPC endpoint but does not modify the IAM permissions of the EC2 instance profile role. Therefore, it will not enable the instances to write to S3.