A Google Cloud resource is any component that you create or use within the Google Cloud. These resources form the building blocks of your applications and systems running on the platform.
Resources in Managed Service for Apache Kafka include the following:
Cluster
Topic
Consumer group
ACL
For more information, see Resource names.
Resource naming format
Here are the formats for the different resources:
Cluster:
projects/{PROJECT_ID}/locations/{LOCATION_NAME}/clusters/{CLUSTER_ID}
Topic:
projects/{PROJECT_ID}/locations/{LOCATION_NAME}/clusters/{CLUSTER_ID}/topics/{TOPIC_ID}
Consumer group:
projects/{PROJECT_ID}/locations/{LOCATION_NAME}/clusters/{CLUSTER_ID}/consumerGroup/{CONSUMER_GROUP_ID}
ACL:
projects/{PROJECT_ID}/locations/{LOCATION_NAME}/clusters/{CLUSTER_ID}/acl/{ACL_ID}
Here's a breakdown of each component in the next sections.
Project ID
The value must be the project ID or project number, available from the Google Cloud console.
For example—test-cool-project
is a project ID, while 123456789123
is a
project number.
Location
The value must be one of the supported Managed Service for Apache Kafka locations. For a list of available locations, see Managed Service for Apache Kafka locations.
Cluster, topic, or consumer group ID
The value must conform to the following guidelines:
Not begin with the string
goog
Start with a letter
Contain between 3 and 255 characters
Contain only these characters: Letters
[A-Za-z]
, numbers[0-9]
, dashes-
, underscores_
, periods.
, tildes~
, plus signs+
, and percent signs%
.
ACL ID
The structure of
acl_id
defines the resource pattern (resource_type,
resource_name, pattern_type) of the ACL. All ACL entries in the ACL applies to
the resource pattern encoded in the ACL ID.
acl_id
must be structured like one of the following samples:
For ACLs on the cluster:
cluster
For ACLs on a single resource within the cluster:
topic/{resource_name}
consumerGroup/{resource_name}
transactionalId/{resource_name}
For ACLs on all resources that match a prefix:
topicPrefixed/{resource_name}
consumerGroupPrefixed/{resource_name}
transactionalIdPrefixed/{resource_name}
For ACLs on all resources of a given type (the wildcard literal "*"):
allTopics
(representstopic/*
)allConsumerGroups
(representsconsumerGroup/*
)allTransactionalIds
(representstransactionalId/*
)
Special characters
You can use the special characters listed in the previous section in resource names without URL-encoding. However, you must ensure that any other special character is properly encoded or decoded when used in URLs.
For example, mi-tópico
is an invalid ID. However, mi-topico
is valid. This
format is important when making REST calls.
If you're referencing a topic from the Kafka client libraries, the full resource path is not used. Only the topic name itself is used.