Test the Gateway Endpoint

Create S3 bucket

  1. Navigate to S3 management console
  2. In the Bucket console, choose Create bucket

Create bucket

  1. In the Create bucket console
  • Name the bucket: choose a name that hasn’t been given to any bucket globally (hint: lab number and your name)

Bucket name

  • Leave other fields as they are (default)
  • Scroll down and choose Create bucket

Create

  • Successfully create S3 bucket.

Success

Connect to EC2 with session manager

  • For this workshop, you will use AWS Session Manager to access several EC2 instances. Session Manager is a fully managed AWS Systems Manager capability that allows you to manage your Amazon EC2 instances and on-premises virtual machines (VMs) through an interactive one-click browser-based shell. Session Manager provides secure and auditable instance management without the need to open inbound ports, maintain bastion hosts, or manage SSH keys.

  • First cloud journey Lab for indepth understanding of Session manager.

  1. In the AWS Management Console, start typing Systems Manager in the quick search box and press Enter:

system manager

  1. From the Systems Manager menu, find Node Management in the left menu and click Session Manager:

system manager

  1. Click Start Session, and select the EC2 instance named Test-Gateway-Endpoint.

    This EC2 instance is already running in “VPC Cloud” and will be used to test connectivity to Amazon S3 through the Gateway endpoint you just created (s3-gwe).

Start session

Session Manager will open a new browser tab with a shell prompt: sh-4.2 $

Success

You have successfully start a session - connect to the EC2 instance in VPC cloud. In the next step, we will create a S3 bucket and a file in it.

Create a file and upload to s3 bucket

  1. Change to the ssm-user’s home directory by typing cd ~ in the CLI

Change user’s dir

  1. Create a new file to use for testing with the command fallocate -l 1G testfile.xyz, which will create a file of 1GB size named “testfile.xyz”.

Create file

  1. Upload file to S3 bucket with command aws s3 cp testfile.xyz s3://your-bucket-name. Replace your-bucket-name with the name of S3 bucket that you created earlier.

Uploaded

You have successfully uploaded the file to your S3 bucket. You can now terminate the session.

Check object in S3 bucket

  1. Navigate to S3 console.
  2. Click the name of your s3 bucket
  3. In the Bucket console, you will see the file you have uploaded to your S3 bucket

Check S3

Section summary

Congratulation on completing access to S3 from VPC. In this section, you created a Gateway endpoint for Amazon S3, and used the AWS CLI to upload an object. The upload worked because the Gateway endpoint allowed communication to S3, without needing an Internet Gateway attached to “VPC Cloud”. This demonstrates the functionality of the Gateway endpoint as a secure path to S3 without traversing the Public Internet.