For the instance to be able to send logs to S3 through the S3 Gateway Endpoint, we need to allow outbound traffic to S3.
Access the VPC service management console
Click Add rule:
pl- and select the S3 prefix list (e.g., com.amazonaws.us-east-1.s3).
Access the Systems Manager - Session Manager service console

Scroll down, in the S3 logging section,

Scroll down, click Save to save the configuration.
Access the Systems Manager - Session Manager service console
Type the ipconfig command.

Access the S3 service management console
Click on the session log file name

At the object details page, click Open.

The log file will be opened in a new tab in the browser. You can view the commands that have been stored in the session logs.
