AWS Toolkit for VS Code: Amazon Q & CodeWhisperer
Explore AWS Toolkit for VS Code: Boost coding with Amazon Q & CodeWhisperer's AI suggestions and cloud integration. Enhance development workflow & productivity.
AWS Toolkit for Visual Studio Code
Installing AWS Toolkit for Visual Studio Code
Download and Install AWS Toolkit for Visual Studio Code
Installing AWS Toolkit for Visual Studio Code from the VS Code IDE Marketplace
Authentication for Amazon Q + CodeWhisperer
Authentication and Connection Using AWS Builder ID
Authentication and Connection Using IAM Identity Center
Authentication for AWS Explorer
Authenticate and Connect Using IAM Identity Center
Authenticate and Connect Using IAM Credentials
Working with AWS Services in AWS Explorer
Working with Amazon Q from the Toolkit
Opening Amazon Q Chat from VS Code Toolbar
Developing Features with Amazon Q
Explaining and Updating Code with Amazon Q
- Answer questions about AWS.
- Address queries about common programming concepts.
- Explain the meaning of command lines or code functions.
- Write unit tests and code.
- Debug and repair code.
- Refactor code.
- Real-Time Code Suggestions: Automatically suggests code in over 15 languages, including Infrastructure as Code (CloudFormation, AWS CDK, and Terraform).
- Optimized for AWS Service Usage: Code suggestions are optimized for AWS APIs such as Amazon Elastic Compute Cloud (Amazon EC2), AWS Lambda, and Amazon Simple Storage Service (Amazon S3).
- Integrated Security Scanning: Detects hard-to-find security vulnerabilities in code and provides immediate repair suggestions.
- VS Code requires the Windows, macOS, or Linux operating system.
- AWS Toolkit for Visual Studio Code requires you to use VS Code version 1.73.0 or later.
- For more information about VS Code or to download the latest version of VS Code, visit the VS Code download page.
- Open the AWS Toolkit for Visual Studio Code extension in your VS Code IDE
- From the AWS Toolkit for Visual Studio Code extension in the VS Code Marketplace, select Install to begin the installation process.
- When prompted, choose to restart VS Code to complete the installation process.
- Passwords are case-sensitive.
- Passwords must be between 8 to 64 characters in length.
- Passwords must include at least one character from each of the following categories:
- Lowercase letters (a-z)
- Uppercase letters (A-Z)
- Numbers (0-9)
- Non-alphanumeric and non-letter characters (~!@#$%^&*_-+=`|(){}[]:;"’<>,.?/)
- The last three passwords cannot be reused.
- Passwords must not be used if they have been disclosed in a third-party data breach.
Note: Tools and services using the AWS Builder ID will guide you in creating and using an AWS Builder ID as necessary.
- Visit the registration page of the AWS tool or service you wish to access, or go to the AWS Builder ID profile.
- On the Create AWS Builder ID page, enter your Email Address. We recommend using your personal email.
- Click Next.
- Enter your Name, then click Next.
- On the Email Verification page, enter the verification code sent to your email address. Click Verify. Depending on your email provider, it may take a few minutes to receive the email. Check your spam and junk folders for the code. If you do not receive an email from AWS after five minutes, click Resend Code.
- After we verify your email, on the Choose a Password page, enter your Password and Confirm Password.
- If a Captcha appears as an additional security measure, enter the characters you see.
- Click Create AWS Builder ID.
- From the CodeWhisperer section of the user interface Sign in to Get Started, expand the Sign in with IAM Identity Center (SSO) section.
- Enter your starting URL, then select Select a Region and choose your AWS region.> **Note:**Choose the region that corresponds with the IAM Identity Center credentials you are using.
- Select the Sign in button and confirm you wish to open the AWS authorization request page on your default web browser.
- On your default web browser, verify that the authorization code matches the one from the Sign in with AWS Builder ID dialog, then select the Confirm and continue button to proceed.
- Follow the instructions on your default web browser. You will be notified when the authorization process is complete, and you can close the browser and return to VS Code.
- In the AWS Explorer section of the user interface, under Sign in to Get Started, expand Sign in with IAM Identity Center (SSO).
- Enter your Start URL, then choose Select a Region and select your AWS region.> Note> Choose the region that corresponds to the region associated with your IAM Identity Center credentials.
- Click the Sign in button and confirm that you want to open the AWS authorization request webpage in your default web browser.
- In your default web browser, verify that the authorization code matches the code from the Sign in with AWS Builder ID dialog, then click Confirm and continue to proceed.
- Follow the instructions in your default web browser. You will be notified when the authorization process is complete. You can then close the browser and return to VS Code.
- In the AWS Explorer section of the user interface, under Sign in to Get Started, expand Or, provide IAM Roles Credentials.
- Enter the Profile Name, Access Key, and Secret Key of your AWS account in the provided fields, then click Add Profile to add the profile to your configuration file and connect the Toolkit with your AWS account.
- The AWS Explorer Toolkit will update to display your AWS services and resources once authentication is complete and a connection has been established.
- If the toolkit is properly installed and configured, you should see items in AWS Explorer. To view AWS Explorer, select the AWS icon on the activity bar.Example:
- Certain features require specific AWS permissions. For instance, to view AWS Lambda functions in your AWS account, the credentials you configure in ‘Authentication and access’ must include at least read-only Lambda permissions. Refer to the following topics for more information on the permissions required for each feature.
- If you wish to interact with AWS services that are not immediately visible in AWS Explorer, you can go to ‘More resources’ and choose from hundreds of available resources to add to the interface.For example, you can select ‘AWS Toolkit:CodeArtifact::Repository’ from the choice of available resource types. Once this resource type is added to ‘More resources’, you can expand the entry to view a list of different CodeArtifact repository resources with their unique properties and characteristics. Furthermore, you can describe the properties and characteristics of the resource in JSON format templates, which can be saved to create new resources in AWS Cloud.
- To start working with Amazon Q, authenticate and connect to AWS using your AWS Builder ID or IAM AWS login information.
- View detailed plans and pricing for Amazon Q at the Amazon Q Pricing Guide.
- For details on connecting your AWS account with the Toolkit, see the Authentication for Amazon Q + CodeWhisperer section in this User Guide.
- Initiate a chat with Amazon Q by asking questions in the Chat. Amazon Q can discuss various topics including AWS, software development, programming languages, and more. You can also ask Amazon Q specific questions about your project in VS Code.
- For detailed information about Amazon Q Chat, including topics and sample questions, see the Amazon Q Chat topic in the Amazon Q User Guide.
- Below are Quick Chat commands of Amazon Q that you can enter in the chat window.
- /clear: Clear the current chat by removing all previously saved text and context.
- /dev: Start a chat about developing Amazon Q features and create a deployment plan for your project.
- /transform: Initiate a chat about Amazon Q Code Transformation, assisting you in converting code from one language version to another.
- /help: Display a list of help topics and information about Amazon Q.
- To start a new chat with Amazon Q or access an existing one, follow one of the procedures below.
- From the VS Code Toolbar, select the Amazon Q (preview version) icon to open the Amazon Q (preview version): Chat window.
- Start a new conversation by selecting the + icon.
- Enter your question or command in the “Ask a question or enter ‘/’” text field to continue the conversation.
- Develop your project by chatting with Amazon Q about the type of feature you want to create. Explain the desired features in the chat and Amazon Q will generate a deployment plan for your new or existing project.
- For detailed information on developing features with Amazon Q, see the Developing Features with Amazon Q topic in the Amazon Q User Guide.> Note: Amazon Q feature development is only accessible with IAM identification authentication. See detailed plans and pricing of Amazon Q at the Amazon Q Pricing Guide.
- Amazon Q does not modify or update code until you have reviewed and approved the change in the file diff.
- To get started with Amazon Q feature development, complete the following steps:
- From a new or existing VS Code project, open Amazon Q Chat.
- In the Amazon Q Chat window, enter
/dev
, then press enter to launch Amazon Q feature development; the Amazon Q Chat text field updates with the prompt Briefly describe a task or issue. - Respond to the prompt in the Amazon Q Chat window, briefly describing the feature you want to develop, then press enter to start creating the deployment plan.
- Amazon Q responds with a deployment plan upon completion, and the text field updates with the prompt.
- Enter any modifications or questions about the deployment plan into the text field.
- When satisfied with the plan, select Write Code from the chat window for Amazon Q to suggest code for your project.
- Amazon Q can explain and update code. To get an explanation or code update, send code to Amazon Q with a request, after which Amazon Q responds with updates.
- For detailed information about Amazon Q’s code explaining and updating, see the Explaining and Updating Code with Amazon Q topic in the Amazon Q User Guide.
- Here are the options you can specify when requesting a code explanation or update from Amazon Q:
- Explain: Explain the code in natural language.
- Refactor: Make performance adjustments to the code.
- Debug: Debug the code.
- Optimize: Perform code performance improvements.
- Send to Prompt: Send marked code to the Amazon Q window for further queries.
- To request a code explanation or update, complete the following steps:> Note: Amazon Q does not modify or update the code until you have reviewed and approved the changes in the file diff.
- From the VS Code editor, highlight a section of code and open the context menu (right-click).
- From the context menu, expand Send to Amazon Q.
- Select an option from the list to send the code to Amazon Q.
- In Amazon Q, review the proposed explanations or changes to the code, and if there are additional steps required to complete the request, follow the prompts in the chat window.
- Amazon Q Code Transformation can update the language version of code in a project or workspace.
- For detailed information about Amazon Q Code Transformation, see the Code Transformation topic in the Amazon Q User Guide.> Note: Amazon Q Code Transformation is only accessible with IAM Identity Center authentication. See detailed plans and pricing for Amazon Q at the Amazon Q Pricing Guide.
- Currently, Amazon Q Code Transformation only upgrades code from Java 8 or Java 11 to Java 17.
- Amazon Q Code Transformation starts by verifying if the language version can be upgraded, which takes up to 30 minutes.
- After successful verification, the code transformation process can take up to 15 minutes.
- Amazon Q does not make any modifications or updates to the code until you have reviewed and approved all changes in the file diff.
- From VS Code, open the project you want to upgrade the language version for.
- From the AWS Toolkit for Visual Studio Code, expand Amazon Q (preview version), then select Transform or type
/transform
into the Amazon Q Chat. - Amazon Q begins the verification process by rebuilding the project in the source language version.> Note: The verification process can take up to 30 minutes.
- No changes are made to the code during this process.
- If the transformation process cannot be completed, Amazon Q generates a build export for your review.
- After a successful verification build, Amazon Q begins the code transformation process. This can take up to 15 minutes.
- Amazon Q notifies you when the build process is complete, select View diff to review and approve the proposed code updates.
- Real-time source code suggestions: Automatically suggest code in over 15 programming languages, now including infrastructure as code (CloudFormation, AWS CDK, and Terraform).
- Optimized for AWS service usage: Suggests code optimized for AWS APIs, including Amazon Elastic Compute Cloud (Amazon EC2), AWS Lambda, and Amazon Simple Storage Service (Amazon S3).
- Security scanning integration: Scan your code to detect hard-to-find vulnerabilities and receive code suggestions to fix them immediately.
- View, Edit, and Deploy AWS Resources Multiple Accounts and AWS Regions - Access Your AWS Resources Across Your Accounts and Regions
- S3 Support - View, Create, and Edit S3 Buckets, Folders, and Files
- Lambda - Download & Upload Lambda Functions
- Lambda - Step Through AWS Lambda Functions with VS Code Debugger
- CloudWatch - Search Logs Generated by Your AWS Resources
- ECS - Execute Commands on Running ECS Containers (or Open a Terminal)