Creating a Stream Pool
Create a stream pool in the Streaming service. A stream pool is a logical grouping for streams.
Every stream must be a member of a stream pool. If you don't create a stream pool or specify an existing stream pool when creating a stream, then the Streaming service uses a default pool to contain the stream. To review requirements for creating and managing streams, see Getting Started with Streaming.
Use the oci streaming admin stream-pool create command and required parameters to create a stream pool:
oci streaming admin stream-pool create --name <stream_pool_name> --compartment-id <compartment_OCID>
For example:
oci streaming admin stream-pool create --name MyStreamPool --compartment-id ocid1.tenancy.oc1..exampleuniqueID { "data": { "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID", "custom-encryption-key": { "key-state": "NONE", "kms-key-id": null }, "defined-tags": {}, "endpoint-fqdn": null, "freeform-tags": {}, "id": "ocid1.streampool.oc1.phx.exampleuniqueID", "is-private": false, "kafka-settings": { "auto-create-topics-enable": false, "bootstrap-servers": null, "log-retention-hours": 24, "num-partitions": 1 }, "lifecycle-state": "CREATING", "lifecycle-state-details": null, "name": "MyStreamPool", "private-endpoint-settings": { "nsg-ids": null, "private-endpoint-ip": null, "subnet-id": null }, "time-created": "2020-11-02T23:01:59.429000+00:00" }, "etag": "\"b0066564-4bf4-4e27-9255-9055e69a7808-03668273-b0d5-4b8b-9370-74522c29eb56\"" }
Tip
Provide input for--custom-encryption-key-details
,--private-endpoint-details
, and--kafka-settings
as valid formatted JSON. See Passing Complex Input and Using a JSON File for Complex Input for information about JSON formatting.For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Use the CreateStreamPool API operation to create a stream pool.
Using OCI SDKs
To create a stream pool, use the createStreamPool
method of StreamAdminClient
.
See the Developer Guide to Streaming for detailed SDK examples.
Using Resource Manager and Terraform
Use the oci_streaming_stream_pool
resource to create a stream pool with optional private endpoint and Kafka compatibility settings. Private endpoint settings require a VCN, a subnet, and a network security group. This example Terraform configuration creates those resources as well.
For example:
resource "oci_streaming_stream_pool" "test_stream_pool" {
#Required
compartment_id = var.compartment_ocid
name = "<stream_pool_name>"
#Optional
private_endpoint_settings {
nsg_ids = [oci_core_network_security_group.test_nsg.id]
private_endpoint_ip = "10.0.0.5"
subnet_id = oci_core_subnet.test_subnet.id
}
kafka_settings {
#Optional
auto_create_topics_enable = true
log_retention_hours = 24
num_partitions = 1
}
}
resource "oci_core_vcn" "test_vcn" {
cidr_block = "10.0.0.0/16"
compartment_id = var.compartment_ocid
display_name = "testvcn"
dns_label = "dnslabel"
}
resource "oci_core_subnet" "test_subnet" {
cidr_block = "10.0.0.0/24"
compartment_id = var.compartment_ocid
vcn_id = oci_core_vcn.test_vcn.id
}
resource "oci_core_network_security_group" "test_nsg" {
compartment_id = var.compartment_ocid
vcn_id = oci_core_vcn.test_vcn.id
}
Resource Manager is an Oracle Cloud Infrastructure (OCI) service that allows you to automate the process of provisioning your OCI resources. Using Terraform, Resource Manager helps you install, configure, and manage resources through the "infrastructure-as-code" model.
A Terraform configuration codifies your infrastructure in declarative configuration files. The configuration defines the resources you intend to provision, variables, and specific instructions for provisioning the resources
You can use Resource Manager or the Terraform CLI with the OCI Terraform provider to see how your streams and stream pools are represented in Terraform configuration files.
For more information about writing configurations for use with Resource Manager, see Terraform Configurations for Resource Manager and Terraform Configuration.