1. Packages
  2. Planetscale Provider
  3. API Docs
  4. Password
planetscale 0.5.0 published on Saturday, Apr 5, 2025 by planetscale

planetscale.Password

Explore with Pulumi AI

A PlanetScale database password.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as planetscale from "@pulumi/planetscale";

const example = new planetscale.Password("example", {
    organization: "example",
    database: "example_db",
    branch: "main",
});
export const password = example;
Copy
import pulumi
import pulumi_planetscale as planetscale

example = planetscale.Password("example",
    organization="example",
    database="example_db",
    branch="main")
pulumi.export("password", example)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/planetscale/planetscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := planetscale.NewPassword(ctx, "example", &planetscale.PasswordArgs{
			Organization: pulumi.String("example"),
			Database:     pulumi.String("example_db"),
			Branch:       pulumi.String("main"),
		})
		if err != nil {
			return err
		}
		ctx.Export("password", example)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Planetscale = Pulumi.Planetscale;

return await Deployment.RunAsync(() => 
{
    var example = new Planetscale.Password("example", new()
    {
        Organization = "example",
        Database = "example_db",
        Branch = "main",
    });

    return new Dictionary<string, object?>
    {
        ["password"] = example,
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.planetscale.Password;
import com.pulumi.planetscale.PasswordArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Password("example", PasswordArgs.builder()
            .organization("example")
            .database("example_db")
            .branch("main")
            .build());

        ctx.export("password", example);
    }
}
Copy
resources:
  example:
    type: planetscale:Password
    properties:
      organization: example
      database: example_db
      branch: main
outputs:
  password: ${example}
Copy

Create Password Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Password(name: string, args: PasswordArgs, opts?: CustomResourceOptions);
@overload
def Password(resource_name: str,
             args: PasswordArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def Password(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             branch: Optional[str] = None,
             database: Optional[str] = None,
             organization: Optional[str] = None,
             cidrs: Optional[Sequence[str]] = None,
             name: Optional[str] = None,
             replica: Optional[bool] = None,
             role: Optional[str] = None,
             ttl_seconds: Optional[float] = None)
func NewPassword(ctx *Context, name string, args PasswordArgs, opts ...ResourceOption) (*Password, error)
public Password(string name, PasswordArgs args, CustomResourceOptions? opts = null)
public Password(String name, PasswordArgs args)
public Password(String name, PasswordArgs args, CustomResourceOptions options)
type: planetscale:Password
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PasswordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PasswordArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PasswordArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PasswordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PasswordArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var passwordResource = new Planetscale.Password("passwordResource", new()
{
    Branch = "string",
    Database = "string",
    Organization = "string",
    Cidrs = new[]
    {
        "string",
    },
    Name = "string",
    Replica = false,
    Role = "string",
    TtlSeconds = 0,
});
Copy
example, err := planetscale.NewPassword(ctx, "passwordResource", &planetscale.PasswordArgs{
	Branch:       pulumi.String("string"),
	Database:     pulumi.String("string"),
	Organization: pulumi.String("string"),
	Cidrs: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:       pulumi.String("string"),
	Replica:    pulumi.Bool(false),
	Role:       pulumi.String("string"),
	TtlSeconds: pulumi.Float64(0),
})
Copy
var passwordResource = new Password("passwordResource", PasswordArgs.builder()
    .branch("string")
    .database("string")
    .organization("string")
    .cidrs("string")
    .name("string")
    .replica(false)
    .role("string")
    .ttlSeconds(0)
    .build());
Copy
password_resource = planetscale.Password("passwordResource",
    branch="string",
    database="string",
    organization="string",
    cidrs=["string"],
    name="string",
    replica=False,
    role="string",
    ttl_seconds=0)
Copy
const passwordResource = new planetscale.Password("passwordResource", {
    branch: "string",
    database: "string",
    organization: "string",
    cidrs: ["string"],
    name: "string",
    replica: false,
    role: "string",
    ttlSeconds: 0,
});
Copy
type: planetscale:Password
properties:
    branch: string
    cidrs:
        - string
    database: string
    name: string
    organization: string
    replica: false
    role: string
    ttlSeconds: 0
Copy

Password Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Password resource accepts the following input properties:

Branch This property is required. string
The branch this password belongs to.
Database This property is required. string
The database this branch password belongs to.
Organization This property is required. string
The organization this database branch password belongs to.
Cidrs List<string>
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
Name string
The display name for the password.
Replica bool
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
Role string
The role for the password.
TtlSeconds double
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
Branch This property is required. string
The branch this password belongs to.
Database This property is required. string
The database this branch password belongs to.
Organization This property is required. string
The organization this database branch password belongs to.
Cidrs []string
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
Name string
The display name for the password.
Replica bool
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
Role string
The role for the password.
TtlSeconds float64
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
branch This property is required. String
The branch this password belongs to.
database This property is required. String
The database this branch password belongs to.
organization This property is required. String
The organization this database branch password belongs to.
cidrs List<String>
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
name String
The display name for the password.
replica Boolean
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role String
The role for the password.
ttlSeconds Double
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
branch This property is required. string
The branch this password belongs to.
database This property is required. string
The database this branch password belongs to.
organization This property is required. string
The organization this database branch password belongs to.
cidrs string[]
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
name string
The display name for the password.
replica boolean
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role string
The role for the password.
ttlSeconds number
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
branch This property is required. str
The branch this password belongs to.
database This property is required. str
The database this branch password belongs to.
organization This property is required. str
The organization this database branch password belongs to.
cidrs Sequence[str]
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
name str
The display name for the password.
replica bool
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role str
The role for the password.
ttl_seconds float
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
branch This property is required. String
The branch this password belongs to.
database This property is required. String
The database this branch password belongs to.
organization This property is required. String
The organization this database branch password belongs to.
cidrs List<String>
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
name String
The display name for the password.
replica Boolean
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role String
The role for the password.
ttlSeconds Number
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.

Outputs

All input properties are implicitly available as output properties. Additionally, the Password resource produces the following output properties:

AccessHostUrl string
The host URL for the password.
Actor PasswordActor
The actor that created this branch.
CreatedAt string
When the password was created.
DatabaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
DeletedAt string
When the password was deleted.
ExpiresAt string
When the password will expire.
Id string
The provider-assigned unique ID for this managed resource.
Plaintext string
The plaintext password, only available if the password was created by this provider.
Region PasswordRegion
The region in which this password can be used.
Renewable bool
Whether or not the password can be renewed.
Username string
The username for the password.
AccessHostUrl string
The host URL for the password.
Actor PasswordActor
The actor that created this branch.
CreatedAt string
When the password was created.
DatabaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
DeletedAt string
When the password was deleted.
ExpiresAt string
When the password will expire.
Id string
The provider-assigned unique ID for this managed resource.
Plaintext string
The plaintext password, only available if the password was created by this provider.
Region PasswordRegion
The region in which this password can be used.
Renewable bool
Whether or not the password can be renewed.
Username string
The username for the password.
accessHostUrl String
The host URL for the password.
actor PasswordActor
The actor that created this branch.
createdAt String
When the password was created.
databaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
deletedAt String
When the password was deleted.
expiresAt String
When the password will expire.
id String
The provider-assigned unique ID for this managed resource.
plaintext String
The plaintext password, only available if the password was created by this provider.
region PasswordRegion
The region in which this password can be used.
renewable Boolean
Whether or not the password can be renewed.
username String
The username for the password.
accessHostUrl string
The host URL for the password.
actor PasswordActor
The actor that created this branch.
createdAt string
When the password was created.
databaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
deletedAt string
When the password was deleted.
expiresAt string
When the password will expire.
id string
The provider-assigned unique ID for this managed resource.
plaintext string
The plaintext password, only available if the password was created by this provider.
region PasswordRegion
The region in which this password can be used.
renewable boolean
Whether or not the password can be renewed.
username string
The username for the password.
access_host_url str
The host URL for the password.
actor PasswordActor
The actor that created this branch.
created_at str
When the password was created.
database_branch PasswordDatabaseBranch
The branch this password is allowed to access.
deleted_at str
When the password was deleted.
expires_at str
When the password will expire.
id str
The provider-assigned unique ID for this managed resource.
plaintext str
The plaintext password, only available if the password was created by this provider.
region PasswordRegion
The region in which this password can be used.
renewable bool
Whether or not the password can be renewed.
username str
The username for the password.
accessHostUrl String
The host URL for the password.
actor Property Map
The actor that created this branch.
createdAt String
When the password was created.
databaseBranch Property Map
The branch this password is allowed to access.
deletedAt String
When the password was deleted.
expiresAt String
When the password will expire.
id String
The provider-assigned unique ID for this managed resource.
plaintext String
The plaintext password, only available if the password was created by this provider.
region Property Map
The region in which this password can be used.
renewable Boolean
Whether or not the password can be renewed.
username String
The username for the password.

Look up Existing Password Resource

Get an existing Password resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PasswordState, opts?: CustomResourceOptions): Password
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_host_url: Optional[str] = None,
        actor: Optional[PasswordActorArgs] = None,
        branch: Optional[str] = None,
        cidrs: Optional[Sequence[str]] = None,
        created_at: Optional[str] = None,
        database: Optional[str] = None,
        database_branch: Optional[PasswordDatabaseBranchArgs] = None,
        deleted_at: Optional[str] = None,
        expires_at: Optional[str] = None,
        name: Optional[str] = None,
        organization: Optional[str] = None,
        plaintext: Optional[str] = None,
        region: Optional[PasswordRegionArgs] = None,
        renewable: Optional[bool] = None,
        replica: Optional[bool] = None,
        role: Optional[str] = None,
        ttl_seconds: Optional[float] = None,
        username: Optional[str] = None) -> Password
func GetPassword(ctx *Context, name string, id IDInput, state *PasswordState, opts ...ResourceOption) (*Password, error)
public static Password Get(string name, Input<string> id, PasswordState? state, CustomResourceOptions? opts = null)
public static Password get(String name, Output<String> id, PasswordState state, CustomResourceOptions options)
resources:  _:    type: planetscale:Password    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccessHostUrl string
The host URL for the password.
Actor PasswordActor
The actor that created this branch.
Branch string
The branch this password belongs to.
Cidrs List<string>
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
CreatedAt string
When the password was created.
Database string
The database this branch password belongs to.
DatabaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
DeletedAt string
When the password was deleted.
ExpiresAt string
When the password will expire.
Name string
The display name for the password.
Organization string
The organization this database branch password belongs to.
Plaintext string
The plaintext password, only available if the password was created by this provider.
Region PasswordRegion
The region in which this password can be used.
Renewable bool
Whether or not the password can be renewed.
Replica bool
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
Role string
The role for the password.
TtlSeconds double
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
Username string
The username for the password.
AccessHostUrl string
The host URL for the password.
Actor PasswordActorArgs
The actor that created this branch.
Branch string
The branch this password belongs to.
Cidrs []string
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
CreatedAt string
When the password was created.
Database string
The database this branch password belongs to.
DatabaseBranch PasswordDatabaseBranchArgs
The branch this password is allowed to access.
DeletedAt string
When the password was deleted.
ExpiresAt string
When the password will expire.
Name string
The display name for the password.
Organization string
The organization this database branch password belongs to.
Plaintext string
The plaintext password, only available if the password was created by this provider.
Region PasswordRegionArgs
The region in which this password can be used.
Renewable bool
Whether or not the password can be renewed.
Replica bool
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
Role string
The role for the password.
TtlSeconds float64
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
Username string
The username for the password.
accessHostUrl String
The host URL for the password.
actor PasswordActor
The actor that created this branch.
branch String
The branch this password belongs to.
cidrs List<String>
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
createdAt String
When the password was created.
database String
The database this branch password belongs to.
databaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
deletedAt String
When the password was deleted.
expiresAt String
When the password will expire.
name String
The display name for the password.
organization String
The organization this database branch password belongs to.
plaintext String
The plaintext password, only available if the password was created by this provider.
region PasswordRegion
The region in which this password can be used.
renewable Boolean
Whether or not the password can be renewed.
replica Boolean
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role String
The role for the password.
ttlSeconds Double
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
username String
The username for the password.
accessHostUrl string
The host URL for the password.
actor PasswordActor
The actor that created this branch.
branch string
The branch this password belongs to.
cidrs string[]
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
createdAt string
When the password was created.
database string
The database this branch password belongs to.
databaseBranch PasswordDatabaseBranch
The branch this password is allowed to access.
deletedAt string
When the password was deleted.
expiresAt string
When the password will expire.
name string
The display name for the password.
organization string
The organization this database branch password belongs to.
plaintext string
The plaintext password, only available if the password was created by this provider.
region PasswordRegion
The region in which this password can be used.
renewable boolean
Whether or not the password can be renewed.
replica boolean
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role string
The role for the password.
ttlSeconds number
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
username string
The username for the password.
access_host_url str
The host URL for the password.
actor PasswordActorArgs
The actor that created this branch.
branch str
The branch this password belongs to.
cidrs Sequence[str]
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
created_at str
When the password was created.
database str
The database this branch password belongs to.
database_branch PasswordDatabaseBranchArgs
The branch this password is allowed to access.
deleted_at str
When the password was deleted.
expires_at str
When the password will expire.
name str
The display name for the password.
organization str
The organization this database branch password belongs to.
plaintext str
The plaintext password, only available if the password was created by this provider.
region PasswordRegionArgs
The region in which this password can be used.
renewable bool
Whether or not the password can be renewed.
replica bool
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role str
The role for the password.
ttl_seconds float
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
username str
The username for the password.
accessHostUrl String
The host URL for the password.
actor Property Map
The actor that created this branch.
branch String
The branch this password belongs to.
cidrs List<String>
List of IP addresses or CIDR ranges that can use this password. Individual IPs must still contain a prefix, eg: 127.0.0.1/32
createdAt String
When the password was created.
database String
The database this branch password belongs to.
databaseBranch Property Map
The branch this password is allowed to access.
deletedAt String
When the password was deleted.
expiresAt String
When the password will expire.
name String
The display name for the password.
organization String
The organization this database branch password belongs to.
plaintext String
The plaintext password, only available if the password was created by this provider.
region Property Map
The region in which this password can be used.
renewable Boolean
Whether or not the password can be renewed.
replica Boolean
When true, all queries from this password will be read-only and directed to a replica. Requires role to be set to reader.
role String
The role for the password.
ttlSeconds Number
Time to live (in seconds) for the password. The password will be invalid and unrenewable when TTL has passed.
username String
The username for the password.

Supporting Types

PasswordActor
, PasswordActorArgs

AvatarUrl string
The URL of the actor's avatar
DisplayName string
The name of the actor
Id string
The ID of the actor
AvatarUrl string
The URL of the actor's avatar
DisplayName string
The name of the actor
Id string
The ID of the actor
avatarUrl String
The URL of the actor's avatar
displayName String
The name of the actor
id String
The ID of the actor
avatarUrl string
The URL of the actor's avatar
displayName string
The name of the actor
id string
The ID of the actor
avatar_url str
The URL of the actor's avatar
display_name str
The name of the actor
id str
The ID of the actor
avatarUrl String
The URL of the actor's avatar
displayName String
The name of the actor
id String
The ID of the actor

PasswordDatabaseBranch
, PasswordDatabaseBranchArgs

AccessHostUrl string
Id string
MysqlEdgeAddress string
Name string
Production bool
AccessHostUrl string
Id string
MysqlEdgeAddress string
Name string
Production bool
accessHostUrl String
id String
mysqlEdgeAddress String
name String
production Boolean
accessHostUrl string
id string
mysqlEdgeAddress string
name string
production boolean
accessHostUrl String
id String
mysqlEdgeAddress String
name String
production Boolean

PasswordRegion
, PasswordRegionArgs

DisplayName string
Name of the region.
Enabled bool
Whether or not the region is currently active.
Id string
The ID of the region.
Location string
Location of the region.
Provider string
Provider for the region (ex. AWS).
PublicIpAddresses List<string>
Public IP addresses for the region.
Slug string
The slug of the region.
DisplayName string
Name of the region.
Enabled bool
Whether or not the region is currently active.
Id string
The ID of the region.
Location string
Location of the region.
Provider string
Provider for the region (ex. AWS).
PublicIpAddresses []string
Public IP addresses for the region.
Slug string
The slug of the region.
displayName String
Name of the region.
enabled Boolean
Whether or not the region is currently active.
id String
The ID of the region.
location String
Location of the region.
provider String
Provider for the region (ex. AWS).
publicIpAddresses List<String>
Public IP addresses for the region.
slug String
The slug of the region.
displayName string
Name of the region.
enabled boolean
Whether or not the region is currently active.
id string
The ID of the region.
location string
Location of the region.
provider string
Provider for the region (ex. AWS).
publicIpAddresses string[]
Public IP addresses for the region.
slug string
The slug of the region.
display_name str
Name of the region.
enabled bool
Whether or not the region is currently active.
id str
The ID of the region.
location str
Location of the region.
provider str
Provider for the region (ex. AWS).
public_ip_addresses Sequence[str]
Public IP addresses for the region.
slug str
The slug of the region.
displayName String
Name of the region.
enabled Boolean
Whether or not the region is currently active.
id String
The ID of the region.
location String
Location of the region.
provider String
Provider for the region (ex. AWS).
publicIpAddresses List<String>
Public IP addresses for the region.
slug String
The slug of the region.

Import

Passwords can be imported using “org,database,branch,id” as the identifier.

NOTE: ‘id’ is the 12-character password id (eg: k4fhp4kvj0mz) and not the password’s name.

$ pulumi import planetscale:index/password:Password example "org,database,branch,id"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
planetscale planetscale/terraform-provider-planetscale
License
Notes
This Pulumi package is based on the planetscale Terraform Provider.