

# Generate a password with Secrets Manager
<a name="generate-password"></a>

A common pattern for using Secrets Manager is to generate a password in Secrets Manager and then use that password in your database or service. You can do this using the following methods:
+ Amazon CloudFormation – See [Create Amazon Secrets Manager secrets in Amazon CloudFormation](cloudformation.md).
+ Amazon CLI – See [https://docs.amazonaws.cn/cli/latest/reference/secretsmanager/get-random-password.html](https://docs.amazonaws.cn/cli/latest/reference/secretsmanager/get-random-password.html).
+ Amazon SDKs – See [https://docs.amazonaws.cn/secretsmanager/latest/apireference/API_GetRandomPassword.html](https://docs.amazonaws.cn/secretsmanager/latest/apireference/API_GetRandomPassword.html).