JamesQMurphy.Configuration.Aws 0.9.1

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

JamesQMurphy.Configuration.Aws

JamesQMurphy.Configuration.Aws is a .NET library that integrates with AWS Systems Manager (SSM) Parameter Store to retrieve configuration values and map them into the .NET Configuration system. This package is designed to simplify the process of securely managing application configuration using AWS SSM Parameter Store.

Features

  • Retrieves configuration values from AWS SSM Parameter Store.
  • Supports recursive retrieval of parameters.
  • Automatically maps AWS SSM parameter names to .NET configuration keys.
  • Supports decryption of secure string parameters.

Installation

Install the package via NuGet:

dotnet add package JamesQMurphy.Configuration.Aws

Usage

Adding the Provider to Your Configuration

To use this library, add the SsmParameterStoreConfigurationSource to your IConfigurationBuilder:

using Amazon.SimpleSystemsManagement;
using Microsoft.Extensions.Configuration;
using JamesQMurphy.Configuration.Aws;

// Create an Amazon SSM client
var ssmClient = new AmazonSimpleSystemsManagementClient();

// Define the base path in the Parameter Store
string basePath = "/my-app/config/";

// Add the SSM Parameter Store provider to the configuration
var configuration = new ConfigurationBuilder()
    .Add(new SsmParameterStoreConfigurationSource(basePath, ssmClient))
    .Build();

Mapping Parameter Store Keys to .NET Configuration Keys

AWS SSM Parameter Store keys are mapped to .NET configuration keys as follows:

  • The BasePath is stripped from the beginning of the parameter name.
  • The / delimiter in AWS SSM keys is replaced with : to match the .NET configuration key format.

For example:

  • Parameter Store key: /my-app/config/Database/ConnectionString
  • .NET configuration key: Database:ConnectionString

Accessing Configuration Values

Once the configuration is built, you can access the values as you would with any other .NET configuration source:

string connectionString = configuration["Database:ConnectionString"];
Console.WriteLine($"Connection String: {connectionString}");

Required IAM Permissions

To use this library, the AWS IAM role or user associated with your application must have the following permissions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ssm:GetParametersByPath",
        "ssm:GetParameters",
        "ssm:GetParameter"
      ],
      "Resource": "arn:aws:ssm:<region>:<account-id>:parameter/<base-path>/*"
    }
  ]
}

Replace <region>, <account-id>, and <base-path> with the appropriate values for your AWS environment.

Notes

  • Ensure that the BasePath provided to the SsmParameterStoreConfigurationSource matches the prefix of your parameters in the Parameter Store.
  • If your parameters include secure strings, the WithDecryption option is enabled by default to decrypt them.

License

This package is licensed under the MIT 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 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.

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
0.9.1 290 4/23/2025