public void SecretsManagerRotateSecret() { #region to-configure-rotation-for-a-secret-1524001629475 var response = client.RotateSecret(new RotateSecretRequest { RotationLambdaARN = "arn:aws:lambda:us-west-2:123456789012:function:MyTestDatabaseRotationLambda", RotationRules = new RotationRulesType { AutomaticallyAfterDays = 30 }, SecretId = "MyTestDatabaseSecret" }); string arn = response.ARN; string name = response.Name; string versionId = response.VersionId; #endregion }
private Amazon.SecretsManager.Model.RotateSecretResponse CallAWSServiceOperation(IAmazonSecretsManager client, Amazon.SecretsManager.Model.RotateSecretRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Secrets Manager", "RotateSecret"); try { #if DESKTOP return(client.RotateSecret(request)); #elif CORECLR return(client.RotateSecretAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }