Create a username and password secret to store authentication credentials for databases, APIs, SMTP servers, or other services.
Username & Password secrets store authentication credentials as a username/password pair. Use them for database connections, API authentication, SMTP servers, or any service requiring basic credentials.
Use encoding: base64 when your credentials contain special characters that might cause parsing issues, or when you’re storing pre-encoded credentials from another system.
In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
2
Enter basic information
Enter a Name and optional Description.
3
Select secret type
Select Username/Password as the secret type.
4
Configure credentials
Click Data in the left pane. Enter the Username and Password. If your credentials are base64 encoded, enable Base64 Decode at Runtime to decode them when accessed.
This example uses hardcoded credentials for testing. In production, use Terraform variables, environment variables, or integrate with a secrets manager like HashiCorp Vault.
TypeScript
Python
Go
C#
import * as cpln from "@pulumiverse/cpln";const dbCredentials = new cpln.Secret("db-credentials", { name: "db-credentials", description: "PostgreSQL database credentials", userpass: { username: "app_user", password: "secure-password-here", encoding: "plain", },});