I found my Genie…Amazon Q Developer

Aamod Kadam
6 min readJun 22, 2024

--

Amazon Q Developer

I recently attended an AWS user group session on Amazon Q Developer and as a next step I decided to try it myself.

My Setup

Step — Install Amazon Q extension

First thing is to install Amazon Q Extension for VS Code.

Refer the instructions for further details — Amazon Q — Visual Studio Marketplace

Once installed Amazon Q appears in the VS Code.

Amazon Q comes with a Free version and Pro License version . I am going to use the Free version. It is not required to have an AWS account to use the free version. So just click on Use For Free and it will take you to the page where you can create AWS Builder id or simply sign it using existing AWS Builder id and just follow the screen prompts.

I already have an AWS builder id so I am going to use it.

After you Allow access and if everything goes smoothly your Amazon Q is ready to greet you.

Pretty Simple !

Scenario — Hello World program

Let us start with the customary Hello World program so I asked Amazon Q to write code for me to print Hello World (Hello amod in this case ) message.

I provided my input something like this > Can you write a simple hello amod program in Python for me ?

Its response was …

I just copied the code , ran it and it simply worked !

That was smooth but it was too simple and so I decided to test Amazon Q’s capability to generate code for AWS Services.

Use Case with Amazon S3

I have multiple AWS accounts which I have been using in various workshops and there are quite a few S3 buckets spread across multiple accounts which I don’t need anymore . So I thought of why not ask Amazon Q Developer to write a program to delete S3 buckets ? There are also a large number of objects in various buckets and deleting manually is cumbersome.

My next prompt to Amazon Q Developer was to provide code which deletes S3 buckets with a note to empty buckets if need be.

After a few seconds I got the following response with complete CODE given !

It also provided me with some explanation of the code.

Amazon Q developer response is organized with different sections :

  • Part I — Code
  • Part II — Code explanation in natural language
  • Part III — It tells you what else is required to run this code.
  • Part IV — Sources utilised to generate the response

The response from Amazon Q was nice and really brought a human touch !

Step — Test the Code

Naturally, I was curious about the viability of the code. Would it work straight out of the box? Or would I need to make adjustments to avoid potential runtime errors? To answer these questions, I decided to test the code on my AWS account.

Current State of one AWS Account

The following are the contents of my S3 buckets in one of my AWS accounts.

One of the buckets ccp-assignment-3 is not empty as seen below.

Note : I have boto3 library installed and my AWS credentials are also configured so I am all set to test the code.

The content of Amazon S3 before running the code.

The code provided by Amazon Q is saved in a file delete_buckets_gen_ai.py.

I just ran the CODE AND BINGO ! IT WORKED PERFECTLY without modifying a single line of code.

Reflecting on Experience !

If you had noticed the timestamp on S3 objects, those were created somewhere in Jan 2023. However I was so lazy to write the code to delete those files. However with Amazon Q developer I managed to do everything quickly. To give you some perspective it took me less than 20 minutes from setting up the Amazon Q Developer , generating the code and actually using the generated code to delete S3 buckets!

I remember a few years back I had spent almost a couple of days writing this code using Java language.

If I reflect on my earlier process or steps — read the API , google it for any similar situation , copy paste code from AWS or Stackoverflow .Try and modify the code to meet your requirement and repeat until you succeed.

Now it is simply asking Amazon Q Developer with the right prompt and that is all !

It feels like I found my Genie (at least for coding) with Amazon Q Developer.

Final Thoughts !

  • Amazon Developer Q will certainly improve the speed of coding
  • Amazon Developer Q will be used by more and more developers
  • Amazon Developer Q will be be integral part of development tool set
  • It looks like the the programming skills are acquired by AI and it can program on behalf of you, However you are still in charge and you still need to understand the use case and provide context and what you expect the Amazon Developer Q to do
  • It is quite likely that some of the programming jobs will be taken over by AI

Time will tell whether you are going to become an AI Assisted programmer or an assistant to AI tools !

As the saying goesThe only constant is change’ so let us embrace Amazon Q Developer and Generative AI in general for an intriguing journey ahead.

--

--

Aamod Kadam
Aamod Kadam

Written by Aamod Kadam

AWS Community Builder | upGrad Course Author | 7 x AWS | Terraform Associate | Cloud Consulting | AWS | Azure | Docker | Kubernetes | Software Architecture

Responses (1)