Managing Amazon Msk
AWSOfficialPublished by AWS
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides domain expertise for operating Amazon MSK Provisioned clusters. It covers performance troubleshooting, consumer lag diagnosis, storage management, cluster sizing, client configuration, and CloudWatch monitoring. It distinguishes between Standard and Express broker architectures, providing specific workflows for maintenance, topic management, and MSK Replicator setup. The skill also includes guidance on integrating with S3 via Streaming Tables and Data Delivery for General Purpose S3.
What it does
- Provides configuration patterns for Kafka producers and consumers.
- Offers workflows for managing MSK cluster configurations and custom domain names.
- Includes a sizing script for determining broker counts and instance types.
- Details procedures for MSK Replicator setup for DR and cross-account replication.
- Outlines monitoring and alerting strategies using CloudWatch metrics.
- Guides the setup of Streaming Tables and Data Delivery for S3.
When to use it
- When configuring or tuning Kafka clients for MSK connectivity.
- When sizing a new MSK cluster or choosing between Standard and Express brokers.
- When troubleshooting performance issues, consumer lag, or storage constraints.
- When setting up cross-cluster replication or disaster recovery.
- When integrating MSK with S3 for data lake or streaming table requirements.
Advantages
- Provides clear decision frameworks for Standard vs. Express broker types.
- Includes automated sizing logic via provided scripts.
- Centralizes operational procedures for common MSK maintenance tasks.
- Offers specific guidance for complex configurations like custom advertised listeners.
Usage examples
- “How do I choose between MSK Standard and Express brokers for my workload?”
- The agent will guide you through the size-and-choose-cluster.md reference and run the msk_sizing.py script to compare costs and performance characteristics.
- “My consumer lag is increasing, what should I check?”
- The agent will provide a troubleshooting workflow based on troubleshoot-consumer-lag.md, covering rebalance issues and consumer group health.
- “How do I configure a custom domain name for my MSK brokers?”
- The agent will explain how to use the custom.advertised.listeners configuration property as detailed in configure-cluster.md.
- “What are the recommended producer settings for MSK?”
- The agent will provide the table of recommended values for settings like linger.ms, batch.size, and acks from the configure-clients.md reference.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/aws/managing-amazon-msk/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip managing-amazon-msk.zip -d .agents/skills
Documentation by AWS
Amazon MSK
Overview
Domain expertise for operating Amazon MSK Provisioned clusters with Standard and Express broker types. Covers performance troubleshooting, consumer lag diagnosis, storage management, cluster sizing, client configuration, and CloudWatch monitoring.
Execute commands using available tools from the AWS MCP server when connected — it provides sandboxed execution, audit logging, and observability. When the MCP server is not available, fall back to the AWS CLI or shell as needed.
Standard brokers use customer-managed EBS volumes for storage. You choose instance types (kafka.m5/m7g families), provision EBS, and manage storage scaling.
Express brokers use instance types prefixed with express.m7g and are the default recommendation for almost all MSK workloads — they typically cost less, not just less effort. Up to 3x ingress per broker (MSK Express broker types) means fewer brokers for the same load, and storage is billed per GB-hour on data actually retained rather than provisioned up front on EBS that cannot shrink. They also scale 20x faster, rebalance partitions 180x faster (Intelligent Rebalancing), recover 90% quicker (MSK Express broker types), and have no maintenance windows. Express brokers have NO customer-managed EBS — do NOT recommend EBS expansion or provisioned throughput for Express clusters. Express brokers enforce fixed replication factor of 3 and min.insync.replicas=2. See size-and-choose-cluster.md for the full Standard vs Express decision framework.
Which Workflow Do You Need?
Determine the broker type first: aws kafka describe-cluster-v2 --cluster-arn <arn>. Check Provisioned.BrokerNodeGroupInfo.InstanceType — if it starts with express., it is an Express cluster.
| Customer Intent | Reference |
|---|---|
| High CPU, high latency, slow cluster, traffic shaping | troubleshoot-performance.md |
| Consumer lag increasing, rebalance storms, stuck consumer groups | troubleshoot-consumer-lag.md |
| Disk filling up, retention planning, tiered storage | manage-storage.md |
| Choosing Standard vs Express, sizing a cluster, partition limits, broker count, monthly cost | size-and-choose-cluster.md |
| Producer/consumer configuration, IAM/SCRAM/TLS auth | configure-clients.md |
Creating/applying MSK configurations (server.properties); custom domain names on brokers via custom.advertised.listeners (advertised listeners, static/custom bootstrap endpoint) — validation rules, apply/rollback, scaling; migrating from the dynamic per-broker kafka-configs.sh override to the static property | configure-cluster.md |
| Client-side connectivity for a custom domain: NLB + ACM certificate + Route 53 fronting, TLS handshake/termination, mTLS through an NLB, cross-zone load balancing | configure-clients.md (Custom Domain Name Connectivity section) |
Create, update, delete, list, or describe Kafka topics; when to use the native topic APIs / CfnTopic vs. a Kafka admin client | manage-topics.md |
| MSK Replicator setup, migration, DR, active-active/active-passive, cross-account replication, self-managed-to-MSK or MSK-to-MSK, loop-prevention/topic-naming behavior | msk-replicator.md |
Replication throughput per partition, how many partitions a replicator needs, why replicator scaling isn't increasing throughput, replicator quotas (topics, ingress, record size), ReplicationLatency/MessageLag/ReplicatorThroughput | msk-replicator.md (Size partition count section) |
| Setting up monitoring, dashboards, alarms | monitor-and-alarm.md |
| Full CloudWatch metric list (Standard or Express) | Prefer monitor-and-alarm.md for strategic recommendations and how to interpret metrics, only search documentation if you need to understand a metric not included in this reference file (MSK Standard CloudWatch Metrics, MSK Express CloudWatch Metrics) for full list |
| Rolling restart impact, patching, maintenance resilience | maintenance-operations.md |
| Deliver streaming data to Apache Iceberg tables on S3 Tables with low cost in a fully managed service (Streaming Tables) — setup, IAM, schema, create/update/delete/list/describe channels | streaming-tables.md |
| Deliver topic data to S3 bucket as JSON/ByteArray/String objects with low cost in a fully managed service (Data Delivery for General Purpose S3 buckets) — setup, IAM, output key templates, create/update/delete/list/describe channels | data-delivery-for-general-purpose-s3.md |
| Build a lakehouse / data lake from Kafka; make streaming data queryable in Athena | streaming-tables.md |
| Alternative to Kafka Connect S3 Sink or Amazon Data Firehose for MSK; zero-ops streaming delivery to S3 | data-delivery-for-general-purpose-s3.md |
| Streaming Tables / Data Delivery CloudWatch metrics and alarms, DLQ errors, failed deliveries, channel state transitions, freshness lag | streaming-tables-troubleshooting.md |
| "Can I use Streaming Tables / Data Delivery on MSK Serverless / Standard brokers?" — eligibility routing | streaming-tables.md (answer is always: Express brokers only, use Firehose, Flink, or Kafka Connect for Standard and Serqverless - Firehose integration for Amazon MSK) |
| What are the current supported Kafka versions for MSK? | Supported Apache Kafka versions |
| Does MSK support KRaft clusters, and how do I migrate between ZooKeeper and KRaft mode clusters? | zk-to-kraft-migration.md |
| What are the current quotas for MSK Express (ingress, egress, partitions, broker count, etc.)? | MSK Express Quotas |
| What are the current quotas for MSK Standard (partitions, broker count, etc.)? | MSK Standard Quotas, and MSK Standard best practices for partition count limits |
| What broker-level configuration changes can I make on MSK Express or Standard brokers? | MSK Configuration |
Available scripts
scripts/msk_sizing.py— MUST be run for any sizing question (broker count, instance choice, cost). Prices from the live AWS Pricing API when AWS credentials withpricing:GetProductsare available, and falls back to an embeddedus-east-1snapshot when they are not, so it runs with or without credentials. See size-and-choose-cluster.md for the required workflow and script reference.
Guardrail — where this skill's own files live (MCP vs local install)
This skill can be loaded two ways, and they resolve the skill's own bundled files — the references/ documents and the scripts/ files
from different places. Determine how the skill was loaded before you read a reference or run a script:
Loaded through the AWS MCP
retrieve_skilltool call. The skill is not installed on the local filesystem; its reference files and scripts do not exist on disk. You MUST fetch each reference or script through the sameretrieve_skilltool by passing thefileparameter (for example,file="references/configure-clients.md"orfile="scripts/msk_sizing.py"), and run a script from the content that tool returns. Do NOTfile_readthese paths from the local or working directory, and do NOT search the filesystem for them — they are not there, and any local file that happens to match the name is unrelated to this skill.Installed locally (the skill lives in a local skills directory such as
.claude/skills/managing-amazon-msk/,~/.claude/skills/managing-amazon-msk/, or.kiro/skills/managing-amazon-msk/). Read references and run scripts from the local skill directory using the relative paths shown throughout this documentation.
This distinction applies only to the skill's own packaged files. Every artifact
created during a session or supplied by users are read from and written to
the user's working directory regardless of how the skill was loaded. Never
fetch or write customer data through retrieve_skill.
Common Workflows
Create/apply Amazon MSK configurations and set custom domain names — creating an Amazon MSK configuration (server.properties with the fileb:// real-newline requirement), applying it with update-cluster-configuration, and setting broker custom domain names via custom.advertised.listeners: see configure-cluster.md. For the NLB/certificate/DNS connectivity that fronts a custom domain, see configure-clients.md.
Files
- ATTRIBUTION.mdAdded by AutoGineer918 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md11.0 KiB
- references/configure-clients.md13.3 KiB
- references/configure-cluster.md11.3 KiB
- references/data-delivery-for-general-purpose-s3.md15.7 KiB
- references/maintenance-operations.md13.0 KiB
- references/manage-storage.md8.5 KiB
- references/manage-topics.md7.0 KiB
- references/monitor-and-alarm.md15.4 KiB
- references/msk-replicator.md18.9 KiB
- references/size-and-choose-cluster.md17.2 KiB
- references/streaming-tables-troubleshooting.md5.3 KiB
- references/streaming-tables.md19.5 KiB
- references/troubleshoot-consumer-lag.md11.5 KiB
- references/troubleshoot-performance.md9.3 KiB
- references/zk-to-kraft-migration.md728 B
- scripts/msk_sizing.pyScript62.6 KiB
references/manage-storage.md
Manage MSK Storage
Standard Brokers: EBS Storage Management
Monitor disk usage
Monitor KafkaDataLogsDiskUsed (DEFAULT level, dimensions: Cluster Name, Broker ID). This metric shows the percentage of disk used for data logs per broker. Set a CloudWatch alarm at 85%.
MSK also sends proactive storage alerts at 60% and 80% usage via the MSK console, Health Dashboard, EventBridge, and account email.
Expand EBS storage
You can increase but NEVER decrease EBS volume size. Maximum: 16,384 GiB (16 TiB) per broker.
aws kafka update-broker-storage \
--cluster-arn <cluster-arn> \
--current-version <cluster-version> \
--target-broker-ebs-volume-info '[{"KafkaBrokerNodeId": "All", "VolumeSizeGB": <target-size>}]'Constraints:
You MUST get the current cluster version first:
aws kafka describe-cluster-v2 --cluster-arn <arn>— the version string looks likeKTVPDKIKX0DER, not a simple integer.Storage expansion has a cool-down period of minimum 6 hours. A second expansion attempt during cool-down fails with "storage is optimizing."
Optimization after expansion can take up to 24 hours proportional to storage size.
Enable auto-scaling
Auto-scaling automatically expands storage when utilization reaches a threshold. Configure via the MSK console or Application Auto Scaling API.
Policy parameters:
Storage Utilization Target: Recommended 50-60%. Range: 10-80%.
Maximum Storage Capacity: Up to 16 TiB per broker.
Auto-scaling increases storage by the larger of 10 GiB or 10% of current storage. A scaling action can occur only once every 6 hours.
Long-term alternative: If recurring storage management is a pain point, consider migrating to Express brokers — storage is fully managed, pay-as-you-go, and requires no provisioning or monitoring.
Identify high-growth topics
To find which topics consume the most storage, check per-topic BytesInPerSec (PER_TOPIC_PER_BROKER level) and multiply by retention period:
Estimated storage per topic = SUM(BytesInPerSec across all brokers for the topic) × retention_seconds × ReplicationFactor
Use this to identify topics that need retention adjustment. Retention changes require app-owner approval — reducing retention deletes data permanently.
Provision storage throughput (Standard only)
For broker sizes kafka.m5.4xlarge or larger (or kafka.m7g.2xlarge or larger), you can provision storage throughput above the default of 250 MiB/s (for volumes 10 GiB+). Check the MSK storage throughput documentation for current max provisioned throughput per broker size.
When enabling provisioned throughput, also increase num.replica.fetchers (default 2) to match the instance size — e.g., 4 for m5.4xl, 8 for m5.8xl.
Express Brokers: Managed Storage
Express brokers have fully managed, pay-as-you-go storage. You do NOT provision or manage EBS volumes.
How Express storage works
Express storage is elastic and virtually unlimited. You do not provision volumes or manage capacity. However, storage is pay-as-you-go based on total data retained, so runaway growth directly impacts cost.
Monitor Express storage
Monitor total cluster storage with the StorageUsed metric (DEFAULT level, dimension: Cluster Name). There are no per-broker disk usage metrics for Express because storage is not tied to individual brokers.
Set a CloudWatch alarm on StorageUsed based on expected retention:
Expected StorageUsed ≈ SUM(BytesInPerSec across all topics) × retention_seconds × 3
The × 3 accounts for Express's fixed replication factor. If StorageUsed significantly exceeds this estimate, investigate per-topic growth.
Identify and resolve runaway storage growth
Even though Express storage scales automatically, you should actively monitor for unexpected growth to control costs:
Check per-topic ingress: Use
BytesInPerSecat PER_TOPIC_PER_BROKER level to identify which topics are driving the most data volume.Check topic-level retention overrides: A topic with
retention.msset higher than the cluster default will retain more data. Audit topic configs with:kafka-configs.sh --bootstrap-server <bootstrap> --describe --entity-type topics --entity-name <topic>Check for compacted topics: Topics with
cleanup.policy=compactretain data indefinitely based on key cardinality, not time. High-cardinality compacted topics can grow without bound.Check for topic proliferation: A growing number of topics (each with RF=3) compounds storage. Monitor
GlobalTopicCountat the cluster level.Reduce retention: Lowering
retention.mson high-volume topics is the most direct way to reduce stored data. Coordinate with app owners before changing — reducing retention deletes data permanently.
Storage costs on Express
Express storage is fully managed. Unlike Standard where you explicitly manage EBS and optionally enable tiered storage, Express storage requires no configuration. Storage costs are based on total data retained — reducing retention or cleaning up unused topics is the primary lever for cost control.
Standard Brokers: Tiered Storage
Standard brokers can optionally enable tiered storage to extend retention beyond EBS capacity.
How tiered storage works on Standard
Closed log segments are copied from primary (EBS) storage to tiered (S3) storage automatically.
Active segments are NOT eligible for tiering — segment size (
segment.bytes, default 128 MiB for tiered clusters) or segment roll time (segment.ms) controls when segments close.local.retention.mscontrols how long data stays on primary storage after being copied to tiered storage. Default-2means useretention.ms(data stays on both local and tiered until retention expires).retention.mscontrols total retention (local + tiered). Minimum 3 days for tiered topics.
Example retention scenario
With retention.ms = 5 days and local.retention.ms = 12 hours:
Data stays on fast primary storage for 12 hours
Data remains in tiered storage for the full 5 days
Consumers reading data older than 12 hours fetch from tiered storage with slightly higher initial latency
Tiered storage constraints
Compacted topics (
cleanup.policy=compact) are NOT supported with tiered storageWhen explicitly set to a positive value,
local.retention.msMUST be less thanretention.ms. The default-2is a sentinel meaning "useretention.ms" and is always valid.Minimum log segment size: 48 MiB; minimum segment roll time: 10 minutes
Once disabled for a topic, tiered storage CANNOT be re-enabled on that topic
Supported on Kafka versions 3.6.0+ and 2.8.2.tiered
Not supported on
kafka.t3.smallinstancesClients SHOULD NOT use
read_committedisolation level when reading from tiered storage unless actively using transactions
Enable tiered storage
Enabling tiered storage is a two-step process: first switch the cluster to TIERED storage mode, then enable remote.storage.enable on each topic. Switching the cluster mode alone does NOT tier any data — no topic tiers until you set remote.storage.enable=true on it.
Step 1 — set the cluster storage mode to TIERED. The cluster must run Kafka 3.6.0+ or 2.8.2.tiered. If it does not, upgrade first with aws kafka update-cluster-kafka-version (check upgrade targets via aws kafka get-compatible-kafka-versions). The cluster log.cleanup.policy must be delete (compacted topics are not eligible). Get the current version string (e.g. KTVPDKIKX0DER, not an integer) from describe-cluster-v2 first.
aws kafka update-storage \
--cluster-arn <cluster-arn> \
--current-version <cluster-version> \
--storage-mode TIEREDStep 2 — enable tiered storage per topic. Requires an Apache Kafka client version 3.0.0+ for kafka-topics.sh --create; existing topics can be reconfigured from a lower client version with kafka-configs.sh.
kafka-configs.sh --bootstrap-server <bootstrap> --alter --entity-type topics --entity-name <topic> \
--add-config 'remote.storage.enable=true,local.retention.ms=43200000,retention.ms=604800000'References
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · plugins/aws-data-analytics/skills/managing-amazon-msk · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- aws/agent-toolkit-for-aws
AutoGineer is not affiliated with or endorsed by AWS or AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download managing-amazon-msk.zip