Skip to content

Commit

Permalink
Merge branch '7.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ybyzek committed Feb 8, 2022
2 parents 757e172 + d5e6552 commit 6dc23c9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions ccloud/beginner-cloud/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ CLUSTER_NAME="${CLUSTER_NAME:-demo-kafka-cluster}"
CLUSTER_CLOUD="${CLUSTER_CLOUD:-aws}"
CLUSTER_REGION="${CLUSTER_REGION:-us-west-2}"
echo -e "\n# Create a new Confluent Cloud cluster $CLUSTER_NAME"
echo "confluent kafka cluster create $CLUSTER_NAME --cloud $CLUSTER_CLOUD --region $CLUSTER_REGION"
OUTPUT=$(confluent kafka cluster create $CLUSTER_NAME --cloud $CLUSTER_CLOUD --region $CLUSTER_REGION)
echo "confluent kafka cluster create $CLUSTER_NAME --cloud $CLUSTER_CLOUD --region $CLUSTER_REGION --output json"
OUTPUT=$(confluent kafka cluster create $CLUSTER_NAME --cloud $CLUSTER_CLOUD --region $CLUSTER_REGION --output json)
status=$?
echo "$OUTPUT"
if [[ $status != 0 ]]; then
echo "ERROR: Failed to create Kafka cluster $CLUSTER_NAME. Please troubleshoot and run again"
exit 1
fi
CLUSTER=$(echo "$OUTPUT" | grep '| Id' | awk '{print $4;}')
CLUSTER=$(echo "$OUTPUT" | jq -r .id)

echo -e "\n# Specify $CLUSTER as the active Kafka cluster"
echo "confluent kafka cluster use $CLUSTER"
Expand Down Expand Up @@ -347,7 +347,7 @@ confluent kafka acl delete --allow --service-account $SERVICE_ACCOUNT_ID --opera
##################################################

echo -e "\n# Cleanup: delete connector, service-account, topics, api-keys, kafka cluster, environment"
CONNECTOR_ID=$(confluent connect list | grep $CONNECTOR | tr -d '\*' | awk '{print $1;}')
CONNECTOR_ID=$(confluent connect list -o json | jq -r 'map(select(.name == "'"$CONNECTOR"'")) | .[].id')
echo "confluent connect delete $CONNECTOR_ID"
confluent connect delete $CONNECTOR_ID 1>/dev/null
echo "confluent iam service-account delete $SERVICE_ACCOUNT_ID"
Expand Down
2 changes: 1 addition & 1 deletion ccloud/docs/ccloud-stack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ By default, the |ccloud| ksqlDB app is not created with ``ccloud-stack``, you ha
confluent api-key create --service-account $SERVICE_ACCOUNT_ID --resource $RESOURCE -o json // for schema-registry
# By default, ccloud-stack does not enable Confluent Cloud ksqlDB, but if you explicitly enable it:
confluent ksql app create --cluster $CLUSTER --api-key "$KAFKA_API_KEY" --api-secret "$KAFKA_API_SECRET" -o json "$KSQLDB_NAME"
confluent ksql cluster create --cluster $CLUSTER --api-key "$KAFKA_API_KEY" --api-secret "$KAFKA_API_SECRET" -o json "$KSQLDB_NAME"
confluent api-key create --service-account $SERVICE_ACCOUNT_ID --resource $RESOURCE -o json // for ksqlDB REST API
confluent kafka acl create --allow --service-account $SERVICE_ACCOUNT_ID --operation <....> // permissive ACLs for all services
Expand Down
2 changes: 1 addition & 1 deletion cloud-etl/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Overview

This demo showcases a cloud ETL solution leveraging all fully-managed services on [Confluent Cloud](https://confluent.cloud?utm_source=github&utm_medium=demo&utm_campaign=ch.examples_type.community_content.cloud-etl)
A source connector reads data from an AWS Kinesis stream or PostgreSQL database and written into Confluent Cloud, a Confluent KSQL application processes that data, and then a sink connector writes the output data into cloud storage in the provider of your choice.
A source connector reads data from an AWS Kinesis stream or PostgreSQL database and written into Confluent Cloud, a Confluent ksqlDB application processes that data, and then a sink connector writes the output data into cloud storage in the provider of your choice.

![image](docs/images/topology.png)

Expand Down
4 changes: 2 additions & 2 deletions cloud-etl/create_ksqldb_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ccloud::validate_credentials_ksqldb "$KSQLDB_ENDPOINT" "$CONFIG_FILE" "$KSQLDB_B
echo -e "Create output topics $KAFKA_TOPIC_NAME_OUT1 and $KAFKA_TOPIC_NAME_OUT2, and ACLs to allow the ksqlDB application to run\n"
confluent kafka topic create $KAFKA_TOPIC_NAME_OUT1
confluent kafka topic create $KAFKA_TOPIC_NAME_OUT2
ksqlDBAppId=$(confluent ksql app list | grep "$KSQLDB_ENDPOINT" | awk '{print $1}')
confluent ksql app configure-acls $ksqlDBAppId $KAFKA_TOPIC_NAME_IN $KAFKA_TOPIC_NAME_OUT1 $KAFKA_TOPIC_NAME_OUT2
ksqlDBAppId=$(confluent ksql cluster list -o json | jq -r 'map(select(.endpoint == "'"$KSQLDB_ENDPOINT"'")) | .[].id')
confluent ksql cluster configure-acls $ksqlDBAppId $KAFKA_TOPIC_NAME_IN $KAFKA_TOPIC_NAME_OUT1 $KAFKA_TOPIC_NAME_OUT2
SERVICE_ACCOUNT_ID=$(ccloud:get_service_account_from_current_cluster_name)
confluent kafka acl create --allow --service-account $SERVICE_ACCOUNT_ID --operation WRITE --topic $KAFKA_TOPIC_NAME_OUT1
confluent kafka acl create --allow --service-account $SERVICE_ACCOUNT_ID --operation WRITE --topic $KAFKA_TOPIC_NAME_OUT2
Expand Down
4 changes: 2 additions & 2 deletions cp-quickstart/start-cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ retry $MAX_WAIT ccloud::validate_ccloud_ksqldb_endpoint_ready $KSQLDB_ENDPOINT |
print_pass "Confluent Cloud KSQL is UP"

printf "Obtaining the ksqlDB App Id\n"
CMD="confluent ksql app list -o json | jq -r '.[].id'"
CMD="confluent ksql cluster list -o json | jq -r '.[].id'"
ksqlDBAppId=$(eval $CMD) \
&& print_code_pass -c "$CMD" -m "$ksqlDBAppId" \
|| exit_with_error -c $? -n "$NAME" -m "$CMD" -l $(($LINENO -3))

printf "\nConfiguring ksqlDB ACLs\n"
CMD="confluent ksql app configure-acls $ksqlDBAppId pageviews users"
CMD="confluent ksql cluster configure-acls $ksqlDBAppId pageviews users"
$CMD \
&& print_code_pass -c "$CMD" \
|| exit_with_error -c $? -n "$NAME" -m "$CMD" -l $(($LINENO -3))
Expand Down
1 change: 0 additions & 1 deletion utils/ccloud_library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,6 @@ function ccloud::wait_for_connector_up() {
function ccloud::validate_ccloud_ksqldb_endpoint_ready() {
KSQLDB_ENDPOINT=$1


STATUS=$(confluent ksql cluster list -o json | jq -r 'map(select(.endpoint == "'"$KSQLDB_ENDPOINT"'")) | .[].status' | grep UP)
if [[ "$STATUS" == "" ]]; then
return 1
Expand Down

0 comments on commit 6dc23c9

Please sign in to comment.