Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview

Nameclusters
TypeResource
Idaws.kafka.clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
active_operation_arnstringArn of active cluster operation.
broker_node_group_infoobjectDescribes the setup to be used for Apache Kafka broker nodes in the cluster.
client_authenticationobjectIncludes all client authentication information.
cluster_arnstringThe Amazon Resource Name (ARN) that uniquely identifies the cluster.
cluster_namestringThe name of the cluster.
creation_timestring (date-time)The time when the cluster was created.
current_broker_software_infoobjectInformation about the version of software currently deployed on the Apache Kafka brokers in the cluster.
current_versionstringThe current version of the MSK cluster.
customer_action_statusstringDetermines if there is an action required from the customer. (CRITICAL_ACTION_REQUIRED, ACTION_RECOMMENDED, NONE)
encryption_infoobjectIncludes encryption-related information, such as the AWS KMS key used for encrypting data at rest and whether you want MSK to encrypt your data in transit.
enhanced_monitoringstringSpecifies which metrics are gathered for the MSK cluster. This property has the following possible values: DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION. For a list of the metrics associated with each of these levels of monitoring, see Monitoring. (DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, PER_TOPIC_PER_PARTITION)
logging_infoobject
number_of_broker_nodesintegerThe number of broker nodes in the cluster.
open_monitoringobjectSettings for open monitoring using Prometheus.
rebalancingobjectSpecifies whether or not intelligent rebalancing is turned on for a newly created MSK Provisioned cluster with Express brokers. Intelligent rebalancing performs automatic partition balancing operations when you scale your clusters up or down. By default, intelligent rebalancing is ACTIVE for all new Express-based clusters.
statestringThe state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING. (ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, UPDATING)
state_infoobject
storage_modestringControls storage mode for various supported storage tiers. (LOCAL, TIERED)
tagsobjectTags attached to the cluster.
zookeeper_connect_stringstringThe connection string to use to connect to the Apache ZooKeeper cluster.
zookeeper_connect_string_tlsstringThe connection string to use to connect to zookeeper cluster on Tls port.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_clusterselectcluster_arn, regionReturns a description of the MSK cluster whose Amazon Resource Name (ARN) is specified in the request.
list_clustersselectregionclusterNameFilter, maxResults, nextTokenReturns a list of all the MSK clusters in the current Region.
create_clusterinsertregion, BrokerNodeGroupInfo, ClusterName, KafkaVersion, NumberOfBrokerNodesCreates a new MSK cluster.
update_broker_countupdatecluster_arn, region, CurrentVersion, TargetNumberOfBrokerNodesUpdates the number of broker nodes in the cluster.
update_broker_storageupdatecluster_arn, region, CurrentVersion, TargetBrokerEBSVolumeInfoUpdates the EBS storage associated with MSK brokers.
update_broker_typeupdatecluster_arn, region, CurrentVersion, TargetInstanceTypeUpdates EC2 instance type.
update_connectivityupdatecluster_arn, region, CurrentVersionUpdates the cluster's connectivity configuration.
delete_clusterdeletecluster_arn, regioncurrentVersionDeletes the MSK cluster specified by the Amazon Resource Name (ARN) in the request.
batch_associate_scram_secretexeccluster_arn, region, SecretArnListAssociates one or more Scram Secrets with an Amazon MSK cluster.
batch_disassociate_scram_secretexeccluster_arn, region, SecretArnListDisassociates one or more Scram Secrets from an Amazon MSK cluster.
reboot_brokerexeccluster_arn, region, BrokerIdsReboots brokers.
update_monitoringexeccluster_arn, region, CurrentVersionUpdates the monitoring settings for the cluster. You can use this operation to specify which Apache Kafka metrics you want Amazon MSK to send to Amazon CloudWatch. You can also specify settings for open monitoring with Prometheus.
update_rebalancingexeccluster_arn, region, CurrentVersionUse this resource to update the intelligent rebalancing status of an Amazon MSK Provisioned cluster with Express brokers.
update_securityexeccluster_arn, region, CurrentVersionUpdates the security settings for the cluster. You can use this operation to specify encryption and authentication on existing clusters.
update_storageexeccluster_arn, region, CurrentVersionUpdates cluster broker volume size (or) sets cluster storage mode to TIERED.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
cluster_arnstringThe Amazon Resource Name (ARN) of the cluster to be updated.
regionstringAWS region (default: us-east-1)
clusterNameFilterstringSpecify a prefix of the name of the clusters that you want to list. The service lists all the clusters whose names start with this prefix.
currentVersionstringThe current version of the MSK cluster.
maxResultsintegerThe maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.
nextTokenstringThe paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request.

SELECT examples

Returns a description of the MSK cluster whose Amazon Resource Name (ARN) is specified in the request.

SELECT
active_operation_arn,
broker_node_group_info,
client_authentication,
cluster_arn,
cluster_name,
creation_time,
current_broker_software_info,
current_version,
customer_action_status,
encryption_info,
enhanced_monitoring,
logging_info,
number_of_broker_nodes,
open_monitoring,
rebalancing,
state,
state_info,
storage_mode,
tags,
zookeeper_connect_string,
zookeeper_connect_string_tls
FROM aws.kafka.clusters
WHERE cluster_arn = '{{ cluster_arn }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new MSK cluster.

INSERT INTO aws.kafka.clusters (
BrokerNodeGroupInfo,
Rebalancing,
ClientAuthentication,
ClusterName,
ConfigurationInfo,
EncryptionInfo,
EnhancedMonitoring,
OpenMonitoring,
KafkaVersion,
LoggingInfo,
NumberOfBrokerNodes,
Tags,
StorageMode,
region
)
SELECT
'{{ BrokerNodeGroupInfo }}' /* required */,
'{{ Rebalancing }}',
'{{ ClientAuthentication }}',
'{{ ClusterName }}' /* required */,
'{{ ConfigurationInfo }}',
'{{ EncryptionInfo }}',
'{{ EnhancedMonitoring }}',
'{{ OpenMonitoring }}',
'{{ KafkaVersion }}' /* required */,
'{{ LoggingInfo }}',
{{ NumberOfBrokerNodes }} /* required */,
'{{ Tags }}',
'{{ StorageMode }}',
'{{ region }}'
RETURNING
cluster_arn,
cluster_name,
state
;

UPDATE examples

Updates the number of broker nodes in the cluster.

UPDATE aws.kafka.clusters
SET
CurrentVersion = '{{ CurrentVersion }}',
TargetNumberOfBrokerNodes = {{ TargetNumberOfBrokerNodes }}
WHERE
cluster_arn = '{{ cluster_arn }}' --required
AND region = '{{ region }}' --required
AND CurrentVersion = '{{ CurrentVersion }}' --required
AND TargetNumberOfBrokerNodes = '{{ TargetNumberOfBrokerNodes }}' --required
RETURNING
cluster_arn,
cluster_operation_arn;

DELETE examples

Deletes the MSK cluster specified by the Amazon Resource Name (ARN) in the request.

DELETE FROM aws.kafka.clusters
WHERE cluster_arn = '{{ cluster_arn }}' --required
AND region = '{{ region }}' --required
AND currentVersion = '{{ currentVersion }}'
;

Lifecycle Methods

Associates one or more Scram Secrets with an Amazon MSK cluster.

EXEC aws.kafka.clusters.batch_associate_scram_secret
@cluster_arn='{{ cluster_arn }}' --required,
@region='{{ region }}' --required
@@json=
'{
"SecretArnList": "{{ SecretArnList }}"
}'
;