Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Last active June 1, 2022 21:06
Embed
What would you like to do?
secretsmanager Api SecretController GetSecret Complete
[HttpGet]
public async Task<IActionResult> GetSecret()
{
GetSecretValueRequest request = new GetSecretValueRequest();
request.SecretId = "test-secret";
request.VersionStage = "AWSCURRENT";
GetSecretValueResponse response = await _secretsManager.GetSecretValueAsync(request);
return Ok(new { Secret = response.SecretString });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment