.NET - Secret()

Creates a reference to a secret in the secrets manager.

using Nitric.Sdk;
using Nitric.Sdk.Resource;
var keyRef = Nitric.Secret("apiKey").With(SecretPermission.Accessing);
Nitric.Run();

Parameters

  • Name
    name
    Required
    Required
    Type
    string
    Description

    The unique name of this secret within the secrets manager.

Access

All Nitric resources provide access permissions you can use to specify the level of access your code needs to the resource. See here for details about infrastructure security.

Available permissions:


SecretPermission.Putting

This permission allows your code to set a new latest value for a secret.


SecretPermission.Accessing

This permission allows your code to retrieve secret values.


Examples

Create a reference to a secret

using Nitric.Sdk;
using Nitric.Sdk.Resource;
var keyRef = Nitric.Secret("apiKey").With(SecretPermission.Putting);
Nitric.Run();

See also

Last updated on Dec 24, 2024