The AWS Toolkit for Visual Studio Code is an extension that enables you to interact with Amazon Web Services (AWS) from within Visual Studio Code.
This is pre-release software and we recommend against using it in a production environment.
You can use the AWS Toolkit for Visual Studio Code to:
-
Manage supported AWS resources in an AWS account. For example, you can:
- List available AWS CloudFormation stacks that contain AWS serverless applications.
- List available AWS Lambda functions.
- Invoke available Lambda functions.
-
Develop serverless applications locally, and then deploy them to an AWS account.
After you install the AWS Toolkit for Visual Studio Code, you must complete these additional steps to access most of its features:
- Create an AWS account and an access key.
- Connect the Toolkit to AWS by using AWS credentials.
To use this Toolkit to develop serverless applications with AWS, you must also do the following on the local machine where the Toolkit is installed:
- Install the AWS Command Line Interface (AWS CLI).
- Install and then run Docker.
- Install the AWS SAM CLI.
For complete setup instructions, see Setting Up the AWS Toolkit for Visual Studio Code in the AWS Toolkit for Visual Studio Code User Guide.
You can access many of the AWS Toolkit for Visual Studio Code features through Command Palette. To access the available commands, choose View, Command Palette on the menu bar, and then begin typing AWS:
.
Available commands include:
- AWS: Connect to AWS - Connects the Toolkit to an AWS account. For more information, see "Step 2: Connect to an AWS Account" in Managing AWS Resources.
- AWS: Create Credentials Profile - Creates an AWS credentials profile. For more information, see "Step 1: Create a Credentials Profile" in Managing AWS Resources.
- AWS: Create New SAM Application - Generates a set of code files for a new AWS serverless application. For more information, see Create a Serverless Application.
- AWS: Deploy SAM Application - Deploys a local serverless application to an AWS account. For more information, see Deploy a Serverless Application.
- AWS: Detect SAM CLI - Checks whether the Toolkit can communicate correctly with the AWS SAM CLI that is installed.
- AWS: Focus on Explorer View - Displays the AWS: Explorer Side Bar, if it isn't already displayed, and then moves the focus to it.
- AWS: Hide region from the Explorer - Hides the list of available AWS resources for the specified AWS Region from the AWS: Explorer Side Bar.
- AWS: Show region in the Explorer - Displays the list of available AWS resources for the specified AWS Region in the AWS: Explorer Side Bar.
- AWS: Sign out - Disconnects the Toolkit from the currently connected AWS account.
- AWS: View AWS Toolkit Logs - Displays log files that contain general Toolkit diagnosis information.
- AWS: View Quick Start - Displays this page.
- If you already have an AWS credentials profile, skip ahead to "Step 2: Connect to an AWS Account." (For additional information, see Setting Up Your AWS Credentials in the AWS Toolkit for Visual Studio Code User Guide.)
- On the menu bar, choose View, Command Palette.
- Begin typing:
AWS: Create Credentials Profile
. When you see the AWS: Create Credentials Profile command, choose it. - Follow the on-screen instructions to add AWS credentials profile information. (For additional information, see Setting Up Your AWS Credentials in the AWS Toolkit for Visual Studio Code User Guide.)
- On the menu bar, choose View, Command Palette.
- Begin typing
AWS: Connect to AWS
. When you see the AWS: Connect to AWS command, choose it. - In the list of AWS credentials profiles that is displayed, choose the AWS credentials profile that you want to use. (For additional information, see Setting Up Your AWS Credentials in the AWS Toolkit for Visual Studio Code User Guide.)
- If the AWS: Explorer Side Bar isn't displayed, display it by choosing the AWS icon in the Activity Bar. (To hide the AWS: Explorer, choose the AWS icon again.)
- If you have existing resources in your AWS account but they aren't displayed in the AWS: Explorer, choose the Refresh icon in the AWS: Explorer to display them.
- Expand the AWS Region that contains the resource that you want to manage. (To hide or show AWS Region information, choose View, Command Palette on the menu bar, and then choose AWS: Hide region from the Explorer or AWS: Show region in the Explorer.)
- Expand the AWS service that contains the resource that you want to manage. (Currently, the Toolkit doesn't support all available AWS services and resource types.)
- If applicable, expand the parent resource that contains the child resource that you want to manage.
- Right-click the resource to manage, and then choose one of the available actions in the context menu. (Currently, the Toolkit doesn't support all available resource actions.)
For more information, see the following in the AWS Toolkit for Visual Studio Code User Guide:
You can use the AWS Toolkit for Visual Studio Code to create, run, debug, and deploy serverless applications.
- Create a Serverless Application
- Run or Debug a Serverless Application
- Deploy a Serverless Application
- On the menu bar, choose View, Command Palette.
- Begin typing:
AWS: Create new SAM Application
. When you see the AWS: Create new SAM Application command, choose it. - Follow the on-screen instructions to finish creating the SAM application.
The Toolkit produces the application code and files, adds them to the location you specified, and opens the program file in the editor.
For more information, see Creating a Serverless Application in the AWS Toolkit for Visual Studio Code User Guide.
(Clip is time lapsed)
After you choose the AWS icon in the Activity Bar, CodeLenses display within open serverless application code files above functions that use AWS Lambda function handler syntax. (A handler is a function that Lambda calls to start execution of a Lambda function.) These CodeLenses enable you to run or debug the corresponding serverless application locally. CodeLens actions here include:
- Configure, for specifying function configurations such as an event payload and environment variables.
- Run Locally, for running the function without debugging.
- Debug Locally, for running the function with debugging.
(For general information about running and debugging in VS Code, see Debugging on the VS Code website.)
For information about how to work with remote versions of Lambda functions, see Interacting with Remote Lambda Functions in the AWS Toolkit for Visual Studio Code User Guide.
(Clip is time lapsed)
Before you start this procedure, you must have an Amazon S3 bucket in the AWS account. The AWS Toolkit for Visual Studio Code will use this bucket when packaging and deploying the application. (To create a bucket, see How Do I Create an S3 Bucket in the Amazon Simple Storage Service Console User Guide.)
-
On the menu bar, choose View, Command Palette.
-
Begin typing:
AWS: Deploy SAM Application
. When you see the AWS: Deploy SAM Application command, choose it. -
Follow the on-screen instructions to finish deploying the serverless application, including:
- Choosing the SAM template file that corresponds with the serverless application you want to deploy.
- Choosing the AWS Region you want to deploy to.
- Specifying the name of an existing Amazon S3 bucket in the AWS account that the Toolkit will use for packaging and deploying the serverless application. (The Toolkit uses Amazon S3 as part of its process to deploy serverless applications.) The bucket must exist within the AWS Region that you chose earlier.
-
The serverless application is deployed to an AWS CloudFormation stack. (The Toolkit uses AWS CloudFormation as part of its process to deploy serverless applications.) If the stack already exists, it is updated; otherwise, a new stack is created. Within a few minutes, the Toolkit displays a deployment success or failure message.
-
To work with the corresponding stack that the Toolkit creates in AWS CloudFormation, in the AWS: Explorer, expand the AWS Region that contains the stack. Then expand AWS CloudFormation. Lastly, expand or right-click on the stack that you want to manage.
For more information, see Deploying a Serverless Application in the AWS Toolkit for Visual Studio Code User Guide.
To report issues with the AWS Toolkit for Visual Studio Code or to propose Toolkit code changes, see the aws/aws-toolkit-vscode repository on GitHub.
You can also contact AWS directly.