How to use the .NET AWS SDK with LocalStack.


The AWS SDK for .NET, like other AWS SDKs, lets you set the endpoint when creating resource clients, which is the preferred way of integrating the .NET SDK with LocalStack.


Here is an example of how to create an LambdaClient with the endpoint set to LocalStack.

var lambdaClient = new AmazonLambdaClient(new AmazonLambdaConfig()
        ServiceURL = "http://localhost:4566"

If you want to specify a region and credentials when creating the client, please set them as AuthenticationRegion and BasicAWSCredentials, like in this example:

var lambdaClient = new AmazonLambdaClient(new BasicAWSCredentials("temp", "temp"), new AmazonLambdaConfig()
        ServiceURL = "http://localhost:4566",
        AuthenticationRegion = "eu-west-1"


Last modified December 1, 2022: LocalStack Beta Docs (#337) (28576f89)