BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Harnessing AI-Generated Cloudformation with Application Composer

Harnessing AI-Generated Cloudformation with Application Composer

This item in japanese

The AWS Toolkit for VS Code has recently extended its support to include AWS Application Composer, which was introduced a year ago in the AWS Management Console. This enhancement empowers users to craft Infrastructure as Code (IaC) for a comprehensive range of over 1100 AWS CloudFormation resources.

Application Composer empowers developers to construct Infrastructure as Code (IaC) templates through a visual interface where you can intuitively drag and drop cards on a virtual canvas. These cards symbolize CloudFormation resources, providing a versatile platform to interconnect them for creating permissions and references. With support for over 1100 CloudFormation resources, ranging from AWS Amplify to AWS X-Ray, you can now build comprehensive applications seamlessly.

In the past, standard CloudFormation resources were limited to basic configurations. For instance, adding an Amplify App resource would result in a minimal configuration like the following YAML snippet:

MyAmplifyApp:
  Type: AWS::Amplify::App
  Properties:
    Name: <String>

Now, with Application Composer integrated into the Integrated Development Environment (IDE), generative AI is employed to create resource-specific configurations automatically. These configurations come with built-in safeguards, including validation against the CloudFormation schema to ensure the use of valid values.

When working on CloudFormation or AWS Serverless Application Model (AWS SAM) templates in Visual Studio Code (VS Code), users can leverage their Builder ID to sign in and generate multiple suggested configurations within Application Composer.

These AI-generated suggestions, tailored to each resource type, undergo validation against the CloudFormation schema to ensure compliance with valid values or provide helpful placeholders. Developers can select, use, and customize these suggestions according to their specific requirements.

To get started, ensure the AWS Toolkit extension is installed in VS Code, and Amazon CodeWhisperer is enabled using the correct Builder ID. Once connected, it is possible to initiate Application Composer, create a folder for the application, and start adding resources to the canvas.

While the application architecture is designed on the canvas, Application Composer automatically generates IaC, incorporating best practices defaults. For standard CloudFormation components, the AI assistant generates suggestions, ensuring adherence to the CloudFormation schema.

 

AI-generated canvas [source aws]

 

Once the canvas is populated with resources, the user can refine the template.yaml file, add function code, and initiate the deployment process through the App Composer extension with the Sync button that generates AWS SAM instructions to follow.

 

App Composer Sync button [source aws]

 

AI-generated CloudFormation templates streamline the development process, enhance understanding of resource configurations, and accelerate development cycles. By harnessing the power of AI, developers can build more efficient and scalable infrastructure solutions.

About the Author

Rate this Article

Adoption
Style

BT