

Version 4 (V4) of the AWS SDK for .NET has been released\$1

For information about breaking changes and migrating your applications, see the [migration topic](https://docs.aws.amazon.com/sdk-for-net/v4/developer-guide/net-dg-v4.html).

 [https://docs.aws.amazon.com/sdk-for-net/v4/developer-guide/net-dg-v4.html](https://docs.aws.amazon.com/sdk-for-net/v4/developer-guide/net-dg-v4.html)

# Deploy applications to AWS
Deploy to AWS

After you've developed your cloud-native .NET Core application or service on a development machine, you'll want to deploy it to AWS. You can do this by using the AWS Management Console or certain services like CloudFormation or AWS Cloud Development Kit (AWS CDK). You can also use AWS tools that have been created for the purpose of deployment. By using these tools, you can do the following.

## Deploy from the .NET CLI


You can use the following AWS tools for .NET CLI to deploy your applications to AWS:
+ [AWS Deploy Tool for .NET CLI](https://aws.github.io/aws-dotnet-deploy/) - Supports deployments to [AWS App Runner](https://aws.amazon.com/apprunner/), [Amazon Elastic Container Service (Amazon ECS)](https://aws.amazon.com/ecs/) , and [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/).
+ [AWS Lambda Tools for .NET CLI](https://www.nuget.org/packages/Amazon.Lambda.Tools) - Supports deployments of AWS Lambda projects.

## Deploy from the IDE toolkits


You can use AWS toolkits to deploy your applications directly from the IDE of your choice:
+ **[AWS Toolkit for Visual Studio](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/deployment-chapt.html)**
**Note**  
The "Publish to AWS" feature in the toolkit exposes the same functionality as the AWS Deploy Tool for .NET CLI. To learn more, go to [Publish to AWS](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/publish-experience.html) in the *AWS Toolkit for Visual Studio User Guide*.
+ **[AWS Toolkit for JetBrains](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)**

  See [Work with AWS Serverless Applications](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/key-tasks.html#key-tasks-sam) and [Work with AWS App Runner](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/key-tasks.html#key-tasks-app-runner).
+ **[AWS Toolkit for VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/welcome.html)**

  See [Working with serverless applications](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/serverless-apps.html) and [Using AWS App Runner](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/using-apprunner.html).
+ **[AWS Toolkit for Azure DevOps](https://docs.aws.amazon.com/vsts/latest/userguide/tutorial-eb.html)**

## Use cases


The following sections contain use case scenarios for certain types of applications, including information about how you would use the .NET CLI to deploy those applications.
+ [ASP.NET Core apps](deploying-asp-net.md)
+ [.NET Console apps](deploying-console.md)
+ [Blazor WebAssembly apps](deploying-blazor.md)
+ [AWS Lambda projects](deploying-lambda.md)

# ASP.NET Core apps


The [AWS Deploy Tool](https://aws.github.io/aws-dotnet-deploy/) for the .NET CLI helps you deploy your ASP.NET applications and guides you through a deployment process. It's an interactive tooling for the .NET CLI that helps deploy .NET applications with minimum AWS knowledge.

The Deploy Tool has the following capabilities:
+ **Compute recommendations for your application** - Get the compute recommendations and learn which AWS compute is best suited for your application.
+ **Dockerfile generation** - The tool generates a Dockerfile if needed, or uses an existing Dockerfile.
+ **Auto packaging and deployment** – The tool builds the deployment artifacts, provisions the infrastructure by using a generated AWS CDK deployment project, and deploys your application to the chosen AWS compute.
+ **Repeatable and shareable deployments** – You can generate and modify AWS CDK deployment projects to fit your specific use case. You can also version control your projects and share them with your team for repeatable deployments.
+ **Help with learning AWS CDK for .NET** - The tool helps you gradually learn the underlying AWS tools that it is built on, such as the AWS CDK.

The [AWS Deploy Tool](https://aws.github.io/aws-dotnet-deploy/) supports deploying ASP.NET Core applications to the following AWS services:
+ **[Amazon ECS Service](https://aws.amazon.com/ecs/) using [AWS Fargate](https://aws.amazon.com/fargate/)** - Supports deployments of web applications to Amazon Elastic Container Service (Amazon ECS) with compute power managed by an AWS Fargate serverless compute engine.
+ **[AWS App Runner](https://aws.amazon.com/apprunner/)** - Supports deployments to a fully managed service that makes it easy for developers to deploy containerized web applications and APIs at scale. No prior infrastructure experience is required.
+ **[AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)** - Supports deployments to a service that makes it easy for developers to deploy web applications and APIs to a fully managed environment at scale. No prior infrastructure experience is required.

To learn more, see the [tool overview](https://aws.github.io/aws-dotnet-deploy/). To get started from there, navigate to **Documentation**, **Getting started**, and choose **[How to install](https://aws.github.io/aws-dotnet-deploy/docs/getting-started/installation/)** for installation instructions.

# .NET Console apps


The [AWS Deploy Tool](https://aws.github.io/aws-dotnet-deploy/) for the .NET CLI helps you deploy your .NET Console applications as a service or a scheduled task as a container image on Linux and guides you through a deployment process. If your application doesn't have a Dockerfile, the tool automatically generates it. Otherwise, an existing Dockerfile is used.

The Deploy Tool has the following capabilities:
+ **Compute recommendations for your application** - Get the compute recommendations and learn which AWS compute is best suited for your application.
+ **Dockerfile generation** - The tool generates a Dockerfile if needed, or uses an existing Dockerfile.
+ **Auto packaging and deployment** – The tool builds the deployment artifacts, provisions the infrastructure by using a generated AWS CDK deployment project, and deploys your application to the chosen AWS compute.
+ **Repeatable and shareable deployments** – You can generate and modify AWS CDK deployment projects to fit your specific use case. You can also version control your projects and share them with your team for repeatable deployments.
+ **Help with learning AWS CDK for .NET** - The tool helps you gradually learn the underlying AWS tools that it is built on, such as the AWS CDK.

The [AWS Deploy Tool](https://aws.github.io/aws-dotnet-deploy/) supports deploying .NET Console applications to the following AWS services:
+ **[Amazon ECS Service](https://aws.amazon.com/ecs/) using [AWS Fargate](https://aws.amazon.com/fargate/)** - Supports deployments of .NET applications as a service (for example, a background processor) to Amazon Elastic Container Service (Amazon ECS) with compute power managed by AWS Fargate serverless compute engine.
+ **[Amazon ECS Scheduled Task](https://aws.amazon.com/ecs/) using [AWS Fargate](https://aws.amazon.com/fargate/)** - Supports deployments of .NET applications as a scheduled task (for example, end-of-day process) to Amazon ECS with compute power managed by AWS Fargate serverless compute engine.

To learn more, see the [tool overview](https://aws.github.io/aws-dotnet-deploy/). To get started from there, navigate to **Documentation**, **Getting started**, and choose **[How to install](https://aws.github.io/aws-dotnet-deploy/docs/getting-started/installation/)** for installation instructions.

# Blazor WebAssembly apps


The [AWS Deploy Tool](https://aws.github.io/aws-dotnet-deploy/) for the .NET CLI helps you host your Blazor WebAssembly application in Amazon S3, using Amazon CloudFront for content network delivery. Your app is deployed to an S3 bucket for web hosting. The tool creates and configures an S3 bucket, and then uploads your Blazor application to the bucket.

The Deploy Tool has the following capabilities:
+ **Auto packaging and deployment** – The tool builds the deployment artifacts, provisions the infrastructure by using a generated AWS CDK deployment project, and deploys your application to the chosen AWS compute.
+ **Repeatable and shareable deployments** – You can generate and modify AWS CDK deployment projects to fit your specific use case. You can also version control your projects and share them with your team for repeatable deployments.
+ **Help with learning AWS CDK for .NET** - The tool helps you gradually learn the underlying AWS tools that it is built on, such as the AWS CDK.

To learn more, see the [tool overview](https://aws.github.io/aws-dotnet-deploy/). To get started from there, navigate to **Documentation**, **Getting started**, and choose **[How to install](https://aws.github.io/aws-dotnet-deploy/docs/getting-started/installation/)** for installation instructions.

# AWS Lambda projects


AWS Lambda is a compute service that lets you run code without provisioning or managing servers. It runs your code on a high availability compute infrastructure and performs all of the administration of the compute resources. For more information about Lambda, see [What is AWS Lambda?](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) in the *AWS Lambda Developer Guide*.

You can deploy Lambda functions by using the .NET command line interface (CLI).

**Topics**
+ [

## Prerequisites
](#lambda-cli-prereqs)
+ [

## Available Lambda commands
](#listing-the-lam-commands-available-through-the-cli)
+ [

## Steps to deploy
](#publishing-a-net-core-lam-project-from-the-net-core-cli)

## Prerequisites


Before you start using the .NET CLI to deploy Lambda functions, you must meet the following prerequisites:
+ Confirm that you have the .NET CLI installed. For example: `dotnet --version`. If needed, go to [https://dotnet.microsoft.com/download](https://dotnet.microsoft.com/download) to install it.
+ Set up the .NET CLI to work with Lambda. For a description of how to do so, see [.NET Core CLI](https://docs.aws.amazon.com//lambda/latest/dg/csharp-package-cli.html) in the *AWS Lambda Developer Guide*. In that procedure, the following is the deployment command:

  ```
  dotnet lambda deploy-function MyFunction --function-role role
  ```

  If you're not sure how to create an IAM role for this exercise, don't include the `--function-role role` part. The tool will help you create a new role.

## Available Lambda commands


To list the Lambda commands that are available through the .NET CLI, open a command prompt or terminal and enter `dotnet lambda --help`. The command output will be similar to the following:

```
Amazon Lambda Tools for .NET applications
Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet

Commands to deploy and manage AWS Lambda functions:

        deploy-function         Command to deploy the project to AWS Lambda
        ...
        (etc.)

To get help on individual commands execute:
        dotnet lambda help <command>
```

The output lists all the commands that are currently available.

## Steps to deploy


The following instructions assume that you've created an AWS Lambda .NET project. For the purposes of this procedure, the project is named `DotNetCoreLambdaTest`.

1. Open a command prompt or terminal, and navigate to the folder containing your .NET Lambda project file.

1. Enter `dotnet lambda deploy-function`.

1. If prompted, enter the AWS Region (the Region to which your Lambda function will be deployed).

1. When prompted, enter the name of the function to deploy, for example, `DotNetCoreLambdaTest`. It can be the name of a function that already exists in your AWS account or one that hasn't been deployed there yet.

1. When prompted, select or create the IAM role that Lambda will assume when executing the function.

After successful completion, the message **New Lambda function created** is displayed.

```
Executing publish command
...
(etc.)
New Lambda function created
```

If you deploy a function that already exists in your account, the deploy function asks only for the AWS Region (if necessary). In this case, the command output ends with `Updating code for existing function`.

After your Lambda function is deployed, it's ready to use. For more information, see [Examples of How to Use AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/use-cases.html).

Lambda automatically monitors Lambda functions for you and reports metrics through Amazon CloudWatch. To monitor and troubleshoot your Lambda function, see [Monitoring and troubleshooting Lambda applications](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html).