IMPORTANT TO KNOW FOR THE WORKSHOP: We run in AWS, Azure and Google Cloud. Currently we do support 24 Regions. Please be aware that the cluster and the Flink Pool need to be in the same Cloud-Provider-Region.
This is the deployment of confluent cloud infrastructure resources to run the Flink SQL Hands-on Workshop. We will deploy with terraform:
- Environment:
- Name: flink_hands-on+UUID
- with enabled Schema Registry (essentials) in AWS region (eu-central-1)
- Confluent Cloud Basic Cloud: cc_handson_cluster
- in AWS in region (eu-central-1)
- Connectors:
- Datagen for shoe_products
- Datagen for shoe_customers
- Datagen for show_orders
- Service Accounts
- app_manager-XXXX with Role EnvironmentAdmin
- sr-XXXX with Role EnvironmentAdmin
- clients-XXXX with Role CloudClusterAdmin
- connectors-XXXX
- User account on Confluent Cloud
- Local install of Terraform (details below)
- Local install of jq (details below)
- Local install Confluent CLI, install the cli
- Create API Key in Confluent Cloud via CLI:
confluent login confluent api-key create --resource cloud --description "API for terraform" # It may take a couple of minutes for the API key to be ready. # Save the API key and secret. The secret is not retrievable later. #+------------+------------------------------------------------------------------+ #| API Key | <your generated key> | #| API Secret | <your generated secret> | #+------------+------------------------------------------------------------------+
- Or visit the Cloud API Key page to create a Cloud API Key for your user, if you don't have any yet.
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
brew update
brew upgrade hashicorp/tap/terraform
If you are running Windows, please use this guide
If you are running on Ubuntu (or WSL2 with Ubuntu), please use this guide
This tutorial was tested with Terraform v1.6.4 and confluent terraform provider 1.55.0 . To upgrade terraform on MacOS use
brew upgrade terraform
Or download new version from website
brew install jq
If you are running Windows, download from here
If you are running on Ubuntu (or WSL2 with Ubuntu), please follow the instructions here
Please install the Confluent CLI, with these instructions
# For Mac
brew install confluentinc/tap/cli
This tutorial was developed with Confluent CLI v3.41.0 and run on lates: v4.9.8
Clone the repo on your desktop.
cd $HOME # or where-ever directory you want to use
git clone https://github.com/griga23/shoe-store.git
cd shoe-store
Go to the Confluent Console via the url https://confluent.cloud/settings/api-keys then, use the "+ Add API key" button on the right side of the page. Select "My account", >> "Next" then select the "Cloud resource management" tile, complete and download the API key. It will be use to get Terraform plan and provision resources.
- Add your API key to the Terraform variables by creating a tfvars file
cat > $PWD/terraform/terraform.tfvars <<EOF
confluent_cloud_api_key = "{Confluent Cloud API Key}"
confluent_cloud_api_secret = "{Confluent Cloud API Key Secret}"
cc_cloud_provider = "{the_selected_cloud_provider}"
cc_cloud_region= "{the_selected_region_of_the_confluent_cloud}"
EOF
In some cases you may want to prefix your resources, to do so use:
cat >> $PWD/terraform/terraform.tfvars <<EOF
use_prefix = "{choose your prefix}"
EOF
run the following commands:
cd ./terraform
terraform init
terraform plan
terraform apply
# Apply shows you what will be provision, enter yes to continue provisioning
terraform output -json
# for sensitive data
terraform output -raw SRSecret
terraform output -raw AppManagerSecret
terraform output -raw ClientSecret
Please check whether the terraform execution went without errors.
You can copy the login instruction also from the UI.
To continue with the UI:
- Access Confluent Cloud WebUI: https://confluent.cloud/login
- Access your Environment:
flink_handson_terraform-XXXXXXXX
- Start with lab1
You deployed:
You are ready to start with LAB1
terraform destroy
There could be a conflict destroying everything with our Tags. In this case destroy again via terraform.
#╷
#│ Error: error deleting Tag "<tagID>/PII": 409 Conflict
#│
#│
#╵
#╷
#│ Error: error deleting Tag "<tagID>/Public": 409 Conflict
#│
#│
#╵
# destroy again
terraform destroy