

# Infrastructure Composer cards
Cards

Infrastructure Composer simplifies the process of writing infrastructure as code (IaC) for CloudFormation resources. To effectively use Infrastructure Composer, there are two basic concepts you should first understand: Infrastructure Composer [cards](#using-composer-cards-intro) and [card connections](using-composer-connecting.md).

In Infrastructure Composer, cards represent CloudFormation resources. there are two general categories of cards:
+ [Enhanced component card](using-composer-cards-component-intro-enhanced.md) – A collection of CloudFormation resources that have been combined into a single curated card that enhances ease of use, functionality, and are designed for a wide variety of use cases. Enhanced component cards are the first cards listed in the **Resources** palette in Infrastructure Composer.
+ [Standard IaC resource card](using-composer-cards-resource-intro.md) – A single AWS CloudFormation resource. Each standard IaC resource card, once dragged onto the canvas, is labeled **Standard component** and may be combined into multiple resources.

**Note**  
Depending on the card, a *Standard IaC resource* card may be labeled a **Standard component** card after it has been dragged onto the visual canvas. This simply means the card is a collection of one or more standard IaC resource cards.

While some types of cards are available from the **Resources** palette, cards can also appear on the canvas when you import an existing CloudFormation or AWS Serverless Application Model (AWS SAM) template into Infrastructure Composer. The following image is an example of an imported application that contains various card types:

![\[An imported application template displayed on the Infrastructure Composer canvas, showing various card types.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_11.png)


**Topics**
+ [

# Enhanced component cards in Infrastructure Composer
](using-composer-cards-component-intro-enhanced.md)
+ [

# Standard component cards in Infrastructure Composer
](using-composer-cards-resource-intro.md)
+ [

# Card connections in Infrastructure Composer
](using-composer-connecting.md)

# Enhanced component cards in Infrastructure Composer
Enhanced component cards

Enhanced component cards are created and managed by Infrastructure Composer. Each card contains CloudFormation resources that are commonly used together when building applications on AWS. Their infrastructure code is created by Infrastructure Composer following AWS best practices. Enhanced component cards are a great way to start designing your application.

Enhanced component cards are available from the *Resources* palette, under the *Enhanced components* section.

*Enhanced component cards* can be fully configured and used within Infrastructure Composer to design and build your serverless applications. We recommend using enhanced component cards when designing your applications with no existing code.

This table displays our enhanced components with links to the AWS CloudFormation or AWS Serverless Application Model (AWS SAM) template specification of the card’s featured resource:


| Card | Reference | 
| --- | --- | 
|  Amazon API Gateway  |  [AWS::Serverless::API](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html)  | 
|  Amazon Cognito UserPool  |  [AWS::Cognito::UserPool](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html)  | 
|  Amazon Cognito UserPoolClient  |  [AWS::Cognito::UserPoolClient](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html)  | 
|  Amazon DynamoDB Table  |  [AWS::DynamoDB::Table](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html)  | 
|  Amazon EventBridge Event rule  |  [AWS::Events::Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html)  | 
|  EventBridge Schedule  |  [AWS::Scheduler::Schedule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-scheduler-schedule.html)  | 
|  Amazon Kinesis Stream  |  [AWS::Kinesis::Stream](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html)  | 
|  AWS Lambda Function  |  [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)  | 
|  Lambda Layer  |  [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html)  | 
|  Amazon Simple Storage Service (Amazon S3) Bucket  |  [AWS::S3::Bucket](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html)  | 
|  Amazon Simple Notification Service (Amazon SNS) Topic  |  [AWS::SNS::Topic](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html)  | 
|  Amazon Simple Queue Service (Amazon SQS) Queue  |  [AWS::SQS::Queue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sqs-queue.html)  | 
|  AWS Step Functions State machine  |  [AWS::Serverless::StateMachine](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html)  | 

## Example


The following is an example of an **S3 Bucket** enhanced component:

![\[An S3 Bucket enhanced component card.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_07.png)


When you drag an **S3 Bucket** component card onto the canvas and view your template, you will see the following two CloudFormation resources added to your template:
+ `AWS::S3::Bucket`
+ `AWS::S3::BucketPolicy`

The **S3 Bucket** enhanced component card represents two CloudFormation resources that are both required for an Amazon Simple Storage Service (Amazon S3) bucket to interact with other services in your application.

# Standard component cards in Infrastructure Composer
Standard component cards

Before a standard component card is placed on Infrastructure Composer's visual canvas, it is listed as a **Standard (IaC) resource** card on the **Resources** palette in Infrastructure Composer. A standard (IaC) resource card represents a single CloudFormation resource. Each standard IaC resource card, once placed on the visual canvas, becomes a card labeled **Standard component**, and may be combined to represent multiple CloudFormation resources.

![\[Standard IaC resource cards in the Resources palette.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_12.png)


Each standard IaC resource card can be identified by its CloudFormation resource type. The following is an example of a standard IaC resource card that represents an `AWS::ECS::Cluster` CloudFormation resource type:

![\[A standard IaC resource cluster card.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_08.png)


Each standard component card visualizes the CloudFormation resources that it contains. The following is an example of a standard component card that includes two standard IaC resources:

![\[A DemoLambdaFunction standard component card that includes two standard IaC resource cards.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_13.png)


As you configure the properties of your standard component cards, Infrastructure Composer may combine related cards together. For example, here are two standard component cards:

![\[Two standard component cards. One is an AWS::Lambda::Function card and the other is an AWS::IAM::Role card.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_14.png)


In the **Resource properties** panel of the standard component card representing an `AWS::Lambda::Function` resource, we reference the AWS Identity and Access Management (IAM) role by its logical ID:

![\[The Resource properties panel for the AWS::Lambda::Function standard component card.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_15.png)


After saving our template, the two standard component cards combine into a single standard component card.

![\[A standard component card that includes two CloudFormation resources.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_cards_16.png)


# Card connections in Infrastructure Composer
Card connections

In AWS Infrastructure Composer, a connection between two cards is visually displayed by a line. These lines represent event-driven relationships within your application.

**Topics**
+ [

## Connections between cards
](#using-composer-connecting-cards)
+ [

## Connections between enhanced component cards
](#using-composer-connecting-enhanced)
+ [

## Connections to and from standard IaC resource cards
](#using-composer-connecting-standard)

## Connections between cards


How you connect cards together varies depending on the card type. Each enhanced card has at least one connector port. To connect them, you simply select one connector port and drag it to the port of another card, and Infrastructure Composer will connect the two resources or display a message stating this configuration isn’t supported. 

![\[An API Gateway card connected to a Lambda function.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_use_con_01.png)


As seen above, lines between enhanced component cards are solid. Conversely, standard IaC resource cards (also referred to as standard component cards) do not have connector ports. For these cards, you must specify these event-driven relationships in your application's template, and Infrastructure Composer will automatically detect their connections and visualize them with a dotted line between your cards.

![\[An image of a standard component card connected to an enhanced component card.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_use_con_04.png)


To learn more, see the sections below.

## Connections between enhanced component cards


In Infrastructure Composer, a connection between two enhanced component cards is visually displayed by a solid line. These lines represent event-driven relationships within your application.

To connect two cards, click on a port from one card and drag it onto a port on another card.

![\[Selecting a port from one resource card and connecting it to another resource card on the Infrastructure Composer canvas.\]](http://docs.aws.amazon.com/infrastructure-composer/latest/dg/images/aac_ref_08.gif)


**Note**  
Standard IaC resource cards do not have connector ports. For these cards, you must specify their event-driven relationships in your application's template, and Infrastructure Composer will automatically detect their connections and visualize them with a dotted line between your cards.

For more information, see [Connect cards on Infrastructure Composer's visual canvas](reference-navigation-gestures-connect.md).

### 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, Infrastructure Composer provisions resource-based policies using AWS Serverless Application Model (AWS SAM) policy templates.
+ To learn more about IAM permissions and policies, see [Overview of access management: Permissions and policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html) in the *IAM User Guide*.
+ To learn more about AWS SAM policy templates, see [AWS SAM policy templates](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-policy-templates.html) in the *AWS Serverless Application Model Developer Guide*.

#### Environment variables


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

#### Events


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

## Connections to and from standard IaC resource cards


All CloudFormation resources are available to use as standard IaC resource cards from the **Resources** palette. When you drag a standard IaC resource card onto the canvas, a standard IaC resource card becomes a standard component card, and this prompts Infrastructure Composer to create a starting template for your resource in your application.

For more information, see [Standard cards in Infrastructure Composer](using-composer-standard-cards.md).