NSchema.Aws 2.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package NSchema.Aws --version 2.0.0
                    
NuGet\Install-Package NSchema.Aws -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NSchema.Aws" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NSchema.Aws" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NSchema.Aws" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NSchema.Aws --version 2.0.0
                    
#r "nuget: NSchema.Aws, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NSchema.Aws@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NSchema.Aws&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NSchema.Aws&version=2.0.0
                    
Install as a Cake Tool

NSchema.Aws

AWS provider for NSchema, the declarative database schema migration library for .NET.

This package plugs an S3-backed implementation of NSchema's ISchemaStateStore into your application, enabling offline migration planning without live database access.

Getting started

Install the core package and this provider:

dotnet add package NSchema
dotnet add package NSchema.Aws

Register the S3 state store against an NSchemaApplicationBuilder:

using NSchema;
using NSchema.Aws;

var builder = NSchemaApplication.CreateBuilder(args);

builder
    .AddSchemasFromAssemblyContaining<Program>()
    .UseCurrentSchemaPostgres(connectionString)
    .UseStateStoreS3("my-bucket", "nschema/state.json");

var app = builder.Build();
await app.Apply();

Configuration

UseStateStoreS3 has three overloads:

// 1. Bucket and key directly.
builder.UseStateStoreS3("my-bucket", "nschema/state.json");

// 2. Configure options via a delegate.
builder.UseStateStoreS3(o =>
{
    o.Bucket = configuration["NSchema:Bucket"]!;
    o.Key = configuration["NSchema:Key"]!;
});

// 3. As above, with access to the IServiceProvider.
builder.UseStateStoreS3((o, sp) =>
{
    var config = sp.GetRequiredService<IConfiguration>();
    o.Bucket = config["NSchema:Bucket"]!;
    o.Key = config["NSchema:Key"]!;
});

By default an AmazonS3Client using ambient credentials (ECS task role, Lambda execution role, environment variables, etc.) is registered automatically. To bring your own client:

// Register via AWSSDK.Extensions.NETCore.Setup before calling UseStateStoreS3.
builder.Services.AddAWSService<IAmazonS3>();
builder.UseStateStoreS3("my-bucket", "nschema/state.json");

IAM permissions

Role Required permission
Deploy / Refresh s3:GetObject, s3:PutObject
Plan (PR build) s3:GetObject

Example policy (scoped to the state object):

{
  "Effect": "Allow",
  "Action": ["s3:GetObject", "s3:PutObject"],
  "Resource": "arn:aws:s3:::my-bucket/nschema/state.json"
}

Locking

State writes are last-write-wins. Concurrent applies will silently overwrite each other's state. This is acceptable when deploys are serialised (e.g. a single ECS task per environment).

License

See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.5 0 6/7/2026
3.0.0-alpha.4 43 6/6/2026
3.0.0-alpha.3 41 6/6/2026
3.0.0-alpha.2 38 6/5/2026
3.0.0-alpha.1 47 6/4/2026
2.0.0 113 6/1/2026
2.0.0-alpha.2 69 5/31/2026
2.0.0-alpha.1 82 5/30/2026