LayeredCraft.Cdk.Constructs
1.0.0.21
dotnet add package LayeredCraft.Cdk.Constructs --version 1.0.0.21
NuGet\Install-Package LayeredCraft.Cdk.Constructs -Version 1.0.0.21
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="LayeredCraft.Cdk.Constructs" Version="1.0.0.21" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LayeredCraft.Cdk.Constructs" Version="1.0.0.21" />
<PackageReference Include="LayeredCraft.Cdk.Constructs" />
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 LayeredCraft.Cdk.Constructs --version 1.0.0.21
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LayeredCraft.Cdk.Constructs, 1.0.0.21"
#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 LayeredCraft.Cdk.Constructs@1.0.0.21
#: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=LayeredCraft.Cdk.Constructs&version=1.0.0.21
#tool nuget:?package=LayeredCraft.Cdk.Constructs&version=1.0.0.21
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 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
EnvironmentVariables = new Dictionary<string, string>
{
{ "ENVIRONMENT", "production" },
{ "LOG_LEVEL", "info" }
}
});
}
}
Static Website
var website = new StaticSiteConstruct(this, "Website", new StaticSiteConstructProps
{
SiteBucketName = "my-website-bucket",
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
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 was computed. 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.
-
net8.0
- Amazon.CDK.Lib (>= 2.204.0)
-
net9.0
- Amazon.CDK.Lib (>= 2.204.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 |
---|---|---|
1.0.0.21 | 145 | 7/11/2025 |
1.0.0.20 | 134 | 7/10/2025 |
1.0.0.19 | 123 | 7/10/2025 |
1.0.0.18 | 122 | 7/10/2025 |
1.0.0.17 | 128 | 7/9/2025 |
1.0.0.16 | 122 | 7/9/2025 |
1.0.0.15 | 130 | 7/9/2025 |
1.0.0.14 | 127 | 7/9/2025 |
1.0.0.13 | 127 | 7/9/2025 |
1.0.0.12 | 129 | 7/9/2025 |
1.0.0.11 | 129 | 7/9/2025 |
0.1.0-beta.10 | 112 | 7/9/2025 |
0.1.0-beta.9 | 109 | 7/8/2025 |
0.1.0-beta.8 | 115 | 7/8/2025 |
0.1.0-beta.7 | 106 | 7/7/2025 |
0.1.0-beta.6 | 107 | 7/4/2025 |
0.1.0-beta.5 | 99 | 7/4/2025 |
0.1.0-beta.4 | 104 | 7/3/2025 |
0.1.0-beta.3 | 102 | 7/3/2025 |
0.1.0-beta.2 | 111 | 7/3/2025 |
0.1.0-beta.1 | 114 | 7/3/2025 |