Set up for deploying with the Amazon SAM CLI and Infrastructure Composer - Amazon Infrastructure Composer
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Set up for deploying with the Amazon SAM CLI and Infrastructure Composer

To deploy your application with Amazon SAM, you first need to install and access the Amazon CLI and the Amazon SAM CLI. The topics in this section provide details on doing this.

Install the Amazon CLI

We recommend installing and setting up the Amazon CLI before installing the Amazon SAM CLI. For instructions, see Install or update to the latest version of the Amazon CLI in the Amazon Command Line Interface User Guide.

Note

After installing the Amazon CLI, you must configure Amazon credentials. To learn more, see Quick setup in the Amazon Command Line Interface User Guide.

Install the Amazon SAM CLI

To install the Amazon SAM CLI, see Installing the Amazon SAM CLI in the Amazon Serverless Application Model Developer Guide.

Access the Amazon SAM CLI

If you use Infrastructure Composer from the Amazon Web Services Management Console, you have the following options to use the Amazon SAM CLI.

Activate local sync mode

With local sync mode, your project folder, including the Amazon SAM template, are automatically saved to your local machine. Infrastructure Composer structures your project directory in a way that Amazon SAM recognizes. You can run the Amazon SAM CLI from the root directory of your project.

For more information about local sync mode, see Locally sync and save your project in the Infrastructure Composer console.

Export your template

You can export your template to your local machine. Then, run the Amazon SAM CLI from the parent folder that contains the template. You can also use the --template-file option with any Amazon SAM CLI command and provide the path to your template.

Use Infrastructure Composer from the Amazon Toolkit for Visual Studio Code

You can use Infrastructure Composer from the Toolkit for VS Code to bring Infrastructure Composer to your local machine. Then, use Infrastructure Composer and the Amazon SAM CLI from VS Code.

Next steps

To deploy your application, refer to Use Infrastructure Composer with Amazon SAM to build and deploy.