1. Manage StreamNative Clusters
  2. Manage BYOC Infrastructure

Create a Cloud Environment

Public Preview

This feature is currently in Public Preview. Exercise caution before using this for provisioning production environments. If you encounter issues creating a Cloud Connection or Cloud Environment, please submit a ticket.

Note

This document assumes that you have already created a Cloud Connection allowing StreamNative to connect to your cloud account. If you have not yet done so, please create one, and then return to this page to continue setting up your Cloud Environment.

Cloud Environments set up your AWS, GCP, or Azure account with everything it needs to create and run Pulsar Clusters. You can create a Cloud Environment either through snctl, or StreamNative's terraform provider. Once you have created a Cloud Environment, you can create an Instance and Pulsar Cluster through the StreamNative Console

Create a Cloud Environment on UI

  1. Sign in to StreamNative Cloud at https://console.streamnative.cloud.

  2. Select the Organization.

  3. Expand the user profile drop down and click on the Cloud Environments page

    Dropdown CloudEnvironment

  4. On the Cloud Environments page, click the New button and select Create environment.

  5. Select the CloudConnection, then click Environment setup.

    Select CloudConnection

  6. Specify the region and other configurations, then click Create.

    Create CloudEnvironment

Tutorial

You can also watch the video of creating a cloud environment using Cloud Console UI:

Create Cloud Environment

Create a Cloud Environment with snctl

To create a Cloud Environment using snctl, use snctl create cloudenvironment. Usage:

  snctl create cloudenvironment --cloud-connection-name CLOUD_CONNECTION_NAME --region REGION
FlagDescription
--cloud-connection-nameRequired. The name of cloud connection name.
--regionRequired. The region of Cloud Environment. For Azure, it's the resource group name
--zoneOptional. The zone of Cloud Environment. It will be zonal if this is configured.
--network-cidrOptional. The network cidr of Cloud Environment. Cannot be specified if network-id is specified.
--subnet-cidrOptional. The subnet cidr of Cloud Environment. Only required for Azure environments when cidr is specified.
--network-idOptional. The network id of Cloud Environment. Cannot be specified if cidr is specified.
--default-gateway-accessOptional. The access type of Pulsar endpoint. It can be public or private. Default to public.
--default-gateway-allowed-idsOptional. The allowed ids of the default gateway, only can be set when --default-gateway-access is private.
--environment-typeOptional. The environment type, can be dev, test, staging, production, poc, qa, acc. Default to production.

Examples

snctl create cloudenvionment --cloud-connection-name share-aws --region us-east-1 -n orgname

Tutorial

You can also watch the video of creating a cloud environment using snctl:

Create Cloud Environment

Create a Cloud Environment with terraform

To create a Cloud Environment with terraform:

  1. Prepare main.tf
  2. Run terraform init
  3. Run terraform apply

Cloud Environment Schema

FieldTypeDescription
organization, requiredStringThe organization name
cloud_connection_name, requiredStringName of the cloud connection
region, requiredStringThe cloud region in which this environment will be created
zone, optionalStringThe zone of Cloud Environment. It will be zonal if this is configured.
networkList of Objectsee 'network schema' below for nested schema
network schemacidr (String), id (String)cidr and id cannot be specified together
default_gateway, optionalList of Objectsee 'default_gateway schema' below for nested schema
default_gateway schemaaccess (String), private_service (List of Object)see 'private_service schema' for nested schema
private_service schemaallowed_ids (List of String)

Examples

module "sn_managed_cloud" {
  source = "github.com/streamnative/terraform-managed-cloud//modules/aws?ref=v3.13.1"

  external_id = "<YOUR_SNCLOUD_ORG_ID>"
}

resource "streamnative_cloud_connection" "shared_aws" {
    depends_on = [ module.sn_managed_cloud ]
    organization = "orgname"
    name = "shared-aws"

    type = "aws"
    aws {
        account_id = "xxx"
    }
}

resource "streamnative_cloud_environment" "aws_usw1_production" {
    depends_on = [ streamnative_cloud_connection.shared_aws ]
    organization = "orgname"
    region = "us-west-1"
    cloud_connection_name = "shared-aws"

    network {
      cidr = "10.60.0.0/16"
    }
}

Tutorial

You can also watch the video of creating a cloud environment using Terraform:

Create Cloud Environment using Terraform

Monitoring the Provisioning Process

Creating a Cloud Environment through Terraform does not immediately create the Cloud Environment, but rather kicks off a process that creates it. In order to monitor that process, you can use snctl.

snctl describe -n orgname cloudenvironment name-of-your-environment

Once snctl describe returns a status of True and a type of Ready your Cloud Environment has been provisioned, and you can create a Pulsar Cluster within it. This should take approximately 40 minutes.

If this command returns an error state, please reach out to the StreamNative support team.

Recommended default CIDR Values

If you are using a StreamNative-managed VPC as described in the documentation above, we recommend the following default CIDR values.

  • AWS
    • Default VPC CIDR: 10.60.0.0/16 (must between /16 and /28), but we suggest using /16 to /18, otherwise there will not be enough IP addresses.
    • The subnet CIDR will be calculated by VPC CIDR.
  • GCP
    • Default VPC CIDR: 10.0.0.0/16
  • Azure
    • Default VPC CIDR: 10.70.0.0/16
    • Default Subnet CIDR: 10.70.0.0/24

Next steps

With one or multiple Cloud Environments in place, you can then start to create StreamNative instances and clusters using those cloud environments.

Previous
Create a Cloud Connection