forked from aws/aws-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aws#4586 from bisdavid/kafka-10-07
New CLI examples for Kafka service
- Loading branch information
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
**To create an Amazon MSK cluster** | ||
|
||
The following ``create-cluster`` example creates an MSK cluster named ``MessagingCluster`` with three broker nodes. A JSON file named ``brokernodegroupinfo.json`` specifies the three subnets over which you want Amazon MSK to distribute the broker nodes. This example doesn't specify the monitoring level, so the cluster gets the ``DEFAULT`` level. :: | ||
|
||
aws kafka create-cluster \ | ||
--cluster-name "MessagingCluster" \ | ||
--broker-node-group-info file://brokernodegroupinfo.json \ | ||
--kafka-version "2.2.1" \ | ||
--number-of-broker-nodes 3 | ||
|
||
Contents of ``brokernodegroupinfo.json``:: | ||
|
||
{ | ||
"InstanceType": "kafka.m5.xlarge", | ||
"BrokerAZDistribution": "DEFAULT", | ||
"ClientSubnets": [ | ||
"subnet-0123456789111abcd", | ||
"subnet-0123456789222abcd", | ||
"subnet-0123456789333abcd" | ||
] | ||
} | ||
|
||
Output:: | ||
|
||
{ | ||
"ClusterArn": "arn:aws:kafka:us-west-2:123456789012:cluster/MessagingCluster/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2", | ||
"ClusterName": "MessagingCluster", | ||
"State": "CREATING" | ||
} | ||
|
||
For more information, see `Create an Amazon MSK Cluster <https://docs.aws.amazon.com/msk/latest/developerguide/msk-create-cluster.html>`__ in the *Amazon Managed Streaming for Apache Kafka*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
**To create a custom Amazon MSK configuration** | ||
|
||
The following ``create-configuration`` example creates a custom MSK configuration with the server properties that are specified in the input file. :: | ||
|
||
aws kafka create-configuration \ | ||
--name "CustomConfiguration" \ | ||
--description "Topic autocreation enabled; Apache ZooKeeper timeout 2000 ms; Log rolling 604800000 ms." \ | ||
--kafka-versions "2.2.1" \ | ||
--server-properties file://configuration.txt | ||
|
||
Contents of ``configuration.txt``:: | ||
|
||
auto.create.topics.enable = true | ||
zookeeper.connection.timeout.ms = 2000 | ||
log.roll.ms = 604800000 | ||
|
||
This command produces no output. | ||
Output:: | ||
|
||
{ | ||
"Arn": "arn:aws:kafka:us-west-2:123456789012:configuration/CustomConfiguration/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2", | ||
"CreationTime": "2019-10-09T15:26:05.548Z", | ||
"LatestRevision": | ||
{ | ||
"CreationTime": "2019-10-09T15:26:05.548Z", | ||
"Description": "Topic autocreation enabled; Apache ZooKeeper timeout 2000 ms; Log rolling 604800000 ms.", | ||
"Revision": 1 | ||
}, | ||
"Name": "CustomConfiguration" | ||
} | ||
|
||
For more information, see `Amazon MSK Configuration Operations <https://docs.aws.amazon.com/msk/latest/developerguide/msk-configuration-operations.html>`__ in the *Amazon Managed Streaming for Apache Kafka Developer Guide*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
**To update the EBS storage for brokers** | ||
|
||
The following ``update-broker-storage`` example updates the amount of EBS storage for all the brokers in the cluster. Amazon MSK sets the target storage amount for each broker to the amount specified in the example. You can get the current version of the cluster by describing the cluster or by listing all of the clusters. :: | ||
|
||
|
||
aws kafka update-broker-storage \ | ||
--cluster-arn "arn:aws:kafka:us-west-2:123456789012:cluster/MessagingCluster/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2" \ | ||
--current-version "K21V3IB1VIZYYH" \ | ||
--target-broker-ebs-volume-info "KafkaBrokerNodeId=ALL,VolumeSizeGB=1100" | ||
|
||
The output returns an ARN for this ``update-broker-storage`` operation. To determine if this operation is complete, use the ``describe-cluster-operation`` command with this ARN as input. :: | ||
|
||
{ | ||
"ClusterArn": "arn:aws:kafka:us-west-2:123456789012:cluster/MessagingCluster/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2", | ||
"ClusterOperationArn": "arn:aws:kafka:us-west-2:123456789012:cluster-operation/V123450123/a1b2c3d4-1234-abcd-cdef-22222EXAMPLE-2/a1b2c3d4-abcd-1234-bcde-33333EXAMPLE" | ||
} | ||
|
||
For more information, see `Update the EBS Storage for Brokers <https://docs.aws.amazon.com/msk/latest/developerguide/msk-update-storage.html>`__ in the *Amazon Managed Streaming for Apache Kafka Developer Guide*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**To update the configuration of an Amazon MSK cluster** | ||
|
||
The following ``update-cluster-configuration`` example updates the configuration of the specified existing MSK cluster. It uses a custom MSK configuration. :: | ||
|
||
|
||
aws kafka update-cluster-configuration \ | ||
--cluster-arn "arn:aws:kafka:us-west-2:123456789012:cluster/MessagingCluster/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2" \ | ||
--configuration-info file://configuration-info.json \ | ||
--current-version "K21V3IB1VIZYYH" | ||
|
||
Contents of ``configuration-info.json``:: | ||
|
||
{ | ||
"Arn": "arn:aws:kafka:us-west-2:123456789012:configuration/CustomConfiguration/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2", | ||
"Revision": 1 | ||
} | ||
|
||
The output returns an ARN for this ``update-cluster-configuration`` operation. To determine if this operation is complete, use the ``describe-cluster-operation`` command with this ARN as input. :: | ||
|
||
{ | ||
"ClusterArn": "arn:aws:kafka:us-west-2:123456789012:cluster/MessagingCluster/a1b2c3d4-5678-90ab-cdef-11111EXAMPLE-2", | ||
"ClusterOperationArn": "arn:aws:kafka:us-west-2:123456789012:cluster-operation/V123450123/a1b2c3d4-1234-abcd-cdef-22222EXAMPLE-2/a1b2c3d4-abcd-1234-bcde-33333EXAMPLE" | ||
} | ||
|
||
For more information, see `Update the Configuration of an Amazon MSK Cluster <https://docs.aws.amazon.com/msk/latest/developerguide/msk-update-cluster-cofig.html>`__ in the *Amazon Managed Streaming for Apache Kafka Developer Guide*. |