Skip to content

Python code to rotate Clickhouse Cloud database password and put the new password into AWS Secrets Manager secret

Notifications You must be signed in to change notification settings

yuriipaneiko/Clickhouse-Cloud-Password-Rotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

README

The following code is designed to rotate Clickhouse Cloud database password using AWS Lambda Service. After password rotating, code will update AWS SecretsManager secret.

The following environments must be provided:

CLICKHOUSE_CLOUD_API_SECRET_NAME = "" # Name of secrets manager secret that contains ClickHouse cloud API token with write permissions
ENVIRONMENT = "" # Environment name, could be anything you want, refers to function/secret name
CL_CLOUD_API = "https://api.clickhouse.cloud/v1" # Moved to env in case it will be changed later
ORGANIZATION_ID = "" # Your Clickhouse Cloud organization ID
SERVICE_NAME = "" # Your Clickhouse Cloud service (database) name

Code expects the name of secrets manager secret to be modified has the following structure: <ENVIRONMENT>-clickhouse-credentials.

If you don’t want to update secret, comment update_secret(new_password=new_password) line

About

Python code to rotate Clickhouse Cloud database password and put the new password into AWS Secrets Manager secret

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages