.NET - Secret.Version.Access()

Retrieves the value from a version of a secret.

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

Examples

Access the latest version of a secret

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

Access a specific version of a secret

using Nitric.Sdk;
using Nitric.Sdk.Resource;
var keyRef = Nitric.Secret("apiKey").With(SecretPermission.Accessing);
var keyValue = keyRef.Version("the-version-id").Access();
keyValue.ValueText;
Nitric.Run();
Last updated on Dec 19, 2024