terraform-provider-stackitp.../docs/resources/postgresflexalpha_instance.md
Marcel S. Henselin 2f2b5cd04a
All checks were successful
CI Workflow / Check GoReleaser config (pull_request) Successful in 1m20s
Notify on new PR / Notify via Google Chat (pull_request) Successful in 1m20s
CI Workflow / Prepare GO cache (pull_request) Successful in 2m53s
CI Workflow / CI run build and linting (pull_request) Successful in 10m9s
CI Workflow / CI run tests (pull_request) Successful in 10m42s
CI Workflow / Code coverage report (pull_request) Successful in 47s
TF Acceptance Tests Workflow / Acceptance Tests (pull_request) Successful in 17m46s
CI Workflow / Test readiness for publishing provider (pull_request) Successful in 21m10s
chore: update docs
2026-05-07 09:49:17 +02:00

5.5 KiB

page_title subcategory description
stackitprivatepreview_postgresflexalpha_instance Resource - stackitprivatepreview

stackitprivatepreview_postgresflexalpha_instance (Resource)

Example Usage

# NOTE: flavor handling will change in future
# V2 compatible flavor usage (example without encryption)
resource "stackitprivatepreview_postgresflexalpha_instance" "example-instance" {
  project_id      = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  name            = "example-instance"
  acl             = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
  backup_schedule = "0 0 * * *"
  retention_days  = 30
  flavor = {
    cpu = 2
    ram = 4
  }
  replicas = 1
  storage = {
    performance_class = "premium-perf2-stackit"
    size              = 10
  }
  network = {
    acl          = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
    access_scope = "PUBLIC"
  }
  version = 17
}

# future use of flavor (implemented in V3 API)
# first determine flavor and then use the flavor_id

resource "stackitprivatepreview_postgresflexalpha_instance" "example-instance" {
  project_id      = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  name            = "example-instance"
  acl             = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
  backup_schedule = "0 0 * * *"
  retention_days  = 30
  flavor_id       = "flavor.id"
  replicas        = 1
  storage = {
    performance_class = "premium-perf2-stackit"
    size              = 10
  }
  encryption = {
    kek_key_id      = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    kek_key_ring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    kek_key_version = 1
    service_account = "service@account.email"
  }
  network = {
    acl          = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
    access_scope = "PUBLIC"
  }
  version = 17
}

# Only use the import statement, if you want to import an existing postgresflex instance
import {
  to = stackitprivatepreview_postgresflexalpha_instance.import-example
  id = "${var.project_id},${var.region},${var.postgres_instance_id}"
}

import {
  to = stackitprivatepreview_postgresflexalpha_instance.import-example
  identity = {
    project_id  = var.project_id
    region      = var.region
    instance_id = var.postgres_instance_id
  }
}

Schema

Required

  • backup_schedule (String) The schedule for when the database backup will be created. Currently, ONLY daily schedules are supported (every 24 hours). The schedule is written as a cron schedule.
  • name (String) The name of the instance.
  • network (Attributes) The access configuration of the instance (see below for nested schema)
  • replicas (Number) How many replicas the instance should have.
  • retention_days (Number) How long backups are retained. The value can only be between 32 and 90 days.
  • storage (Attributes) The object containing information about the storage size and class. (see below for nested schema)
  • version (String) The Postgres version used for the instance. See Versions Endpoint for supported version parameters.

Optional

  • encryption (Attributes) The configuration for instance's volume and backup storage encryption.

⚠︝ Note: This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected. (see below for nested schema)

  • flavor (Attributes, Deprecated) (see below for nested schema)
  • flavor_id (String) The id of the instance flavor.
  • instance_id (String) The ID of the instance.
  • project_id (String) The STACKIT project ID.
  • region (String) The region which should be addressed

Read-Only

  • acl (List of String) List of IPV4 cidr.
  • connection_info (Attributes) The connection information of the instance (see below for nested schema)
  • id (String) The ID of the instance.
  • is_deletable (Boolean) Whether the instance can be deleted or not.
  • status (String) The current status of the instance.

Nested Schema for network

Required:

  • acl (List of String) List of IPV4 cidr.

Optional:

  • access_scope (String) The access scope of the instance. It defines if the instance is public or airgapped.

Read-Only:

  • instance_address (String)
  • router_address (String)

Nested Schema for storage

Required:

  • performance_class (String) The storage class for the storage.
  • size (Number) The storage size in Gigabytes.

Nested Schema for encryption

Required:

  • kek_key_id (String) The encryption-key key identifier
  • kek_key_ring_id (String) The encryption-key keyring identifier
  • kek_key_version (String) The encryption-key version
  • service_account (String)

Nested Schema for flavor

Optional:

  • cpu (Number, Deprecated)
  • ram (Number, Deprecated)

Read-Only:

  • description (String)
  • id (String)

Nested Schema for connection_info

Read-Only:

Nested Schema for connection_info.write

Read-Only:

  • host (String) The host of the instance.
  • port (Number) The port of the instance.