

# Sync Infrastructure Composer to deploy to the Amazon Web Services Cloud
<a name="using-composer-ide-sync"></a>

Use the **sync** button in Amazon Infrastructure Composer from the Amazon Toolkit for Visual Studio Code to deploy your application to the Amazon Web Services Cloud.

The **sync** button initiates the `sam sync` command from the Amazon SAM Command Line Interface (CLI).

The `sam sync` command can deploy new applications or quickly sync changes that you make locally to the Amazon Web Services Cloud. Running `sam sync` may include the following:
+ Building your application with `sam build` to prepare your local application files for deployment by creating or updating a local `.aws-sam` directory.
+ For resources that support Amazon service APIs, the Amazon SAM CLI will use the APIs to deploy your changes. The Amazon SAM CLI does this to quickly update your resources in the cloud.
+ If necessary, the Amazon SAM CLI performs an Amazon CloudFormation deployment to update your entire stack through a change set.

The `sam sync` command is best suited for rapid development environments when quickly updating your cloud resources can benefit your development and testing workflows.

To learn more about `sam sync`, see [Using sam sync](https://docs.amazonaws.cn/serverless-application-model/latest/developerguide/using-sam-cli-sync.html) in the *Amazon Serverless Application Model Developer Guide*.

## Set up
<a name="using-composer-ide-sync-setup"></a>

To use the **sync** feature in Infrastructure Composer, you must have the Amazon SAM CLI installed on your local machine. For instructions, see [Installing the Amazon SAM CLI](https://docs.amazonaws.cn/serverless-application-model/latest/developerguide/install-sam-cli.html) in the *Amazon Serverless Application Model Developer Guide*.

When you use the **sync** feature in Infrastructure Composer, the Amazon SAM CLI references your configuration file for the information it needs to sync your application to the Amazon Web Services Cloud. For instructions on creating, modifying, and using configuration files, see [ Configure project settings](https://docs.amazonaws.cn/serverless-application-model/latest/developerguide/using-sam-cli-configure.html#using-sam-cli-configure-project) in the *Amazon Serverless Application Model Developer Guide*.

## Sync and deploy your application
<a name="using-composer-ide-sync-use"></a>

**To sync your application to the Amazon Web Services Cloud**

1. Select the **sync** button on the Infrastructure Composer canvas.

1. You may receive a prompt to confirm that you are working with a development stack. Select **OK** to continue.

1. Infrastructure Composer may prompt you to configure the following options:
   + **Amazon Web Services Region** – The region to sync your application to.
   + **Amazon CloudFormation stack name** – The name of your Amazon CloudFormation stack. You can select an existing stack name or create a new one.
   + **Amazon Simple Storage Service (Amazon S3) bucket** – The name of your Amazon S3 bucket. The Amazon SAM CLI will package and store your application files and function code here. You can select an existing bucket or create a new one.

Infrastructure Composer will initiate the Amazon SAM CLI `sam sync` command and open a terminal window in your IDE to output its progress.