Select Cloud Provider and Region
By default, the
cloud-stack utility creates resources in the cloud provider
aws in region
us-west-2. To create resources in another cloud provider or region other than the default, complete the following steps:
View the available cloud providers and regions using the Confluent Cloud CLI:
ccloud-stack and override the parameters
CLUSTER_REGION, as shown in the following example:
CLUSTER_CLOUD=aws CLUSTER_REGION=us-west-2 ./ccloud_stack_create.sh
Re-use Existing Environment
By default, a new
ccloud-stack creates a new environment.
This means that, by default,
./ccloud_stack_create.sh creates a new environment and
./ccloud_stack_destroy.sh deletes the environment specified in the configuration file.
However, due to Confluent Cloud environment limits per organization, it may be desirable to work within an existing environment.
When you create a new stack, to reuse an existing environment, set the parameter
ENVIRONMENT with an existing environment ID, as shown in the example:
When you destroy resources that were created by
ccloud-stack, the default behavior is that the environment specified by the service account ID in the configuration file is deleted.
However, there are two additional options.
To preserve the environment when destroying all the other resources in the
ccloud-stack, set the parameter
PRESERVE_ENVIRONMENT=true, as shown in the following example.
If you do not specify
PRESERVE_ENVIRONMENT=true, then the environment specified by the service account ID in the configuration file is deleted.
PRESERVE_ENVIRONMENT=true ./ccloud_stack_destroy.sh stack-configs/java-service-account-<SERVICE_ACCOUNT_ID>.config
To destroy the environment when destroying all the other resources in the
ccloud-stack, but the service account is not part of the environment name (i.e., multiple
ccloud-stacks were created in the same environment), set the parameter
ENVIRONMENT_NAME_PREFIX=ccloud-stack-<SERVICE_ACCOUNT_ID>, as shown in the following example.
Note that the service account ID in the environment name is not the same as the service account ID in the config name.
If you do not specify the environment name prefix, then the destroy function will not be able to identify the proper environment ID to delete.
ENVIRONMENT_NAME_PREFIX=ccloud-stack-<SERVICE_ACCOUNT_ID_original> ./ccloud_stack_destroy.sh stack-configs/java-service-account-<SERVICE_ACCOUNT_ID_current>.config