Using Amazon Q Developer and ChatGPT to build solutions on AWS
Using Amazon Q Developer and ChatGPT to build solutions on AWS

Using Amazon Q Developer and ChatGPT to build solutions on AWS

Last week, a prospective client came to us asking if the following was possible on AWS:

To use an API to transcribe an audio file and apply audio intelligence.?

  1. Maintain high security and compliance.?
  2. Ability to transcribe audio files to text (Speech to text)
  3. Automatically detect and redact PHI in the audio file and transcription

I decided to try to implement this prospective client request before even closing the deal with Amazon Q Developer, IntelliJ, and ChatGPT.?

I went over to ChatGPT and asked ChatGPT,? “how to build the following with AWS ” + ${above requirements}.?

ChatGPT responded with?

1. Security & Compliance

? Store audio and text in Amazon S3 with KMS encryption.

? Use CloudTrail to log access.

? Lambda deletes files after processing.

2. Transcribe Audio to Text

? Use Amazon Transcribe for speech-to-text.

3. Detect & Redact PHI

? Use Amazon Bedrock (Claude or Titan) to detect and remove PHI.

Nice. I would have come up with the same blueprint, but ChatGPT validated the blueprint that I had in my head.?

Now, the tricky part, how do I get AI to generate the code to do this?

I fired up IntelliJ, and started to follow this YouTube video put together by Amazon on Amazon Q Developer.

The YouTube video was helpful, but I got stuck quickly. I was able to launch IntelliJ and install the Amazon Q Developer Plugin by navigating to Settings\Plugin.

IntelliJ Plugins for Amazon Q

After you install, you’ll be prompted to login with your AWS account. I chose the “Use for free” button.


Amazon Q Authentication Dialog

Amazon Q stated that it was trying to launch a browser to authenticate, but the browser never popped.? Frustrating.?

At the bottom of IntelliJ, I noticed that the plugin was complaining about errors in my ~/.aws/config file. I’m on a Mac, I’ve used the AWS CLI to access profiles for at least 15 clients. Yuck.

I initially tried to clean up the AWS config, credential, and sso files, but no luck.

Next, I opted to create a new user on my Mac and start from a clean slate. Starting from a clean slate required me to switch over to the new account and re-install the Q Developer Plugin. This time when I clicked on “Use for Free”,? Safari popped open and I was able to login. Progress.

Amazon Q Developer can not only be used for generating new code, but it can also be used to address technical debt. Hmm, I wonder if Q Developer can update a Java 11 to Java 17 project??

I created a shell Java project in IntelliJ. I told Amazon to “/transform” the project from Java 11 to Java 17. Low and behold, my pom.xml got updated from Java 11 to 17.


Amazon Q upgraded my Java 11 project to Java 17

Pretty cool, so I got greedy.?

Next, I asked for Amazon Q Developer to generate a REST API that enables me to deposit an audio file to an S3 bucket.?


Amazon Q generated a Controller, Service and S3Config class to upload my audio file to an S3 Bucket

Voila! I got a brand new Service, Controller, and S3Config file. The uploadAudioToS3 function even comes with MultipartFile support out of the box so it can handle large files. Exception handling is built in. Wow.

Let’s go for a little more. I asked Amazon Q Developer to launch the Transcription job after the file has been successfully uploaded to S3. The StartTranscriptionJobRequest gets built into the AudioService and gets invoked right after the file gets uploaded. PutObjectAsync may be a better choice here.


Amazon Q generated a transcription job to be launched upon completion of the S3 upload

Now, the only problem is my project won’t compile. :) Something got screwed up with my pom.xml or classpath. I’ve spent my hour trying to build this. I’ve seen the light.

If you’re working on AWS and you want to move faster, start using AWS Q Developer. If you have any issues getting it to work, reach out to AllCode, and we’ll get you going!

David Han, PMP

Engagement Manager, Professional Services | Project Management

1 个月

Love to see the trial and error and gradual success!

要查看或添加评论,请登录

Joel Garcia的更多文章

  • Retrieval-Augmented Generation (RAG)for Newbies

    Retrieval-Augmented Generation (RAG)for Newbies

    Clients come to us all the time with the following requests: “We are actively looking for developers to help us build…

    8 条评论
  • The ABC’s of SMS Messaging for Schools

    The ABC’s of SMS Messaging for Schools

    Even now, many schools still rely on flyers and word of mouth to get the word out on essential, time-sensitive…

    6 条评论