Alvecta.Foundation.Deployment.Cdk
6.3.64
See the version list below for details.
dotnet add package Alvecta.Foundation.Deployment.Cdk --version 6.3.64
NuGet\Install-Package Alvecta.Foundation.Deployment.Cdk -Version 6.3.64
<PackageReference Include="Alvecta.Foundation.Deployment.Cdk" Version="6.3.64" />
<PackageVersion Include="Alvecta.Foundation.Deployment.Cdk" Version="6.3.64" />
<PackageReference Include="Alvecta.Foundation.Deployment.Cdk" />
paket add Alvecta.Foundation.Deployment.Cdk --version 6.3.64
#r "nuget: Alvecta.Foundation.Deployment.Cdk, 6.3.64"
#:package Alvecta.Foundation.Deployment.Cdk@6.3.64
#addin nuget:?package=Alvecta.Foundation.Deployment.Cdk&version=6.3.64
#tool nuget:?package=Alvecta.Foundation.Deployment.Cdk&version=6.3.64
Alvecta.Foundation.Deployment.Cdk
Reusable AWS CDK (C#) building blocks that deploy an Alvecta application from one cdk.json
manifest: DNS and certificates, one Lambda per service (.NET behind HTTP API Gateway, Node.js/SSR
behind CloudFront), SNS notification topics, SSM secrets and IAM grants, plus an optional Aurora
DSQL cluster in a separate database app.
It sits outside the Clean Architecture layers: it is referenced only by a solution's
*.Deployment.Cdk project, never by application code. Dependencies: Amazon.CDK.Lib,
Constructs, Alvecta.Utils and Alvecta.Utils.Json.
Two CDK apps
| App | Entry point | Stacks |
|---|---|---|
| Application | Hosting.CdkApplicationHost.Run(applicationName, createApplicationStack) |
{env}-{app}-DnsAndCert-Stack in us-east-1 (subdomain hosted zone, NS delegation, CloudFront wildcard certificate), then {env}-{app}-Stack, your regional stack |
| Database | Hosting.CdkDatabaseHost.Run(applicationName) |
{env}-{app}-Database-Stack: the Aurora DSQL cluster, termination-protected and retained on delete |
Both pick the environment from the env context value (cdk deploy -c env=Dev) and read its block
from Environments in cdk.json. The database app is deployed on its own and first. It writes the
cluster's endpoint and ARN to SSM Parameter Store, where the application stack reads them at deploy
time, so the two apps share no CloudFormation export and an application deploy never touches the
database.
What the regional stack gets
A single Composition.ServicesConstruct builds the whole regional stack from a list of
ServiceDefinitions:
ServiceDefinition.DotNet<TSettings>(serviceName, projectName, iamPolicies)— a .NET Lambda published fromsrc/Parts/<serviceName>/<projectName>/<projectName>.csproj, fronted by HTTP API Gateway on<hostName>.<subdomain>, with throttling, an optional warm-up schedule and an optional long-timeout migration function.ServiceDefinition.Node<TSettings>(...)— a Node.js (SSR) Lambda fronted by CloudFront.- Settings checked at synth time — each service's
EnvironmentVariablesblock must deserialize intoTSettings, so a missing required setting failscdk synth, not the running service. The block is flattened into Lambda environment variables with__separators. secret:<ssm-name>values — each referenced parameter is created as aSecureStringwith the placeholderdefaultwhen it does not exist yet (an existing value is never overwritten). The service resolves it at startup withAlvecta.Foundation.Infrastructure.AmazonSsm.variable:<name>and${variable:<name>}values — replaced with stack values: the ARN of a declared notification topic, orDsqlClusterEndpoint/DsqlClusterArn. An unknown name fails synth.- IAM —
Helpers.ServiceIamPolicyFactory.CreateServicePoliciesgrants SSM read/write under the environment's parameter prefix,dsql:DbConnectAdminon the cluster (when there is one) andsns:Publishon the topics the service references;CreateFrontendPoliciesgrants SSM read only.
The lower-level constructs (DotNetLambdaApiConstruct, NodeLambdaApiConstruct,
CloudFrontFrontendConstruct, SsmSecretInitializerConstruct) and stacks
(DnsAndCertificateStack, DsqlClusterStack) are public for stacks that need a different shape.
Usage
dotnet add package Alvecta.Foundation.Deployment.Cdk
The application app's entry point and regional stack:
using Alvecta.Foundation.Deployment.Cdk;
using Alvecta.Foundation.Deployment.Cdk.Composition;
using Alvecta.Foundation.Deployment.Cdk.Helpers;
using Alvecta.Foundation.Deployment.Cdk.Hosting;
using Amazon.CDK;
using Constructs;
public static class Program
{
public static void Main() =>
CdkApplicationHost.Run(
applicationName: "Shop",
createApplicationStack: (app, id, props) => new ShopStack(app, id, props));
}
public class ShopStack : Stack
{
public ShopStack(Construct scope, string id, ApplicationStackProps props)
: base(scope, id, props)
{
_ = new ServicesConstruct(
this,
"Services",
new ServicesConstructProps
{
EnvironmentName = props.EnvironmentName,
ApplicationName = props.ApplicationName,
EnvironmentConfig = props.EnvironmentConfig,
CloudFrontCertificate = props.CloudFrontCertificate,
SubdomainZone = props.SubdomainZone,
ServicesFolder = "src/Parts",
Services =
[
ServiceDefinition.DotNet<BackendSettings>(
"Backend",
"Acme.Shop.Backend.Hosting.WebApi.AmazonLambda",
ServiceIamPolicyFactory.CreateServicePolicies),
],
});
}
}
The database app is a second entry point with its own --app command:
public static class Program
{
public static void Main() => CdkDatabaseHost.Run(applicationName: "Shop");
}
The cdk.json context both apps read (property names are case-insensitive; DsqlConfig,
Notifications, WarmupConfig, ThrottlingConfig and MigrationLambdaConfig are optional):
{
"context": {
"Environments": {
"Dev": {
"AwsConfig": { "Account": "123456789012", "Region": "eu-central-1" },
"DnsConfig": {
"ParentHostedZoneId": "Z0123456789ABCDEFGHIJ",
"ParentHostedZoneName": "example.com",
"SubdomainName": "dev-shop",
"BaseDomainName": "example.com"
},
"SsmParameterPrefix": "/DevShop",
"DsqlConfig": { "DeletionProtection": true },
"Notifications": [
{ "Name": "Orders", "Emails": [ "ops@example.com" ], "ResultSnsTopicArnVariableName": "OrdersTopicArn" }
],
"Services": {
"Backend": {
"DomainConfig": { "HostName": "api" },
"LambdaConfig": { "MemorySizeMb": 1024, "TimeoutSeconds": 20 },
"ThrottlingConfig": { "RequestsPerSecond": 100, "BurstRequests": 50 },
"WarmupConfig": { "IntervalMinutes": 3 },
"MigrationLambdaConfig": { "MemorySizeMb": 1024, "TimeoutSeconds": 900 },
"EnvironmentVariables": {
"Database": {
"ConnectionString": "Server=${variable:DsqlClusterEndpoint};Database=postgres;User Id=admin;SearchPath=Shop"
},
"Payments": { "ApiKey": "secret:/DevShop/PaymentsApiKey" },
"Notifications": { "OrdersTopicArn": "variable:OrdersTopicArn" }
}
}
}
}
}
}
}
| Product | Versions 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. |
-
net10.0
- Alvecta.Utils (>= 8.0.66)
- Alvecta.Utils.Json (>= 8.0.66)
- Amazon.CDK.Lib (>= 2.273.0)
- Constructs (>= 10.8.1)
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 |
|---|---|---|
| 7.0.66 | 0 | 10/19/2026 |
| 7.0.65 | 0 | 10/19/2026 |
| 6.3.64 | 0 | 10/19/2026 |
| 6.3.63 | 0 | 10/19/2026 |
| 6.2.62 | 43 | 10/14/2026 |
| 6.1.61 | 85 | 10/9/2026 |
| 6.1.60 | 87 | 10/7/2026 |
| 6.1.59 | 88 | 10/6/2026 |
| 6.1.58 | 89 | 10/5/2026 |
| 6.0.57 | 92 | 10/2/2026 |
| 6.0.56 | 90 | 10/1/2026 |
| 6.0.55 | 90 | 10/1/2026 |
| 5.0.54 | 109 | 9/30/2026 |
| 5.0.53 | 98 | 9/28/2026 |
| 5.0.52 | 98 | 9/17/2026 |
| 5.0.51 | 102 | 9/17/2026 |
| 5.0.50 | 97 | 9/17/2026 |
| 5.0.49 | 96 | 9/17/2026 |
| 5.0.48 | 98 | 9/17/2026 |
| 4.1.47 | 98 | 9/16/2026 |