AwsUtil 2.2.9
dotnet add package AwsUtil --version 2.2.9
NuGet\Install-Package AwsUtil -Version 2.2.9
<PackageReference Include="AwsUtil" Version="2.2.9" />
<PackageVersion Include="AwsUtil" Version="2.2.9" />
<PackageReference Include="AwsUtil" />
paket add AwsUtil --version 2.2.9
#r "nuget: AwsUtil, 2.2.9"
#:package AwsUtil@2.2.9
#addin nuget:?package=AwsUtil&version=2.2.9
#tool nuget:?package=AwsUtil&version=2.2.9
AwsUtil
A comprehensive C# utility library wrapping 133 AWS services with cached clients, structured exceptions, placeholder resolution, and multi-service orchestration — the .NET port of aws-util.
Features
- 133 AWS Service Wrappers — High-level methods for S3, DynamoDB, Lambda, SQS, Bedrock, ECS, RDS, and 126 more
- Cached Client Factory — LRU cache with TTL-based eviction (15-min default, max 64 clients) so credential rotations are picked up automatically
- Dual API Surface — Every operation has both
async Task<T>and synchronous overloads - Structured Exception Hierarchy — AWS error codes classified into 6 semantic exception types plus a catch-all
- Placeholder Resolution — Inline
${ssm:/path}and${secret:name:key}references resolved from SSM Parameter Store and Secrets Manager - Config Loader — Batch load app config from SSM parameter paths with optional Secrets Manager overlay
- 30+ Multi-Service Orchestrations — Pre-built patterns for blue/green deploys, data pipelines, security ops, disaster recovery, and more
Quick Start
Install
dotnet add package AwsUtil
Use a service
using AwsUtil;
using AwsUtil.Services;
// S3 operations
await S3Service.UploadFileAsync("my-bucket", "data/file.json", "/tmp/file.json");
var bytes = await S3Service.DownloadBytesAsync("my-bucket", "data/file.json");
var url = S3Service.GeneratePresignedUrl("my-bucket", "data/file.json", expiresIn: 3600);
// SQS operations
await SqsService.SendMessageAsync(
"https://sqs.us-east-1.amazonaws.com/123/my-queue", "hello");
var messages = await SqsService.ReceiveMessagesAsync(
"https://sqs.us-east-1.amazonaws.com/123/my-queue");
// DynamoDB operations
await DynamoDbService.PutItemAsync("my-table", item);
var result = await DynamoDbService.GetItemAsync("my-table", key);
// Placeholder resolution (SSM + Secrets Manager)
var dbHost = (string)Placeholder.Retrieve("${ssm:/myapp/db/host}")!;
var dbPass = (string)Placeholder.Retrieve("${secret:myapp/db-credentials:password}")!;
Multi-service orchestration
// Batch config loading from SSM + Secrets Manager
var config = await ConfigLoader.LoadAppConfigAsync(
"/myapp/prod/", secretName: "myapp/secrets");
var dbUrl = config.Get("database-url");
// DB credentials from Secrets Manager
var creds = await ConfigLoader.GetDbCredentialsAsync("myapp/db-creds");
Exception Handling
All AWS errors are mapped to semantic exception types via ErrorClassifier:
| Exception | Example AWS Error Codes |
|---|---|
AwsThrottlingException |
Throttling, TooManyRequestsException, SlowDown |
AwsNotFoundException |
ResourceNotFoundException, NoSuchKey, NoSuchBucket |
AwsPermissionException |
AccessDenied, UnauthorizedOperation, ExpiredToken |
AwsConflictException |
ConflictException, AlreadyExistsException |
AwsValidationException |
ValidationException, InvalidParameterValue |
AwsTimeoutException |
Operation timeout |
AwsServiceException |
Catch-all for unclassified errors |
try
{
await S3Service.DownloadBytesAsync("my-bucket", "missing-key");
}
catch (AwsNotFoundException ex)
{
Console.WriteLine($"Not found: {ex.ErrorCode}"); // "NoSuchKey"
}
catch (AwsThrottlingException)
{
// Back off and retry
}
catch (AwsUtilException ex)
{
Console.WriteLine($"{ex.GetType().Name}: {ex.Message} [{ex.ErrorCode}]");
}
Placeholder Resolution
Resolve AWS references embedded in configuration strings:
// SSM Parameter Store
var host = (string)Placeholder.Retrieve("${ssm:/myapp/db/host}")!;
// Secrets Manager (full secret)
var secret = (string)Placeholder.Retrieve("${secret:myapp/api-key}")!;
// Secrets Manager (JSON key extraction)
var password = (string)Placeholder.Retrieve("${secret:myapp/db-creds:password}")!;
// Async version
var value = await Placeholder.RetrieveAsync("${ssm:/myapp/config}");
// Clear caches
Placeholder.ClearAllCaches();
Service Coverage
Core: S3, SQS, DynamoDB, Lambda, SNS, SES (v1 & v2), Parameter Store, Secrets Manager, KMS, STS, IAM, EC2
Compute & Containers: ECS, ECR, EKS, Lambda, Batch, App Runner, Elastic Beanstalk, Lightsail, EMR, EMR Containers, EMR Serverless
Database & Storage: RDS, DynamoDB, ElastiCache, Neptune, Neptune Graph, Keyspaces, MemoryDB, DocumentDB, Redshift, Redshift Data, Redshift Serverless, EFS, FSx, Storage Gateway, Transfer, Timestream Write/Query, RDS Data
Networking & CDN: Route 53, CloudFront, ELBv2, VPC Lattice, Auto Scaling
AI/ML: Bedrock, Bedrock Agent, Bedrock Agent Runtime, SageMaker Runtime, SageMaker Feature Store, Rekognition, Textract, Comprehend, Translate, Polly, Transcribe, Personalize, Forecast, Lex
Analytics: Athena, Glue, Kinesis, Kinesis Firehose, Kinesis Analytics, MSK, QuickSight, DataBrew
Security & Compliance: Security Hub, Inspector, Detective, Macie, Access Analyzer, SSO Admin, Cognito
Management & Governance: CloudWatch, CloudTrail, CloudFormation, EventBridge, Step Functions, Organizations, Service Quotas, Config Service, Health
Developer Tools: CodeBuild, CodeCommit, CodeDeploy, CodePipeline, CodeArtifact, CodeStar Connections
IoT: IoT Core, IoT Data, IoT Greengrass, IoT SiteWise
Media & Communication: MediaConvert, IVS, Connect
Multi-Service Orchestration (30+ patterns): Deployer, Data Pipeline, Security Ops, Blue/Green, Disaster Recovery, Cost Governance, Credential Rotation, Container Ops, ML Pipeline, and more
Architecture
- All service classes are static with static methods — no dependency injection needed
- Client acquisition via
ClientFactory.GetClient<T>(region?)with LRU caching (TTL 15 min, max 64 clients) - Error handling through
ErrorClassifierwhich maps AWS error codes to typed exceptions - Dual API with both async and synchronous overloads for every operation
Requirements
- .NET 10.0 or later
- AWS credentials configured via environment variables, shared credentials file, or IAM role
Links
Made with care by Masrik Dahir
| 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
- AWSSDK.AccessAnalyzer (>= 4.0.6)
- AWSSDK.AppRunner (>= 4.0.2.25)
- AWSSDK.Athena (>= 4.0.4.10)
- AWSSDK.AutoScaling (>= 4.0.9.4)
- AWSSDK.AWSHealth (>= 4.0.5.9)
- AWSSDK.Batch (>= 4.0.8.7)
- AWSSDK.Bedrock (>= 4.0.25.1)
- AWSSDK.BedrockAgent (>= 4.0.8.1)
- AWSSDK.BedrockAgentRuntime (>= 4.0.8.18)
- AWSSDK.BedrockRuntime (>= 4.0.17.2)
- AWSSDK.CertificateManager (>= 4.0.3.4)
- AWSSDK.CloudFormation (>= 4.0.8.18)
- AWSSDK.CloudFront (>= 4.0.13.4)
- AWSSDK.CloudTrail (>= 4.0.5.19)
- AWSSDK.CloudWatch (>= 4.0.9.2)
- AWSSDK.CloudWatchLogs (>= 4.0.19.1)
- AWSSDK.CodeArtifact (>= 4.0.1.23)
- AWSSDK.CodeBuild (>= 4.0.5.24)
- AWSSDK.CodeCommit (>= 4.0.2.23)
- AWSSDK.CodeDeploy (>= 4.0.2.23)
- AWSSDK.CodePipeline (>= 4.0.4.24)
- AWSSDK.CodeStarconnections (>= 4.0.2.24)
- AWSSDK.CognitoIdentity (>= 4.0.2.25)
- AWSSDK.CognitoIdentityProvider (>= 4.0.6.9)
- AWSSDK.Comprehend (>= 4.0.2.23)
- AWSSDK.ConfigService (>= 4.0.7.7)
- AWSSDK.Connect (>= 4.0.39)
- AWSSDK.Core (>= 4.0.3.28)
- AWSSDK.DatabaseMigrationService (>= 4.0.8.4)
- AWSSDK.Detective (>= 4.0.2.23)
- AWSSDK.DocDB (>= 4.0.5.23)
- AWSSDK.DynamoDBv2 (>= 4.0.17.7)
- AWSSDK.EC2 (>= 4.0.83)
- AWSSDK.ECR (>= 4.0.13)
- AWSSDK.ECS (>= 4.0.18)
- AWSSDK.EKS (>= 4.0.15)
- AWSSDK.ElastiCache (>= 4.0.3.2)
- AWSSDK.ElasticBeanstalk (>= 4.0.3.9)
- AWSSDK.ElasticFileSystem (>= 4.0.3.23)
- AWSSDK.ElasticLoadBalancingV2 (>= 4.0.6.19)
- AWSSDK.ElasticMapReduce (>= 4.0.9.5)
- AWSSDK.EMRContainers (>= 4.0.2.23)
- AWSSDK.EMRServerless (>= 4.0.8.14)
- AWSSDK.EventBridge (>= 4.0.5.25)
- AWSSDK.ForecastQueryService (>= 4.0.2.25)
- AWSSDK.ForecastService (>= 4.0.1.23)
- AWSSDK.FSx (>= 4.0.9.18)
- AWSSDK.Glue (>= 4.0.27.7)
- AWSSDK.GlueDataBrew (>= 4.0.2.25)
- AWSSDK.Greengrass (>= 4.0.2.23)
- AWSSDK.IdentityManagement (>= 4.0.9.17)
- AWSSDK.Inspector2 (>= 4.0.9.10)
- AWSSDK.IoT (>= 4.0.6.15)
- AWSSDK.IotData (>= 4.0.2.25)
- AWSSDK.IoTSiteWise (>= 4.0.4.25)
- AWSSDK.IVS (>= 4.0.2.25)
- AWSSDK.Kafka (>= 4.0.7.8)
- AWSSDK.KeyManagementService (>= 4.0.9.10)
- AWSSDK.Keyspaces (>= 4.0.3.11)
- AWSSDK.Kinesis (>= 4.0.8.10)
- AWSSDK.KinesisAnalyticsV2 (>= 4.0.3.4)
- AWSSDK.KinesisFirehose (>= 4.0.3.23)
- AWSSDK.Lambda (>= 4.0.14)
- AWSSDK.Lex (>= 4.0.1.23)
- AWSSDK.LexModelBuildingService (>= 4.0.2.25)
- AWSSDK.Lightsail (>= 4.0.7)
- AWSSDK.Macie2 (>= 4.0.2.24)
- AWSSDK.MediaConvert (>= 4.0.15.6)
- AWSSDK.MemoryDB (>= 4.0.3.25)
- AWSSDK.Neptune (>= 4.0.5.9)
- AWSSDK.NeptuneGraph (>= 4.0.2.24)
- AWSSDK.Organizations (>= 4.0.11.4)
- AWSSDK.Personalize (>= 4.0.3.18)
- AWSSDK.PersonalizeRuntime (>= 4.0.1.25)
- AWSSDK.Pipes (>= 4.0.2.23)
- AWSSDK.Polly (>= 4.0.6.6)
- AWSSDK.QuickSight (>= 4.0.18.4)
- AWSSDK.RDS (>= 4.0.19.6)
- AWSSDK.RDSDataService (>= 4.0.2.23)
- AWSSDK.Redshift (>= 4.0.6.14)
- AWSSDK.RedshiftDataAPIService (>= 4.0.3.19)
- AWSSDK.RedshiftServerless (>= 4.0.4.13)
- AWSSDK.Rekognition (>= 4.0.3.23)
- AWSSDK.Route53 (>= 4.0.8.19)
- AWSSDK.S3 (>= 4.0.21)
- AWSSDK.SageMakerFeatureStoreRuntime (>= 4.0.1.23)
- AWSSDK.SageMakerRuntime (>= 4.0.2.10)
- AWSSDK.Scheduler (>= 4.0.2.23)
- AWSSDK.SecretsManager (>= 4.0.4.16)
- AWSSDK.SecurityHub (>= 4.0.8.9)
- AWSSDK.SecurityToken (>= 4.0.5.19)
- AWSSDK.ServiceQuotas (>= 4.0.4.15)
- AWSSDK.SimpleEmail (>= 4.0.2.23)
- AWSSDK.SimpleEmailV2 (>= 4.0.12.9)
- AWSSDK.SimpleNotificationService (>= 4.0.2.26)
- AWSSDK.SimpleSystemsManagement (>= 4.0.7.10)
- AWSSDK.SQS (>= 4.0.2.24)
- AWSSDK.SSOAdmin (>= 4.0.5.10)
- AWSSDK.StepFunctions (>= 4.0.2.19)
- AWSSDK.StorageGateway (>= 4.0.3.20)
- AWSSDK.Textract (>= 4.0.3.23)
- AWSSDK.TimestreamQuery (>= 4.0.3.25)
- AWSSDK.TimestreamWrite (>= 4.0.3.25)
- AWSSDK.TranscribeService (>= 4.0.5.13)
- AWSSDK.Transfer (>= 4.0.7)
- AWSSDK.Translate (>= 4.0.1.24)
- AWSSDK.VPCLattice (>= 4.0.4.21)
- AWSSDK.WAFV2 (>= 4.0.8.9)
- AWSSDK.XRay (>= 4.0.3.23)
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.2.9 | 15 | 4/9/2026 |