selectel_dbaas_kafka_datastore_v1
Эта инструкция — копия документации Selectel Terraform-провайдера в Terraform Registry.
Creates and manages a Kafka cluster using public API v1. For more information about Managed Databases, see the official Selectel documentation.
Example usage
resource "selectel_dbaas_kafka_datastore_v1" "cluster_1" {
name = "cluster-1"
project_id = selectel_vpc_project_v2.project_1.id
region = "ru-3"
type_id = data.selectel_dbaas_datastore_type_v1.datastore_type_1.datastore_types[0].iddatastore_types[0].id
subnet_id = selectel_vpc_subnet_v2.subnet.subnet_id
node_count = 1
flavor {
vcpus = 2
ram = 8192
disk = 32
disk_type = "network-ultra"
}
security_groups = ["796f1f0a-d97d-4a8e-904e-4fd5ef57465c", "b9c2e73d-a6c5-4def-994d-ce85e3ce98d3"]
}
Argument Reference
-
name— (Required) Cluster name. Changing this creates a new cluster. -
project_id— (Required) Unique identifier of the associated project. Changing this creates a new cluster. Retrieved from the selectel_vpc_project_v2 resource. Learn more about Projects. -
region— (Required) Pool where the database is located, for example,ru-3. Changing this creates a new cluster. Learn more about available pools in the Availability matrix. -
subnet_id— (Required) Unique identifier of the associated subnet. Changing this creates a new cluster. Retrieved from the selectel_vpc_subnet_v2 resource for a public subnet, or from the openstack_networking_subnet_v2 resource of the OpenStack provider for a private subnet. -
type_id— (Required) Unique identifier of the cluster type. Changing this creates a new cluster. Retrieved from the selectel_dbaas_datastore_type_v1 data source. -
node_count— (Required) Number of nodes in the cluster. The only available value is 1. Learn more about Replication. -
flavor_id— (Optional) Unique identifier of the flavor for the cluster. Can be skipped whenflavoris set. You can retrieve information about available flavors with the selectel_dbaas_flavor_v1 data source. -
flavor— (Optional) Flavor configuration for the cluster. You can retrieve information about available flavors with the selectel_dbaas_flavor_v1 data source. Learn more about available configurations for Kafka.-
vcpus— (Required) Number of vCPUs. -
ram— (Required) Amount of RAM in MB. -
disk— (Required) Volume size in GB. -
disk_type— (Optional) Volume type. Available values arelocalandnetwork-ultra. The default value islocal.Learn more about volumes for Kafka.
-
-
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 cluster, use the selectel_dbaas_firewall_v1 resource. -
config— (Optional) Configuration parameters for the cluster. You can retrieve information about available configuration parameters with the selectel_dbaas_configuration_parameter_v1 data source. -
logs— (Optional) Name of an existing or a new log group in the Logs service. The name must start with the prefix 's/dbaas/'. It can contain uppercase and lowercase letters, digits and symbols (underscore, hyphen, forward slash, period and hash). The name cannot exceed 512 symbols. For example, s/dbaas/My-first-group. Learn more about Logs. -
security_groups— (Optional) List of security groups. If no security group UUIDs are specified when creating the cluster, a default security group will be created and its UUID will be assigned automatically. A cluster must have at least one security group. Learn more about security groups.
Attributes Reference
-
status— Cluster status. -
connections— DNS addresses to connect to the cluster.
Import
You can import a cluster:
export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
export INFRA_PROJECT_ID=<selectel_project_id>
export INFRA_REGION=<selectel_pool>
terraform import selectel_dbaas_kafka_datastore_v1.datastore_1 <datastore_id>
where:
-
<account_id>— Selectel account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration. -
<username>— Name of the service user. To get the name, in the Control panel, go to Identity & Access Management ⟶ User management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users. -
<password>— Password of the service user. -
<selectel_project_id>— Unique identifier of the associated project. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects. -
<selectel_pool>— Pool where the cluster is located, for example,ru-3. To get information about the pool, in the Control panel, go to Cloud Platform ⟶ Managed Databases. The pool is in the Pool column. -
<datastore_id>— Unique identifier of the cluster, for example,b311ce58-2658-46b5-b733-7a0f418703f2. To get the cluster ID, in the Control panel, go to Cloud Platform ⟶ Managed Databases ⟶ copy the ID under the cluster name.