Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Last active June 1, 2022 21:06
Show Gist options
  • Save awswithdotnet/828107f016b6305652586a57663ba978 to your computer and use it in GitHub Desktop.
Save awswithdotnet/828107f016b6305652586a57663ba978 to your computer and use it in GitHub Desktop.
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