Skip to content

Add support for AppConfig FeatureFlag profiles. #228

Open
@sandbrock-nd

Description

@sandbrock-nd

Describe the feature

When creating an AppConfig profile of type FeatureFlag, I cannot control the JSON schema. This is an example result when querying the AppConfig service for a FeatureFlag profile:

{"test-flag-1":{"enabled":false},"test-flag-2":{"enabled":true}}

This doesn't play nice with the .NET builder.Configuration... because it lacks a named wrapper node. All my feature flags are defined at the root.

I'd like to the ability to specify a base node to nest the AppConfig profile under. For example, I'd like the ability to register my feature flags with the builder.Configuration system under a "FeatureFlags" node:

builder.Services.Configure<Dictionary<string, AppConfigFeatureFlag>>(builder.Configuration.GetSection("FeatureFlags"));

Use Case

I cannot use FeatureFlag AppConfig profiles very cleanly because the feature flags all end up nested under the root of the configuration tree.

Proposed Solution

builder.Configuration.AddAppConfig(new AppConfigConfigurationSource
{
    ApplicationId = "idp-auth-s2s-svc",
    EnvironmentId = "Default",
    ConfigProfileId = "my-appconfig-configuration-profile",
    AwsOptions = new AWSOptions(),
    ReloadAfter = new TimeSpan(0, 0, 30),
    WrapperNodeName = "FeatureFlags" // Add a wrapper node name here
})

Other Information

Pull request at #229

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

[email protected]

Targeted .NET Platform

.NET 8

Operating System and version

macOS Sequoia 15.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.needs-reviewp2This is a standard priority issuepr/needs-reviewThis PR needs a review from a Member.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions