Tooark.Secrets.Aws 4.7.0

dotnet add package Tooark.Secrets.Aws --version 4.7.0
                    
NuGet\Install-Package Tooark.Secrets.Aws -Version 4.7.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="Tooark.Secrets.Aws" Version="4.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tooark.Secrets.Aws" Version="4.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Tooark.Secrets.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 Tooark.Secrets.Aws --version 4.7.0
                    
#r "nuget: Tooark.Secrets.Aws, 4.7.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 Tooark.Secrets.Aws@4.7.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=Tooark.Secrets.Aws&version=4.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Tooark.Secrets.Aws&version=4.7.0
                    
Install as a Cake Tool

Tooark.Secrets.Aws

Tooark.Secrets provider on AWS: it loads Secrets Manager secrets and Parameter Store parameters into IConfiguration, and implements ISecretService on Secrets Manager.

The model, the common options and the conversion of names into keys are in the Tooark.Secrets README. This README covers what is specific to AWS.

🌍 Languages: πŸ‡ΊπŸ‡Έ English (this file) Β· πŸ‡§πŸ‡· PortuguΓͺs


πŸ“‘ Contents


πŸ”§ Installation

dotnet add package Tooark.Secrets.Aws

βš™οΈ Configuration

appsettings.json

{
  "Secrets": {
    "Region": "sa-east-1",
    "SecretsPrefix": "arkuest/prod",
    "ParametersPath": "/arkuest/prod"
  }
}

Program.cs

using Tooark.Secrets.Aws.Injections;

// Secrets and parameters in the configuration, on top of appsettings.json
builder.Configuration.AddTooarkSecretsAws();

// Runtime secret reads, with cache
builder.Services.AddTooarkSecretsAws(builder.Configuration);

The IConfigurationBuilder AddTooarkSecretsAws requires SecretsPrefix, ParametersPath or both. The IServiceCollection one registers ISecretService and the Secrets Manager client as IAmazonSecretsManager; a client already registered by the application is kept.

AwsSecretsOptions properties

Besides the common options:

Property Type Default Description
Region string? β€” Store region, such as sa-east-1. Without it, the region from the AWS default chain applies
ServiceUrl string? β€” Address of a compatible service, such as LocalStack
SecretsPrefix string? β€” Name prefix of the Secrets Manager secrets that become configuration, such as arkuest/prod
ParametersPath string? β€” Path of the Parameter Store parameters that become configuration, such as /arkuest/prod

Credentials always come from the AWS default chain: environment variables, the ~/.aws/credentials profile, the ECS task role, the EKS pod role or the EC2 instance profile. There is no access key in the options: the store credential cannot come from the store.


πŸ”‘ Permissions

The application's identity needs:

Permission Resource For
secretsmanager:ListSecrets * (the action takes no specific resource) Listing the prefix's secrets
secretsmanager:GetSecretValue ARN of the prefix's secrets Reading the secrets and ISecretService
ssm:GetParametersByPath ARN of the parameters path Listing and reading the parameters
kms:Decrypt Your own KMS key, when used Secrets and SecureString with your own key

🟧 Behavior on AWS

  • Secrets Manager β€” the prefix filters the listing on AWS and is then checked against the level boundary. A secret scheduled for deletion does not show up, and one deleted between listing and reading is skipped. A binary secret is read as UTF-8 text.
  • "Key/value" secret β€” Secrets Manager stores this type as JSON. With ExpandJson, each pair becomes a key; without it, the key receives the whole JSON.
  • Parameter Store β€” the path is read recursively, with SecureString decrypted. A StringList arrives as the comma-separated text.
  • Same name β€” with the same name in a secret and a parameter, the secret wins.
  • ISecretService β€” the name is the secret's name or its ARN; a missing secret returns null.

πŸ“‹ Dependencies

Package Version Description
Tooark.Secrets 4.x Model and configuration source
AWSSDK.SecretsManager 4.x Secrets Manager client
AWSSDK.SimpleSystemsManagement 4.x Parameter Store client
Microsoft.Extensions.DependencyInjection.Abstractions 8.x/10.x Container registration

⚠️ Error Codes and Solutions

The common errors are in the Tooark.Secrets README. A failure to load the source arrives as Secrets.LoadFailed;AWS, with the AWS error in InnerException.

Message Description Solution
Options.Secrets.Aws.ServiceUrlInvalid;{value} ServiceUrl is not an absolute http or https URL Use the full address, such as http://localhost:4566

🀝 Contributing

Contributions are welcome! Start with CONTRIBUTING.md β€” it covers the development workflow, the coding and commit conventions and the pull request checklist. Bugs and feature requests go through the issue templates of the Tooark repository.

By participating you agree to the Code of Conduct.


πŸ†˜ Help & Security

  • ❓ Questions, bugs, feature ideas β€” see SUPPORT.md for the right channel
  • πŸ”’ Security vulnerabilities β€” do not open a public issue; follow SECURITY.md

πŸ’– Support

If Tooark helps your projects, consider supporting its development:

Every contribution helps keep the project maintained and improving. Thank you! πŸ™


πŸ“„ License

This project is licensed under the BSD 3-Clause License.

Product 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 was computed.  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. 
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
4.7.0 95 9/30/2026