Amazon CodeWhisperer —on cruise control — leveraging the new PrivateLink Integration with Amazon CodeWhisperer endpoints, case studies and useful tech links !!

Mani
6 min readSep 4, 2023

Amazon CodeWhisperer, a generative AI coding assistant and which is trained on billions of lines of code and can generate code suggestions ranging from snippets to full functions in real time based on your comments and existing code. Since its launch, there has been a lot of buzz and adoption by developers across the world. I have also written two personal blogs — one on getting started and another (using an driving analogy 😃) to start accelerating on your journey !!

Hopefully, now that you have accelerated, this blog goes to the next level of using CodeWhisperer (CW) which will cover the following key things:

But wait, first !!

CodeWhisperer Individual Tier is FREE — https://aws.amazon.com/codewhisperer/pricing/
The CodeWhisperer Individual Tier is free to use. Individual developers can sign up and sign in using an email address with an AWS Builder ID to start using CodeWhisperer within minutes. The Individual Tier provides code suggestions, reference tracking, and security scans.

Hope you have recovered from the “price sticker” shock 🤣, lets get started !!

Leveraging the new Amazon CodeWhisperer and interface VPC endpoints (AWS PrivateLink)

Amazon CodeWhisperer supports multiple IDE’s (Integrated Development environments) leveraging add-ons/plugins like the AWS Toolkit for Visual Studio Code and AWS toolkit for Jetbrains. Security conscious customers and developers running IDE’s like VS Code and Jetbrains from their office networks, will need private access to AWS services, rather than accessing them over the internet. AWS PrivateLink is a highly available, scalable technology that you can use to privately connect your VPC to services as if they were in your VPC. The growing list of AWS services that can integrate with AWS PrivateLink is available at https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html. Traffic between your VPC and CodeWhisperer does not leave the Amazon network.

NEWS FLASH — The good news is that we can establish a private connection between your VPC and Amazon CodeWhisperer by creating an interface VPC endpoint, powered by AWS PrivateLink.

Deployment architecture — for accessing CodeWhisperer from on-prem using AWS PrinivetLink

You can easily test this, by setting up a AWS Client VPN connection between your laptop and a VPC on AWS. This will also work, if you a have AWS Direct Connect (with a private VIF) or a AWS site to site VPN. These steps are clearly documented at https://docs.aws.amazon.com/codewhisperer/latest/userguide/vpc-interface-endpoints.html

Step 1: Create a VPN connection between your on-premises like your laptop or desktop and your VPC. If you already have a site to site VPN or AWS Direct Connect, this step is not needed. I setup a Client VPN without split tunnel, so all traffic from client desktop/laptop is via the VPN endpoint only.

Step 2: Create an interface VPC endpoint for CodeWhisperer.

VPC Endpoint for CodeWhisperer

We will be using the vpc endpoint, similar to vpce-xxxxxx.codewhisperer.us-east-1.vpce.amazonaws.com for our connectivity to CodeWhisperer.

Step 3: Set up an inbound Amazon Route 53 endpoint. This will enable you to use the DNS name of your CodeWhisperer endpoint from your on-premises laptop/desktop.

Hosted zone for CodeWhisperer

Step 4: Setup the http/https proxy of your IDE to point to the VPC endpoint for CodeWhisperer.

I used Visual Studio Code, setup with the AWS toolkit for accessing CodeWhisperer. Now, since we have setup the VPC endpoint for CodeWhisperer, we need to manually add the https proxy for VS Code to access CodeWhisperer via the VPC endpoint and not directly through the internet. Just ensure you use the private endpoint like https://vpce-xxxxxx.codewhisperer.us-east-1.vpce.amazonaws.com for the http proxy setting and turn on the setting for “use proxy support for all extensions”.

VS code proxy settings

Please note the exact setting in the IDE where you set the proxy will differ for Jetbrains.

That’s it !!

Lets test the network connectivity first .. I connected to the AWS network via the AWS VPN Client and tested a ping to the CodeWhisperer VPC endpoint (it should return some random result, showing connectivity exists) and any random public website (which should not return a result).

connect via the AWS Client VPN and test connectivity to the CodeWhisperer endpoint

With this confirmation, launch your Visual Studio Code (or Jetbrains) and start on your accelerated coding journey with Amazon CodeWhisperer !!

VS Code with AWS toolkit

Some amazing guides/how-to’s for Amazon CodeWhisperer

A ton of new guides are being published every week, on various topics related to Amazon CodeWhisperer. You can find a lot of this information at the official website at https://aws.amazon.com/codewhisperer/resources/

The following resources, which have been recently published, which I found very useful:

  1. Accelerate Python Coding with Amazon CodeWhisperer — https://www.youtube.com/watch?v=pUXFUBfqKGA
  2. Build an Image Gallery App using React with Amazon CodeWhisperer — https://www.youtube.com/watch?v=LV6CiWnoo5I
  3. How to use Reference Tracking and Security Scanning with Amazon CodeWhisperer - https://www.youtube.com/watch?v=ed_4T2CnNx8
  4. How to use Amazon CodeWhisperer in JupyterLab — https://www.youtube.com/watch?v=NJaHPWX-4C4

In addition to the capabilities offered in the Individual Tier, the CodeWhisperer Professional Tier offers administrative capabilities to organizations that want to provide their developers with access to CodeWhisperer. The following resources are very useful, if you need to setup access for developers in Amazon CodeWhisperer using AWS IAM Identity Center with other third party identity providers:

  1. How to configure access for developers in Amazon CodeWhisperer using AWS IAM Identity Center and Okta Workforce Identity Cloud — https://www.youtube.com/watch?v=-dSfLb4I46s
  2. How to configure access for developers in Amazon CodeWhisperer using AWS IAM Identity Center and Microsoft Entra ID (Formerly Azure AD) — https://www.youtube.com/watch?v=Y75bOHlaevU

The above is not a complete list by any means, just a few ones that have been released recently in July/August 2023 and which I found very interesting. I will try to keep this section current, by refreshing the above list on a periodic basis.

Some public references to customers/partners who are using Amazon CodeWhisperer

There are several customer and partner testimonials for Amazon CodeWhisperer at https://aws.amazon.com/codewhisperer/testimonials/

Amazon CodeWhisperer, in my personal opinion, can be a huge game changer and productivity booster for all kinds of developers, for individuals as well as companies of all sizes and especially for companies who are System Integrators with a large and diverse pool of software developers. Some recent announcements from HCL technologies, Persistent systems, Accenture, TCS and others are an indication of the increasing interest in Amazon CodeWhisperer.

That is all folks, hope this blog was useful. Please do contact your AWS account team or contact me on LinkedIn or twitter, if you need more information.

Bye, Namaskara 🙏

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Mani
Mani

Written by Mani

Principal Solutions Architect at AWS India, and I blog/post about interesting stuff that I am curious about and which is relevant to developers & customers.

No responses yet

Write a response