LayeredCraft.Cdk.Constructs
2.1.5.35
dotnet add package LayeredCraft.Cdk.Constructs --version 2.1.5.35
NuGet\Install-Package LayeredCraft.Cdk.Constructs -Version 2.1.5.35
<PackageReference Include="LayeredCraft.Cdk.Constructs" Version="2.1.5.35" />
<PackageVersion Include="LayeredCraft.Cdk.Constructs" Version="2.1.5.35" />
<PackageReference Include="LayeredCraft.Cdk.Constructs" />
paket add LayeredCraft.Cdk.Constructs --version 2.1.5.35
#r "nuget: LayeredCraft.Cdk.Constructs, 2.1.5.35"
#:package LayeredCraft.Cdk.Constructs@2.1.5.35
#addin nuget:?package=LayeredCraft.Cdk.Constructs&version=2.1.5.35
#tool nuget:?package=LayeredCraft.Cdk.Constructs&version=2.1.5.35
LayeredCraft CDK Constructs
A comprehensive library of reusable AWS CDK constructs for .NET projects, designed for serverless applications and static websites. Built with best practices, observability, and cost efficiency in mind.
Features
- ๐ Lambda Functions: Comprehensive Lambda construct with configurable OpenTelemetry support, IAM management, and environment configuration
- ๐ Static Sites: Complete static website hosting with S3, CloudFront, SSL certificates, and Route53 DNS management
- ๐ DynamoDB Tables: Full-featured DynamoDB construct with streams, TTL, and global secondary indexes
- ๐งช Testing Helpers: Extensive testing utilities with fluent assertions and builders
- ๐ Type Safety: Full intellisense and compile-time validation
- โก Performance: Optimized for cold starts with AWS Lambda SnapStart support
Installation
dotnet add package LayeredCraft.Cdk.Constructs
Quick Start
Basic Lambda Function
using Amazon.CDK;
using LayeredCraft.Cdk.Constructs;
using LayeredCraft.Cdk.Constructs.Models;
public class MyStack : Stack
{
public MyStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props)
{
var lambda = new LambdaFunctionConstruct(this, "MyLambda", new LambdaFunctionConstructProps
{
FunctionName = "my-api",
FunctionSuffix = "prod",
AssetPath = "./lambda-deployment.zip",
RoleName = "my-api-role",
PolicyName = "my-api-policy",
GenerateUrl = true, // Creates Function URL for HTTP access
IncludeOtelLayer = true, // Enable OpenTelemetry (disabled by default in v2.0+)
Architecture = "arm64", // Optional: specify architecture (default: amd64)
EnvironmentVariables = new Dictionary<string, string>
{
{ "ENVIRONMENT", "production" },
{ "LOG_LEVEL", "info" }
}
});
}
}
Static Website
var website = new StaticSiteConstruct(this, "Website", new StaticSiteConstructProps
{
DomainName = "example.com",
SiteSubDomain = "www",
AssetPath = "./website-build"
});
DynamoDB Table
var table = new DynamoDbTableConstruct(this, "UserTable", new DynamoDbTableConstructProps
{
TableName = "users",
PartitionKey = new AttributeDefinition { AttributeName = "userId", AttributeType = AttributeType.STRING },
GlobalSecondaryIndexes = [
new GlobalSecondaryIndex
{
IndexName = "email-index",
PartitionKey = new AttributeDefinition { AttributeName = "email", AttributeType = AttributeType.STRING },
ProjectionType = ProjectionType.ALL
}
]
});
Documentation
- Lambda Function Construct - Full-featured Lambda functions with OpenTelemetry, IAM, and more
- Static Site Construct - Complete static website hosting with CloudFront and SSL
- DynamoDB Table Construct - Production-ready DynamoDB tables with streams and indexes
- Testing Guide - Comprehensive testing utilities and patterns
- Examples - Real-world usage examples and patterns
Requirements
- .NET 8.0 or .NET 9.0
- AWS CDK v2 (Amazon.CDK.Lib 2.203.1+)
- AWS CLI configured with appropriate permissions
- Node.js (for CDK deployment)
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
# Clone the repository
git clone https://github.com/LayeredCraft/cdk-constructs.git
cd cdk-constructs
# Restore dependencies
dotnet restore
# Build the project
dotnet build
# Run tests
dotnet run --project test/LayeredCraft.Cdk.Constructs.Tests/ --framework net8.0
Code Style
- Follow C# coding conventions
- Use meaningful names for variables and methods
- Add XML documentation for public APIs
- Include unit tests for new features
- Run tests before submitting PRs
License
This project is licensed under the MIT License.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: https://layeredcraft.github.io/cdk-constructs/
Changelog
See CHANGELOG.md for details on releases and changes.
Built with โค๏ธ by the LayeredCraft team
Contributors โจ
Thanks goes to these wonderful people (emoji key):
<table> <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/taylorbobaylor"><img src="https://avatars.githubusercontent.com/u/25238885?v=4?s=100" width="100px;" alt="Taylor Christian"/><br /><sub><b>Taylor Christian</b></sub></a><br /><a href="https://github.com/LayeredCraft/cdk-constructs/commits?author=taylorbobaylor" title="Documentation">๐</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/ncipollina"><img src="https://avatars.githubusercontent.com/u/1405469?v=4?s=100" width="100px;" alt="Nick Cipollina"/><br /><sub><b>Nick Cipollina</b></sub></a><br /><a href="https://github.com/LayeredCraft/cdk-constructs/commits?author=ncipollina" title="Code">๐ป</a> <a href="https://github.com/LayeredCraft/cdk-constructs/commits?author=ncipollina" title="Documentation">๐</a> <a href="#infra-ncipollina" title="Infrastructure (Hosting, Build-Tools, etc)">๐</a></td> </tr> </tbody> </table>
This project follows the all-contributors specification. Contributions of any kind welcome!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Amazon.CDK.Lib (>= 2.238.0)
-
net8.0
- Amazon.CDK.Lib (>= 2.238.0)
-
net9.0
- Amazon.CDK.Lib (>= 2.238.0)
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 |
|---|---|---|
| 2.1.5.35 | 212 | 2/18/2026 |
| 2.1.4.32 | 188 | 2/11/2026 |
| 2.1.3.31 | 416 | 1/5/2026 |
| 2.1.2.30 | 303 | 12/12/2025 |
| 2.1.1.29 | 794 | 12/3/2025 |
| 2.1.1-beta.28 | 628 | 12/3/2025 |
| 2.1.0.27 | 429 | 10/15/2025 |
| 2.1.0-preview.26 | 146 | 10/15/2025 |
| 2.0.1.25 | 459 | 9/2/2025 |
| 2.0.0.24 | 350 | 8/6/2025 |
| 2.0.0-beta.23 | 323 | 8/6/2025 |
| 1.0.1.22 | 211 | 7/18/2025 |
| 1.0.0.21 | 256 | 7/11/2025 |
| 1.0.0.20 | 210 | 7/10/2025 |
| 1.0.0.19 | 195 | 7/10/2025 |
| 1.0.0.18 | 209 | 7/10/2025 |
| 1.0.0.17 | 213 | 7/9/2025 |
| 1.0.0.16 | 191 | 7/9/2025 |
| 1.0.0.15 | 202 | 7/9/2025 |
| 1.0.0.14 | 210 | 7/9/2025 |