Visually Design Serverless Applications with AWS Infrastructure Composer (formerly AWS Application Composer) - Automatic IaC Template Generation
This article explains visual design of serverless architectures with Infrastructure Composer, automatic SAM template generation, and VS Code integration.
Overview of Infrastructure Composer
Infrastructure Composer is a service that lets you visually design serverless application architectures and automatically creates AWS CloudFormation and AWS SAM templates. Instead of hand-writing YAML, you place resources on a canvas and connect them, and Infrastructure Composer assembles a template, including the required IAM policies and event source settings, in line with AWS best practices.
Visual Design and Bidirectional Sync
When you drag a Lambda function onto the canvas and connect it to API Gateway with a connector line, the API Gateway event source mapping and the Lambda execution role are generated automatically. When you connect a DynamoDB table to Lambda, the table ARN is set as an environment variable, and access permissions to DynamoDB are added to the IAM policy. Changes on the canvas and in the template code are synchronized automatically, and edits you make to the YAML by hand also appear in the diagram. Using the VS Code extension, you can visually edit existing local SAM templates.
Use in Team Development and Limitations
You test templates designed in Infrastructure Composer locally with SAM CLI, commit them to a Git repository, and put them into your usual IaC workflow. Changes you make on the visual canvas are also reflected in the template automatically, so you check the differences in code reviews. The resources you can work with in Infrastructure Composer are not limited to serverless resources such as Lambda, API Gateway, DynamoDB, S3, SQS, SNS, and Step Functions. Resources such as VPC, RDS, and ElastiCache can also be placed on the canvas if CloudFormation supports them. In templates that make heavy use of complex Conditions and Mappings, the boundary between visual editing and manual editing becomes blurred, so it is important for the team to set rules on how much to manage in Composer and where to start writing by hand.
Choosing Between CloudFormation / SAM
Infrastructure Composer is a tool for working with CloudFormation and AWS SAM templates as diagrams, and it does not replace CloudFormation or SAM CLI. It is well suited to quickly prototyping new serverless applications. Importing a large existing template (hundreds of resources) makes the canvas cluttered and reduces usability, so you decide carefully whether to apply it to existing projects. In projects that use CDK, you can visualize the CloudFormation templates generated by CDK constructs in Composer, but there is no feature to convert edits made in Composer back into CDK code, so using it as a read-only visualization tool is the practical approach. When combined with SAM Accelerator (sam sync), you can run a cycle of designing in Composer, hot deploying with sam sync, and verifying behavior at short intervals.
Infrastructure Composer Pricing
There is no charge for using Infrastructure Composer itself. No additional charges apply to the visual editor in the AWS console, the VS Code extension, or automatic SAM template generation. The only cost is the usage charges for the AWS resources deployed with the generated templates. Local testing combined with SAM CLI is also not subject to additional charges.
The Flow from Idea to Deployment
Infrastructure Composer smoothly connects the series of steps from design to deployment. When you assemble an architecture by placing / connecting resources on the screen, the corresponding IaC template is generated. When you draw lines between resources, the required permissions and settings are filled in automatically, which reduces the effort of writing detailed wiring by hand. You can take the generated templates, combine them with development tools for serverless, and proceed to local testing and deployment to production. Being able to quickly give shape to the architecture in your head and turn it directly into something that runs helps you get development started.
Automatic Wiring of Event Sources and Permissions
In serverless applications, you need to correctly connect multiple resources, such as functions, data stores, and message queues. When you write this by hand, missing permission grants and mistakes in connection settings tend to occur. When you connect resources to each other in the visual design, the permissions and reference settings that the relationship requires are automatically reflected in the template. This reduces wiring mistakes and also shortens the time it takes to isolate why something does not work. Assembling resource relationships visually puts the complex settings behind them in order, which makes serverless development work easier.
As an Aid to Learning and Understanding
Infrastructure Composer is also useful as an entry point for learning serverless configurations. When you place and connect resources, you can understand which part of the template each one corresponds to by comparing the diagram with the code. For beginners who are learning how to write IaC, this helps them see abstract templates as concrete configurations. In addition, if you load an existing template and turn it into a diagram, you can quickly grasp the overall picture of a complex application, which helps during handovers and investigations. Being able to understand the visual and the written forms together supports learning and maintenance in serverless development.
Summary
Infrastructure Composer is a tool that visualizes the design of serverless applications and speeds up the initial IaC setup through automatic SAM template generation. Bidirectional sync between the visual canvas and YAML makes it easier to keep design and implementation aligned. It is well suited to prototyping and small to medium-sized serverless projects.
References (Official AWS Resources)
The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.
- AWS Infrastructure Composer official page
- AWS Lambda official page
- Amazon API Gateway official page
- AWS Documentation (official)
If this page and the official documentation disagree, treat the official documentation as authoritative.