Skip to content

Allow to set a custom Redis secret #8082

@dluc

Description

@dluc

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Similarly to Postgres, Mysql, Qdrant, etc. which have password and apiKey params to set custom secrets for the container, it would be useful to have the same for Redis, allowing to customize the value (e.g. fetching from a proprietary secret store)

Qdrant example:

var secret = builder.AddParameter("...-Key", customValue);
builder.AddQdrant("...", apiKey: secret)

IResourceBuilder<ParameterResource>? apiKey = null,

Postgres example:

var secret = builder.AddParameter("...-password", customValue);
builder.AddPostgres("...", password: secret)

IResourceBuilder<ParameterResource>? password = null,

Mysql:

public static IResourceBuilder<MySqlServerResource> AddMySql(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder<ParameterResource>? password = null, int? port = null)

Elasticsearch:

IResourceBuilder<ParameterResource>? password = null,

Describe the solution you'd like

For all resources available as containers, if they require/allow a secret (password, API key), it's useful to set this value. It would be nice making it easier, providing an explicit parameter in the AddX extension methods.

  • If possible, there could be a new .WithParameter(string name, string value) method.
  • .WithConnectionStringRedirection seems quite complicate to use.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions