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.

    1. On the Stream Pools list page, select Create Stream Pool. If you need help finding the list page, see Listing Stream Pools.
    2. Enter a name for the stream pool. Avoid entering confidential information.
    3. Select the compartment for the stream pool.
    4. Select Endpoint Type. Select Public Endpoint or Private Endpoint, depending on whether you want to restrict traffic to streams in this stream pool to a private endpoint that doesn't require traffic to traverse the internet.

      To create a private endpoint, you need access to a virtual cloud network (VCN) with a private subnet. Select a VCN with a private subnet where DNS resolution is also enabled, and then select the subnet.

      If instead you want to assign a specific private IP address, you must select one that belongs to the subnet's CIDR. By default, the Networking service assigns a random private IP address on your behalf and applies no security rules to the stream pool. For more information, see VCN and Subnet Management.

      You can also select an existing network security group to apply the same set of security rules to each stream in the pool.

    5. Under Configure Encryption Settings, select how to encrypt the streams in the stream pool.

      By default, Encrypt using Oracle-managed keys is selected. To encrypt the data in the streams in this stream pool by using your own Vault encryption key, select Encrypt using customer-managed keys. To use the Vault service, you need access to a vault and key, and you must allow the service to use the key.

      • Vault: Select the vault that contains the master encryption key that you want to use.
      • Master encryption key: Select the master encryption key that you want to use.

      For more information about encryption with a Vault key that you manage, see Overview of Vault and Managing Keys.

    6. To add tags or if you intend to use Kafka with this stream pool, select Show Advanced Options.
    7. (Optional) Assign tags to the stream pool. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
    8. To use the stream pool with Kafka, select Auto create topics and configure your stream settings:
      • Default Retention Period (Hours): Specify the number of hours for the stream's retention period.
      • Default Number of Partitions: Specify the default number of partitions for the stream.
      • Select View Kafka settings after the Stream pool is created to display the Kafka Connection settings for the stream pool after it's created.
    9. (Optional) Add one or more tags to the stream pool: Select Show Advanced Options to show the Add Tags section.
      If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
    10. Select Create.
  • 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
}
About Resource Manager and Terraform

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.