Using AWS Application Composer with Amazon CodeWhisperer - AWS Application Composer

Using AWS Application Composer with Amazon CodeWhisperer

AWS Application Composer from the AWS Toolkit for Visual Studio Code provides an integration with Amazon CodeWhisperer. You can use CodeWhisperer within Application Composer to generate the infrastructure code for your AWS resources as you design your application.

CodeWhisperer is a general purpose, machine learning-powered code generator. To learn more, see What is CodeWhisperer? in the Amazon CodeWhisperer User Guide.

What is CodeWhisperer support in Application Composer?

For standard resource and standard component cards, you can use CodeWhisperer to generate infrastructure code suggestions for your resources.

CodeWhisperer generating a code suggestion in Application Composer

Standard resource and standard component cards can represent an AWS CloudFormation resource or a collection of AWS CloudFormation resources. To learn more, see Configure Application Composer cards.

Setting up

To use CodeWhisperer in Application Composer, you must authenticate with CodeWhisperer in the Toolkit. For instructions, see Getting started with CodeWhisperer in VS Code and JetBrains in the Amazon CodeWhisperer User Guide.

Using CodeWhisperer in Application Composer

You can use CodeWhisperer from the Resource properties panel of any standard resource or standard component card.

To use CodeWhisperer in Application Composer
  1. From a standard resource or standard component card, open the Resource properties panel.

  2. Locate the Resource configuration field. This field contains the infrastructure code for the card.

  3. Select the Generate suggestions button. CodeWhisperer will generate a suggestion.

    Note

    Code generated at this stage will not overwrite existing infrastructure code from your template.

  4. To generate more suggestions, select Regenerate. You can toggle through the samples to compare results.

  5. To select an option, choose Select. You can modify the code here before saving it to your application. To exit without saving, select the exit icon (X).

  6. To save the code to your application template, select Save from the Resource properties panel.

Learn more

To learn more about CodeWhisperer, see What is CodeWhisperer? in the Amazon CodeWhisperer User Guide.