Generated banner for Managing Amazon Msk
Generated logo for Managing Amazon Msk

Managing Amazon Msk

AWSOfficialPublished by AWS

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Operates Amazon MSK Provisioned clusters (Standard and Express brokers). Required for ANY MSK Provisioned task — training data conflates Standard and Express. Covers performance, consumer lag, storage, traffic shaping; sizing Standard vs Express; Kafka client tuning; CloudWatch alarms; cluster configs; maintenance, patching, rolling restarts; topic management; MSK Replicator setup for DR and active-active/active-passive replication (same-/cross-account), including throughput and partition sizing; Streaming Tables for S3 Tables and Data Delivery for General Purpose S3 — setup, IAM, monitoring. Prefer Flink for Kafka Iceberg sink questions. Migrations: use migrate-to-msk. Triggers: MSK Provisioned, Kafka, `kafka.*`/`express.*` types, AWS/Kafka namespace, cross-cluster replication, Kafka to Iceberg on S3 Tables, Kafka to S3, lakehouse, data lake from Kafka, Kafka Connect S3 Sink or Firehose alternative. DO NOT USE for MSK Connect — search docs instead. Serverless: only S3 Tables/data delivery eligibility.
— the description by AWS

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

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/aws/managing-amazon-msk/download
  2. Unzip 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 IntentReference
High CPU, high latency, slow cluster, traffic shapingtroubleshoot-performance.md
Consumer lag increasing, rebalance storms, stuck consumer groupstroubleshoot-consumer-lag.md
Disk filling up, retention planning, tiered storagemanage-storage.md
Choosing Standard vs Express, sizing a cluster, partition limits, broker count, monthly costsize-and-choose-cluster.md
Producer/consumer configuration, IAM/SCRAM/TLS authconfigure-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 propertyconfigure-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 balancingconfigure-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 clientmanage-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 behaviormsk-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/ReplicatorThroughputmsk-replicator.md (Size partition count section)
Setting up monitoring, dashboards, alarmsmonitor-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 resiliencemaintenance-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 channelsstreaming-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 channelsdata-delivery-for-general-purpose-s3.md
Build a lakehouse / data lake from Kafka; make streaming data queryable in Athenastreaming-tables.md
Alternative to Kafka Connect S3 Sink or Amazon Data Firehose for MSK; zero-ops streaming delivery to S3data-delivery-for-general-purpose-s3.md
Streaming Tables / Data Delivery CloudWatch metrics and alarms, DLQ errors, failed deliveries, channel state transitions, freshness lagstreaming-tables-troubleshooting.md
"Can I use Streaming Tables / Data Delivery on MSK Serverless / Standard brokers?" — eligibility routingstreaming-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 with pricing:GetProducts are available, and falls back to an embedded us-east-1 snapshot 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_skill tool 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 same retrieve_skill tool by passing the file parameter (for example, file="references/configure-clients.md" or file="scripts/msk_sizing.py"), and run a script from the content that tool returns. Do NOT file_read these 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

references/streaming-tables.md

Streaming Tables — Iceberg (S3 Tables) Delivery

Streaming Tables for Amazon MSK Express brokers delivers topic data from Express brokers to Apache Iceberg tables in S3 Table buckets. Serverless, no connector management, minutes-level data freshness, and auto-scaling throughput. Freshness bounds and the per-channel throughput ceiling are in Amazon MSK Data Delivery quotas.

Each record is delivered exactly once by the delivery pipeline. Streaming tables do not consume broker egress throughput or impact producer or consumer workloads. This optimizes cost as it enables delivery to Iceberg tables without requiring additional cluster capacity on MSK Express clusters. Additionally, you can fan out multiple streaming tables channels from the same topic.

Streaming Tables for Apache Iceberg on S3 Tables Constraints

Check Streaming Tables documentation for constraints. Some key constraints are:

  • Streaming Tables is ONLY available on Express brokers — Standard brokers and MSK Serverless are NOT supported

  • Data freshness is bounded and not adjustable, and the tightest freshness setting requires a minimum sustained uncompressed throughput per channel — get both from Amazon MSK Data Delivery quotas. Low-throughput topics must use a looser freshness setting

  • Streaming Tables is append-only — does not support CDC, upserts, or deletes

  • Streaming Tables Iceberg destination supports JSON input only (plain JSON or GSR-serialized JSON) - does not support Avro/Protobuf input

  • Schema evolution is not supported

  • Streaming Tables creates its own Iceberg tables — it cannot write to existing Iceberg tables

  • No backfill — only records produced AFTER Streaming Tables is enabled are delivered

If the user needs any of the above functionality, recommend Managed Service for Apache Flink instead. Streaming Tables are the most cost-effective way to deliver data to Iceberg tables on S3 Tables, so if it can be used it should be preferred in general.

Broker-type routing (Express vs Standard/Serverless). Streaming Tables and Data Delivery are Express-only. On Standard or Serverless clusters they are not available — to move topic data into S3 / an Iceberg lakehouse there, use one of: the Amazon Data Firehose MSK-source integration (fully managed; delivers to Amazon S3 or to Apache Iceberg tables in self-managed S3 or S3 Tables), a self-managed Kafka Connect S3 sink connector, or Managed Service for Apache Flink. On Express, prefer Streaming Tables / Data Delivery over all three.

Prerequisites

  • MSK Provisioned cluster with Express brokers

  • Kafka topic producing JSON data

  • AWS Glue Schema Registry with registered JSON Schema (draft-04 or draft-07)

  • S3 Table bucket in the same Region as the cluster

Input Formats

FormatHow it worksWhen to use
JSONPlain JSON. You provide a GSR schema ARN in channel config.Producer writes plain JSON; schema managed externally
JSON_SCHEMA_GSRGSR-serialized JSON with schema ID embedded per record.Producer uses GSR serializer library

For JSON_SCHEMA_GSR, do NOT provide schemaRegistryArn or schemaArn in the source configuration — the schema ID is embedded in each record.

Schema Requirements

Partition constraint: Register a JSON Schema (draft-04 or draft-07) in Glue Schema Registry. The partition source column MUST have "format": "date-time" to map to Iceberg timestamptz. PartitionSpec.SourceList must contain exactly one source column. Multi-column partitioning is not supported. Omitting SourceList or providing an empty array fails with InvalidParameter: sourceList.

JSON Schema to Iceberg Type Mapping
JSON SchemaConditionIceberg type
stringplainstring
stringformat: "date-time"timestamptz
stringformat: "date"date
stringformat: "time"time
stringformat: "uuid"uuid
stringformat: "byte" / contentEncoding: "base64"binary
integerfits 32-bitint
integerexceeds 32-bitlong
numberwith multipleOfdecimal(38, scale)
numberplaindouble
boolean—boolean
objectnamed propertiesstruct
objectadditionalPropertiesmap<string, V>
array—list<E>

Schema behavior:

  • Extra fields in source data → silently dropped

  • Missing optional fields → written as null

  • Missing required fields → record sent to DLQ

  • Nesting limit: 16 levels max

  • Partition column is automatically treated as required

Example schema:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "id": {"type": "integer"},
        "timestamp": {"type": "string", "format": "date-time"},
        "source": {"type": "string"},
        "value": {"type": "number"}
    },
    "required": ["id", "timestamp", "value"]
}

IAM Setup

Trust Policy
{
    "Version": "2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Principal": {"Service": "kafka.amazonaws.com"},
        "Action": "sts:AssumeRole",
        "Condition": {
            "StringEquals": {"aws:SourceAccount": "ACCOUNT_ID"},
            "ArnLike": {"aws:SourceArn": "arn:aws:kafka:REGION:ACCOUNT_ID:channel/*"}
        }
    }]
}
Permission Policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "S3TablesActions",
            "Effect": "Allow",
            "Action": [
                "s3tables:GetTable", "s3tables:GetTableMetadataLocation",
                "s3tables:UpdateTableMetadataLocation", "s3tables:CreateTable",
                "s3tables:PutTableData", "s3tables:CreateNamespace",
                "s3tables:GetTableData", "s3tables:GetTableBucket",
                "s3tables:TagResource", "s3tables:PutTableRecordExpirationConfiguration"
            ],
            "Resource": [
                "arn:aws:s3tables:REGION:ACCOUNT_ID:bucket/BUCKET_NAME",
                "arn:aws:s3tables:REGION:ACCOUNT_ID:bucket/BUCKET_NAME/table/*"
            ]
        },
        {
            "Sid": "DLQBucketAccess",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject", "s3:GetBucketLocation", "s3:ListBucket",
                "s3:ListBucketMultipartUploads", "s3:UploadPart",
                "s3:CompleteMultipartUpload", "s3:CreateMultipartUpload",
                "s3:ListMultipartUploadParts"
            ],
            "Resource": ["arn:aws:s3:::DLQ_BUCKET", "arn:aws:s3:::DLQ_BUCKET/*"]
        },
        {
            "Sid": "GlueSchemaRegistryAccess",
            "Effect": "Allow",
            "Action": [
                "glue:GetSchemaVersion", "glue:GetSchema", "glue:ListSchemas",
                "glue:GetRegistry", "glue:ListRegistries", "glue:GetSchemaByDefinition"
            ],
            "Resource": [
                "arn:aws:glue:REGION:ACCOUNT_ID:schema/REGISTRY/SCHEMA",
                "arn:aws:glue:REGION:ACCOUNT_ID:registry/REGISTRY"
            ]
        },
        {
            "Sid": "KMSAccess",
            "Effect": "Allow",
            "Action": ["kms:Decrypt", "kms:GenerateDataKey"],
            "Resource": "arn:aws:kms:REGION:ACCOUNT_ID:key/KEY_ID",
            "Condition": {
                "StringEquals": {"kms:ViaService": "s3tables.REGION.amazonaws.com"}
            }
        },
        {
            "Sid": "KMSAccessDLQ",
            "Effect": "Allow",
            "Action": ["kms:Decrypt", "kms:GenerateDataKey"],
            "Resource": "arn:aws:kms:REGION:ACCOUNT_ID:key/DLQ_KEY_ID",
            "Condition": {
                "StringEquals": {"kms:ViaService": "s3.REGION.amazonaws.com"},
                "StringLike": {"kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::DLQ_BUCKET/*"}
            }
        },
        {
            "Sid": "CloudWatchLogsAccess",
            "Effect": "Allow",
            "Action": ["logs:CreateLogStream", "logs:PutLogEvents"],
            "Resource": "arn:aws:logs:REGION:ACCOUNT_ID:log-group:/aws/msk/streaming-tables/CHANNEL_NAME:*"
        }
    ]
}

Statement notes: S3TablesActions required. CloudWatchLogsAccess required whenever CloudWatch Logs delivery logging is enabled (the default) — without it the service role cannot write delivery logs and failures stay invisible; swap for s3:PutObject (log bucket) or firehose:PutRecord/firehose:PutRecordBatch if you route delivery logs to S3 or Firehose instead. DLQBucketAccess required. GlueSchemaRegistryAccess required (for JSON input, only glue:GetSchemaVersion needed; for JSON_SCHEMA_GSR, include all). KMSAccess covers the S3 Tables destination (scoped via kms:ViaService: s3tables.REGION.amazonaws.com). KMSAccessDLQ is required when the DLQ bucket uses SSE-KMS — the DLQ is a regular S3 bucket, so its key must be reached via kms:ViaService: s3.REGION.amazonaws.com; without this statement the service role gets AccessDenied writing failed records to an SSE-KMS DLQ. Both KMS statements are recommended for production — omit only if the corresponding bucket relies on SSE-S3 (AES-256) default encryption. SSE-KMS (or at minimum SSE-S3) should always be enabled on both delivery and DLQ buckets.

Cross-account: If S3 Table bucket is in another account, the bucket owner must attach a table bucket policy granting the service role access.

Create the Channel

Prerequisite: create the CloudWatch log group first. The log group referenced by LoggingInfo.CloudWatchLogs.LogGroup must exist before create-channel is called. MSK will not auto-create it, and create-channel will fail if the group is missing.

Plain JSON input:

# 1. Create the log group up front
aws logs create-log-group --log-group-name "/aws/msk/streaming-tables/CHANNEL_NAME"

# 2. Create the channel
aws kafka create-channel \
    --channel-name "CHANNEL_NAME" \
    --cluster-arn "arn:aws:kafka:REGION:ACCOUNT_ID:cluster/CLUSTER/ID" \
    --topic-configuration-list '[{
        "TopicArn": "arn:aws:kafka:REGION:ACCOUNT_ID:topic/CLUSTER/ID/TOPIC",
        "RecordConverter": {"ValueConverter": "JSON"},
        "RecordSchema": {"GsrArn": "arn:aws:glue:REGION:ACCOUNT_ID:schema/REGISTRY/SCHEMA"}
    }]' \
    --iceberg-destination-configuration '{
        "AppendOnly": true,
        "SchemaEvolution": {"EnableSchemaEvolution": false},
        "Catalog": {
            "CatalogArn": "arn:aws:glue:REGION:ACCOUNT_ID:catalog/s3tablescatalog/BUCKET",
            "WarehouseLocation": "arn:aws:s3tables:REGION:ACCOUNT_ID:bucket/BUCKET"
        },
        "DataFreshnessInSeconds": 300,
        "DeadLetterQueueS3": {
            "BucketArn": "arn:aws:s3:::DLQ_BUCKET",
            "ErrorOutputPrefix": "dlq/"
        },
        "DestinationTableList": [{
            "DestinationDatabaseName": "DB_NAME",
            "DestinationTableName": "TABLE_NAME",
            "PartitionSpec": {
                "PartitionStrategy": "TIME_HOUR",
                "SourceList": [{"SourceName": "timestamp"}]
            }
        }],
        "TableCreation": {"EnableTableCreation": true},
        "ServiceExecutionRoleArn": "arn:aws:iam::ACCOUNT_ID:role/ROLE",
        "CompressionType": "ZSTD"
    }' \
    --logging-info '{
        "CloudWatchLogs": {"Enabled": true, "LogGroup": "/aws/msk/streaming-tables/CHANNEL_NAME"},
        "S3": {"Enabled": true, "Bucket": "LOG_BUCKET", "Prefix": "msk-channel-logs/"},
        "Firehose": {"Enabled": false, "DeliveryStream": ""}
    }'

GSR-serialized input — same command but the topic entry uses "RecordConverter": {"ValueConverter": "JSON_SCHEMA_GSR"} and omits RecordSchema (the schema ID is embedded per-record).

Compression: Iceberg Parquet output is compressed with ZSTD by default; SNAPPY is also supported via the CompressionType field.

Delivery Logging

Always enable at least one logging destination on the channel. Without it, delivery errors (AccessDenied on S3 Tables / DLQ, schema-mapping failures, GSR access denials, KMS Decrypt failures) are invisible — the only visible symptom is missing rows in Iceberg. Logging is also a prerequisite for streaming-tables-troubleshooting.md.

The --logging-info field on aws kafka create-channel accepts three independent destinations — any subset can be enabled at once:

DestinationJSON keyRequired fieldsWhen to use
CloudWatch LogsCloudWatchLogsEnabled, LogGroup (must exist before create-channel)Default choice — interactive querying via Logs Insights, alarms on log patterns
Amazon S3S3Enabled, Bucket, Prefix (optional)Long-term retention, Athena/downstream analysis
FirehoseFirehoseEnabled, DeliveryStreamFan-out to OpenSearch / Splunk / third-party SIEMs

Log group prerequisite: MSK does not auto-create the CloudWatch log group. Create it in advance with aws logs create-log-group --log-group-name "<name>" and, for production, set a retention policy (aws logs put-retention-policy --log-group-name "<name>" --retention-in-days 30). Passing a nonexistent log group to create-channel returns a validation error.

IAM: The service role must be able to write to whichever destinations are enabled — for CloudWatch Logs: logs:CreateLogStream, logs:PutLogEvents on the target log group; for S3: s3:PutObject on the log bucket/prefix (plus kms:GenerateDataKey if SSE-KMS); for Firehose: firehose:PutRecord, firehose:PutRecordBatch on the delivery stream.

Encryption: Enable SSE-KMS on the CloudWatch log group (via aws logs associate-kms-key) and the S3 log bucket — delivery error records may contain payload fragments and topic names.

Logging is set at channel creation and is not updatable. aws kafka update-channel only accepts --iceberg-destination-update and --s3-destination-update with a single field (DataFreshnessInSeconds). To change logging destinations, delete and recreate the channel.

Verify and Query

# Check channel state (wait for ACTIVE) — both --cluster-arn and --channel-arn are required
aws kafka describe-channel \
    --cluster-arn "arn:aws:kafka:REGION:ACCOUNT_ID:cluster/CLUSTER/ID" \
    --channel-arn "CHANNEL_ARN"
Querying with Athena

Before querying Streaming Tables data with Athena, you must grant Lake Formation permissions to your query principal:

# Grant database-level access
aws lakeformation grant-permissions \
    --principal DataLakePrincipal="{\"DataLakePrincipalIdentifier\":\"arn:aws:iam::ACCOUNT_ID:role/QUERY_ROLE\"}" \
    --resource '{"Database":{"CatalogId":"ACCOUNT_ID:s3tablescatalog/BUCKET","Name":"DB_NAME"}}' \
    --permissions "DESCRIBE" "SELECT"

# Grant table-level access
aws lakeformation grant-permissions \
    --principal DataLakePrincipal="{\"DataLakePrincipalIdentifier\":\"arn:aws:iam::ACCOUNT_ID:role/QUERY_ROLE\"}" \
    --resource '{"Table":{"CatalogId":"ACCOUNT_ID:s3tablescatalog/BUCKET","DatabaseName":"DB_NAME","Name":"TABLE_NAME"}}' \
    --permissions "SELECT" "DESCRIBE"

Then query via Athena (after data freshness interval):

SELECT * FROM "s3tablescatalog/BUCKET"."DB_NAME"."TABLE_NAME" LIMIT 10;

For details on Lake Formation permissions with S3 Tables, see the Athena S3 Tables documentation.

Monitoring

Streaming Tables emits its own CloudWatch metrics in the AWS/Kafka namespace with dimensions ClusterName, ChannelName, Topic. Recommended alarms — DeliveryToIceberg.DataFreshness (or DeliveryToS3.DataFreshness for S3 destinations) above the configured freshness interval, FailedRowCount (Iceberg) / FailedRecordCount (S3) > 0, and DLQDeliverySuccess > 0. Full metric list, alarm patterns, and troubleshooting steps live in streaming-tables-troubleshooting.md. Do not fall back to generic Express cluster health metrics or DIY S3-bucket-object alarms for Streaming Tables — the channel-scoped metrics above are the correct primitives.

Throughput and Freshness

The freshness range, the default freshness, and the minimum throughput required to sustain the tightest freshness setting are published quotas. Read them from Amazon MSK Data Delivery quotas before advising a customer on a freshness value. The tradeoff behind the throughput floor is explained in Key concepts: the service needs enough accumulated data per interval for efficient delivery and inline compaction, so lower-throughput topics need a looser freshness setting.

Only one throughput floor is published — the one paired with the minimum freshness interval. Do not present a per-interval throughput table by scaling that figure across the rest of the freshness range; those values are not documented. For a topic below the floor, tell the customer to loosen freshness without quoting a specific required rate.

Table Maintenance

Enable S3 Tables automated maintenance: compaction, snapshot expiration, unreferenced file cleanup. Optionally enable record expiration for TTL-based deletion.

  • Iceberg table format version: 2, Parquet output. Check the current Iceberg version via aws kafka describe-channel --cluster-arn <arn> --channel-arn <arn> response or AWS documentation — it may be upgraded over time.

  • Table is managed — read-only from your perspective (do not modify schema or write directly)

Quotas

Do not quote channel, freshness, throughput, or partition limits from memory. Read the current values from Amazon MSK Data Delivery quotas, which lists channels per cluster, channels per Kafka topic, the freshness bounds, the minimum throughput for the tightest freshness, max throughput per channel, and max partitions per table, along with whether each is adjustable.

For the account's actual (possibly already-raised) values on the adjustable quotas, check the account rather than the docs:

aws service-quotas list-service-quotas --service-code kafka --query "Quotas[?contains(QuotaName, 'Channel')]"

Adjustable quotas are raised through the Service Quotas console.

Security Considerations

  • Enable server-side encryption (SSE-KMS or SSE-S3) on both delivery (S3 Tables) and DLQ buckets

  • Enable S3 bucket access logging on the DLQ bucket

  • Apply S3 bucket policies to restrict access to authorized principals only

  • DLQ contents may include sensitive customer data (PII, financial data) — restrict access and enable encryption

  • Enable CloudWatch Logs encryption for log groups that receive Streaming Tables delivery logs

  • Regularly audit IAM role policies and cross-account trust relationships

  • Use VPC endpoints for S3 where applicable to keep traffic off the public internet

  • For additional hardening guidance, see the MSK Security chapter and Amazon S3 security best practices

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.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download managing-amazon-msk.zip