servercore_dbaas_postgresql_datastore_v1
Creates and manages a PostgreSQL datastore using public API v1. Applicable to PostgreSQL, PostgreSQL for 1C, and PostgreSQL TimescaleDB datastores. For more information about Managed Databases, see the official Servercore documentation for PostgreSQL, PostgreSQL for 1C, and PostgreSQL TimescaleDB.
Example usage
PostgreSQL and PostgreSQL TimescaleDB
resource "servercore_dbaas_postgresql_datastore_v1" "datastore_1" {
name = "datastore-1"
project_id = servercore_project_v2.project_1.id
region = "ru-3"
type_id = data.servercore_dbaas_datastore_type_v1.datastore_type_1.datastore_types[0].id
subnet_id = servercore_subnet_v2.subnet.subnet_id
node_count = 3
flavor {
vcpus = 4
ram = 4096
disk = 32
}
pooler {
mode = "transaction"
size = 50
}
}
PostgreSQL for 1C
resource "servercore_dbaas_postgresql_datastore_v1" "datastore_1" {
name = "datastore-1"
project_id = servercore_project_v2.project_1.id
region = "ru-3"
type_id = data.servercore_dbaas_datastore_type_v1.datastore_type_1.datastore_types[0].id
subnet_id = servercore_subnet_v2.subnet.subnet_id
node_count = 3
flavor {
vcpus = 4
ram = 4096
disk = 32
}
}
Argument Reference
-
name
— (Required) Datastore name. Changing this creates a new datastore. -
project_id
— (Required) Unique identifier of the associated project. Changing this creates a new datastore. Retrieved from the servercore_vpc_project_v2 resource. Learn more about Projects. -
region
— (Required) Pool where the datastore is located, for example,ru-3
. Changing this creates a new datastore. Learn more about available pools in the Availability matrix. -
subnet_id
— (Required) Unique identifier of the associated OpenStack network. Changing this creates a new datastore. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation. -
type_id
— (Required) Unique identifier of the datastore type. Changing this creates a new datastore. Retrieved from the servercore_dbaas_datastore_type_v1 data source. -
node_count
— (Required) Number of nodes in the datastore. The available range is from 1 to 6. Learn more about Replication. -
flavor_id
— (Optional) Unique identifier of the flavor for the datastore. Can be skipped whenflavor
is set. You can retrieve information about available flavors with the servercore_dbaas_flavor_v1 data source. -
flavor
— (Optional) Flavor configuration for the datastore. You can retrieve information about available flavors with the servercore_dbaas_flavor_v1 data source. Learn more about available configurations for PostgreSQL, PostgreSQL for 1C, and PostgreSQL TimescaleDB.-
vcpus
— (Required) Number of vCPUs. -
ram
— (Required) Amount of RAM in MB. -
disk
— (Required) Volume size in GB.
-
-
pooler
— (Optional) Configures a connection pooler for the datastore. Applicable to PostgreSQL and PostgreSQL TimescaleDB.-
mode
— (Required) Pooling mode. Available values aresession
,transaction
, andstatement
. The default value istransaction.
Learn more about pooling modes for PostgreSQL and PostgreSQL TimescaleDB. -
size
— (Required) Pool size. The available range is from 1 to 500. The default value is30
. Learn more about pool size for PostgreSQL and PostgreSQL TimescaleDB.
-
-
firewall
— (Deprecated) Remove this argument as it is no longer in use and will be removed in the next major version of the provider. To manage a list of IP-addresses with access to the datastore, use the servercore_dbaas_firewall_v1 resource. -
restore
— (Optional) Restores parameters for the datastore. Changing this creates a new datastore.-
datastore_id
— (Optional) Unique identifier of the datastore from which you restore. To get the datastore ID, in the Control panel, go to Cloud Platform ⟶ Managed Databases ⟶ copy the ID under the cluster name. -
target_time
— (Optional) Time within seven previous days when you have the datastore state to restore.
-
-
config
— (Optional) Configuration parameters for the datastore. You can retrieve information about available configuration parameters with the servercore_dbaas_configuration_parameter_v1 data source. -
floating_ips
— (Optional) Assigns public IP addresses to the nodes in the datastore. The network configuration must meet the requirements. Learn more about public IP addresses and the required network configuration.-
master — (Required) Number of public IPs associated with the master. Available values are
0
and1
. -
replica — (Required) Number of public IPs associated with the replicas. The minimum value is
0
. The maximum value must be 1 less than the value of thenode_count
argument.
-