planetscalevitessbranch_password (Resource)

June 1, 2026 ยท View on GitHub

VitessBranchPassword Resource

Example Usage

resource "planetscale_vitess_branch_password" "my_vitessbranchpassword" {
  organization = "my-organization"
  database = "ru00w3vqvfr9"
  branch   = "2474dzfubrf3"

  role          = "admin"
}

Schema

Required

  • branch (String) The name of the branch the password belongs to
  • database (String) The name of the database the password belongs to
  • organization (String) The name of the organization the password belongs to

Optional

  • cidrs (List of String) List of IP addresses or CIDR ranges that can use this password
  • direct_vtgate (Boolean) Whether the password connects directly to a VTGate. Requires replacement if changed.
  • name (String) Optional name of the password
  • replica (Boolean) Whether the password is for a read replica. Requires replacement if changed.
  • role (String) The database role of the password (i.e. admin). must be one of ["reader", "writer", "admin", "readwriter"]; Requires replacement if changed.
  • ttl (Number) Time to live (in seconds) for the password. The password will be invalid when TTL has passed. Requires replacement if changed.

Read-Only

  • access_host_regional_url (String) The regional host URL
  • access_host_regional_urls (List of String) The read-only replica host URLs
  • access_host_url (String) The host URL for the password
  • actor (Attributes) (see below for nested schema)
  • created_at (String) When the password was created
  • database_branch (Attributes) (see below for nested schema)
  • deleted_at (String) When the password was deleted
  • direct_vtgate_addresses (List of String) The list of hosts in each availability zone providing direct access to a vtgate
  • expired (Boolean) True if the credentials are expired
  • expires_at (String) When the password will expire
  • id (String) The ID of the password
  • last_used_at (String) When the password was last used to execute a query
  • plain_text (String, Sensitive) The plain text password. Null except in the response from the create endpoint.
  • region (Attributes) (see below for nested schema)
  • renewable (Boolean) Whether or not the password can be renewed
  • ttl_seconds (Number) Time to live (in seconds) for the password. The password will be invalid when TTL has passed
  • username (String) The username for the password

Nested Schema for actor

Read-Only:

  • avatar_url (String) The URL of the actor's avatar
  • display_name (String) The name of the actor
  • id (String) The ID of the actor

Nested Schema for database_branch

Read-Only:

  • id (String) The ID for the branch
  • mysql_edge_address (String) The address of the MySQL provider for the branch
  • name (String) The name for the branch
  • private_edge_connectivity (Boolean) True if private connectivity is enabled
  • production (Boolean) Whether or not the branch is a production branch

Nested Schema for region

Read-Only:

  • current_default (Boolean) True if the region is the default for new branch creation
  • display_name (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
  • mysql_supported (Boolean) Whether the region supports MySQL/Vitess databases
  • postgresql_supported (Boolean) Whether the region supports PostgreSQL databases
  • provider (String) Provider for the region (ex. AWS)
  • public_ip_addresses (List of String) Public IP addresses for the region
  • slug (String) The slug of the region

Import

Import is supported using the following syntax:

In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

import {
  to = planetscale_vitess_branch_password.my_planetscale_vitess_branch_password
  id = jsonencode({
    branch       = "..."
    database     = "..."
    id           = "..."
    organization = "..."
  })
}

The terraform import command can be used, for example:

terraform import planetscale_vitess_branch_password.my_planetscale_vitess_branch_password '{"branch": "...", "database": "...", "id": "...", "organization": "..."}'