Demo - Accessing S3 using a Gateway Endpoint
Setup
- Log into AWS and navigate to the N. Virginia region.
- Run the CFN Stack here and wait for this to complete.
- Open up the bucket in S3 that was created.
- Upload a file called secret.txt with some random text in it.
Implement
- Navigate to the EC2 console and click on your EC2 instance
- Connect to this instance using Session Manager (the others won't work because this is a private EC2 instance) a. try to ping something b. notice that there's no public IPv4 address.
- Run
aws s3 ls
and notice that it hangs - Ctrl+C to stop that. - Navigate to the VPC console and click on Endpoints. a. these endpoints exist as a way to connect via Sessions Manager
- Click Create Endpoint.
- Select S3 and select the Gateway endpoint for S3
- Select the VPC
- Select the appropriate route table with the appropriate subnets - should be the sn-app ones.
- Create the endpoint.
- Click on Route Tables on the left and select the route table associated with this VPC.
- Under routes, you'll notice one associated with the gateway endpoint.
Copy things from this S3 bucket
- Run
aws s3 ls
to list the buckets. If this doesn't work, recheck your steps. - run
aws s3 cp s3://bucketname/secret.txt secret.txt
to copy the secret.txt down to your instance.
Demo - Using SNS from a private VPC
Doesn't work