AWS Training and Certification Blog

Use HAQM CodeWhisperer to advance your cloud knowledge

April 30, 2024 update: HAQM CodeWhisperer is now HAQM Q Developer.

HAQM CodeWhisperer is a revolutionary artificial intelligence (AI)-powered productivity tool that improves developer productivity and can serve as an accelerated learning path for cloud computing. HAQM CodeWhisperer uses machine learning (ML) to provide intelligent code suggestions in an integrated development environment (IDE).

HAQM CodeWhisperer is trained on billions of lines of HAQM and publicly available code. It has built-in security scans, provides code suggestions to remediate any issues it identifies, and makes it easy for developers to deploy AWS services that meet AWS best practices. Whether you are a new cloud architect or an experienced developer, HAQM CodeWhisperer can increase your cloud fluency by generating code examples, API references, and infrastructure-as-code (IaC) templates.

In this blog, we’ll explore three practical ways developers and cloud architects can use HAQM CodeWhisperer as an educational catalyst in their cloud learning journey.

1. Generate templates for infrastructure-as-code

When starting out with AWS, many people will manually deploy resources using the AWS Management Console. However, as cloud proficiency grows, the best practice is to adopt IaC approaches using services like AWS CloudFormation or Terraform. IaC allows you to deploy your entire AWS infrastructure via declarative code template, enabling repeatability and scalability in a controlled manner with less room for error. These templates serve as blueprints and are a great way to learn how to deploy AWS resources.

Using HAQM CodeWhisperer

HAQM CodeWhisperer can help you overcome the IaC learning curve by synthesizing IaC templates based on your instructions and previous code context. In the example below, I provided a high-level comment instructing HAQM CodeWhisperer to create an AWS CloudFormation template. HAQM CodeWhisperer generated the AWSTemplateFormatVersion section, which is the first step in creating a CloudFormation template.

Next, I gave HAQM CodeWhisperer additional instructions to create a Virtual Private Cloud (VPC), Subnet, and Elastic Compute Cloud (EC2) instance. HAQM CodeWhisperer knows this is a CloudFormation template based on the AWSTemplateFormatVersion line and generates the code, in grey, needed to accomplish the instructions. To accept, simply hit tab and the code is placed into the IDE.

HAQM CodeWhisperer speeds up the development process by generating code for you so you don’t have to manually look up syntax, documentation, and resources specifications.

If you’re new to cloud, you can use HAQM CodeWhisperer to quickly understand the format of AWS CloudFormation templates and method to deploy AWS services programmatically. This synthesized starting point can be helpful when learning a new IaC language or when you need to quickly learn about cloud environments. HAQM CodeWhisperer gives you a head start based on the specifications and instructions you provide.

2. Learn about your organization’s code base

When you join a new team or start work on a new project, it can be challenging to learn the intricacies of the organization’s coding and cloud architecting best practices. HAQM CodeWhisperer can be customized to generate recommendations based on an organization’s internal libraries and architectural patterns. This enables HAQM CodeWhisperer to recommend more relevant code, onboard developers faster, and help you get up to speed on AWS cloud services.

→ Using HAQM CodeWhisperer

HAQM CodeWhisperer can be connected to your organization’s GitHub, AWS CodeCommit, or other Git repositories. HAQM CodeWhisperer will then generate code suggestions in the context of your organization, helping you quickly learn the organization’s coding style and architectural patterns without having to go through documentation and different development projects.

Further, HAQM CodeWhisperer can be a continuous learning tool for seasoned developers and architects. Organizations can add new standards, libraries, and frameworks to their codebase, and HAQM CodeWhisperer will incorporate it into recommendations. This provides an avenue for veteran developers to stay up-to-date on organizational changes and technologies without having to read announcements or change documentation.

3. Integrate HAQM CodeWhisperer with HAQM Q to further your learning

Sometimes, you need more in-depth explanations or guidance than the code suggested by HAQM CodeWhisperer. For this, HAQM CodeWhisperer can be integrated with HAQM Q, an interactive, generative AI-powered assistant available in the IDE. You can ask HAQM Q to explain, refactor, fix, or optimize code right in your IDE, giving you deeper insights so you learn more about the code being recommended.

Going back to our first example, we can highlight and right click on the code generated, requesting HAQM Q to explain the code (right side of image below). This opens the HAQM Q chatbot (left side of image), explaining the highlighted code.

The integration between HAQM CodeWhisperer and HAQM Q creates a loop of code generation and knowledge acquisition, allowing developers to continuously upskill on cloud while increasing their coding productivity.

Build your knowledge of HAQM CodeWhisperer

To learn more about HAQM CodeWhisperer, check out the free 30-minute HAQM CodeWhisperer – Getting Started course on AWS Skill Builder, our online learning center. In the course, you’ll learn the key features of HAQM CodeWhisperer and how to install, configure, and start using HAQM CodeWhisperer in your preferred IDE. HAQM CodeWhisperer is available in Visual Studio Code, JetBrains IDEs, AWS Cloud9, AWS Lambda, JupterLab, and more.

You can then get hands-on via the AWS Jam, Build using HAQM CodeWhisperer, where you’ll learn how to effectively tackle time-consuming coding tasks and maximize your productivity. This AWS Jam contains seven engaging challenges and can be completed at your own pace. Take advantage of the 7-day free trial of AWS Skill Builder subscription to access this Jam for free.

Conclusion

HAQM CodeWhisperer is a powerful AI tool that can enhance the way developers and cloud architects learn about AWS and their organization’s application development process. You can use HAQM CodeWhisperer’s code synthesis, knowledge of your organization’s code base, and integration with HAQM Q to learn about AWS, all while building build cloud-native applications. Dive in and let HAQM CodeWhisperer guide your cloud education!

Additional learning resources

This blog was written with minimal assistance from generative AI tools: Claude (2023). Used to augment and improve the syntax and content of this blog. Anthropic AI assistant. http://www.anthropic.com