Select, group, organize, and connect cards - AWS Application Composer

Select, group, organize, and connect cards

This section describes how you select, group, connect, and organize Application Composer cards in its visual canvas.

Select a card to design with

To add a card to your application, select it from the resource palette and drag it onto the canvas.

Selecting a resource from the resource palette and dragging it onto the Application Composer canvas.

Group cards together

There are two ways to group cards together:

  • While pressing Shift, select cards to group. Then, choose Group from the resource actions menu.

  • select a card you want in a group. From the menu that appears, select Group. This will create a group that you can drag and drop other cards into.

Selecting multiple Lambda functions and grouping them together.

Connect cards

On enhanced component cards, ports visually identify where connections can be made.

  • A port on the right side of a card indicates an opportunity for the card to invoke another card.

  • A port on the left side of a card indicates an opportunity for the card to be invoked by another card.

Connect cards together by clicking on a the right port of one card and dragging it onto a left port on another card.

An image of an API Gateway card being connected to a Lambda function.

When you connect enhanced component cards together, Application Composer automatically creates the infrastructure code in your template to provision the event-driven relationship between your resources.

Disconnecting enhanced component cards

To disconnect enhanced component cards, select the line and choose Disconnect.

An image of an API Gateway card being disconnected from a Lambda function.

Application Composer will automatically modify your template to remove the event-driven relationship from your application.

Supported connections

When you create a connection, a message will display, letting you know if the connection was successfully made. Select the message to see what Application Composer changed to provision a connection. If the connection was unsuccessful, you can select Template view to manually update your infrastructure code to provision the connection.

  • When successful, click on the message to view the Change inspector. Here, you can see what Application Composer modified to provision your connection.

  • When unsuccessful, a message will display. You can select the Template view and manually update your infrastructure code to provision the connection.

Bringing up the Change Inspector from the bottom of the screen.

What enhanced component cards provision

Connections between two cards, visually indicated by a line, provision the following when necessary:

  • AWS Identity and Access Management (IAM) policies

  • Environment variables

  • Events

IAM policies

When a resource needs permission to invoke another resource, Application Composer provisions resource-based policies using AWS Serverless Application Model (AWS SAM) policy templates.

Environment variables

Environment variables are temporary values that can be changed to affect the behavior of your resources. When necessary, Application Composer defines the infrastructure code to utilize environment variables between resources.

Events

Resources can invoke another resource through different types of events. When necessary, Application Composer defines the infrastructure code necessary for resources to interact through event types.

Standard IaC resource cards do not include ports to create connections with other resources. During card configuration, you specify event-driven relationships in the template of your application, Application Composer will automatically detect these connections and visualize them with a dotted line between your cards. The following is an example of a connection between a standard component card and an enhanced component card:

An image of a standard component card connected to an enhanced component card.

For more information on connecting cards, see Standard IaC resource cards (standard component cards).

Invoke an AWS Lambda function when an item is placed in an Amazon Simple Storage Service (Amazon S3) bucket

In this example, an Amazon S3 bucket card is connected to a Lambda function card. When an item is placed in the Amazon S3 bucket, the function is invoked. The function can then be used to process the item or trigger other events in your application.

A connection from the right port of a Amazon S3 bucket resource to the left port of a Lambda function resource.

This interaction requires that an event be defined for the function. Here is what Application Composer provisions:

Transform: AWS::Serverless-2016-10-31 ... Resources: MyBucket: Type: AWS::S3::Bucket ... MyBucketBucketPolicy: Type: AWS::S3::BucketPolicy ... MyFunction: Type: AWS::Serverless::Function Properties: ... Events: MyBucket: Type: S3 Properties: Bucket: !Ref MyBucket Events: - s3:ObjectCreated:* # Event that triggers invocation of function - s3:ObjectRemoved:* # Event that triggers invocation of function

Invoke an Amazon S3 bucket from a Lambda function

In this example, a Lambda function card invokes an Amazon S3 bucket card. The Lambda function can be used to perform CRUD operations on items in the Amazon S3 bucket.

A connection from the right port of an Lambda function resource to the left port of a Amazon S3 bucket resource.

This interaction requires the following, which is provisioned by Application Composer:

  • IAM policies that allow the Lambda function to interact with the Amazon S3 bucket.

  • Environment variables that influence the behavior of the Lambda function.

Transform: AWS::Serverless-2016-10-31 ... Resources: MyBucket: Type: AWS::S3::Bucket ... MyBucketBucketPolicy: Type: AWS::S3::BucketPolicy ... MyFunction: Type: AWS::Serverless::Function Properties: ... Environment: Variables: BUCKET_NAME: !Ref MyBucket BUCKET_ARN: !GetAtt MyBucket.Arn Policies: - S3CrudPolicy: BucketName: !Ref MyBucket

Arrange cards on your canvas

Select Arrange to visually arrange and organize the canvas.