Working with Publish to Amazon in Visual Studio - Amazon Toolkit with Amazon Q
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).

Working with Publish to Amazon in Visual Studio

Publish to Amazon is an interactive deployment experience that assists you with publishing your .NET applications to Amazon deployment targets, supporting applications targeting .NET Core 3.1 and later. Working with Publish to Amazon keeps your work flow inside of Visual Studio by making these deployment features available, directly from your IDE:

  • The ability to deploy your application with a single click.

  • Deployment recommendations based on your application.

  • Automatic Dockerfile creation, as is relevant and required by your deployment destination's environment (deployment target).

  • Optimized settings for building and packaging your applications, as required by your deployment target.

Note

For additional information about publishing .NET Framework applications, see the guide Creating and deploying .NET applications on Elastic Beanstalk

You can also access Publish to Amazon from the .NET CLI. For more information, see the Deploy .NET applications on Amazon guide.

Prerequisites

To successfully publish .NET applications to an Amazon service, install the following to your local device:

  • .NET Core 3.1+(which includes .NET5 and .NET6): For additional information about these products and download information, visit the Microsoft download site.

  • Node.js 14.x or later version: Node.js is required to run Amazon Cloud Development Kit (Amazon CDK). To download or obtain more information about Node.js, visit the Node.js download site.

    Note

    Publish to Amazon utilizes Amazon CDK to deploy your application and all of its deployment infrastructure as a single project. For more information about Amazon CDK see the Cloud Development Kit guide.

  • (Optional) Docker is used when deploying to a container-based service such as Amazon ECS. For more information and to download Docker, see the Docker download site.

Supported application types

Before publishing to a new or exiting target, begin by creating or opening one of the following project types in Visual Studio:

  • ASP.NET Core application

  • .NET Console application

  • Blazor WebAssembly application

Publishing applications to Amazon targets

When publishing to a new target, Publish to Amazon will guide you through the process by making recommendations and using common settings. If you need to publish to a target that was set up previously, your preferences are stored and can be adjusted, or are immediately available for one-click deployment.

Note

Toolkits integration with the .NET CLI Server:

Publishing launches a .NET server process on the localhost to perform the publication process.

Publish to a new target

The following describes how to configure your Publish to Amazon deployment preferences, when you're publishing to a new target.

  1. From the Amazon Explorer, expand the Credentials drop-down menu, then choose the Amazon profile that corresponds with the region and Amazon services that are required for your deployment.

  2. Expand the Region drop-down menu, then choose the Amazon region that contains the Amazon services that are necessary for your deployment.

  3. From the Visual Studio Solutions Explorer pane, open the context menu for (right-click) the project's name, and choose Publish to Amazon. This will open Publish to Amazon.

  4. From Publish to Amazon, choose Publish to New Target to configure a new deployment.

    Note

    To modify your default deployment credentials, choose or click the Edit link located next to the Credentials section, in Publish to Amazon.

    To bypass the target configuration process, choose Publish to Existing Target, then pick your preferred configuration from the list of your previous deployment targets.

  5. From the Publish Targets pane, choose an Amazon service to manage your application deployment.

  6. When you are satisfied with your configuration, choose Publish to start the deployment process.

    Note

    After initiating a deployment, Publish to Amazon displays the following status updates:

    • During the deployment process, Publish to Amazon displays information about the deployment's progress.

    • Following the deployment process, Publish to Amazon indicates if the deployment succeeded or failed.

    • After a successful deployment, the Resources panel offers additional information about the resource that was created. This information will vary depending on the type of application and deployment configuration.

Publish to an existing target

The following describes how to republish your .NET application to an existing Amazon target.

  1. From the Amazon Explorer, expand the Credentials drop-down menu, then choose the Amazon profile that corresponds with the region and Amazon services that are required for your deployment.

  2. Expand the Region drop-down menu, then choose the Amazon region that contains the Amazon services that are necessary for your deployment.

  3. From the Visual Studio Solutions Explorer pane, right-click the project's name and choose Publish to Amazon to open Publish to Amazon.

  4. From Publish to Amazon, choose Publish to Existing Target to select your deployment environment from a list of existing targets.

    Note

    If you have recently published any applications to the Amazon Cloud, those applications are displayed in Publish to Amazon.

  5. Select the publishing target that you want to deploy your application to, then click Publish to start the deployment process.