- Manage StreamNative Clusters
- 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
Sign in to StreamNative Cloud at https://console.streamnative.cloud.
Select the Organization.
Expand the user profile drop down and click on the Cloud Environments page
On the Cloud Environments page, click the New button and select Create environment.
Select the CloudConnection, then click Environment setup.
Specify the region and other configurations, then click Create.
Tutorial
You can also watch the video of creating a cloud environment using Cloud Console UI:
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
Flag | Description |
---|---|
--cloud-connection-name | Required. The name of cloud connection name. |
--region | Required. The region of Cloud Environment. For Azure, it's the resource group name |
--zone | Optional. The zone of Cloud Environment. It will be zonal if this is configured. |
--network-cidr | Optional. The network cidr of Cloud Environment. Cannot be specified if network-id is specified. |
--subnet-cidr | Optional. The subnet cidr of Cloud Environment. Only required for Azure environments when cidr is specified. |
--network-id | Optional. The network id of Cloud Environment. Cannot be specified if cidr is specified. |
--default-gateway-access | Optional. The access type of Pulsar endpoint. It can be public or private . Default to public . |
--default-gateway-allowed-ids | Optional. The allowed ids of the default gateway, only can be set when --default-gateway-access is private . |
--environment-type | Optional. 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 a Cloud Environment with terraform
To create a Cloud Environment with terraform:
- Prepare
main.tf
- Run
terraform init
- Run
terraform apply
Cloud Environment Schema
Field | Type | Description |
---|---|---|
organization, required | String | The organization name |
cloud_connection_name, required | String | Name of the cloud connection |
region, required | String | The cloud region in which this environment will be created |
zone, optional | String | The zone of Cloud Environment. It will be zonal if this is configured. |
network | List of Object | see 'network schema' below for nested schema |
network schema | cidr (String), id (String) | cidr and id cannot be specified together |
default_gateway, optional | List of Object | see 'default_gateway schema' below for nested schema |
default_gateway schema | access (String), private_service (List of Object) | see 'private_service schema' for nested schema |
private_service schema | allowed_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:
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.
- Default VPC CIDR:
- GCP
- Default VPC CIDR:
10.0.0.0/16
- Default VPC CIDR:
- Azure
- Default VPC CIDR:
10.70.0.0/16
- Default Subnet CIDR:
10.70.0.0/24
- Default VPC CIDR:
Next steps
With one or multiple Cloud Environments in place, you can then start to create StreamNative instances and clusters using those cloud environments.