Tag Archives: Intermediate (200)

Optimizing Apache HBase availability on Amazon EMR, Part 2: Diagnose and tune compaction

Post Syndicated from Reekunj Parmar original https://aws.amazon.com/blogs/big-data/optimizing-apache-hbase-availability-on-amazon-emr-part-2-diagnose-and-tune-compaction/

This post shows you how to diagnose and tune compaction in Apache HBase on Amazon EMR. Compaction is the background process that merges store files. When it competes with your workload during peak hours, you can see higher read and write latency, write stalls, and RegionTooBusyException errors. Amazon EMR on Amazon Simple Storage Service (Amazon S3), you can also see more 503 Slow Down responses when you increase your cluster’s request rate.

This is the second post in a two-part series on operating Apache HBase on Amazon EMR:

  • Part 1 covers the three-level troubleshooting model and three availability issues: an HBase coordinator that doesn’t finish initializing, a RegionServer that stops unexpectedly, and HBase regions that stay in transition (RIT).
  • Part 2 (this post) covers performance: how to confirm that compaction is the cause, which parameters to tune first, and when to contact AWS Support.

This post covers the following:

  • How compaction affects performance.
  • How to confirm whether compaction is causing the latency.
  • The compaction parameters to tune, their defaults, and what each one does.
  • Practices that reduce compaction work.
  • When to stop and contact AWS Support, and what to bring to a support case.

This post doesn’t cover the following:

  • Coordinator startup, RegionServers that stop unexpectedly, and regions in transition, which are covered in Part 1 of this series.
  • Compaction algorithm internals or writing custom compaction policies.
  • Schema design and row key distribution (the Practices that reduce compaction work section covers how they affect compaction).

This post is for operations teams, data engineers, HBase administrators, and site reliability engineers (SREs) who see recurring latency spikes, write stalls, RegionTooBusyException errors, or high Amazon S3 request rates during compaction on HBase on Amazon EMR.

Terminology

Apache HBase names the process that coordinates the cluster HMaster, and Amazon EMR runs it on the primary node. This post refers to it as the HBase coordinator. Names that contain master, such as the hbase-master service and the hbase-hbase-master-*.log log files, appear only in commands and log output, where you need the exact name.

In HBase, a region is a range of rows in a table, and a RegionServer is the process that serves regions. Neither is related to an AWS Region.

Prerequisites

  • Read Part 1 of this series, in particular the Three levels of troubleshooting and Quick reference sections.
  • Confirm that you have access to the HBase web UI (coordinator on port 16010, RegionServer on port 16030).
  • Confirm that you have SSH access to the primary and core nodes.
  • Know whether your cluster uses Hadoop Distributed File System (HDFS) or Amazon S3 as its storage mode, and how to apply configuration changes through the hbase-site classification in Amazon EMR. For storage-mode specifics, see HBase on Amazon S3.
  • Be familiar with minor and major compaction in HBase.

How compaction affects performance

By default, HBase runs a major compaction roughly every seven days and uses a jitter factor of 0.5 to spread the start times so that HBase regions don’t all compact at once. For guidance specific to Amazon EMR, see the HBase best practices in the Amazon EMR best practices guide.

Major compaction reads and rewrites all store files in a region. It improves read performance and removes deleted and expired cells, but when it runs during peak hours it competes with client requests and can increase latency. Tuning compaction means controlling when major compaction runs and how much I/O it uses.

Compaction decision flow

Before you change any parameters, use the following decision flow to identify the cause.

Compaction decision flow diagram showing how to confirm compaction pressure and the six tuning steps to work through in order

Figure 1: Compaction decision flow

The flow has the following steps:

  • If latency is high, check whether compaction is running on the affected RegionServer. If it isn’t, investigate garbage collection (GC), disk, and network instead.
  • If compaction is running, check whether the compaction queue is growing. If it isn’t, check for GC pauses.
  • If compaction is running and the queue is growing, work through the following steps in order:
    1. On HBase on Amazon S3 with Amazon EMR 7.10 to 7.13, set the S3A read policy to sequential before you change any compaction parameter. See Step 3 in Diagnose compaction pressure.
    2. Lower the throughput bounds (hbase.hstore.compaction.throughput.*) to reduce the I/O that compaction takes from client requests. The queue can grow while the limit is lower. HBase removes the limit when any store reaches hbase.hstore.blockingStoreFiles, so the limit doesn’t keep a store at the blocking threshold.
    3. If latency is still high, tune compaction frequency (hbase.hstore.compaction.min, hbase.hstore.compaction.max, and hbase.hstore.compaction.min.size).
    4. If latency is high only during peak hours, set off-peak hours (hbase.offpeak.start.hour and hbase.offpeak.end.hour) so that more compaction work runs outside them.
    5. If compaction still affects peak traffic, turn off automatic major compaction (hbase.hregion.majorcompaction=0) and schedule it yourself.
    6. If none of these steps resolves the issue, contact AWS Support. The cause might be cluster capacity or schema design.

Note: Changing the previous configuration requires EMR HBase Restart. For reconfiguration behavior, refer to Reconfiguration behaviors in the Amazon EMR Management Guide.

Signs of compaction pressure

The following symptoms indicate compaction pressure. They don’t all appear at once. Start with the first two, because you can confirm them in the HBase web UI:

  • Read and write latency rises on some RegionServers but not others. The affected set changes over time as different regions reach their compaction window.
  • The compaction queue length on the affected RegionServer keeps increasing.
  • Long-running reads (report generation, Apache Spark table scans) pause and then resume.
  • Clients receive RegionTooBusyException, call timeouts, or retries. The RegionServer log shows Region is too busy due to exceeding memstore size limit warnings for the same regions.
  • Writes stall periodically. When a store reaches hbase.hstore.blockingStoreFiles store files, HBase delays MemStore flushes until compaction reduces the count, for up to hbase.hstore.blockingWaitTime (90 seconds by default). If the MemStore exceeds hbase.hregion.memstore.flush.size multiplied by hbase.hregion.memstore.block.multiplier in the meantime, HBase blocks updates to the region.
  • On HBase on Amazon S3, more requests return 503 Slow Down when the request rate from your cluster to an Amazon S3 prefix is high. These responses ask your cluster to reduce its request rate. Compaction reads and rewrites store files in Amazon S3, so it adds to that rate.
  • On Amazon EMR 7.10 to 7.13 with HBase on Amazon S3, compactions, scans, and bulk loads run slower than expected and the number of HFiles keeps increasing. See Step 3 in Diagnose compaction pressure.
  • The pattern recurs on a weekly rhythm, which matches the default seven-day major compaction interval.

Diagnose compaction pressure

Work through the following steps in order. Step 1 uses the HBase web UI (Level 1). Steps 2 and 3 use logs, operating system tools, and configuration files (Level 2). None of these checks change the cluster.

Step 1 (Level 1): Check the HBase web UI

  • In the HBase web UI, sort RegionServers by request count and by store file count to find the outliers. A server with a much higher store file count might be running, or waiting for, a compaction.
  • On the RegionServer web UI of an affected server, check the compaction queue length and store file count per region. A queue that keeps growing means compaction can’t keep up with your write volume, so add capacity or tune your configuration.
  • Check the BlockCache hit rate. A lower hit rate also increases latency. On HBase on Amazon S3, RegionServers cache reads in the BlockCache (memory) and the BucketCache (local disk). A cache miss reads the store file from Amazon S3, which has higher latency than a local read. If the hit rate dropped when compaction started, compaction might be replacing frequently read data in the cache.

Step 2 (Level 2): Check the logs and the operating system

Confirm that compaction is running, and on which HBase regions:

grep -E "Starting compaction|Completed (major )?compaction|too many store files" \
/var/log/hbase/hbase-hbase-regionserver-*.log | tail -40

Rule out GC as the cause, because heavy compaction and heap pressure look the same to clients:

grep -E "JvmPauseMonitor|Detected pause in JVM" \
/var/log/hbase/hbase-hbase-regionserver-*.log | tail -20

Check CPU, memory, and disk usage on the host:

free -m                  # check free memory
top -b -n1 | head -20    # CPU
df -h                    # disk capacity

Use the canary tool to measure read latency per HBase region. The tool writes its results to the console and to /var/log/hbase/hbase.log. Save the output as a baseline to compare against after each change:

sudo -u hbase hbase canary my_table

Check the store file layout of the table to see whether it has many small files (from frequent flushes) or a few large ones. Store files are under the HBase root directory, which is in HDFS or Amazon S3, depending on your storage mode. On HBase on Amazon S3 with Amazon EMR 7.4 and later, HBase tracks the store files it reads in a meta file in each store directory instead of relying on directory listings, so use the store file count in the RegionServer web UI as the count of active files:

grep -A1 hbase.rootdir /etc/hbase/conf/hbase-site.xml   # find the HBase root directory
sudo -u hbase hbase hfile -f <hbase.rootdir>/data/default/my_table/<region>/<cf>/<hfile> -m -s

Step 3 (Level 2): Check the S3A read policy (Amazon EMR 7.10 to 7.13)

Starting with Amazon EMR 7.10, HBase on Amazon S3 uses the S3A file system client, and fs.s3a.experimental.input.fadvise defaults to normal. In this mode, S3A can switch to a random read policy even when HBase continues to read sequentially, which slows compactions, scans, and bulk loads. Use the recommended setting for Amazon EMR 7.10, 7.11, 7.12, and 7.13. The symptoms are similar to compaction pressure: slow compactions, an increasing number of HFiles, and blocked flushes that return RegionTooBusyException.

Check the release label and the current setting:

aws emr describe-cluster --cluster-id <cluster-id> --query 'Cluster.ReleaseLabel'
grep -A1 fs.s3a.experimental.input.fadvise /etc/hbase/conf/hbase-site.xml

If the release is 7.10 to 7.13 and the property isn’t set, or is set to normal, set it to sequential in the hbase-site classification before you tune compaction. Changing the setting requires a restart, so it’s a Level 3 action:

[
    {
        "Classification": "hbase-site",
        "Properties": {
            "fs.s3a.experimental.input.fadvise": "sequential"
        }
    }
]

Apply the setting to hbase-site.xml on all nodes, then restart the HBase coordinator and RegionServer processes. Setting the property on individual commands instead doesn’t improve compaction and scan performance. For more information, see HBase on Amazon S3 in the Amazon EMR Release Guide.

Compaction tuning parameters

The following table lists the compaction parameters that this post covers. Apply changes through the hbase-site configuration classification in Amazon EMR. Changing these parameters is a Level 3 action. Change one parameter at a time and compare the results with the canary baseline from Step 2, because several of these parameters interact.

Note: The Amazon EMR column lists defaults from the HBase on Amazon S3 documentation. Where a default isn’t listed there, check the effective value in /etc/hbase/conf/hbase-site.xml on your cluster, and verify component versions on the Amazon EMR release components page. For example, hbase.hstore.blockingStoreFiles is 16 in Apache HBase 2.x, but Amazon EMR sets it to 10 for HBase on Amazon S3.

Parameter What it does Apache HBase 2.x default Amazon EMR default (HBase on Amazon S3)
hbase.hstore.compaction.throughput.higher.bound Upper limit on compaction throughput per RegionServer when store file pressure is high. 104857600 (100 MB/s) Not listed
hbase.hstore.compaction.throughput.lower.bound Lower limit on compaction throughput per RegionServer when store file pressure is low. 52428800 (50 MB/s) Not listed
hbase.hstore.compaction.min Minimum number of eligible store files before a minor compaction runs. If it isn’t set, HBase uses hbase.hstore.compactionThreshold. 3 Not listed
hbase.hstore.compaction.max Maximum number of store files included in a single minor compaction. 10 Not listed
hbase.hstore.compaction.min.size HBase always considers store files smaller than this size eligible for minor compaction. 134217728 (128 MB) Not listed
hbase.hstore.compaction.ratio Size ratio that decides which larger files are included in a minor compaction. 1.2 Not listed
hbase.hstore.blockingStoreFiles Number of store files in a store at which HBase delays MemStore flushes, for up to hbase.hstore.blockingWaitTime (90 seconds), until compaction reduces the count. 16 10
hbase.hregion.memstore.flush.size MemStore size, in bytes, at which HBase flushes to a new store file. 134217728 (128 MB) 134217728 (128 MB)
hbase.hregion.memstore.block.multiplier HBase blocks updates when a MemStore exceeds the product of hbase.hregion.memstore.flush.size and this value. 4 4
hbase.hregion.max.filesize Region size at which HBase splits the region. 10737418240 (10 GB) 10737418240 (10 GB)
hbase.offpeak.start.hour hbase.offpeak.end.hour Off-peak window (hours 0–23). During this window, the larger hbase.hstore.compaction.ratio.offpeak (default 5.0) applies, and compaction throughput isn’t limited unless you set hbase.hstore.compaction.throughput.offpeak. -1 (no off-peak window) Not listed
hbase.hregion.majorcompaction Time between automatic major compactions, in milliseconds. 0 turns off automatic major compaction. 604800000 (7 days) Not listed
hbase.hregion.majorcompaction.jitter HBase uses this value to spread major compaction start times so that Regions do n’t all compact at once. 0.5 Not listed
hbase.bucketcache.size Local disk space, in MB, on each RegionServer for the BucketCache (instance store and Amazon Elastic Block Store (Amazon EBS) volumes). Not set 8,192 MB
fs.s3a.experimental.input.fadvise S3A read policy for HBase on Amazon S3. See Step 3 in Diagnose compaction pressure. Not applicable normal (7.10 and later)

Warning: If you turn off automatic major compaction (hbase.hregion.majorcompaction=0), you are responsible for scheduling it. Minor compactions still merge store files, but delete markers and deleted cells stay in store files until a major compaction runs. This slows reads and delays reclaiming storage. If you turn it off:

  • Schedule major_compact yourself, per table, in a maintenance window. Run it on the primary cluster only, because read-replica clusters must not run manual compactions. On Amazon EMR releases earlier than 7.4.0, also turn off compaction on the read-replica cluster (hbase.regionserver.compaction.enabled=false). From 7.4.0, store file tracking makes this unnecessary.
  • Alarm when the store file count of any store approaches hbase.hstore.blockingStoreFiles (for example, at 80 percent of that value), so that you notice if the schedule slips before writes are delayed.

Use the following HBase shell commands to run a major compaction and check its progress:

hbase> major_compact 'my_table'
hbase> major_compact 'my_table', 'cf1'   # a single column family
hbase> compaction_state 'my_table'       # check progress

Practices that reduce compaction work

Tuning limits the effect of compaction on your workload. The following practices reduce how much compaction work the cluster has to do:

  • Limit region size and the number of regions per RegionServer. Large regions make major compaction expensive, because major compaction rewrites every store file in the region. HBase splits a region when it reaches hbase.hregion.max.filesize (10737418240 bytes, or 10 GB, by default on HBase on Amazon S3). Pre-split tables where you can predict the key distribution, using the SPLITS option of the HBase shell create command or the RegionSplitter tool.
  • Fix hotspotting at the row key. A row key that concentrates writes on one region (sequential timestamps, monotonically increasing IDs) produces frequent flushes and repeated compaction on a single RegionServer. To spread writes across HBase regions, salt, hash, or reverse the key.
  • Reduce small flushes. Many small MemStore flushes create many small store files, which increases compaction work. Compare the MemStore flush size (hbase.hregion.memstore.flush.size) with your write pattern. If regions flush every few seconds, the flush size might be too small, or the RegionServer might be under memory pressure. On HBase on Amazon S3, consider increasing hbase.hregion.memstore.flush.size and hbase.hregion.memstore.block.multiplier. This increases the time between compactions, but it also increases replication lag if you use a read-replica cluster. Make sure that the RegionServer heap can hold the larger MemStores.
  • Size the BucketCache on HBase on Amazon S3. The BucketCache stores reads on the local instance store and Amazon EBS volumes of each RegionServer. The more of your dataset it holds, the fewer reads go to Amazon S3, so compaction competes less with client reads. Increase hbase.bucketcache.size (default 8,192 MB) and choose an instance type with enough instance storage. See HBase on Amazon S3 and the Amazon S3 best practices in the Amazon EMR best practices guide.
  • Use multiple primary nodes. On an Amazon EMR cluster with multiple primary nodes, the HBase coordinator keeps running if one primary node in your cluster stops, so region assignment and split procedures continue. See Plan and configure primary nodes.
  • Alarm on compaction metrics. Set alarms on compaction queue length and store file count per region, which increase as compaction falls behind. Also alarm on Java virtual machine (JVM) pause frequency and the number of stopped RegionServers. For the metrics that are available, see the observability guidance in the Amazon EMR best practices guide.

When to stop and contact AWS Support

Some repair actions change cluster metadata and are difficult to reverse. Stop and open a case with AWS Support when any of the following is true:

  • HBCK2 bypass or setRegionState is your next step. Both can leave procedures or regions in an inconsistent state that you then must correct, and bypass might require a coordinator restart to release locks. AWS Support can validate your diagnosis and confirm the command before you run it.
  • Your next step is to delete znodes. Removing /hbase children discards state that HBase keeps in ZooKeeper, such as the location of hbase:meta, RegionServer registrations, and, on Amazon EMR, store file tracking data. This makes the problem harder to resolve. Don’t delete znodes as a first step.
  • A procedure is stuck and you cannot identify why from the logs. If three thread dumps and the coordinator log have not explained what is holding the procedure, AWS Support can help identify the cause.
  • Several RegionServers stop at the same time. Look for a cause on your cluster that the RegionServers share, such as the network configuration between cluster nodes, the ZooKeeper ensemble, or HDFS.
  • You have tuned compaction parameters twice and latency has not improved. The cause might be schema design, row key distribution, or cluster capacity, and further tuning can hide it without resolving it.
  • The stack trace contains exceptions that you don’t recognize. If the error doesn’t appear in this post or the Apache HBase Reference Guide, it might be an Apache HBase issue that is fixed in a later release. Check the Amazon EMR Release Guide and the Apache HBase JIRA before debugging further.

What to bring to the support case

Collect the following information before you open the case:

Artifact How to get it
Coordinator log extract (first ERROR plus 100 lines of context) Run grep -n -m1 "ERROR" /var/log/hbase/hbase-hbase-master-*.log, then sed -n 'X,+100p' from that line number
RegionServer log extract from the affected server Run the same commands on the affected core node against /var/log/hbase/hbase-hbase-regionserver-*.log
Thread dumps (3, taken 30 seconds apart) from the affected JVM Find the process ID with sudo jps -l, then run sudo -u hbase jstack -l <PID> three times, 30 seconds apart
Stuck procedure identifiers list_procedures in the HBase shell, or the Procedures and Locks page in the HBase web UI
Encoded region names involved From the HBCK Report tab or the Regions in Transition list
Amazon EMR release and HBase version aws emr describe-cluster --cluster-id <cluster-id> --query 'Cluster.ReleaseLabel' for the release, and sudo -u hbase hbase version for the HBase version
Storage mode and S3A read policy grep -A1 -E "hbase.rootdir\|fs.s3a.experimental.input.fadvise" /etc/hbase/conf/hbase-site.xml
Timeline: when it started, what changed Amazon CloudWatch metrics, cluster events in the Amazon EMR console, and any configuration changes or scaling actions
Compaction metrics: queue length, store file count, duration of recent compactions The RegionServer web UI, or the Completed compaction and Completed major compaction log lines, which include how long each compaction took
Any configuration changes you have already made List the parameters you changed and their before and after values

Providing this information up front reduces the number of follow-up requests from AWS Support.

Quick reference: Compaction log signatures

Search for the first occurrence of each signature in the following table, which shows when the condition started. Unless the table says otherwise, the signatures appear in the RegionServer log. For example:

grep -m1 -n "too many store files" /var/log/hbase/hbase-hbase-regionserver-*.log
Signature Meaning
too many store files A store reached the blocking threshold. HBase is delaying MemStore flushes until compaction reduces the number of store files.
RegionTooBusyException A MemStore exceeded hbase.hregion.memstore.flush.size multiplied by hbase.hregion.memstore.block.multiplier, for example because flushes are delayed by too many store files. The RegionServer logs Region is too busy due to exceeding memstore size limit, and clients receive the exception.
Completed major compaction A major compaction finished on that store. A major compaction that rewrote every file also shows (all).
Completed compaction A minor compaction finished. The line includes the number of files, the resulting store size, and how long the compaction took. Use it to establish a baseline.
Detected pause in JVM / JvmPauseMonitor A GC pause. Compare its timestamp with the compaction start time to see which came first.
SlowDown Amazon S3 returned HTTP 503 with the error code SlowDown, which asks your cluster to reduce its request rate to a prefix. Compaction adds to the request rate on HBase on Amazon S3.
ServerCrashProcedure Appears in the coordinator log (hbase-hbase-master-*.log). HBase is reassigning the regions of a RegionServer that stopped. Check whether a GC pause during heavy compaction caused it to stop.
Finished flush of A MemStore flush completed and wrote a new store file. Many of these lines in a short period mean frequent small flushes, which increase compaction work.

Conclusion and next steps

In this post, you learned how to confirm whether compaction is causing latency on HBase on Amazon EMR, and how to tune it, starting with the least invasive change.

For coordinator startup, RegionServers that stop unexpectedly, and regions in transition, see Part 1 of this series.

Next steps

  • Add the triage flow from both posts to your team’s runbook, with your own alarm names, dashboards, and on-call procedures.
  • Set up the alarms described in Practices that reduce compaction work.
  • Stage the HBCK2 jar for your HBase version on the cluster now, so that it’s ready before you need it.
  • Record a compaction baseline. Run grep -E "Completed (major )?compaction" across a week of RegionServer logs to learn the normal duration and frequency for your tables, so that you can recognize unusual behavior.
  • Review the guidance in the HBase best practices and troubleshooting sections of the Amazon EMR best practices guide.

About the authors

Reekunj Parmar

Reekunj Parmar

Reekunj is a Senior Technical Account Manager at Amazon Web Services, focused on Data Analytics. He works with customers to design and architect solutions based on Analytics services in their enterprise cloud environments. With more than 10 years of experience in Analytics, Reekunj helps organizations build secure, resilient architectures.

Ishan Sharma

Ishan Sharma

Ishan is a Cloud Support Engineer at Amazon Web Services and an Amazon EMR subject matter expert. He specializes in helping enterprise customers troubleshoot, optimize, and architect solutions across Amazon EMR and big data technologies. Ishan works closely with organizations to design and operate reliable, high-performance data processing workloads in the cloud.

Ram Nethi

Ram Nethi

Ram is a Senior Solutions Architect at Amazon Web Services, specializing in generative AI, agentic AI architectures, big data, cloud migrations, and application modernization. He guides enterprise and strategic customers across industry domains from legacy environments to production-ready AI workloads on AWS, designing scalable solutions that span infrastructure, DevOps automation, cybersecurity, and end-to-end cloud-native architectures.

Navigating messaging requirements in betting and gaming technology applications (Part 2: Executing the registration and maintaining compliance)

Post Syndicated from Meghana Dasigi original https://aws.amazon.com/blogs/messaging-and-targeting/navigating-messaging-requirements-in-betting-and-gaming-technology-applications-part-2-executing-the-registration-and-maintaining-compliance/

This is Part 2 of a two-part series for developers and technical teams at betting and gaming operators registering SMS messaging for multi-factor authentication (MFA) and account verification through AWS End User Messaging. Part 1 covered why betting and gaming operators face heightened carrier scrutiny, how the AWS and carrier registration roles work, and how to prepare before you apply.

Here in Part 2, we move from preparation to execution: what to include in your application to maximize approval odds, how to maintain compliance and deliverability after approval, and what to do if your registration is denied.

Prerequisites: This guidance applies exclusively to transactional and MFA messaging (for example, one-time passcodes, account verification, and security alerts). AWS End User Messaging does not support marketing or promotional messages for the betting and gaming industry. If you have not read Part 1, we recommend starting there.

The registration process: Best practices for approval

The following sections cover what to include in your application to maximize your chances of registration approval.

Provide detailed use cases

Don’t submit vague use-case descriptions. “We send notifications to users” is not sufficient. For each message type, explain:

  • The specific trigger (for example, “sent when a user logs in from an unrecognized device”).
  • The audience (for example, “verified players who have completed account registration and opted in to MFA”).
  • The content, including your actual one-time password (OTP) template.
  • The basis (for example, “account security notification, MFA only, not promotional”).
  • The expected volume (for example, “approximately 5,000 to 15,000 messages monthly based on current active user count”).

Document your opt-in workflow

Opt-in documentation is one of the most scrutinized components of a betting and gaming technology company’s registration. Include the following:

Implement double opt-in – A double opt-in process (where a user provides their number, receives a confirmation message, and replies to confirm) creates a clear consent record and reduces complaint rates.

Make opt-out instructions explicit in every message – Every message you send should include clear opt-out instructions (for example, “Reply STOP to unsubscribe”).

Document the consent flow with screenshots or flow diagrams – Show exactly where and how users provide consent on your application. Include the exact language of your consent disclosure.

Sample MFA opt-in screen for exampleGames showing the text-message consent disclosure, STOP and HELP instructions, and Terms & Conditions and Privacy Policy links

Figure 1: A sample double opt-in consent flow showing the SMS consent disclosure, STOP and HELP instructions, and links to terms and conditions and the privacy policy

Include relevant operating documentation

Don’t wait to be asked. Include your betting and gaming technology licenses, regulatory approvals, and messaging compliance documentation with your initial application. Providing this detail helps reduce back-and-forth with reviewers and increases your chances of approval.

Post-registration: Maintaining compliance and deliverability

Approval by the carrier is the beginning, not the end. Betting and gaming technology operators that treat registration as a one-time hurdle often find their messaging programs throttled or suspended months later. Long-term deliverability requires ongoing discipline, including the following best practices:

Manage message volume carefully

Declare your expected message volume during registration. Expressly state how many messages you plan to send monthly in the registration.

Maintain consistent sending patterns. Irregular volume (quiet for weeks, then a massive burst) looks like spam or suspicious activity to carriers, aggregators, and AWS monitoring systems. Sudden spikes can result in throttling or suspension, even if the traffic is legitimate. If you expect a temporary increase (major sporting events or new market launches, for example), open an AWS Support case in advance so the team can note the expected volume change and help prevent automated throttling during the spike.

Monitor and optimize your content

Regularly review message content. Regulations change, carrier policies evolve, and language that was acceptable last year might be filtered today.

Avoid language that could trigger gambling-related filters. Work with AWS Support to understand which terms are most likely to cause issues in your specific use cases.

Focus on account security messaging only. Keeping your active message templates strictly within that scope is both a compliance requirement and an effective way to maintain deliverability.

Manage feedback proactively

Set up alerts for spam complaint spikes. Investigate immediately. Carriers, aggregators, and AWS can suspend your messaging if complaint rates stay elevated.

Track delivery rates by template. If your password reset messages drop while OTP delivery stays stable, that’s a signal worth investigating. It is a sign of content-based carrier filtering, origination identity blocking, or malicious account takeover attempts targeting your application.

Maintain open communication with AWS Support. Do not hesitate to reach out to AWS Support if you have any questions.

If your registration is denied

Denial is a common outcome for gaming and betting registrations. If your application is rejected, here is how to move forward.

Understand the rejection

Review the rejection reason against official documentation. AWS publishes the full list of rejection reasons with remediation steps at Understanding rejection reasons. When your registration is rejected, the console displays a specific reason. Match it to the documentation to understand exactly what needs to be changed.

Rejection reasons most relevant to gaming registrations:

Category Rejection Reason (exact text) What It Means Action
Brand Brand associated with or website references gambling which is prohibited by mobile operators The carrier flagged your brand based on your website content or industry classification, regardless of your messaging use case. Make sure your website clearly separates gaming operations from your MFA/security messaging program. Consider whether a dedicated subdomain for account security communications would reduce this signal.
Campaign Use case is considered restricted or disallowed by mobile operators: Gambling Your campaign use case was categorized as gambling-related by the carrier, even if scoped to MFA. Rewrite your use case description to emphasize transactional/security messaging exclusively. Remove any language that references gaming operations beyond identifying your industry.
Campaign Campaign description does not match sample messages or use case The reviewer found a mismatch between your stated use case and the sample messages you provided. Align your campaign description, use case selection, and sample messages, so they all describe the same MFA-only program consistently.
Opt-in workflow Opt-in workflow indicates that use case is considered restricted or disallowed by mobile operators: Gambling Your opt-in screenshots or workflow revealed gambling-related content, causing the reviewer to flag it as a restricted use case. Remove gambling-related branding, imagery, or language from the screens shown in your opt-in flow. The opt-in should present a clean, security-focused experience.
Opt-in workflow Opt-in workflow does not obtain sufficient consent Your opt-in screenshots did not demonstrate explicit, affirmative user consent for SMS messaging (express written consent is required). Update your opt-in flow to show a clear, unchecked checkbox or button that the user must actively select. Provide new screenshots showing the revised flow.
Opt-in workflow Opt-in workflow URL or image is missing or inaccessible and could not be verified No opt-in workflow screenshot or URL was provided, or the URL you submitted was inaccessible to the reviewer. Provide a working URL to your live opt-in page or upload a screenshot/mockup showing your complete opt-in flow. Verify that the URL is publicly accessible before resubmitting.
Opt-in workflow Opt-in workflow not compliant or is missing required terms and conditions language Your opt-in page does not include complete terms and conditions language or a link to your full T&C. Add a visible link to your complete messaging terms and conditions at the point of consent or include the full T&C language inline. Resubmit with updated screenshots.
Opt-in workflow Opt-in workflow not compliant or is missing statement that data will not be shared with third parties or link to privacy policy disclosure Your opt-in page does not include a privacy policy link or a statement that mobile opt-in data will not be shared with third parties. Add a visible link to your privacy policy and a statement that phone numbers/opt-in data will not be shared with third parties at the point of consent.
Sample messages Sample message(s) indicates that message content is related to gambling and is not permitted by US carriers Your message templates contain language or keywords that trigger gambling content filters. Revise message templates to remove any gambling-related terms (brand names containing “bet” or “casino,” for example). Use neutral phrasing for OTP delivery (for example, “Your verification code is 123456”).

Revise and resubmit

If the rejection includes actionable feedback:

  1. Address every point raised in the denial specifically.
  2. Strengthen areas the reviewer questioned (additional documentation, revised message samples, clearer use case scoping).
  3. Consider narrowing your initial scope further (for example, registering for a single message type such as login OTP before expanding).
  4. Resubmit with a cover note explaining what you changed and why.

If the rejection is generic or provides no actionable detail, a resubmission with the same information is unlikely to produce a different result.

Conclusion

Messaging registration for betting and gaming technology operators is complex, and approval is never guaranteed. Carrier and registry decisions are ultimately outside an applicant’s control. However, companies that position themselves well approach registration as a thoughtful compliance exercise, not a technical checkbox. They invest time in documentation before they apply, lead with their MFA use cases, and treat post-approval compliance as an ongoing operational responsibility. Even when initial applications are denied, a well-prepared submission strengthens the foundation for appeals and future attempts.

Betting and gaming technology operators that follow this approach (thorough pre-registration documentation, a clearly scoped MFA-only program, and consistent post-approval hygiene) are better positioned for carrier approval and sustained message deliverability. That translates directly to fewer failed logins, lower account lockout rates, and a smoother onboarding experience for new players.

With AWS End User Messaging, you have the infrastructure to help you deliver MFA more reliably at scale. The suggested best practices described in this post give you the framework to support carrier approval and keep your messaging program running reliably.

Missed Part 1?

If you have not yet read Part 1, start there for the landscape and preparation steps. Together, the two parts give you an end-to-end playbook for getting your MFA messaging approved and keeping it deliverable.


About the authors

Meghana Dasigi

Meghana Dasigi

Meghana is a Sr. Technical Account Manager at AWS Enterprise Support, specializing in messaging, generative AI, and serverless architectures for Media, Entertainment, and Ticketing customers.

Sirinda Glasgow

Sirinda Glasgow

Sirinda is a Sr. Technical Account Manager at AWS Enterprise Support, specializing in security and compliance and hybrid edge infrastructure for Betting and Gaming customers operating regulated workloads.

Navigating messaging requirements in betting and gaming technology applications (Part 1: Understanding the landscape and preparing your application)

Post Syndicated from Meghana Dasigi original https://aws.amazon.com/blogs/messaging-and-targeting/navigating-messaging-requirements-in-betting-and-gaming-technology-applications-part-1-understanding-the-landscape-and-preparing-your-application/

Global betting and gaming technology operators face a distinct challenge. Despite operating as fully licensed and regulated businesses in their respective jurisdictions, they consistently encounter messaging service registration challenges when registering their phone numbers for SMS messaging with telecommunication carriers.

Carriers and messaging providers classify betting and gaming technology operators as “high-risk” or gambling. This classification subjects their applications to heightened scrutiny, stricter content filtering, and rejection rates that far exceed those seen in other industries. A betting and gaming operator that follows the same registration steps that might work for a retail or software as a service (SaaS) company will often find that their application requires additional documentation or revision. These revisions can span multiple review cycles, often without clear guidance on what to change.

This post is written for developers and technical teams at betting and gaming operators who need to submit an SMS messaging registration for multi-factor authentication (MFA) and account verification use cases through AWS End User Messaging. The guidance below represents suggested best practices that can help betting and gaming operators give their application a stronger foundation when seeking SMS messaging approval from carriers. We cover the specific challenges such operators may face, how to prepare before submitting a registration application, what to do during the registration process, what happens if the application is denied by the telecommunications carrier, and the ongoing practices that help keep operator MFA messaging active and deliverable after approval.

Important note: This guidance applies exclusively to transactional and MFA messaging (for example, one-time passcodes, account verification, and security alerts). AWS End User Messaging does not support marketing or promotional messages for the betting and gaming industry.

How registration works: AWS and telecommunication carrier roles

Understanding the registration flow helps set expectations. Your application is submitted through AWS, but the carrier or aggregator decides whether to approve it.

Registration through AWS End User Messaging includes the following steps:

  1. You submit a registration request through the AWS End User Messaging console that includes your business details, use case descriptions, and relevant compliance documentation.
  2. AWS forwards your registration to the downstream carrier or aggregator (based on the origination identity type you selected, such as 10DLC, toll-free, or short code).
  3. The carrier or aggregator reviews your application and makes an approval or denial decision. An aggregator is the application-to-person (A2P) messaging provider that routes traffic to carriers such as T-Mobile and AT&T. AWS does not control this decision.
  4. AWS communicates the approval or denial to you through the AWS End User Messaging console. You can also configure event notifications to be alerted automatically.

The key takeaway: AWS facilitates the submission and relays the outcome, but the aggregator or carrier holds the approval authority.

The challenges: Why betting and gaming technology is different

Betting and gaming technology operators face two primary obstacles that generic messaging registration guides may not address. First, messages from this industry historically generate higher complaint rates. For that reason, The Campaign Registry (TCR) classifies gambling as a Special Use Case that requires enhanced vetting, which makes carriers more cautious about approving new betting and gaming registrations. Second, certain words or phrases can trigger content filters at the carriers, which can cause service disruption and increased scrutiny for future applications. Even legitimate one-time password (OTP) messages can get blocked if your company name contains gambling-related keywords. For example, a message such as “exampleGames: here is your OTP 1234 to start betting” may be filtered because “betting” triggers automated content rules, even though the message is a valid security code. This contributes to higher rejection rates by carriers during number registration. To reduce registration approval delays, provide as detailed and accurate a description of your use case as possible in your application.

Pre-registration preparation

Carriers and aggregators want to see that you’re a legitimate business operating legally before they approve your registration. To help do so, you should:

Establish a clear business identity

  1. Use a legitimate business domain email – Registration applications submitted with Gmail or other personal email addresses signal a lack of organizational legitimacy. Use a duly registered email address on your company’s registered domain.
  2. Make your website transparent – Your website should clearly describe your services, the jurisdictions where you’re licensed to operate, and links to your active gaming licenses or regulatory approvals. Carriers will review it. Include links to your applicable licenses, terms of service, and privacy policy in accessible locations.

Plan your messaging content strategically

  1. Develop message templates before you apply – Your registration application will ask for sample messages. Your samples should focus exclusively on:
    • One-time passcodes for account login.
    • Multi-factor authentication (MFA) verification codes.
    • Account security alerts (new device login, password changes, and suspicious activity).
  2. Avoid promotional gambling language in your samples – Use clear language, accurately describe your use case, and provide all the necessary details.
  3. Prepare examples of your message types – For each template, document who receives it, what triggers it, what the message contains, and how the recipient opted in. The more specific and operational your use case descriptions, the more confidence you give reviewers that this is a well-governed program.
  4. Assemble your applicable compliance documentation

Before submitting any registration through AWS End User Messaging, gather:

  • Your business registration and tax identification documents.
  • Your opt-in consent process documentation.
  • Your Telephone Consumer Protection Act (TCPA) compliance policy or equivalent.
  • Your data retention and privacy policy.
Flowchart of the 10DLC registration journey for OTP messaging across pre-registration, registration, and post-registration phases

Figure 1: The 10DLC registration journey for OTP messaging, from pre-registration preparation through carrier review to post-registration compliance

Coming up in Part 2

You now understand why betting and gaming operators face heightened scrutiny, how the AWS and carrier registration roles work, and how to prepare a strong application before you submit. In Part 2, we cover the registration process itself: how to write use-case descriptions and opt-in documentation that get approved, how to maintain compliance and deliverability after approval, and what to do if your registration is denied.

Read Part 2: Navigating messaging requirements in betting and gaming technology applications (Part 2: Executing the registration and maintaining compliance).


About the authors

Meghana Dasigi

Meghana Dasigi

Meghana is a Sr. Technical Account Manager at AWS Enterprise Support, specializing in messaging, generative AI, and serverless architectures for Media, Entertainment, and Ticketing customers.

Sirinda Glasgow

Sirinda Glasgow

Sirinda is a Sr. Technical Account Manager at AWS Enterprise Support, specializing in security and compliance and hybrid edge infrastructure for Betting and Gaming customers operating regulated workloads.

Track SMS spend by team and use case with AWS End User Messaging

Post Syndicated from Rommel Sunga original https://aws.amazon.com/blogs/messaging-and-targeting/track-sms-spend-by-team-and-use-case-with-aws-end-user-messaging/

If you send SMS for several teams or applications from one AWS account, you’ve probably been asked which team drove last month’s bill. The bill and the default AWS Cost Explorer view show one total for AWS End User Messaging. Grouping by usage type doesn’t help when teams send to the same country with the same type of origination identity, because their message fees land on one line. So each month, someone splits the bill by hand in a spreadsheet.

In this post, we show how to attribute AWS End User Messaging SMS spend to the teams, cost centers, and use cases that generate it. We walk through tagging your origination identities, activating those tags for cost allocation, and reading the results in Cost Explorer. Every step uses the AWS Management Console, and we include the equivalent AWS Command Line Interface (AWS CLI) commands if you want to script the setup.

This post is for FinOps practitioners, platform owners, and solutions architects who run shared SMS workloads and need showback or chargeback by team.

Challenges with tracking SMS spend

Organizations that send SMS for several teams from one AWS account commonly face these challenges:

  • The bill and the default Cost Explorer view report AWS End User Messaging as a single service, with no split by team or application.
  • Grouping by usage type shows what you paid for, such as message fees by destination country and origination identity type, but not who sent the messages.
  • When two or more teams send to the same country with the same type of origination identity, their message fees combine into one usage type line. For example, three sender IDs that all send to the United Kingdom share one line.
  • Finance teams need a monthly showback or chargeback report that they can rerun without manual spreadsheet work.

To address these challenges, you can tag each origination identity with the team and use case that owns it, and then activate those tag keys as cost allocation tags. Cost Explorer can then group your SMS spend by any of those keys, and the same tags flow into your AWS Cost and Usage Report (CUR) and AWS Data Exports.

Solution overview

Cost allocation for AWS End User Messaging SMS works at the level of the origination identity. Phone numbers, sender IDs, and phone pools are AWS resources with their own Amazon Resource Names (ARNs), and each one can carry up to 50 tags. When you send a message from a tagged phone number or sender ID, AWS records the charges for that message against that resource, along with its tags. The monthly fee for a tagged phone number carries its tags too.

The process has four stages, and each stage maps to one or more of the steps in this post:

  1. Tag your origination identities (Steps 1 and 2) – Assign each phone number and sender ID a set of tags, such as business-unit, cost-center, and use-case.
  2. Send traffic (Step 3) – Messages from your tagged identities generate charges that carry the tags. New tag keys can take up to 24 hours to appear in AWS Billing and Cost Management.
  3. Activate the tag keys (Steps 4 and 5) – In the management account of your organization, or in a standalone account, activate the keys as cost allocation tags. Activation can take up to another 24 hours.
  4. Analyze (Steps 6 and 7) – Group your SMS spend by tag in Cost Explorer, or use the tags in your cost and usage reports.

Cost Explorer places charges that don’t belong to a tagged resource in the untagged group, a group that it labels No tag key: key-name.

The following diagram illustrates how the charges from a tagged sender ID reach Cost Explorer.

Figure 1: Each business unit sends from its own tagged sender ID. After the business-unit key is activated, Cost Explorer splits SMS spend by team. Charges from identities or resources without the key appear under No tag key.

Figure 1: Each business unit sends from its own tagged sender ID. After the business-unit key is activated, Cost Explorer splits SMS spend by team. Charges from identities or resources without the key appear under No tag key.

Example scenario

Throughout this post, AnyCompany runs three business units that send SMS from one AWS account. All three send to the United Kingdom, each with its own sender ID, so usage type alone can’t separate their spend. AnyCompany uses the following tagging plan.

Origination identity business-unit cost-center use-case
Sender ID 1 (United Kingdom) retail cc-4100 order-notifications
Sender ID 2 (United Kingdom) banking cc-7250 otp
Sender ID 3 (United Kingdom) marketing cc-3300 promotional

Prerequisites

Before you begin, make sure you have the following components and permissions in place:

  • An AWS account with AWS End User Messaging SMS and at least one origination identity (phone number or sender ID) that you send messages from.
  • Access to the management account of your organization in AWS Organizations, or a standalone account. Only these accounts can activate cost allocation tags. If your SMS runs in a member account, you tag the origination identities there, and the management account activates the keys and requests any backfill.
  • Cost Explorer enabled. The management account sees costs for every account. A member account sees only its own costs, and the management account can turn off Cost Explorer access for member accounts.
  • AWS Identity and Access Management (IAM) permissions to view and tag AWS End User Messaging SMS resources (sms-voice:DescribePhoneNumbers, sms-voice:DescribeSenderIds, sms-voice:DescribePools, sms-voice:TagResource, sms-voice:UntagResource, and sms-voice:ListTagsForResource). If you use the AWS Resource Groups Tagging API, you also need tag:TagResources and tag:GetResources.
  • IAM permissions in the management account or standalone account to activate and backfill cost allocation tags (ce:ListCostAllocationTags, ce:UpdateCostAllocationTagsStatus, ce:StartCostAllocationTagBackfill, and ce:ListCostAllocationTagBackfillHistory), and to view Cost Explorer reports, such as ce:GetCostAndUsage, ce:GetDimensionValues, and ce:GetTags.

Step 1: Plan your tag keys

Decide your keys before you tag anything. Tag keys and values are case sensitive, so Business-Unit and business-unit become two separate keys in your cost reports. Pick one convention, such as lowercase with hyphens, and use it everywhere.

AnyCompany uses three keys: business-unit (which team owns this spend), cost-center (which budget to charge), and use-case (what the traffic is for).

A tag describes the resource, so a sender ID that two teams share can only carry one business-unit value. If you need to split spend between teams, give each team its own origination identity. To see spend for each origination identity, for example, when one team owns several sender IDs, add a key that names the identity, such as identity-name.

Don’t include sensitive information, such as customer names or phone numbers, in tags. Cost allocation tags appear in billing reports that many people in your organization can read.

Step 2: Tag your origination identities

The following steps tag a sender ID. The steps for a phone number are the same, starting from Phone numbers under SMS & RCS.

  1. Open the AWS End User Messaging console.
  2. In the navigation pane, under SMS & RCS, choose Sender IDs.
  3. Choose the sender ID that you want to tag.
  4. On the Tags tab, choose Manage tags.
  5. Choose Add new tag, and then enter a Key and Value. Repeat for each key in your tagging plan.
  6. Choose Save changes.
Figure 2: The Tags tab of a sender ID that has no tags yet. Choose Manage tags to add, edit, or remove tags.

Figure 2: The Tags tab of a sender ID that has no tags yet. Choose Manage tags to add, edit, or remove tags.

Figure 3: The Manage tags dialog for the retail sender ID. Enter a key and value for each tag in your tagging plan.

Figure 3: The Manage tags dialog for the retail sender ID. Enter a key and value for each tag in your tagging plan.

If you send through a phone pool, tag every phone number and sender ID in the pool. Message charges carry the tags of the origination identity that sends the message, not the tags on the pool.

The AWS Resource Groups Tag Editor console doesn’t list AWS End User Messaging SMS resources, but the Resource Groups Tagging API supports them. To tag many identities at once, use the TagResource operation with the AWS CLI or an AWS SDK, or the Tagging API. For examples, see Automate with the AWS CLI later in this post.

Step 3: Send traffic and wait for the tag keys to appear

Send messages from your tagged identities as usual. A new key can take up to 24 hours to appear on the Cost allocation tags page. You can’t activate it until it does, but you can attribute charges from that period with a backfill in Step 5.

If a key still isn’t listed after 24 hours, check the tag on the resource’s Tags tab. Also confirm that the key’s spelling and case match your plan, and that you’re signed in to the management account or standalone account.

Step 4: Activate the tag keys

  1. Sign in to the management account, or your standalone account, and open the AWS Billing and Cost Management console.
  2. In the navigation pane, choose Cost Allocation Tags.
  3. In the Cost allocation tags table, select business-unit, cost-center, and use-case. To find a key, enter it in Find cost allocation tags. Keys from tags on your resources have the type Resource.
  4. Choose Activate.
Figure 4: The Cost allocation tags page showing AnyCompany’s three keys after activation.

Figure 4: The Cost allocation tags page showing AnyCompany’s three keys after activation.

After you activate a key, it can take up to 24 hours to become active in Cost Explorer. Activation applies from that point forward, so charges from before activation stay in the untagged group unless you backfill them.

Step 5 (optional): Backfill earlier months

If you tagged your origination identities before activating the keys, the management account can backfill up to 12 months.

  1. On the Cost allocation tags page, choose Backfill tags.
  2. Choose the earliest month in which your origination identities carried the tags.
  3. Choose Confirm.
Figure 5: The Backfill tags dialog. Choose the earliest month when your origination identities carried the tags.

Figure 5: The Backfill tags dialog. Choose the earliest month when your origination identities carried the tags.

A backfill only adds tag values for periods when the tag was attached to the resource. For example, if you tagged a sender ID on September 17 and request a backfill from September 1, charges from September 1–16 remain untagged. You can submit one backfill request every 24 hours, and Cost Explorer shows the results after its next daily data refresh. A backfill applies each key’s current status, so any key you’ve since deactivated is also removed from earlier months.

Step 6: View SMS spend by tag in Cost Explorer

  1. Open Cost Explorer.
  2. In the Report parameters panel, set Date Range and Granularity. For example, choose the last three months and Monthly.
  3. Under Group by, for Dimension, choose Tag, and then for Tag, choose your key, such as business-unit. Group by with a tag key splits your spend into one line per tag value. A Tag filter only narrows the data to the values that you select.
  4. Under Filters, for Service, choose End User Messaging, and then choose Apply.

Note: SMS carrier fees are billed under this service. The separate End User Messaging Third Party Fees service covers fees such as the WhatsApp fees that Meta charges.

From the management account, you can also filter by Linked account to see the costs of one member account.

Before any tagged usage is metered for a key, every charge sits in a single group, as shown in the following screenshot.

Figure 6: Cost Explorer grouped by business-unit for the months before the sender IDs were tagged. All AWS End User Messaging spend appears under No tag key: business-unit.

Figure 6: Cost Explorer grouped by business-unit for the months before the sender IDs were tagged. All AWS End User Messaging spend appears under No tag key: business-unit.

If you still see only No tag key more than 24 hours after activation, check that the key shows Active on the Cost allocation tags page. Also confirm that you’ve sent messages from a tagged identity since activation, or that you requested a backfill.

After the key is active and tagged usage has been metered, Cost Explorer shows one group for each tag value.

Figure 7: AnyCompany’s AWS End User Messaging spend for September, grouped by business-unit. Charges from resources without the key appear under No tag key: business-unit.

Figure 7: AnyCompany’s AWS End User Messaging spend for September, grouped by business-unit. Charges from resources without the key appear under No tag key: business-unit.

The No tag key group holds charges that have no value for the key. These include:

  • Origination identities that you haven’t tagged yet, or that use a different spelling or case of the key.
  • Other AWS End User Messaging resources that don’t carry the key, such as RCS agents.
  • Messages sent over shared routes, which don’t use one of your origination identities.
  • 10DLC registration fees, such as brand, vetting, and campaign fees.
  • Charges from before the tag was attached or the key was activated.

To reuse this view each month, keep a relative date range, such as the last three months, and choose Save to report library.

Step 7: Combine usage type and tags

Group by Usage type to see what you’re paying for. Usage type names include the AWS Region prefix, the destination country, the origination identity type, and the type of charge, for example USE1-OutboundSMS-GB-Standard-Senderid-MessageFees. Message fees for all three AnyCompany United Kingdom sender IDs appear on this one line.

To split that line by team, set Group by to your tag key and add a Usage type filter for that line. The table then lists a costs row and a usage row for each tag value. To see only the cost rows, enter costs in the search box above the table.

Figure 8: United Kingdom sender ID message fees split by business unit, with Group by set to the business-unit tag and a Usage type filter applied.

Figure 8: United Kingdom sender ID message fees split by business unit, with Group by set to the business-unit tag and a Usage type filter applied.

Automate with the AWS CLI

If you manage many origination identities, or you want to add tagging to your provisioning scripts, you can run the same steps with the AWS CLI. Replace the example ARNs and account ID with your own. To list your ARNs, run aws pinpoint-sms-voice-v2 describe-sender-ids or aws pinpoint-sms-voice-v2 describe-phone-numbers.

To tag a sender ID when you request it, add --tags. The request-phone-number and create-pool commands accept the same option.

aws pinpoint-sms-voice-v2 request-sender-id \
  --sender-id ANYCOMPANY \
  --iso-country-code GB \
  --tags Key=business-unit,Value=retail Key=cost-center,Value=cc-4100 Key=use-case,Value=order-notifications

To tag an existing sender ID or phone number (Step 2), run the following command:

aws pinpoint-sms-voice-v2 tag-resource \
  --resource-arn arn:aws:sms-voice:us-east-1:111122223333:sender-id/ANYCOMPANY/GB \
  --tags Key=business-unit,Value=retail Key=cost-center,Value=cc-4100 Key=use-case,Value=order-notifications

To apply the same tags to several identities in one call, use the Resource Groups Tagging API. Each call accepts up to 20 ARNs:

aws resourcegroupstaggingapi tag-resources \
  --resource-arn-list \
    arn:aws:sms-voice:us-east-1:111122223333:sender-id/ANYCOMPANY/GB \
    arn:aws:sms-voice:us-east-1:111122223333:phone-number/phone-1234567890abcdef0 \
  --tags business-unit=retail,cost-center=cc-4100,use-case=order-notifications

To check which sender IDs carry a key, filter by that key. For phone numbers and pools, use sms-voice:phone-number and sms-voice:pool.

aws resourcegroupstaggingapi get-resources \
  --resource-type-filters sms-voice:sender-id \
  --tag-filters Key=business-unit

To activate the tag keys (Step 4), run the following command in the management account or standalone account. If a key hasn’t appeared yet, the command returns a Tag keys not found error. Wait and try again, as described in Step 3.

aws ce update-cost-allocation-tags-status \
  --cost-allocation-tags-status \
    TagKey=business-unit,Status=Active \
    TagKey=cost-center,Status=Active \
    TagKey=use-case,Status=Active

To backfill earlier months (Step 5), set --backfill-from to the first day of a month, and then check the status of the request:

aws ce start-cost-allocation-tag-backfill --backfill-from 2026-09-01T00:00:00Z
aws ce list-cost-allocation-tag-backfill-history

To get the monthly split by tag (Step 6), run the following command. In the API, the service name is AWS End User Messaging. Charges without the key are returned under business-unit$, which is the API form of No tag key.

aws ce get-cost-and-usage \
  --time-period Start=2026-09-01,End=2026-10-01 \
  --granularity MONTHLY \
  --metrics UnblendedCost \
  --group-by Type=TAG,Key=business-unit \
  --filter '{"Dimensions":{"Key":"SERVICE","Values":["AWS End User Messaging"]}}'

To split a single usage type line by team (Step 7), add a USAGE_TYPE dimension to the filter, for example:

--filter '{"And":[{"Dimensions":{"Key":"SERVICE","Values":["AWS End User Messaging"]}},{"Dimensions":{"Key":"USAGE_TYPE","Values":["USE1-OutboundSMS-GB-Standard-Senderid-MessageFees"]}}]}'

Going further

With your tag keys active, you can reuse them in other AWS Cost Management features:

  • Budgets per team – Create an AWS Budgets cost budget filtered by business-unit to alert each team when its SMS spend crosses a threshold. To receive those alerts on WhatsApp, see Establishing finops management: Integrating AWS Budgets with WhatsApp using AWS End User Messaging.
  • Anomaly alerts – Create an AWS Cost Anomaly Detection monitor for a cost allocation tag, so that an unexpected spike in one team’s SMS spend raises an alert for that team. Create the monitor in the management account, because monitors for cost allocation tags can only be created there.
  • Chargeback reports – Activated tags are included in the cost and usage reports that you create with AWS Data Exports, so you can build monthly chargeback reports in Amazon Athena or your business intelligence tool.

Best practices for SMS cost allocation

  • Tag origination identities when you provision them, so that the first message they send is attributed.
  • Give each team its own origination identity when you need to split its spend.
  • Tag every phone number and sender ID in a phone pool. Tags on the pool itself don’t appear on message charges.
  • Use the same tag keys that your organization uses for other AWS services, so that SMS spend rolls up with the rest of each team’s costs.
  • Review the No tag key group each month. If it grows, check for new origination identities that are missing tags.

Conclusion

By tagging your AWS End User Messaging SMS origination identities and activating those tags for cost allocation, you can see SMS spend by team, cost center, and use case next to the rest of your AWS costs. Tags also separate teams that send to the same country, which usage type alone can’t do.

Tag your identities and send traffic first, and then activate the keys after they appear. If you tagged before activating, backfill up to 12 months so that earlier charges are attributed too. Review the No tag key group each month to catch new identities that are missing tags. To build upon this foundation, consider adding per-team budgets and anomaly monitors on the same tag keys.

For additional implementation guidance and best practices, refer to the following resources:


About the authors

Rommel Sunga

Rommel Sunga

Rommel is a Senior Solutions Architect at AWS, based in Singapore. He specializes in AWS End User Messaging and Amazon Simple Email Service, helping customers build scalable and reliable communication solutions. With expertise in cloud-based messaging architectures, he works with organizations to improve their customer engagement.

Brett Ezell

Brett Ezell

Brett is a Solutions Architect for AWS End User Messaging and Amazon Simple Email Service. Outside of work, Brett spends his time collecting vinyl, comic books, catching live shows, and training at the gym.

Monitor application health with Amazon EC2 application status checks

Post Syndicated from Caroline Frost original https://aws.amazon.com/blogs/compute/monitor-application-health-with-amazon-ec2-application-status-checks/

Amazon Elastic Compute Cloud (Amazon EC2) application status checks monitor application health and responsiveness alongside instance, system, and Amazon Elastic Block Store (Amazon EBS) status checks. You can use them to identify a web server that has stopped accepting requests, a Docker daemon that is not running, an incorrect networking configuration, or a network interface that is no longer passing traffic. Amazon EC2 reports application, instance, system, and Amazon EBS status checks through the DescribeInstanceStatus API and Amazon CloudWatch, so you can monitor application health through these EC2 signals rather than publish a custom health metric.

Application status checks can monitor an EC2 instance whether it is launched using RunInstances, Amazon EC2 Fleet, or Amazon EC2 Auto Scaling. For RunInstances and EC2 Fleet, launch the instance with the tag used by the check association. EC2 reports the application status, and you choose how to respond. Amazon EC2 Auto Scaling monitors instance health and can use included application status checks to automate recovery by replacing an instance when its application status is impaired. When Auto Scaling launches a replacement with the app=database tag, the existing tag-based association includes it, so the application status check monitors the new instance without another association call. This walkthrough uses an Auto Scaling group and also covers CloudWatch alarms, staged onboarding, and application maintenance.

For additional details about the feature and pricing, you can refer to the What’s New post and application status checks in the Amazon EC2 User Guide.

Solution overview

Application status checks report through the DescribeInstanceStatus API and Amazon CloudWatch, so you can consume the result in more than one way. You can poll the status from your own tooling, alarm on the CloudWatch metric and run your own remediation, or rely on Amazon EC2 Auto Scaling to replace an instance whose application status is impaired.

In this example, we use the feature with EC2 Auto Scaling groups. Auto Scaling groups help you manage the instance lifecycle across launching, monitoring, and refreshing instances, and they maintain the number of running instances you specify by replacing an instance that fails a health check. For simplicity, we assume the group is a fixed size, with its desired, minimum, and maximum capacity set to the same value, so replacing an instance keeps capacity steady. We assume we have already set up application monitoring for an application running on EC2 instances in an Amazon EC2 Auto Scaling group. Our goal is to replace an impaired application quickly.

The walkthrough adds one application status check across your instances, surfaces the result in CloudWatch, and configures Auto Scaling to replace an instance whose application status is impaired.

You configure the protocol, port, path, accepted response codes, and failure and success thresholds. EC2 evaluates the endpoint every 60 seconds. A matching response code passes. A different response code, a refused or reset connection, or a timeout counts as a failure. The check reports failed after FailureThreshold consecutive failures and passed after SuccessThreshold consecutive successes. Both thresholds default to 2.

The application status of the instance is separate from the result of any single check. It is the aggregation of the checks associated with the instance that have Aggregation set to included. It reports impaired when at least one included check has a failed result. This is the value that appears as ApplicationStatus in describe-instance-status and that Amazon EC2 Auto Scaling acts on. An initialization grace period delays evaluation after launch, so an application that is still starting is not reported impaired before it is ready. You can associate more than one check with an instance, for example a liveness path and a readiness path, and include or exclude each one from the aggregated instance-level status.

Prerequisites

Before you start, you need the following:

  • An application running on EC2 instances in an Auto Scaling group. If you need to create a group for this walkthrough, see Create an Auto Scaling group using a launch template. Configure the Amazon Machine Image (AMI) or user data in the launch template to install and start the application on each instance.
  • A tag on those instances that you can target, for example app=database.
  • Instances reachable on the health check port from within your virtual private cloud (VPC). With AWS-managed network paths, EC2 matches the health check source to the subnet and security group combinations used by the associated instances. Before creating the check, add an inbound rule to each instance security group that allows health check traffic on the check port from the same security group. The host firewall must also allow the port. The instances do not need public IP addresses.
  • An AWS Identity and Access Management (IAM) principal with permissions for the EC2 application status check actions and EC2 Auto Scaling.
  • Make sure your AWS Command Line Interface (AWS CLI) is up to date. Older releases might not include the application status check commands. If the CLI does not recognize create-application-status-check, follow Installing or updating to the latest version of the AWS CLI before continuing.

If you do not have an application on a health path yet, add a lightweight endpoint that returns a success code when the instance is ready (most web frameworks expose one), or point the check at an existing readiness path. You need at least one running instance in the Auto Scaling group that is reachable on the check port and serving that endpoint to see a passing result.

To add a lightweight endpoint for an instance running Amazon Linux 2023, install nginx and serve a path that returns 200:

sudo dnf install -y nginx
sudo tee /etc/nginx/conf.d/health.conf >/dev/null <<'EOF'
server {
    listen 8080;
    location = /health {
        access_log off;
        default_type text/plain;
        return 200 'ok';
    }
}
EOF
sudo nginx -t
sudo systemctl enable --now nginx
curl -I http://127.0.0.1:8080/health

The final curl command confirms that nginx is listening locally and returning a 200 response. Before you create the application status check, configure the instance security group to allow health check traffic on port 8080 from the same security group. For instructions, see Security group referencing.

Create an application status check

Create a check that requests /health on port 8080 over HTTP and treats 200 as healthy. Keep the default thresholds and set an initialization grace period so that newly launched instances have time to start.

aws ec2 create-application-status-check \
  --protocol http \
  --port 8080 \
  --path /health \
  --status-code-matcher "200" \
  --initialization-grace-period-seconds 300 \
  --tag-specifications 'ResourceType=application-status-check,Tags=[{Key=Name,Value=database-health}]'

The response returns an application status check ID, for example asc-0123456789abcdef0.

Name=database-health identifies the application status check. The app=database tag used in the next step selects the instances to monitor.

The status code matcher defaults to 200 and accepts a comma-separated list of individual codes or ranges, for example "200,204", up to 64 characters.

Associate the check with your instances

Use the application status check ID returned by the create step to associate the check with every instance that carries the app=database tag. Tag-based association covers instances that already carry the tag and instances that launch with it later, which suits an Auto Scaling group where replacement instances launch with the tag.

aws ec2 associate-application-status-check \
  --application-status-check-id asc-0123456789abcdef0 \
  --target-tag-associations Key=app,Value=database

You can also associate specific instances with --instance-ids instead of --target-tag-associations.

View the application status

The describe-instance-status call returns the application status alongside the instance and system status checks, so a query you already run surfaces it without a new API call.

aws ec2 describe-instance-status --instance-ids i-0abc123def4567890

The following example response shows a case where the system and instance status checks pass, while the application status reports impaired.

{
    "InstanceStatuses": [
        {
            "AvailabilityZone": "us-east-1d",
            "InstanceId": "i-0abc123def4567890",
            "InstanceState": {
                "Code": 16,
                "Name": "running"
            },
            "SystemStatus": {
                "Status": "ok",
                "Details": [
                    {
                        "Name": "reachability",
                        "Status": "passed"
                    }
                ]
            },
            "InstanceStatus": {
                "Status": "ok",
                "Details": [
                    {
                        "Name": "reachability",
                        "Status": "passed"
                    }
                ]
            },
            "ApplicationStatus": {
                "Status": "impaired",
                "ImpairedSince": "2026-08-07T14:32:10.000Z"
            }
        }
    ]
}

describe-instance-status returns the aggregation of the included application status checks associated with an instance. For details on every application status check associated with an instance, use describe-application-status, which returns each associated check’s individual result, the reason code, and the HTTP status code your application returned. Use describe-instance-status to see the aggregated application health next to other status checks, and describe-application-status for details on which check failed and why.

aws ec2 describe-application-status --instance-ids i-0abc123def4567890

A failed check includes a reason that explains the outcome. For example:

{
    "ApplicationStatuses": [
        {
            "InstanceId": "i-0abc123def4567890",
            "ApplicationStatus": {
                "Status": "impaired",
                "Details": [
                    {
                        "ApplicationStatusCheckId": "asc-0123456789abcdef0",
                        "Aggregation": "included",
                        "Status": "failed",
                        "Reason": {
                            "Code": "ResponseCodeMismatch",
                            "StatusCode": 503,
                            "Protocol": "HTTP"
                        }
                    }
                ]
            }
        }
    ]
}

For ResponseCodeMatched and ResponseCodeMismatch, the Reason includes the returned StatusCode and the Protocol, so you can distinguish a 500 from a 503. Connection reasons such as ConnectionTimeout, ConnectionRefused, and ConnectionReset indicate that the application did not complete a response at all, and do not include a StatusCode.

Replace instances with an impaired status check

When an application status check reports impaired, the right response depends on what failed, and not every impairment calls for terminating the instance. Common responses include rebooting the instance, rolling back a recent deployment, or terminating the instance and replacing it, and your workload may call for others. A transient fault may clear with a reboot, a bad deployment may call for a rollback, and a crashed or wedged instance usually calls for termination and replacement.

Amazon EC2 Auto Scaling evaluates the aggregated application status as part of its EC2 health checks. When the status is impaired, the group marks the instance unhealthy, terminates it, and attempts to launch a replacement from the group’s launch template. Auto Scaling does not copy the application from the terminated instance. Configure the AMI, user data, or deployment system for the group to install and start the application on each replacement. Because the group has fixed capacity in this example, it replaces the impaired instance rather than changing capacity. Auto Scaling includes application status checks in the group’s EC2 health checks by default, so no separate Auto Scaling health check configuration is required.

Terminate and replace is the default an Auto Scaling group gives you. If your remediation is a reboot or a rollback instead, keep the same impaired signal and act on it yourself, using the CloudWatch alarm in the next section to trigger your own automation.

Set the check’s InitializationGracePeriodSeconds to at least the time your application needs to start, and make sure the Auto Scaling group’s health check grace period is no shorter. Then neither the check nor the group acts on an instance that is still initializing. Detection and remediation then run without a separate monitoring system.

Alarm on the application status in Amazon CloudWatch

EC2 publishes the application status to CloudWatch, so you can alarm on it without a custom metric. This step is optional. Auto Scaling replaces an impaired instance whether or not you create an alarm. Add one when you want notification or a dashboard alongside the replacement. The following alarm notifies an operations topic when the application status check fails for an instance.

aws cloudwatch put-metric-alarm \
  --alarm-name database-impaired \
  --namespace AWS/EC2 \
  --metric-name StatusCheckFailed_Application \
  --dimensions Name=InstanceId,Value=i-0abc123def4567890 \
  --statistic Maximum \
  --period 60 \
  --evaluation-periods 3 \
  --threshold 1 \
  --comparison-operator GreaterThanOrEqualToThreshold \
  --alarm-actions arn:aws:sns:us-east-1:111122223333:ops-notifications

The alarm enters the ALARM state when the application status is impaired for three consecutive minutes. StatusCheckFailed_Application aggregates across every associated check whose aggregation is included. EC2 also publishes a per-check metric named StatusCheckFailed_Application_{application-status-check-id}, so you can alarm on an individual check when an instance has more than one associated.

To see the behavior end to end, stop the application process on one instance without stopping the instance. After the configured thresholds are met, the application status can turn impaired, the CloudWatch alarm can enter the ALARM state, and the Auto Scaling group can replace the instance while the remaining healthy instances can continue to serve traffic.

Rollout and maintenance strategies

Use the following strategies to stage deployment across your instances and suppress reporting during planned application maintenance.

Onboard checks across your instances

Roll application status checks out to a large number of instances in stages. An excluded check does not contribute to replacement decisions while you validate it.

Start in observe-only mode

Create the check with Aggregation set to excluded. An excluded check still runs and reports its result through describe-application-status and CloudWatch, but it does not contribute to the instance-level application status and does not cause Auto Scaling to replace an instance. Watch it for a representative period, confirm it returns the codes you expect, and tune the StatusCodeMatcher, FailureThreshold, SuccessThreshold, and initialization grace period. When you are confident, move the check to included with ModifyApplicationStatusCheck, and the result begins contributing to the instance-level status and to Auto Scaling replacement.

Associate by tag

Associate the check with a tag rather than a list of instance IDs. A tag-based association also covers a new instance when it launches with the tag, without another API call. This fits an Auto Scaling group, an instance refresh, or any workflow that replaces instances over time.

Amazon EKS and Karpenter

Application status checks can monitor an application endpoint on an EC2 worker node, including nodes launched for Amazon Elastic Kubernetes Service (Amazon EKS) managed node groups or by Karpenter. Each associated node must expose the HTTP or HTTPS health path on the configured port and carry the tag used by the check association. For an EKS managed node group, apply the tag to the EC2 instances through its custom launch template. For Karpenter, apply the tag through spec.tags in the EC2NodeClass. Application status checks monitor the endpoint on the EC2 instance, not a Kubernetes Service or an individual pod.

Manage checks as code

Define the check, its thresholds, and its tag association in the same infrastructure-as-code templates you use for your instances, so you can apply the same definition across environments and use your review process for changes. Roll the same definition out one Auto Scaling group or one Region at a time, and use a CloudWatch dashboard on the StatusCheckFailed_Application metric and the per-check StatusCheckFailed_Application_{application-status-check-id} metric to compare behavior before and after you switch a check to included.

The following template creates the check and its tag association. The template creates the check with Aggregation set to excluded so that it reports without contributing to the instance-level status, and you change it to included when you are ready.

Resources:
  DatabaseHealthCheck:
    Type: AWS::EC2::ApplicationStatusCheck
    Properties:
      Protocol: http
      Port: 8080
      Path: /health
      StatusCodeMatcher: "200"
      FailureThreshold: 2
      SuccessThreshold: 2
      InitializationGracePeriodSeconds: 300
      Aggregation: excluded
      Tags:
        - Key: Name
          Value: database-health

  DatabaseHealthCheckTagAssociation:
    Type: AWS::EC2::ApplicationStatusCheckTagAssociation
    Properties:
      ApplicationStatusCheckId: !GetAtt DatabaseHealthCheck.ApplicationStatusCheckId
      TagKey: app
      TagValue: database

The association takes the check ID, which the check exposes as an Fn::GetAtt attribute. To target named instances instead of a tag, use AWS::EC2::ApplicationStatusCheckInstanceAssociation with ApplicationStatusCheckId and InstanceId. Every ID property on both association resources is create-only, so changing the target replaces the association.

Run more than one check

You can associate more than one check with an instance, for example a liveness path and a readiness path, and include or exclude each from the aggregated instance-level status. Create a new check and exclude it from the aggregated count, confirm it behaves, then include it. The application status appears alongside the instance, system, and Amazon EBS status checks in describe-instance-status, so you can adopt it without changing the queries and alarms you already run.

Perform application maintenance

Planned maintenance, such as a rolling configuration change or a version upgrade, can make an application stop responding on its health path for a short time. Without a pause, the check reports the instance impaired and Auto Scaling can replace an instance that is healthy and only briefly offline. Pause reporting for the duration, then resume it.

The direct control is EnableApplicationStatusCheckSuppression. While suppression is in effect, the check does not mark instances impaired, so Auto Scaling does not act on it. Reporting resumes when you call DisableApplicationStatusCheckSuppression, or at the resume time set for the suppression. The following patterns wire that pause into common maintenance workflows.

EC2 Auto Scaling instance refresh and standby

An instance refresh rolls a new launch template through the group in batches and waits for each new instance to pass its health checks, including the application status check, before it continues. Set the check’s InitializationGracePeriodSeconds, and the group’s instance warmup, to at least the time your application needs to start, so the refresh does not act on an instance that is still initializing. For one-off manual work on a single instance, move it to standby with EnterStandby. The group stops health-checking and replacing it until you call ExitStandby.

AWS CodeDeploy

Suppression is not tied to any one deployment tool. If you deploy with AWS CodeDeploy, a deployment that restarts your application fails its health path until the new version is serving, so suppress the instance in a lifecycle hook before the deployment and resume it after. Suppress in a BeforeInstall hook and resume in an ApplicationStart hook in your appspec.yml:

version: 0.0
os: linux
hooks:
  BeforeInstall:
    - location: scripts/suppress_status_check.sh
      timeout: 60
  ApplicationStart:
    - location: scripts/resume_status_check.sh
      timeout: 60

scripts/suppress_status_check.sh suppresses the instance before the new version installs:

#!/bin/bash
set -euo pipefail
aws ec2 enable-application-status-check-suppression \
  --instance-ids i-0abc123def4567890 \
  --duration-seconds 600

scripts/resume_status_check.sh resumes reporting once the new version is up:

#!/bin/bash
set -euo pipefail
aws ec2 disable-application-status-check-suppression \
  --instance-ids i-0abc123def4567890

The --duration-seconds value is a safety net: If the deployment fails before the resume hook runs, suppression lifts on its own rather than leaving the instance unmonitored. Omit it to suppress until you call disable. Grant the instance role ec2:EnableApplicationStatusCheckSuppression and ec2:DisableApplicationStatusCheckSuppression. After reporting resumes, the check evaluates the application again and returns the instance to healthy once it passes, so a routine deployment does not trigger a replacement.

AWS Systems Manager maintenance windows

For scheduled maintenance such as patching, run the work inside an AWS Systems Manager maintenance window and bracket it with the suppression calls: an automation step that enables suppression before the patch task and disables it after. Reporting stays paused for the window and resumes on its own at the suppression resume time if a step does not complete.

Clean up resources

Application status checks incur charges while they are associated with instances. AWS charges for each managed elastic network interface (ENI) AWS creates in your VPC, per Availability Zone, and standard Amazon CloudWatch rates apply to the metrics the checks publish. AWS creates one endpoint per combination of source subnet and security group, so the count does not scale per instance or per check. Delete the resources you created so that you do not incur further charges. Delete the application status check and the CloudWatch alarm, and delete the Auto Scaling group if you created it only for this walkthrough.

aws ec2 delete-application-status-check --application-status-check-id asc-0123456789abcdef0
aws cloudwatch delete-alarms --alarm-names database-impaired

Quotas

Application status checks are subject to service quotas that cap how many checks you create, how many associations you make, and how many instances you monitor. Review the current defaults before you roll out to a large number of instances, because a tag-based association covers instances that launch later. A growing number of instances can reach a quota without any change to your configuration. Once you pass a quota, the instances beyond it stop being checked and report no status. Use the Service Quotas console to view usage and request increases. For the current quotas and how each one is counted, see Application status checks in the Amazon EC2 User Guide.

Conclusion

In this post, we showed how to monitor application health on Amazon EC2 with application status checks. You created an HTTP check, associated it with your instances by tag, viewed the status alongside your existing status checks, alarmed on it in Amazon CloudWatch, and relied on Amazon EC2 Auto Scaling to replace an impaired instance. You can use EC2 status checks and Auto Scaling to detect and respond to application failures rather than operate a separate monitoring system.

If you use another deployment mechanism, apply the association tag to each EC2 instance and make sure the application exposes the configured health path and port. Contact your AWS account team if you need help adapting this pattern to your deployment process.

To learn more, see Application status checks in the Amazon EC2 User Guide and Health checks for instances in an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. As a next step, add a second check for a readiness path and exclude it from aggregation to see how per-check status contributes to the instance-level result.


About the author

Caroline Frost

Caroline Frost

Caroline is an Amazon EC2 Senior Product Manager – Technical, focusing on the EC2 instance lifecycle. She is passionate about building capabilities that improve the developer experience and create operational ease and simplicity.

Introducing the Workday Data Cloud integration with AWS

Post Syndicated from Poornima Chand original https://aws.amazon.com/blogs/big-data/introducing-the-workday-data-cloud-integration-with-aws/

Connecting enterprise systems to modern analytics and AI platforms often requires building brittle pipelines, duplicating data, or sacrificing the governance and business context that makes the data trustworthy. Today we’re introducing the integration of Workday Data Cloud with AWS. With this integration you get bi-directional, zero-copy access to Workday’s governed people and money data from the AWS analytics and AI services that you already use.

Workday Data Cloud overview

Workday Data Cloud is an open, secure, and headless data platform that makes Workday’s people and money data available in the tools where developers build, with its semantic definitions, permission models, metric logic, and audit controls intact. It provides a curated, unified view of people and money data through the Workday Data Lake, bi-directional zero-copy access to that data through Workday Data Connect using Apache Iceberg, and near real-time SQL access for applications and AI agents through Workday Live Data Query.

AWS analytics overview

AWS provides a comprehensive set of analytics and AI services that work together for data engineering, analytics, and machine learning. Here’s how the key services come together in the context of the Workday Data Cloud integration:

Amazon SageMaker Unified Studio

Amazon SageMaker Unified Studio (SMUS) is a unified development environment for data analytics and AI. It brings together data access, querying, visualization, and notebook-based development in one place. With SMUS, developers can connect to Workday Data Cloud, explore datasets interactively, run SQL queries, and build machine learning models, all without switching between multiple tools or interfaces.

Amazon Athena

Amazon Athena is a serverless, interactive query service to analyze data directly in Amazon Simple Storage Service (Amazon S3) using standard SQL. With the Workday Data Cloud integration, analysts and developers can run ad hoc queries against Workday data stored as Iceberg tables without needing to set up or manage infrastructure.

Amazon Redshift

Amazon Redshift is a cloud data warehouse that delivers fast query performance on structured and semi-structured data using SQL. Organizations already using Amazon Redshift for their analytics workloads can now incorporate Workday people and money data through the Glue Data Catalog federation for cross-domain analytics without data movement.

AWS Glue Data Catalog

AWS Glue Data Catalog serves as the central metadata repository that makes Workday data discoverable across the supported AWS analytics services. Through the integration, Workday’s Iceberg REST Catalog is registered as a federated catalog in AWS Glue, which means any AWS service that reads from the AWS Glue Data Catalog such as Amazon Athena, Amazon Redshift, Amazon EMR, and Amazon SageMaker AI can automatically discover and query Workday datasets without additional configuration.

Glue Data Catalog also works in the other direction, letting Workday query data that lives in AWS. Customers can register the Iceberg REST Catalog endpoint of the AWS Glue Data Catalog as an external catalog in Workday Data Cloud. Workday users can then browse and query Apache Iceberg tables stored in Amazon S3 in near real-time, without copying the data into Workday.

AWS Lake Formation

With AWS Lake Formation, you can set up and manage a secure data lake. In this integration, AWS Lake Formation provides the fine-grained permission layer that governs who can access Workday data within the AWS environment, complementing the governance that Workday already applies at its data layer. Administrators can scope each analyst or application to specific databases, tables, rows, or columns.

Amazon S3

Amazon S3 is the foundational storage layer for data lakes on AWS. In the context of this integration, Amazon S3 stores Apache Iceberg tables that can be queried from Workday, so organizations can query and analyze data in AWS alongside their Workday data.

Workday Data Cloud and AWS integration overview

The integration between Workday Data Cloud and AWS enables bi-directional, zero-copy data access. This means data doesn’t need to be copied or replicated between Workday and AWS. Instead, each platform can query the other’s data in place, respecting existing governance and security controls on both sides.

Accessing data in AWS from Workday

Workday applications and AI agents can access data stored in AWS, enriching HR and finance workflows with external business data. Developers building agents or analytics within the Workday platform can query Apache Iceberg tables stored on Amazon S3 by registering the Iceberg REST Catalog endpoint of the AWS Glue Data Catalog as an external catalog in Workday Data Cloud.

Zero-copy federation

Workday Data Cloud federates to the AWS Glue Data Catalog using OAuth 2.0 authentication. After registration, Workday users can discover and query Iceberg tables backed by AWS directly from within Workday Data Cloud without copying data. AWS Lake Formation defines which databases and tables the Workday connection can read, whereas Workday’s Configurable Security controls which individual Workday principals can access the federated tables. This means an AI agent handling workforce planning in Workday can pull in revenue forecasts from an Iceberg table on AWS. Combining those financial projections with headcount data gives HR planners hiring recommendations to review, accounting for both business growth and budget constraints.

Accessing data in Workday from AWS

AWS analytics and AI services can access Workday’s governed people and money data. There are two primary patterns for AWS to query Workday data, each optimized for different use cases:

Live Data Query

Some use cases require near real-time access to Workday data, such as an AI agent checking current headcount or a dashboard showing today’s financial close status. For these, developers can use Workday Live Data Query. From Amazon SageMaker Unified Studio, Amazon Athena, Amazon EMR, or AWS Glue, users connect to Workday through the Live Data Query connector and execute SQL queries directly against live Workday datasets. The query runs within Workday’s governed environment and results flow back in near real-time. This is ideal for operational AI agents, near real-time dashboards, and any application where data freshness is critical.

Amazon SageMaker Unified Studio notebook querying live Workday supplier data with Workday Live Data Query

Figure 1: Querying live Workday supplier data from an Amazon SageMaker Unified Studio notebook with Workday Live Data Query

Zero-copy federation with Apache Iceberg

For near real-time analytics, machine learning (ML) training, and large-scale data exploration, developers access Workday data through Workday Data Connect’s Apache Iceberg integration. By registering the Workday Iceberg REST Catalog in AWS Glue Data Catalog or AWS Lake Formation, all Workday datasets appear as standard Iceberg tables discoverable by any AWS analytics service. The compute runs on the customer’s AWS environment (using Athena, Amazon Redshift, Amazon EMR, or SageMaker AI) while the data stays in Workday Data Cloud.

Amazon Athena query editor running standard SQL against a Workday Data Connect Iceberg table

Figure 2: Querying a Workday Data Connect Iceberg table with standard SQL in the Amazon Athena query editor

Querying a Workday Data Connect Iceberg table with standard SQL in the Amazon Athena query editor

Figure 3: Querying a Workday Data Connect Iceberg table with standard SQL in Amazon Redshift Query Editor v2.

SageMaker Unified Studio notebook using PySpark to browse Workday Iceberg tables through Workday Data Connect

Figure 4: Browsing Workday Iceberg tables with PySpark in a SageMaker Unified Studio notebook using Workday Data Connect

What this means for customers

This integration changes how organizations work with their people and money data for analytics and AI. Here’s what it unlocks:

  • Organizations no longer need to build and maintain complex extract, transform, and load (ETL) pipelines to get Workday data into their analytics environment, which removes data silos without duplicating data. The data stays where it lives, governed and accurate, while remaining fully accessible for analysis and AI.
  • When AI agents and models can access Workday data with its full business context, developers spend less time reverse-engineering business logic and rebuilding permission models. That context includes who has access to what, what a metric actually means, and how calculations are defined.
  • Workday’s permission model, audit controls, and business logic travel with the data, and AWS Lake Formation adds governance on the AWS side. The result is data access that is both open and controlled, which is exactly what regulated industries and enterprise security teams require.
  • Instead of building pipelines, monitoring data freshness, and reconciling duplicates, data teams can focus on building analytics and machine learning applications that drive business outcomes.

Use case walkthrough: AI-powered workforce analytics

Consider a Chief People Officer who wants to understand the relationship between employee engagement scores, compensation benchmarks, and attrition patterns across the organization. Today, this requires extracting data from Workday, loading it into a separate analytics platform, joining it with market data, and building custom reports. This process takes weeks and produces stale results.

With the Workday Data Cloud and AWS integration, a data team can perform the following steps:

  1. Connect to Workday Data Cloud from AWS Glue using the pre-built Workday connector.
  2. Explore workforce datasets such as compensation, tenure, engagement, and performance directly, with full semantic context (job levels, org hierarchies, and tenure calculations) already defined.
  3. Join Workday people data with market compensation benchmarks and recruiting pipeline data stored as Iceberg tables on Amazon S3, all through standard SQL in Athena or SageMaker AI notebooks.
  4. Build a machine learning model in SageMaker AI that predicts attrition risk based on the combined dataset.
  5. Deploy an AI agent that flags high-risk attrition patterns for HR business partners to review and act on. The agent uses Live Data Query for near real-time signals and batch Iceberg access for historical trend analysis.

The entire workflow runs without any data leaving its governed environment, without any custom pipelines to maintain, and with full auditability at every step.

Getting started

The Workday Data Cloud integration with AWS is generally available.

  • Amazon SageMaker Unified Studio users can connect to Workday Data Cloud directly through the Workday Live Data Query connector or the Workday Iceberg REST Catalog connector.
  • Workday Live Data Query connections can also be created in the AWS Glue console, and users can query live Workday data from Amazon Athena, Amazon EMR, and AWS Glue ETL jobs.
  • AWS Glue and AWS Lake Formation users can register the Workday Iceberg REST Catalog as a federated catalog to make Workday datasets discoverable across AWS analytics services.
  • Workday users seeking to query AWS data can register their Glue Data Catalog Iceberg REST endpoint as an external catalog in Workday Data Cloud.

For deeper technical walkthroughs and step-by-step configuration guides, refer to the following resources:

This integration represents a new model for enterprise data access, where governed data flows freely between platforms without compromising security, accuracy, or business context. We are excited to see what customers build with Workday Data Cloud and AWS together.


About the authors

Poornima Chand

Poornima Chand

Poornima is a Principal Solutions Architect at AWS, where she works with customers to solve their unique challenges using AWS technology solutions. She is passionate about driving innovation in agentic AI and helping enterprises build intelligent, scalable, and secure solutions. Outside of work, she enjoys traveling, reading, painting, and spending time in nature.

Archana Bansal

Archana Bansal

Archana is a Senior Manager of Product Management for Workday Data Cloud, helping organizations unlock more value from their enterprise data and AI. Over more than six years, she has shaped the platform’s strategy and product direction, with a focus on data interoperability. She brings 20+ years of product leadership across enterprise data, analytics, and financial platforms at some of the industry’s largest product companies.

Avijit Goswami

Avijit Goswami

Based in California, Avijit is a Principal Data & Applied AI Architect at AWS who partners with customers to design and build robust data foundations and agentic AI solutions. When he’s not working, he loves hitting new trails, discovering new destinations, cheering on his favorite teams, listening to music, and trying out new recipes in the kitchen.

Will Cavin

Will Cavin

Will Cavin is a Principal Technical Product Manager working across the Data and Analytics teams at AWS. He has a passion for helping customers scale their analytics workloads. Prior to AWS, Will served as a cryptologist in the United States Navy. Based in Northern Virginia, he likes to long-distance run and mountain bike with his wife and son in his free time.

Tej Nagabhatla

Tej Nagabhatla

Tej is a Senior Solutions Architect at AWS. He has years of experience guiding numerous Fortune 500 companies along their technology journeys. He specializes in providing architectural guidance across a wide range of topics around AI/ML, security, storage, containers, and serverless technologies. In his free time, Tej enjoys spending time with family, playing basketball, and traveling.

Addressing protocol security gaps in multi-tenant Kubernetes

Post Syndicated from Ajinkya Patil original https://aws.amazon.com/blogs/security/addressing-protocol-security-gaps-in-multi-tenant-kubernetes/

Protocols like Android Debug Bridge (ADB) and Web Real-Time Communication (WebRTC), by default, use unencrypted channels for network communications and don’t support enterprise authentication mechanisms like JSON Web Tokens (JWTs). In a multi-tenant Kubernetes cluster—including Amazon Elastic Kubernetes Service (Amazon EKS)—pods can reach other tenants’ open ports by default unless you configure network policies to restrict cross-namespace traffic. Also, modifying each protocol individually doesn’t scale. This post describes an architecture built on three reusable components: namespace-scoped mutual TLS (mTLS) gateways, managed TURN relay through Amazon Kinesis Video Streams, and JWT identity chains tied to an enterprise identity provider (IdP). The post focuses on architecture decisions and learnings rather than step-by-step deployment.

This post assumes an EKS cluster with namespace isolation configured, an enterprise IdP that issues JWTs, and AWS Private Certificate Authority (AWS Private CA)—a managed service for issuing private certificates—set up in your account. cert-manager—an open-source Kubernetes add-on that automates certificate issuance and renewal—and the AWS Private CA issuer plugin should already be running in the cluster. The architecture also assumes permissions to deploy Envoy Gateway, a Kubernetes API gateway built on the Envoy proxy. The key authentication mechanism used is mTLS, where both client and server present certificates to verify each other.

The challenge: Unauthenticated protocols in multi-tenant Kubernetes

ADB, a command-line tool for communicating with Android devices, requires a proxy or custom API to handle authentication; its unencrypted channel exposes data in transit. Virtual Network Computing (VNC), a protocol for remote desktop access, and similar TCP services share this problem: their credentials are local to the protocol, with no path to a central identity store.

In the Cuttlefish deployment (Cuttlefish is Google’s configurable virtual Android device that runs in containers), the first approach routed this traffic through a bastion host to the Amazon EKS control plane, as Figure 1 shows.

Figure 1: Previous architecture (superseded), shown for comparison only. Communication flow between developer workstation, bastion host, and Amazon EKS control plane

Figure 1: Previous architecture (superseded), shown for comparison only. Communication flow between developer workstation, bastion host, and Amazon EKS control plane

Figure 1 shows a common pattern across the industry to access a private Amazon EKS cluster. We share it to help others identify and migrate away from similar designs for low latency environments. Do not implement this design. The current architecture is described and shown later in this post.

In the now deprecated architecture, a custom API handles authentication by checking each user’s identity against the enterprise IdP and enforcing pod-level authorization. The custom API powers a command-line interface (CLI) that lets you list pods in your assigned namespace and connect to your devices.

The JWT identity chain maps each user to an AWS Security Token Service (AWS STS) RoleSessionName, so every AWS API call in the audit log traces back to a specific person, even in a multi-tenant environment.

Those credentials set up a two-hop port forward that goes from your machine to the bastion, then from the bastion to the target pod. Because all traffic was routed through the Kubernetes API server, concurrent sessions created a throughput bottleneck even though the cluster itself stayed private.

Why self-managed relay infrastructure falls short

A TURN server—a media relay—is needed when communicating parties are behind a NAT Gateway and can’t set up direct peer-to-peer connections.

The initial deployment used STUNner, an open source Kubernetes Session Traversal Utilities for NAT (STUN) and Traversal Using Relays around NAT (TURN) gateway designed for WebRTC media ingestion. STUNner introduced three operational and security challenges.

Because STUNner had no native integration with AWS services or the enterprise IdP, we built a custom token-exchange service to convert IdP tokens into time-limited, namespace-scoped TURN credentials. As usage grew, patching, monitoring, and scaling the TURN servers became a recurring burden. Pod migrations between Availability Zones required manually updating routing rules, and STUNner dropped WebRTC connections during peak usage.

WebRTC’s signaling server introduced a separate security risk. WebRTC encrypts media using Datagram Transport Layer Security (DTLS) and Secure Real-Time Transport Protocol (SRTP) but doesn’t define authentication or encryption for the signaling server; you must build that yourself, which leaves control-plane signaling exposed.

The architecture doesn’t use the Kinesis Video Streams signaling channel because integrating it required substantial changes to the Cuttlefish source patch. The Cuttlefish source code was patched to support non-Google TURN servers, and further changes to support non-Google signaling servers deviated the deployment further from upstream Cuttlefish, risking compatibility issues. Instead, the architecture kept the default Cuttlefish signaling server, with JWT-based session validation and TLS termination at the signaling endpoint designed around it at the application layer.

Namespace-scoped mTLS gateways and managed media relay

The architecture retains namespace isolation, JWT-based authentication, the custom authorization API, and the Cuttlefish patch; the last three of which are custom to this deployment. All components except Cuttlefish patch are reusable.

The reusable components include namespace-scoped Envoy Gateway for mTLS-authenticated TCP proxying, cert-manager-driven certificate rotation through AWS Private CA, and Kinesis Video Streams as a managed TURN provider.

The mTLS gateway assumes several other controls are already in place:

  • Default-deny NetworkPolicy in each tenant namespace. Without this, traffic can bypass the gateway.
  • JWT-based authentication through the custom API. The API validates each user’s identity against the enterprise IdP before returning connection details.
  • Namespace-scoped mTLS certificates issued by AWS Private CA through cert-manager.
  • Kubernetes namespace isolation with scoped role-based access control (RBAC).

ADB connectivity through mTLS

For ADB connectivity, the architecture uses mTLS authentication with Envoy Gateway. Each namespace runs its own Envoy Gateway instance, which routes traffic only to pods within that namespace. cert-manager, running in the cluster with the AWS Private CA issuer plugin, requests short-lived mTLS certificates from AWS Private CA for each namespace at creation time. In production, apply NetworkPolicies before deploying the gateway and issuing certificates.

The certificate commonName uses the convention <user-namespace>.eks.internal so that Envoy can validate the certificate against the expected namespace during the mTLS handshake. The .eks.internal suffix is a naming convention for internal cluster certificates; choose a domain that doesn’t conflict with your organization’s DNS. The usages field specifies both client authentication and server authentication because the same certificate authenticates the client to the gateway and the gateway to the client during the mutual TLS exchange. A cluster-scoped AWSPCAClusterIssuer is used instead of a namespace-scoped AWSPCAIssuer so that a single CA configuration can issue certificates across all tenant namespaces without duplicating issuer resources in each one.

Before deploying Envoy Gateway, each tenant namespace needs a NetworkPolicy that enforces a default-deny ingress posture.

Each certificate is issued with a 12-hour lifetime. A shorter lifetime means a compromised certificate expires quickly without requiring Certificate Revocation List (CRL) or Online Certificate Status Protocol (OCSP) infrastructure, while the 4-hour renewal window gives cert-manager multiple retry attempts before expiry. cert-manager tracks expiry and re-requests a new certificate from AWS Private CA before the current one lapses (by default, renewal starts at the two-thirds mark of the certificate’s lifetime). Envoy Gateway picks up the renewed certificate through Kubernetes Secrets using its Secret Discovery Service (SDS), with no pod restart required.

You first authenticate with the enterprise IdP through the custom CLI, which calls the custom API. The API validates your JWT, confirms your namespace assignment, and returns connection details for the appropriate namespace-scoped Envoy Gateway, including the client certificate for that namespace. The API delivers the certificate over HTTPS. Because certificates are namespace-scoped and expire in 12 hours, a compromised response yields access only to the holder’s own namespace for a limited window. The CLI then presents this certificate to establish a direct mTLS connection, through Envoy, to the target pod. The JWT proves who you are, and the mTLS certificate proves which namespace the connection belongs to.

Envoy proxies the TCP stream directly to the pod and pools connections to reduce latency. The hop between Envoy and the pod isn’t encrypted by mTLS. NetworkPolicy restricts ingress so that only the namespace-scoped Envoy Gateway can reach the ADB port on the target pod. For environments with compliance requirements, extend mTLS to the pod using a sidecar proxy or pod-level certificates. Evaluate this gap against your organization’s data classification and regulatory requirements.

For the REST API path, the custom API sits behind AWS WAF. The ADB data path has no WAF protection; it relies on mTLS, NetworkPolicies, and namespace isolation.

Figure 2: ADB communication flow using Envoy Gateway and custom REST API

Figure 2: ADB communication flow using Envoy Gateway and custom REST API

Figure 2 shows this ADB communication flow using Envoy Gateway and the custom REST API. It logs your authenticated identity, namespace, and timestamp. The mTLS certificate doesn’t carry a user identifier in its subject field. This applies when namespaces are strictly 1:1 with users. For shared namespaces or regulated environments requiring granular attribution, issue per-user certificates from AWS Private CA.

WebRTC relay through Kinesis Video Streams

Kinesis Video Streams provides built-in STUN and TURN infrastructure and signaling channels. It replaced the self-managed STUNner because it integrates with AWS Identity and Access Management (IAM), so the custom token-exchange service is no longer needed. This is an important factor in reducing operational costs. For implementation details, see the Amazon Kinesis Video Streams WebRTC developer guide, which covers signaling channel setup, IAM policies, and TURN credential retrieval.

Kinesis Video Streams WebRTC charges per active signaling channel, per signaling message, and per TURN streaming minute. Idle namespaces incur no TURN cost. See Amazon Kinesis Video Streams pricing for latest pricing and Amazon Kinesis Video Streams with WebRTC service quotas for service quotas.

Figure 3: Final architecture with ADB and WebRTC communication channels

Figure 3: Final architecture with ADB and WebRTC communication channels

Figure 3 shows both ADB and WebRTC communication channels in the completed architecture. Each path has different controls: ADB traffic flows through the namespace-scoped Envoy Gateway, where mTLS and NetworkPolicies enforce access. WebRTC media relay runs through Kinesis Video Streams, with IAM scoping credentials per session. The custom REST API is the only HTTP-based path; it runs over HTTPS with AWS WAF at the edge.

The JWT identity chain connects all three paths: the custom API validates each user’s identity before any connection opens, so the audit log records who connected to which namespace and when.

Applying this pattern to other unauthenticated protocols

The mTLS gateway and certificate rotation pieces transfer directly to most TCP protocols. The TURN relay is specific to WebRTC and similar media-streaming protocols that need NAT traversal. The JWT identity chain requires custom work and isn’t directly transferable. You need to build the API that validates tokens and maps users to namespaces, and a client that retrieves and presents the certificate. The Cuttlefish source patch is specific to this case study and not reusable.

Two common protocol families show how the reusable parts apply:

  • VNC and RDP both store credentials locally, with no path to an enterprise identity provider. Wrapping VNC in mTLS through Envoy replaces the shared password model with certificate-based identity. RDP benefits similarly: certificate authentication works without domain-joining the containers, so you don’t need Active Directory inside each one.
  • MQTT, SIP, and similar TCP protocols often encrypt the payload but skip session-level authentication entirely; meaning you can verify what was sent but not who sent it. Wrapping these protocols in mTLS through Envoy closes that gap without modifying the protocol itself.

JWT identity chain secures session establishment at the application layer. For Internet of Things (IoT) device management, industrial control, or game streaming, Envoy Gateway adds mTLS to TCP protocols that lack built-in encryption in transit. Managed TURN through Kinesis Video Streams handles NAT traversal for WebRTC-based streaming components.

Performance results

Application installs through the dual port-forwarding chain (local machine to bastion, bastion to pod) took 3–4 minutes, and individual ADB commands took 1–2 seconds per round trip.

After migrating to the mTLS Envoy Gateway, ADB commands added under 50 ms of gateway latency compared to local setup. The latency was measured as the difference in round-trip time between a command sent through Envoy and one sent to a local Android device. Through Envoy, individual ADB commands completed in under 100 ms and application installs finished in under 30 seconds, because Envoy proxies the TCP stream directly to the pod instead of routing through the Kubernetes API server. This was an improvement from 1–2 seconds for ADB commands and 3–4 minutes for application installs using bastion host setup.

Key implementation lessons

The main concern addressed by replacing bastion-host forwarding with mTLS proxying was latency compared to local setup. Gateway overhead stayed under 50 ms and met developer expectations.

After migrating to Kinesis Video Streams, WebRTC connections stayed stable during peak usage, and pod migrations between Availability Zones no longer required manual updates to routing rules. Because Kinesis Video Streams integrates with IAM, new protocols added to the cluster are automatically covered by the same audit trail with no additional logging configuration needed.

Security considerations

mTLS authenticates both ends of a connection and encrypts traffic in transit, but it only works when other controls are in place. The NetworkPolicy and pod security controls described in the preceding ADB connectivity section must be in place before mTLS adds value. Without default-deny ingress rules, traffic bypasses the gateway entirely. At the application layer, the custom API validates each user’s JWT before issuing connection details and logs the identity, namespace, and timestamp for every session. Certificates expire after 12 hours and cert-manager rotates them automatically. Short-lived certificates reduce exposure, but if your threat model requires immediate revocation, you need CRL or OCSP infrastructure on top of AWS Private CA. Envoy Gateway is a trust boundary. Review its configuration, resource limits, and access controls against the Envoy security best practices.

The custom API is the primary trust boundary in this architecture. Apply the same rigor to its security review, logging, and access controls as you would to any authentication service.

Conclusion

With namespace-scoped mTLS gateways and managed TURN relay, you can secure unauthenticated protocols on shared EKS clusters without modifying the protocols themselves. ADB command latency drops from 1–2 seconds to under 50 ms, and WebRTC connections remain stable during pod migrations. See the Envoy Gateway documentation, cert-manager documentation, and Amazon Kinesis Video Streams WebRTC developer guide to build and deploy this architecture.

If you have questions about this post, contact AWS Support or start a new thread on AWS re:Post.

Ajinkya Patil

Ajinkya Patil

Ajinkya is a Senior Security Consultant at Amazon Professional Services, specializing in security consulting for AWS customers across the automotive, finance, and media industries since 2019. He has presented at AWS re:inforce and contributed articles to the AWS Security Blog and AWS Prescriptive Guidance. Outside of work, he enjoys traveling and photography.

Run Maestro tests on real Android devices using AWS Device Farm

Post Syndicated from Ronald Teijeira Fernandez original https://aws.amazon.com/blogs/devops/run-maestro-tests-on-real-android-devices-using-aws-device-farm/

ManoMano is a European online marketplace for home improvement and gardening products. Their mobile engineering team builds a React Native application that serves millions of customers across Europe. To verify app quality across a wide range of Android devices, ManoMano adopted Maestro for end-to-end (E2E) testing and needed a way to run these tests at scale on real hardware. This post shares how they solved that challenge using AWS Device Farm.

In this post, you learn how to run Maestro mobile UI tests on real Android devices using AWS Device Farm. Maestro is a mobile UI testing framework that uses a declarative YAML syntax to describe test flows. By using the custom test environment in AWS Device Farm, you can install and run Maestro flows on real physical devices in the cloud.

This post is for mobile developers and Quality Assurance (QA) engineers who use Maestro for E2E testing and want to scale their test suites across real Android devices with different brands, screen sizes, and OS versions.

Many teams that adopt React Native prefer Maestro for its YAML-based simplicity and reliable mobile testing capabilities. With the custom test environment feature in AWS Device Farm, you can run any framework that operates over Android Debug Bridge (ADB), including Maestro. This post shows you how to set it up end to end.

Solution overview

AWS Device Farm is a fully managed app testing service that you can use to test your Android and iOS apps on physical devices in the AWS Cloud. It provides officially supported frameworks (Appium, Espresso, and XCTest) with all dependencies and setup pre-configured. It also offers custom test environments that give you full control over the test host. This means you can install and run any framework that operates over ADB, including Maestro. The custom environment provides the following capabilities:

  • An Amazon Linux 2023 host machine with ADB pre-installed, fully cleaned up and not reused between runs.
  • ADB connectivity to the physical device under test.
  • The ability to install additional tooling through shell commands in the test spec from your test package, downloaded from the internet or accessed through private sources within your virtual private cloud (VPC).
  • Live log and video streaming during test execution.
  • Full artifact collection (logs, screenshots, and other test output) from specified directories.

With these capabilities, you can install the Maestro CLI and, if needed, its primary dependency (for example, Java 21) on the test host. You then run your YAML-based test flows against the connected device, the same way you run them locally.

Architecture of the Maestro on AWS Device Farm solution, showing an Amazon Linux 2 test host connecting to a real Android device over ADB to run Maestro flows

Figure 1: Solution architecture

How it works

The solution uses the following workflow:

  1. AWS Device Farm provisions a real Android device and an Amazon Linux 2023 test host with ADB access to the device.
  2. During the install phase, the test spec downloads and installs Amazon Corretto 21 (Java) and the Maestro CLI on the test host.
  3. During the test phase, Maestro connects to the device through ADB and runs your .yaml test flows.
  4. Maestro writes screenshots, video recordings, and test results to the $DEVICEFARM_LOG_DIR directory.
  5. AWS Device Farm collects all artifacts and makes them available for download after the run completes.

Note: This approach currently supports Android devices only. As of 2026, Maestro iOS support is optimized for simulators and does not work with the real physical iOS devices that AWS Device Farm provides (as indicated in the Maestro documentation).

Prerequisites

To complete this walkthrough, you must have the following:

  • An AWS account with access to AWS Device Farm
  • An Android .apk file built for testing (a release build with animations disabled is recommended for stability)
  • Maestro test flows written in YAML (for more information, see Getting started in the Maestro documentation)
  • Familiarity with the AWS Device Farm Console
  • The Maestro driver APKs (dev.mobile.maestro) for uploading as Extra Apps in AWS Device Farm. After running Maestro locally at least once on a connected device, you can extract the installed APKs using adb shell pm path dev.mobile.maestro.

Walkthrough

Complete the following steps to configure and run Maestro tests on AWS Device Farm.

Step 1: Prepare your Android application package

Build your React Native (or native Android) application as an .apk file. Use a release build or a dedicated test build with animations disabled to reduce test flakiness.

Step 2: Package your Maestro test flows

AWS Device Farm expects a test package in .zip format. Use this zip file as a carrier for your Maestro .yaml flows. The following example shows a typical test directory structure:

.maestro/
├── login_flow.yaml
├── checkout_flow.yaml
└── search_flow.yaml

Run the following command to package the directory into a zip file:

zip -r maestro-tests.zip .maestro/

Upload this zip file to AWS Device Farm as your test package. AWS Device Farm extracts it to $DEVICEFARM_TEST_PACKAGE_PATH, which makes your flows accessible during test execution.

Step 3: Configure the test run

In the AWS Device Farm Console, create a test run with the following configuration:

  1. For Choose your application, upload your .apk file.
  2. For Test framework, select Appium Node.js. This selection determines the expected format of the test package you upload. Appium Node.js accepts a generic zip file containing your test scripts and binaries, which makes it suitable for packaging Maestro flows and the Maestro CLI. Other framework options (such as Instrumentation) require framework-specific package formats like compiled jar files.
  3. For Test package, select the zip file that contains your .maestro directory.
  4. For Test spec, replace the default testspec.yml with the custom configuration in Step 4.
  5. For Devices, select a curated device pool or specific Android devices.
  6. For Extra Apps (located under Additional configuration and then Install other apps), upload the Maestro driver APKs (dev.mobile.maestro). AWS Device Farm installs these on the device before the test begins to help you maintain compatibility with restrictive Android skins.
  7. Review your configuration and choose Confirm and start.

Step 4: Configure the test specification

The following test spec instructs AWS Device Farm to download Amazon Corretto 21, install the Maestro CLI, and run your test flows.

In the following code, replace {YOUR_APP_ID} with your application package ID (for example, com.example.myapp). You can find this in your application’s AndroidManifest.xml or by running adb shell pm list packages | grep <your-app-keyword>.

version: 0.1
# Use the Amazon Linux 2023 host environment
android_test_host: amazon_linux_2023

phases:
  install:
    commands:
      # Set locale (important if your app uses special characters)
      - export LANG=en_US.UTF-8
      - export LC_ALL=en_US.UTF-8
      - export LANGUAGE=en_US.UTF-8
      - locale

      # Install Amazon Corretto 21 (required by Maestro)
      - echo "Downloading Amazon Corretto 21..."
      - curl -L -o /tmp/java21.tar.gz https://corretto.aws/downloads/latest/amazon-corretto-21-x64-linux-jdk.tar.gz
      - mkdir -p /tmp/java21
      - tar -xzf /tmp/java21.tar.gz -C /tmp/java21 --strip-components=1
      - export JAVA_HOME=/tmp/java21
      - export PATH=$JAVA_HOME/bin:$PATH
      - java -version

      # Install Maestro CLI
      - curl -Ls "https://get.maestro.mobile.dev" | bash
      - export PATH="$PATH:$HOME/.maestro/bin"

  pre_test:
    commands:
      # Grant background permissions to Maestro driver (for MIUI devices)
      - adb shell appops set dev.mobile.maestro RUN_IN_BACKGROUND allow 2>/dev/null || true
      - adb shell appops set dev.mobile.maestro START_ACTIVITIES_FROM_BACKGROUND allow 2>/dev/null || true
      - maestro --version

  test:
    commands:
      # Run Maestro test flows
      - maestro test -e APP_ID={YOUR_APP_ID} "$DEVICEFARM_TEST_PACKAGE_PATH/.maestro" --test-output-dir=$DEVICEFARM_LOG_DIR/maestro-results

  post_test:
    commands:
      - echo "E2E tests completed"

artifacts:
  # Collect all Maestro output (screenshots, videos, logs)
  - $DEVICEFARM_LOG_DIR

For more information, see Custom test environments in AWS Device Farm.

Key environment variables

The test spec uses the following AWS Device Farm environment variables:

  • $DEVICEFARM_TEST_PACKAGE_PATH: The path where AWS Device Farm extracts your uploaded test package (zip file).
  • $DEVICEFARM_LOG_DIR: The default directory for storing artifacts. AWS Device Farm collects files from this directory after the run.
  • $DEVICEFARM_APP_PATH: The path to your uploaded .apk file on the test host.
  • $DEVICEFARM_DEVICE_NAME: The unique device identifier (UDID) of the device under test.
  • $DEVICEFARM_DEVICE_OS_VERSION: The Android OS version running on the device.

Reviewing test results

After the test run completes, AWS Device Farm displays results organized into three suites:

  • Setup suite: Contains the output from the install and pre_test phases, including Amazon Corretto and Maestro installation.
  • Tests suite: Contains the output from the maestro test command, with pass/fail status for each flow.
  • Teardown suite: Contains the post_test phase output and device cleanup.
AWS Device Farm test run results page organized into Setup, Tests, and Teardown suites

Figure 2: AWS Device Farm test run results showing the Setup, Tests, and Teardown suites

In the Test Specification Log, you can view the live console output. The following example shows typical output during a test run:

[DEVICEFARM] Setting up your device. This usually takes 2-3 minutes.
[DEVICEFARM] ########### Start executing testspec ###########

[DEVICEFARM] ########### Entering phase install ###########

[DeviceFarm] echo "Downloading Amazon Corretto 21..."
Downloading Amazon Corretto 21...
[DeviceFarm] java -version
openjdk version "21.0.11" 2026-04-21 LTS
OpenJDK Runtime Environment Corretto-21.0.11.10.1 (build 21.0.11+10-LTS)
[DeviceFarm] curl -Ls "https://get.maestro.mobile.dev" | bash
Installation was successful!

[DEVICEFARM] ########### Entering phase test ###########

[DeviceFarm] maestro test -e APP_ID=com.manomano "$DEVICEFARM_TEST_PACKAGE_PATH/.maestro" --test-output-dir=$DEVICEFARM_LOG_DIR/maestro-results

Waiting for flows to complete...
[Passed] login_flow (1m 12s)
[Passed] checkout_flow (2m 29s)
[Passed] search_flow (0m 47s)

3/3 Flows Passed

[DEVICEFARM] ########### Finish executing testspec ###########
[DEVICEFARM] Tearing down your device.

To download detailed results, including screenshots and video recordings, open the Files tab and choose Customer Artifacts. For more information, see Downloading artifacts in a custom test environment.

Handling MIUI device installation prompts

Maestro requires a driver app to be installed on the device under test. On devices with restrictive Android skins (such as Xiaomi MIUI and Oppo ColorOS, which are common in the AWS Device Farm device pool), the operating system blocks USB installations. Installation proceeds only after a user accepts a security prompt, as displayed in Figure 3.

MIUI security dialog on an Android device prompting the user to accept a driver app installation

Figure 3: MIUI installation permission dialog

The way to address this scenario is by pre-installing the Maestro driver APKs as Extra Apps in the AWS Device Farm Console. When you upload the Maestro APKs alongside your application, AWS Device Farm installs them on the device before the test begins. You can then grant the necessary background permissions through ADB using appops commands in the pre_test phase:

adb shell appops set dev.mobile.maestro RUN_IN_BACKGROUND allow
adb shell appops set dev.mobile.maestro START_ACTIVITIES_FROM_BACKGROUND allow

These commands tell the OS to trust the Maestro driver app, allowing it to run in the background and start activities without user interaction. This approach removes the need for the UI watcher script and helps make sure that Maestro can start driving your application when the test begins.

Best practices

The following recommendations are based on the AWS Device Farm best practices for custom test environments:

  • Use environment variables instead of absolute paths: AWS Device Farm provides $DEVICEFARM_TEST_PACKAGE_PATH, $DEVICEFARM_LOG_DIR, and other variables that help maintain consistent behavior across test hosts.
  • Direct artifacts to $DEVICEFARM_LOG_DIR: Use the --test-output-dir flag to write Maestro output to this directory. AWS Device Farm collects artifacts stored here automatically.
  • Verify non-zero exit codes on failure: Maestro returns a non-zero exit code when tests fail, which AWS Device Farm uses to mark the run as failed. Verify this behavior with your Maestro version.
  • Do not log sensitive data: Test spec logs are available as downloadable artifacts. Do not echo API keys or secrets in your commands.
  • Disable animations in your test build: Animations are a common source of test flakiness. Disable them at build time or add ADB commands in the pre_test phase.
  • Use Maestro tags for selective test runs: Use --include-tags or --exclude-tags to run subsets of your test suite, such as smoke tests compared with full regression.

Automate with CI/CD

You can automate this workflow by integrating AWS Device Farm into your continuous integration and continuous delivery (CI/CD) pipeline with the AWS Command Line Interface (AWS CLI) or AWS SDKs. The following are the key API operations:

  • CreateUpload: Upload your .apk and test package zip file.
  • ScheduleRun: Start a test run with your test spec, app, and device pool.
  • GetRun: Poll for run completion and retrieve the result status.
  • ListArtifacts: Download test artifacts such as screenshots, videos, and logs.

For GitHub Actions, use the official GitHub Action, which handles uploading your application and test package, scheduling the run, polling for completion, and downloading artifacts. For AWS CodePipeline, see AWS Device Farm test action reference. For other CI/CD tools or services, use the AWS CLI or AWS SDKs with the AWS Device Farm API.

Cost considerations

AWS Device Farm pricing offers two models for automated testing:

  • Pay per device minute: You pay per minute of device usage. A typical Maestro test run takes 5–15 minutes per device, depending on the number of flows.
  • Unlimited testing (flat rate): A monthly flat fee per device slot gives you unlimited testing on one device at a time. This model is cost-effective for teams that run frequent test suites.

The install phase (downloading Java and Maestro) adds approximately 1–2 minutes to each run. To optimize costs, run critical smoke tests on every commit and full regression suites on release branches only. For current pricing details, see the AWS Device Farm pricing page.

Troubleshooting

The following list describes common issues and their solutions.

  • Maestro times out waiting for the app: Verify that your .apk is a release build or that the app starts quickly. Increase the launch timeout by using the appLaunchTimeout parameter in your flow YAML file.
  • Tests fail on MIUI or Xiaomi devices only: Verify that the Maestro driver APKs are uploaded as Extra Apps in AWS Device Farm and that the appops commands in the pre_test phase grant RUN_IN_BACKGROUND and START_ACTIVITIES_FROM_BACKGROUND permissions.
  • Java not found during Maestro run: Verify that the export PATH commands in the install phase are correct. Environment variables that are set in one phase persist to subsequent phases.
  • Artifacts do not appear after the run: Verify that --test-output-dir points to $DEVICEFARM_LOG_DIR or a subdirectory. AWS Device Farm collects only files in paths that are listed under the artifacts section.
  • Test marked as passed despite flow failures: Verify that your Maestro version returns a non-zero exit code on failure. Some older versions might not exit with a non-zero code by default.

Cleaning up

To avoid incurring future charges, delete the following resources that you created during this walkthrough:

  1. In the AWS Device Farm Console, delete the test run and any associated uploads that you no longer need.
  2. If you created a device pool specifically for this walkthrough, delete it from your AWS Device Farm project.
  3. AWS Device Farm does not incur charges when no test runs are active. No additional cleanup is required unless you are using the unlimited testing plan.

Conclusion

By integrating Maestro with the AWS Device Farm custom test environment, ManoMano transformed their mobile testing strategy. They moved from manual validation on a handful of devices to automated end-to-end testing across real physical hardware on every release. This approach delivers:

  • Broader device coverage: Tests run on devices from different manufacturers with varying screen sizes and OS versions, catching device-specific rendering issues and permission dialogs that emulators miss.
  • Faster feedback cycles: Automated test runs complete in minutes rather than the hours required for manual testing across multiple devices.
  • Consistent reliability: Pre-installing the Maestro driver APKs and granting background permissions through ADB eliminates flakiness caused by restrictive Android skins like MIUI.
  • CI/CD integration: Tests run automatically on every pull request using the official AWS Device Farm GitHub Action, preventing regressions from reaching production.

The key enabler is the AWS Device Farm custom test environment. With it, you can run any framework that operates over ADB, without being limited to officially supported test frameworks. This means you can combine the YAML-based test authoring in Maestro with a managed fleet of real devices and extend the pattern to other ADB-compatible tools as your testing needs evolve.

In this post, you learned how to configure the custom test environment, package your Maestro flows, handle manufacturer-specific restrictions, and automate the workflow in your CI/CD pipeline. To get started, create an AWS Device Farm project and try running your existing Maestro flows by following the steps in this post.


About the authors

Ronald Teijeira Fernández

Ronald Teijeira Fernández

Ronald is a Senior Solutions Architect at Amazon Web Services, helping Public Sector customers in Iberia accelerate cloud adoption and maturity. He specializes in development and security, and is an active member of the Next Generation Development Experience and Security Technical Field Communities, where he enables and supports both the community and customers through technical content and guidance.

Jose Maria Elias

Jose Maria Elias

Jose is a Senior Engineering Manager at ManoMano, where he leads the Foundations team responsible for the core architecture of both web and mobile platforms. Recognizing the critical importance of app quality, he focuses on driving mobile testing automation strategies. He specializes in architecting scalable E2E testing pipelines, currently utilizing the Maestro framework and AWS Device Farm to validate mobile applications across diverse device ecosystems.

Introducing AWS account access manager: IAM role flexibility with centralized workforce access

Post Syndicated from Moumita Saha original https://aws.amazon.com/blogs/security/introducing-aws-account-access-manager-iam-role-flexibility-with-centralized-workforce-access/

AWS Identity and Access Management (IAM) is introducing account access manager, a flexible new way to manage workforce access to your Amazon Web Services (AWS) accounts. This combines the IAM role flexibility your teams already rely on, delivered through the centralized federation of AWS IAM Identity Center, with user-level visibility built-in.

Account access manager streamlines the assignment of your existing IAM roles from individual AWS accounts to your workforce users and groups in an organization instance of IAM Identity Center, giving you a clear path to centralized access management at scale. You can adopt account access manager on its own or alongside IAM Identity Center permission sets; both draw on the same users and groups you already synchronize from your corporate identity provider. That means you assign your existing IAM roles to those users and groups directly, without duplicating identities or managing per-account federation points.

Why use account access manager?

Enterprises scaling on AWS have long faced a difficult choice in workforce access: the flexibility of IAM roles or the central control of IAM Identity Center. Until now, granting workforce access to AWS accounts generally meant choosing one of two approaches, each with trade-offs to consider. Federating into each account separately with IAM roles gives you the full flexibility of IAM roles—custom trust policies, tags, and paths—but requires you to configure an identity provider and manage role assignments independently in each account, making it harder to assign a group across multiple accounts or maintain a unified view of who has access where. Federating once through IAM Identity Center with permission sets gives you a single federation point with centrally provisioned, uniform access, but permission sets can feel restrictive for teams whose roles vary from account to account, or that have difficulty generalizing their existing roles into uniform sets.

Account access manager removes the trade-offs. It’s built for customers who want the single federation point and identity-propagation benefits of IAM Identity Center together with the flexibility of IAM roles. Because it uses the IAM roles you already own, you keep the tailoring capabilities you rely on today:

  • Attribute-based access control (ABAC) – Use IAM role tags, or session tags populated from your identity provider as SAML claims, for fine-grained, attribute-driven authorization.
  • Precise trust policies – Restrict role assumption with network conditions or identity provider (IdP)-asserted claims; such as group membership, department, or cost center, as trust-policy conditions.
  • Role paths for organization at scale – Use IAM role paths to group roles and simplify administration as your environment grows.

Because roles are managed in the account you provision access to, account access manager scales with your account usage rather than relying on Identity Center specific quotas. Assignments are made to users and groups, reducing administrative overhead, and providing accountability and auditability to the specific user and role being used.

How it works

Access flows through IAM Identity Center and carries the user’s identity through trusted identity propagation. Even when multiple users assume a shared IAM role, each role session contains user context that attributes every action to the individual user. Access is granted and audited against the actual user, so you can see who assumed which role in which account. The result is user-level visibility across your organization, not just at the point of sign-in. You also maintain access to the full set of IAM role capabilities, such as role paths, tagging, naming conventions, and other IAM primitives.

Figure 1: Account access manager connects IAM Identity Center federated workforce users and groups to AWS accounts specific IAM roles

Figure 1: Account access manager connects IAM Identity Center federated workforce users and groups to AWS accounts specific IAM roles

To grant a user access to a specific role in an account using account access manager, an administrator creates an entitlement. The user can then access that account from the new account access manager application portal or from their IAM Identity Center access portal, or retrieve credentials from the command line with aws login.

You can manage account access manager through the AWS Management Console for IAM and programmatically through the AWS Command Line Interface (AWS CLI) (aws login and the account-access API namespace), AWS SDKs, AWS CloudFormation, and HashiCorp Terraform and Pulumi, so you can enable it and manage role assignments the same way you manage the rest of your AWS infrastructure. It exposes its own API namespace, account-access, separate from the IAM API, with its own permissions and AWS CloudTrail events.

How to enable account access manager

Here’s how to enable account access manager in your own environment, from prerequisites through your first role assignment.

Prerequisites

  1. An organization instance of IAM Identity Center enabled.
  2. Users or groups in IAM Identity Center that you want to entitle with IAM roles from individual AWS accounts. If users or groups don’t exist already then either:
  3. IAM roles in the individual AWS accounts that you want to assign to users and groups of IAM Identity Center. If the role you need doesn’t exist, create a role using custom trust policies first.
  4. Appropriate permissions to enable account access manager and manage assignments (see the IAM policy examples later in this post).
  5. Both the organization instance of IAM Identity Center and account access manager must be enabled in your organization’s management account.
  6. For CLI access: Install or update to the latest version of the AWS command Line Interface (AWS CLI) v2.36.0 or newer.

Step 1: Enable account access manager

Before enabling account access manager, run the following command from the AWS organization management account to grant account access manager access to your organization:

aws organizations enable-aws-service-access --service-principal account-access.amazonaws.com

Next, use one of the following methods to enable account access manager:

Console:

  1. Sign in to your organization’s management account.
  2. In the AWS Management Console for IAM navigation pane, under Multi-account access, choose account access manager.
  3. The console Region should be set to the primary Region of your IAM Identity Center instance.
  4. If there is no organization instance of IAM Identity Center, you’ll be prompted to enable one before continuing. Otherwise, choose Enable account access manager.
Figure 2: Account access manager enablement from the IAM console

Figure 2: Account access manager enablement from the IAM console

AWS CLI:

Fetch the Amazon Resource Name (ARN) of your IAM Identity Center organization instance, confirm the Region code matches its primary Region, and run:

aws account-access create-application \
 	--region <Region> \
  	--identity-source '{
    		"identityCenter": {
      			"instanceArn": "<IAM Identity Center Instance ARN>"
    		}
 	}'

As an output, the account access manager application ARN will be generated.

After you enable account access manager (through the console or AWS CLI), you will get the account access URL and the account access manager ARN along with other details on the capability.

  • Account access portal URL is the single sign-on entry point for your workforce. This is where your users will go to access AWS accounts. Its format is - https://[Tenant-ID].account-access.[Region].app.aws , found on the Settings tab of the account access manager console).
  • Account access manager ARN: the identifier for the application instance created when you enable account access manager. Note this ARN to use in your IAM role’s trust policies so that only your specific account access manager application can assume those roles, providing confused-deputy protection (see Step 3 for details) and pass it as --application-arn when creating entitlements using the AWS CLI so each assignment is tied to the correct application instance.
Figure 3: Account access manager settings after enablement

Figure 3: Account access manager settings after enablement

In the AWS CLI, run the command aws account-access list-applications to get the application ARN and tenant-ID of the enabled account access manager instance ARN.

Step 2: Update firewalls and gateways

If you filter access to specific AWS domains or URL endpoints with a next-generation firewall (NGFW) or Secure Web Gateway (SWG), allowlist the account access portal domains and endpoints in the following list. Account access manager has no IPv4-only endpoints; endpoints are dual-stack.

  • Account access portal URL – https://[Tenant-ID].account-access.[Region].app.aws
  • Portal APIs – [Tenant-ID].account-access.[Region].app.aws/api/* and /auth/*
  • Control plane – account-access.[Region].api.aws
  • Runtime – account-access-runtime.[Region].api.aws
  • Console – console.aws.amazon.com/account-access

Step 3: Prepare your IAM roles

Before assigning IAM roles to users and groups, update the role’s trust policy to allow account access manager service to assume it.

Add the following statement to the role’s trust policy (or paste the entire policy that follows if you’re creating a new role). Replace <your-account-id>, <region> (your IAM Identity Center primary Region), and <application-id> (from the Settings page of the console).

Figure 4: Account access manager ARN details

Figure 4: Account access manager ARN details

IAM role trust policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AccountAccessManagerIAMRoleTrustPolicyStatement",
      "Effect": "Allow",
      "Principal": {
        "Service": "account-access.amazonaws.com"
      },
      "Action": [
        "sts:AssumeRole",
        "sts:SetContext",
        "sts:TagSession"
      ],
      "Condition": {
        "StringEquals": {
          "aws:SourceAccount": "<your-account-id>",
          "aws:SourceArn": "arn:aws:account-access:<region>:<your-account-id>:application/<application-id>"
        }
      }
    }
  ]
}

Define the Condition block to enforce confused-deputy protection. It helps ensure that the role can be assumed only by the specific account access manager application instance (defined using the application ARN) created when you enabled the service, and only when the request originates from your AWS account where that instance resides.

Best practice:

  • Propagate identity attributes with ABAC – The sts:TagSession action listed in the preceding IAM role trust policy allows upstream attributes from your identity provider (group memberships, department, cost center) to flow through as principal tags on the session. Without it, role assumption still succeeds; only session-tag propagation is suppressed. Add it when downstream IAM policies use aws:PrincipalTag/<key> and the tag is populated from your IdP SAML claims; leave it out otherwise.
  • Automate the trust-policy update – We recommend updating your IAM role-creation workflows to add this trust-policy statement automatically wherever it’s needed, so new roles are assignable from day one. You can use this sample-aam-migration tool as a reference.

Step 4: Assign access to users and groups

Like IAM Identity Center role entitlements, an entitlement in account access manager requires three components: a user or group ID, an account ID, and an IAM role ARN (instead of a permission set ARN). You can create assignments from the Accounts, Users, or Groups tabs in the console, or using the API or AWS CLI. For assignments where the same role needs to be assigned to multiple users, you must create each assignment individually. You can automate it using the account access API, the AWS SDK, or AWS CLI

Assign from the console:

  1. Choose the Users tab and search by username or display name.
  2. Select the user, then choose Assign new access.
    Figure 5: Assign new access in account access manager

    Figure 5: Assign new access in account access manager

  3. On the Assign account access page, enter the workforce user or group, account ID, and IAM role name, then choose Assign access.

Assign a user using AWS CLI:

aws account-access create-entitlement \
  --region <Region> \
  --application-arn "<Account_access_manager_ARN>" \
  --entitlement '{
    "principalRole": {
      "principal": {
        "identityCenter": {
          "userId": "<Identity_Center_User_ID>"
        }
      },
      "roleArn": "arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>"
    }
  }'

To assign a group, replace the userId block with "groupId": "<IDC_GROUP_ID>". To remove access, use aws account-access delete-entitlement with the entitlement ID.

Note:

  • The console can search users, groups, and accounts, but it can’t detect IAM roles because they can come from different AWS accounts in your organization; you must know the role name beforehand.
  • Only IAM roles whose trust policy grants account access manager as an allowed service principal are eligible for assignment.
  • IAM role sessions assigned by account access manager use the maximum session duration configured on the underlying IAM role in each AWS account, up to 12 hours.

Step 5: How workforce users can sign in

Workforce users can federate to AWS accounts using IAM roles assigned through account access manager in any of the following ways:

  1. Directly through the account access portal URL – Navigate to the portal URL (for example, https://aa-xxxxxxxxx.account-access.us-east-2.app.aws, or a vanity URL) and sign in.
  2. Through the AWS access portal – Go to the Applications tab, select the Account Access application, and you’ll be redirected to the account access portal, where your assigned accounts and their respective roles are listed.

Tip: We recommend that users bookmark both the account access portal and the AWS access portal for faster navigation. In addition, if you use a supported IdP, such as Okta, Microsoft Entra ID, or Ping Identity, you can add the account access portal as a bookmark app in the IdP’s dashboard; giving users authenticated, single-click access to the portal directly from the tools they already sign in to each day.

Access through a web browser

Use the following steps to use account access manager through a web browser.

  1. Navigate to the account access portal URL and sign in with your credentials.
  2. On the portal, find the AWS account you need. Search by account name or ID to filter the list of accounts you’re assigned to.
  3. Expand the account to see the roles you can assume.
  4. Select a role (for example, Developer). A new tab opens, signed into that account with the selected role.

Access through the AWS CLI

Account access manager works with the aws login command. To get started:

  1. Install the latest AWS CLI (v2.36.0 or newer).
  2. Sign in through your default browser – Sign in to your account access portal and into the target AWS account using one of your assigned roles.
  3. On the command line, run:
    aws login

  4. Set a default Region if prompted – If you haven’t set one, the AWS CLI will prompt you for a Region (for example, us-east-2).
  5. Select your session – The AWS CLI opens a browser page; select the tile for the session you initiated.
  6. Confirm and return to the CLI – The page confirms that your credentials were shared successfully. Close the tab and keep working in the AWS CLI for the duration of your session.

The temporary credentials are automatically rotated by the AWS CLI, AWS Tools for PowerShell, and AWS SDKs, and remain valid for the default session duration of an IAM role. After the session expires, you’re prompted to sign in again on the browser.

Note: IAM Identity Center–specific commands, such as aws sso configure don’t work with account access manager assignments; use aws login instead. If you want to continue to use aws sso login, refer to AWS CLI Integration for IAM Account access manager.

Create shortcut links to specific console destinations

The portal also lets you create a shortcut link that opens a specific console destination for a given account and role. Shortcut links work only with accounts and roles already assigned to the user—they can’t grant new access—and URL parameters must be URL-encoded. Because shortcut links are Regional and expose the account ID and role name in plain text, review your organization’s sharing policies before experimenting with them.

Customer managed key considerations

If your IAM Identity Center instance is encrypted with an AWS KMS customer managed key, which is required when you replicate IAM Identity Center to additional Regions, check the key policy before you enable account access manager. We recommend implementing the current baseline KMS key policy to ensure account access manager can read user, group, and instance data from IAM Identity Center.

Best practices summary

  • Enable in the right place – Enable account access manager in your organization’s management account and in the same Region as your IAM Identity Center instance and confirm your organization instance is in place before you begin.
  • Automate trust-policy updates – Build the account access manager trust-policy statement into your role-creation pipelines so every new role is assignable from day one, with no manual intervention.
  • Add sts:TagSession only when you need it – Include it only where downstream policies consume principal tags; otherwise leave it off to keep sessions lean and least-privilege.
  • Assign roles to groups, not individual users – Granting access at the group level reduces administrative overhead and strengthens the auditability of user-level access.
  • Scope administrator permissions tightly – Separate managing the feature from managing assignments, and enable delegating administration to keep day-to-day operations out of the management account.
  • Allowlist the portal domains before rollout – Add the account access portal domains and endpoints to your next-generation firewall or Secure Web Gateway ahead of launch to avoid access disruptions.
  • Prepare your workforce users – Have users bookmark both the account access portal and the AWS access portal and communicate the aws login flow clearly to your developers.

Account access manager launch partners

Account access manager launches with a broad ecosystem of AWS identity and access-governance partners who have integrated the service into their existing solutions, making it available to our joint customers from day one. Leading identity providers Okta, PingIdentity and Cisco Duo extend account access manager so customers can manage human workforce access to AWS accounts directly from the identity platforms they already use. Alongside them, access-governance and privileged-access partners Apono, BeyondTrust, Britive, Sonrai Security, C1.ai and Lumos added capabilities to govern, provision, and audit that access through the tooling our customers already rely on.

Account access manager also integrates with leading infrastructure-as-code (IaC) partners, so teams can define and manage access assignments declaratively alongside the rest of their AWS infrastructure. Pulumi enables customers to codify account access manager role assignments as part of their existing provisioning workflows, bringing repeatable, version-controlled automation to workforce access at scale.

Conclusion

Account access manager combines the flexibility of the IAM roles your teams already own with the single, centralized federation point of IAM Identity Center, adding user-level visibility into what users or roles have done across your organization. You assign existing IAM roles to users and groups centrally, scale with your account usage rather than a fixed quota, and give developers a fast, secure command-line experience with aws login. It’s available at no additional cost, enabled by default in Commercial Regions (excluding opt-in Commercial Regions, GovCloud (US), China, and other non-commercial Regions).

To see account access manager in action, watch the enablement video, which walks through enabling the service, preparing your IAM roles, and assigning access to your workforce end to end. You can also extend account access manager through our launch partners; leading identity, access-governance, and IaC providers who have integrated the service into their platforms, so you can govern, provision, and automate workforce access to AWS using the tooling you already rely on. Review the preceding partner integrations to find the ones that fit your environment.

To learn more and get started, visit the AWS Identity and Access Management User Guide. We encourage you to enable account access manager in a test organization, assign your first entitlement, and explore how centralized, user-attributed access can simplify your AWS environment.

Moumita Saha

Moumita Saha

Moumita is a Sr. Identity Specialist Solutions Architect, currently driving identity innovation, she builds customer solutions, shapes product direction, and advances access management practices across industries. With over 14 years of security expertise, she has delivered high-impact security innovations for Fortune 500 enterprises and Global Systems Integrator partners.

Omar Zoma

Omar Zoma

Omar is a Principal Security Solutions Architect with AWS Industries. With 15 years of security experience spanning multiple industries, his goal is to help customers understand and improve their security and compliance posture in a scalable way. He tackles global security challenges through content creation, teaching, knowledge sharing, and contributing to global standards and organizational bodies.

Serverless ICYMI Q3 2026

Post Syndicated from Julian Wood original https://aws.amazon.com/blogs/compute/serverless-icymi-q3-2026/

In this 34th quarterly recap post, discover the most impactful AWS serverless launches, features, and resources from Q3 2026 that you might have missed.

In case you missed our last ICYMI, read about what happened in Q2 2026.

Q3 2026 calendar marking the quarter covered by this serverless recap

Figure 1: 2026 Q3 calendar

Amazon EventBridge

Amazon EventBridge relaunched the Custom event bus for organizations where many teams share events. A central team creates one bus, shares it across accounts with AWS Resource Access Manager, and controls who can publish and subscribe. Application teams create Subscribers in their own accounts instead of chaining forwarding rules between buses. The new bus keeps events for a retention period you choose, preserves order within a key the publisher sets, and accepts Avro, Protocol Buffers, and JSON, including CloudEvents. It runs alongside the classic bus, so adoption is incremental.

Shared EventBridge Custom event bus with subscribers in separate team accounts

Figure 2: Shared Custom event bus with subscribers in team accounts

More services now publish directly to Amazon EventBridge. AWS Secrets Manager sends an event when a secret value changes, and Amazon Simple Storage Service (Amazon S3) Event Notifications now include system-generated tags, so one rule can match events from thousands of buckets. Scheduling email campaigns at scale with Amazon EventBridge Scheduler shows a high-volume scheduling pattern.

AWS Lambda

AWS Lambda functions outside an Amazon Virtual Private Cloud (VPC) with 2 GB of memory or more now get scalable network bandwidth. The bandwidth increases from 625 Mbps at 2 GB up to 3,000 Mbps at 10 GB. Functions that pull large amounts of data from Amazon S3 or external sources finish sooner, as the ETL fan-out pattern in the post shows.

SnapStart now supports container images, cutting startup for larger images from several seconds to as low as sub-second. Provisioned mode for Amazon Simple Queue Service (Amazon SQS) event source mappings now scales to 10,000 event pollers, five times the previous limit, for up to 100,000 concurrent invocations. Lambda can also read function code from your own S3 bucket. Lambda skips copying the package to its own storage, so code storage quotas stop being a concern and functions activate faster after updates.

Lambda Managed Instances

AWS Lambda Managed Instances, a capability of AWS Lambda, now supports a 90-minute timeout for asynchronous and event source mapping invocations, six times the 15-minute limit. This longer timeout can help for jobs such as media transcoding, Monte Carlo simulations, and batch inference. You can run on AWS Graviton-powered C9g, C9gd, M9g, and M9gd instances with up to 25% better performance than Graviton4. Capacity providers now publish logs to Amazon CloudWatch, showing scaling activity and instance lifecycle operations. Eliminating Java cold starts with AWS Lambda Managed Instances covers latency-sensitive Java functions.

Durable functions

The Durable Execution SDK for .NET is generally available, joining TypeScript, Python, and Java. You can now bring your own SDK for any runtime, checked against an open source conformance test suite. The Pydantic AI integration makes each model and tool call a durable step, so an interrupted agent resumes where it stopped instead of repeating expensive calls. If your data governance policies require keys you control, you can encrypt execution data with your own AWS Key Management Service (AWS KMS) key. Observability best practices for Lambda durable functions covers dashboards, alarms, and tracing. Durable functions is also now available in the AWS European Sovereign Cloud.

Lambda MicroVMs

The following video shows stateful game servers running on Lambda MicroVMs.

Video thumbnail for building multiplayer game servers on AWS Lambda MicroVMs

Figure 3: Building multiplayer game servers with AWS Lambda MicroVMs

Secure code execution for AI agents explains how each Lambda MicroVMs user or job gets its own Firecracker-isolated environment that keeps state for up to 8 hours. MicroVMs is now available in 10 Regions and supports AWS PrivateLink, without exposing traffic to the public internet. Other posts cover CPU and memory metrics and custom domains with an Application Load Balancer, and the AWS Developers channel shows stateful game servers on MicroVMs.

Running self-hosted AI agent sandboxes gives every agent session its own MicroVM in your account, with separate credentials, file system, and network boundary. Each MicroVM launches from a pre-captured snapshot, so new sessions skip application initialization.

Architecture of self-hosted AI agent sandboxes running on AWS Lambda MicroVMs

Figure 4: Self-hosted agent sandboxes on AWS Lambda MicroVMs architecture

Other Lambda updates

Lambda now offers public preview runtimes, starting with Node.js 26 and Python 3.15, so you can test your workloads before general availability. Java 8, 11, and 17 now run on Amazon Linux 2023, because Amazon Linux 2 reached end of life in June. You can move off Amazon Linux 2 without changing Java version at the same time. Functions support full AWS Identity and Access Management (AWS IAM) resource-based policies, and recursive loop detection is in all available commercial Regions. With S3 Files, you can configure direct reads from high-performance storage for lower latency or from your bucket for higher throughput. To change function behavior without redeploying, see Implementing dynamic feature flags with AWS AppConfig on AWS Lambda.

AWS Step Functions

AWS Step Functions now adds SDK integrations for new services automatically within weeks of release, starting with Lambda MicroVMs. A workflow can launch a MicroVM to run agent-generated code in isolation. Validating multi-agent decisions with Step Functions and Amazon Bedrock AgentCore fans work out to several agents with a Distributed Map and checks their decisions before acting.

Amazon SNS and Amazon API Gateway

Amazon Simple Notification Service (Amazon SNS) now supports message payloads up to 1 MiB, four times the previous limit. Set the MaximumMessageSize topic attribute to publish larger messages without splitting them, following the 1 MB increase across other serverless services in January. Amazon API Gateway now supports backend mTLS with your own client certificate and configurable destinations for execution logs.

Amazon S3

Amazon Elastic Container Service (Amazon ECS) on Amazon Elastic Compute Cloud (Amazon EC2) now supports S3 Files, and Amazon S3 Vectors, a capability of Amazon S3, adds metadata pre-filtering, returning up to 5 times more matches on selective filters. You can move objects to S3 Standard-IA on the day you create them instead of waiting 30 days. Object Lock adds event holds for retention that starts with a future event, such as a contract closing.

Building with AI

The Lambda console has a one-step setup prompt that configures your coding agent with AWS Serverless skills and the Serverless MCP server. The console-to-IDE integration now includes Kiro and Cursor and can convert your function to an AWS Serverless Application Model (AWS SAM) template. Set up your AI coding agent to build with AWS Step Functions does the same for workflows.

Agent Toolkit for AWS

The AWS MCP Server in the Agent Toolkit for AWS added a serverless capability that inspects a Lambda function and its connected resources, so your agent can diagnose issues in place. New skills cover Amazon Cognito, Amazon DocumentDB (with MongoDB compatibility), Amazon OpenSearch Service, and Amazon Redshift. The AWS Command Line Interface (AWS CLI) can now check for and update all skills in one command.

Amazon Bedrock AgentCore

The new AgentCore runtime, a capability of Amazon Bedrock AgentCore, reclaims unused memory during a session, so you pay for what you use, and keeps cold starts consistent. Runtime instances run agents on Amazon EC2 instance types you choose, much as Lambda Managed Instances does for functions. AgentCore payments, a capability of Amazon Bedrock AgentCore, is generally available, and temporal policies authorize tool calls based on what the agent already did in the session.

AgentCore memory, a capability of Amazon Bedrock AgentCore, added JSON payload extraction, fine-grained access control, flexible namespaces, and direct ingestion. AgentCore Identity, a capability of Amazon Bedrock AgentCore, has a managed consent portal for OAuth flows, and AWS Agent Registry is generally available. Amazon Bedrock Managed Agents, powered by OpenAI is in preview. New models include Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, GPT-6 Astra, GPT-6 Sol and Luna, and Kimi K3.

Strands Agents

Title card introducing the Strands harness open source agent

Figure 5: Introducing Strands harness

Strands harness is an open source, general-purpose agent you start with one line of Python or TypeScript and run locally or deploy anywhere. Across six benchmarks using the same models, it cost 28% less than other popular harnesses with similar accuracy, mostly because of its default context management. Harness Optimizer tunes prompts, tool descriptions, and skills automatically, strands-dynamodb-storage adds durable agent storage on Amazon DynamoDB, and Strands Evals now evaluates agents built with other frameworks.

Kiro

Kiro Crew desktop session view showing agent work across sessions

Figure 6: Kiro Crew session view

Kiro Crew is an open source workspace that runs agent work across sessions, schedules, and subagents from a desktop app, web dashboard, or terminal. Kiro on the web is generally available, cloud sessions keep CLI and IDE tasks running after you close your laptop, and workflows run multi-step plans across several agents in the background.

Serverless blog posts

Here are the Q3 2026 serverless blog posts, grouped by the month they published.

July

August

September

Still looking for more?

The Serverless landing page has overall information about building serverless applications. The Lambda resources page contains case studies, webinars, whitepapers, customer stories, reference architectures, and even more Getting Started tutorials.

You can also follow the Developer Advocacy team to get the latest news, follow conversations, and interact with the team.

And finally, visit Serverless Land for your serverless needs.

Introducing queue consumption mode for Apache Kafka in AWS Lambda

Post Syndicated from Vaibhav Jain original https://aws.amazon.com/blogs/compute/introducing-queue-consumption-mode-for-apache-kafka-in-aws-lambda/

Queue consumption mode for AWS Lambda event source mappings (ESMs) that subscribe to Apache Kafka is now available. Queue consumption mode is available on the self-managed Apache Kafka ESM. It covers both Kafka clusters you operate yourself and managed Kafka offerings such as Confluent Cloud and other providers that offer Kafka 4.2 or later with Kafka Queue support.

With this launch, you can build queue-style event-driven workloads on Kafka that process records with high parallelism that scales concurrency to match your backlog instead of your topic layout. Queue mode achieves this using Kafka Share Groups (KIP-932), introduced in Kafka 4.0. With share groups, multiple consumers read concurrently from the same partitions, so Lambda can process records from a single partition across many parallel invocations. The result is parallelism that is decoupled from partition count, without head-of-line blocking and without introducing a second messaging system into your architecture.

Many Kafka workloads treat each event as an independent unit of work rather than a step in an ordered sequence: generating image and video renditions after upload, offloading slow work from a user-facing API, scoring transactions for fraud, delivering notifications, enriching records for inference, processing bulk files, buffering ahead of a rate-limited dependency, and ingesting telemetry. Correctness for these workloads depends on processing records quickly, not in order. The Kafka consumer group protocol, however, assigns each partition to exactly one consumer, so a topic with 10 partitions supports up to 10 concurrent consumers. Over-partitioning raises that ceiling but increases broker resource usage, slows rebalances, and still leaves head-of-line blocking, where one slow record stalls every record behind it. Previously, teams moved this traffic to a separate queuing system, adding a platform to operate and new producer code.

In this post, you learn how queue consumption mode works compared to the existing stream mode, what broker and cluster requirements your Kafka 4.2 cluster must meet, and how to scale from on-demand defaults to provisioned mode for high-throughput workloads.

What’s new

This launch adds a ConsumptionMode parameter to the Kafka event source mappings in Lambda. It accepts two values: Stream (the default, matching today’s behavior) and Queue, which uses Kafka Share Groups for parallel consumption. The core primitive in both modes is the event poller, a compute resource that fetches records from Kafka and invokes your Lambda function. Queue mode changes the protocol an event poller uses to obtain those records. Because pollers are no longer bound to individual partitions, queue mode supports higher concurrency. A single poller reaches up to 10 concurrent invocations compared to 5 in stream mode, and queue mode scales independently of partition count. We cover the scaling model in detail later in this post.

Stream mode: One consumer per partition, ordered processing

ConsumptionMode defaults to Stream, so existing ESMs are unaffected by this launch. In Stream mode, event pollers join a Kafka consumer group, and the broker assigns each partition exclusively to one consumer. This guarantees ordered processing within each partition.

Queue mode: Multiple consumers per partition, unordered parallel processing

Setting ConsumptionMode to Queue directs Lambda to use the Kafka Share Consumer. Event pollers join a share group, where partitions can be assigned to multiple event pollers for parallel processing without guarantees about order. The broker manages a record lifecycle of Available, Acquired, Acknowledged, and Archived. Fetched records are marked Acquired under a visibility timeout called the record lock duration. A successful invocation acknowledges them. A failed invocation releases them back to Available for any poller to acquire. While an invocation is still running, the poller renews the lock without incrementing the delivery attempt count.

Choosing between the modes

Use Stream mode when per-partition ordering matters: change data capture, event sourcing, or per-entity state machines. Use Queue mode when records are independent, and you want parallelism that is not bounded by partition count. You can run a Queue mode ESM and a Stream mode ESM against the same topic. Each operates independently through its own protocol.

Minimum requirements

Before you configure an ESM with ConsumptionMode: Queue, confirm that your Kafka cluster and Lambda function meet the following requirements.

Cluster requirements

  • Apache Kafka 4.2 or later, with share groups enabled.

Four broker settings interact with your ESM configuration:

  • group.share.partition.max.record.locks – The maximum in-flight records per partition. In Queue mode, multiple pollers might acquire records from the same partition concurrently, so the total in-flight count can exceed a single poller’s batch size. Set this value high enough to accommodate your expected concurrency. When the limit is reached, pollers can’t acquire new records from that partition until existing records are acknowledged, or their locks expire.
  • group.share.record.lock.duration.ms – The visibility timeout for acquired records. In most cases, the default of 30 seconds is sufficient. The poller renews the lock during processing. A long-running function does not typically require a duration longer than 30 seconds.
  • group.share.delivery.count.limit – The maximum number of times the broker attempts to deliver a record before archiving it. This works alongside MaximumRetryAttempts to govern retry behavior.
  • group.share.max.size – The maximum consumers allowed in the share group. When provisioned mode is active, keep MinimumPollers ≤ MaximumPollers ≤ group.share.max.size so that Lambda scaling isn’t capped by the broker. In on-demand mode, Lambda internally manages poller counts within broker-safe defaults.

Getting started

In the Lambda console, choose your function, choose Add trigger, and select Self-managed Apache Kafka. Enter your bootstrap servers and topic name, set Consumption mode to Queue, and configure your virtual private cloud (VPC) subnets and security groups. Optionally set Minimum event pollers and Maximum event pollers to use provisioned mode. For on-demand scaling leave those empty.

The following AWS CLI command creates the equivalent Queue mode ESM in on-demand mode:

aws lambda create-event-source-mapping
--function-name my-function
--self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["broker1.example.com:9092","broker2.example.com:9092"]}}'
--topics my-queue-topic
--batch-size 100
--self-managed-kafka-event-source-config '{"ConsumptionMode": "Queue"}'

ConsumptionMode is the only parameter required to enable Queue mode. BatchSize sets the maximum records per batch sent to your function, accepts values from 1–10,000, and defaults to 100.

With AWS CloudFormation, the equivalent resource looks as follows:

MyKafkaQueueESM:
  Type: AWS::Lambda::EventSourceMapping
  Properties:
    FunctionName: !Ref MyFunction
    SelfManagedEventSource:
      Endpoints:
        KafkaBootstrapServers:
          - broker1.example.com:9092
          - broker2.example.com:9092
    Topics:
      - my-queue-topic
    BatchSize: 100
    SelfManagedKafkaEventSourceConfig:
      ConsumptionMode: Queue

Queue mode is also configurable through the AWS SDKs, AWS Serverless Application Model (AWS SAM), and AWS Cloud Development Kit (AWS CDK). For the complete setup walkthrough, see the AWS Lambda Developer Guide.

Scaling with on-demand mode

Queue mode ESMs use on-demand mode for scaling by default. Lambda evaluates share group consumer lag at one-minute intervals and adds or removes event pollers as needed, completing scaling actions within three minutes. On-demand mode scales to five event pollers per ESM, each supporting up to 1 MB/s. It reaches its ceiling at either 5 MB/s aggregate throughput or 50 concurrent invocations, whichever comes first. This suits lower-concurrency workloads and development environments.

Scaling with provisioned mode

For workloads with strict latency requirements or spiky traffic, provisioned mode for scaling gives you direct control over the event pollers dedicated to your ESM. Set MinimumPollers from 1 –200 and MaximumPollers from 1 to 2,000. However, the broker’s group.share.max.size setting caps how many members can join a share group, and Kafka 4.2 limits this value to 1,000. Set MaximumPollers to 1,000 or below unless your broker supports a higher limit. Each provisioned event poller supports up to 5 MB/s.

aws lambda create-event-source-mapping
--function-name my-function
--self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["broker1.example.com:9092","broker2.example.com:9092"]}}'
--topics my-queue-topic
--batch-size 100
--self-managed-kafka-event-source-config '{"ConsumptionMode": "Queue"}'
--provisioned-poller-config '{"MinimumPollers": 5, "MaximumPollers": 100}'
--source-access-configurations '[{"Type":"VPC_SUBNET","URI":"subnet-0123456789abcdef0"},{"Type":"VPC_SUBNET","URI":"subnet-0123456789abcdef1"},{"Type":"VPC_SECURITY_GROUP","URI":"sg-0123456789abcdef0"}]'

To size MinimumPollers, divide your baseline ingestion rate by 5 MB/s. If your workload is concurrency-bound, divide your target concurrent invocations by 10 instead. A workload needing 300 concurrent invocations requires at least 30 pollers. Setting MinimumPollers equal to MaximumPollers pins capacity and disables autoscaling. For detailed sizing guidance, see Introducing provisioned mode for Kafka event source mappings with AWS Lambda on the AWS Compute Blog.

Low-latency processing, schema registry filtering for Avro and Protobuf, and ESM grouping are available only in provisioned mode. Provisioned mode also removes the requirement to configure AWS PrivateLink VPC endpoints, so you are not charged for those endpoints. To switch an ESM to on-demand scaling, pass an empty configuration:

aws lambda update-event-source-mapping \
--uuid a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \
--provisioned-poller-config '{}'

Cost optimization with provisioned mode

In provisioned mode, ESMs in the same VPC can share Event Poller Unit (EPU) capacity through a common PollerGroupName, letting low-throughput ESMs pack onto shared EPUs instead of each holding dedicated capacity. For details, see Cost optimization for provisioned mode. A poller group supports up to 100 ESMs and 2,000 aggregate maximum pollers.

Queue mode ESMs share EPUs only with other Queue mode ESMs. The two modes autoscale on different signals, and isolation keeps a new Queue mode ESM from destabilizing existing ordered consumers. Use a unique PollerGroupName for your Queue mode ESMs. If you reuse a PollerGroupName across modes, CreateEventSourceMapping returns a validation error.

Handling failures

MaximumRetryAttempts accepts values from 0 to 10,000 and defaults to -1, which retries indefinitely. BisectBatchOnFunctionError splits a batch in half when the function returns an error, isolating a poison-pill record from an otherwise healthy batch. To capture records that exhaust their retries, configure an on-failure destination: a Kafka topic, Amazon Simple Queue Service (Amazon SQS), or Amazon Simple Notification Service (Amazon SNS). ESM logging to Amazon CloudWatch Logs is available for diagnostics.

Key considerations for Queue mode

Keep the following in mind when configuring your event source mapping for Queue mode.

  • Make your function idempoten – Lambda event source mappings process each record at least once, and duplicate processing can occur. See How do I make my Lambda function idempotent in the AWS Knowledge Center.
  • No ordering guarantees – Records can arrive out of order, including records from the same partition.
  • Batching window is not supported – MaximumBatchingWindowInSeconds returns a validation error. The Kafka Share Consumer requires every record in a batch to be acknowledged before fetching new records, which is incompatible with a time-based window.
  • Starting position is not supported – StartingPosition and StartingPositionTimestamp can’t be used. Queue mode reads from the share group’s committed position. To control where a new share group begins reading, configure share.auto.offset.reset on the broker.
  • Event filtering supports up to five filter patterns per event source mapping.

Pricing and availability

Queue consumption mode is available in all AWS Regions where Lambda event source mappings for self-managed Apache Kafka is supported. On-demand mode carries no charge beyond standard Lambda invocation charges. Provisioned mode is billed on EPU usage. For details, see AWS Lambda pricing.

Conclusion

Queue consumption mode brings queue-style processing to Apache Kafka topics without additional infrastructure and without changes to your producers, topic configuration, or function code. By replacing exclusive partition assignment with share groups, it removes the partition count as a ceiling on parallelism and eliminates head-of-line blocking for workloads built on independent records.

To get started, create an event source mapping with ConsumptionMode set to Queue on a self-managed Apache Kafka 4.2 or later cluster. For configuration details, see Polling Kafka queue topics in the AWS Lambda Developer Guide.

For more serverless learning resources, visit Serverless Land.

 


About the authors

Vaibhav Jain

Vaibhav Jain

Vaibhav is a Senior Delivery Consultant at Amazon Web Services, where he leads technical delivery for complex data platform and application modernization engagements. He has over 20 years of experience in application development, including 15 years building large-scale distributed systems before joining AWS.

Hardith Murari

Hardith Murari

Hardith is a Delivery Consultant at Amazon Web Services, focused on application development, modernization, and event-driven architectures. He is driven by a deep interest in cloud infrastructure, distributed systems, and developer tooling, always seeking to improve reliability, scalability, and the overall developer experience on AWS.

Nihar Sheth

Nihar Sheth

Nihar is a Principal Product Manager for AWS Lambda at Amazon Web Services, where he leads product strategy for serverless compute and event-driven integrations. He is passionate about building capabilities that make it easier to create event-driven, highly scalable applications with a focus on developer experience, performance, and operational simplicity.

Optimizing Apache HBase availability on Amazon EMR, Part 1: Coordinator startup, RegionServer recovery, and regions in transition

Post Syndicated from Reekunj Parmar original https://aws.amazon.com/blogs/big-data/optimizing-apache-hbase-availability-on-amazon-emr-part-1-coordinator-startup-regionserver-recovery-and-regions-in-transition/

Running Apache HBase on Amazon EMR gives you a scalable, high-performance NoSQL store, and following well-understood operational patterns can help improve availability. The most common availability conditions each leave a reliable signature. With the right process, you can more efficiently identify the cause and restore the cluster to full health.

This post gives you that repeatable process for three situations you are most likely to meet: an HBase coordinator that is slow to finish initializing, a RegionServer that leaves the cluster, and regions that stay in transition longer than expected. For each one, you learn which web UI pages, commands, and log messages point you to the cause, and which actions can help resolve it.

This is the first post in a two-part series on operating Apache HBase on Amazon EMR.

  • Part 1 (this post) covers the triage framework and availability topics: an HBase coordinator that is slow to start, a RegionServer that leaves the cluster, and AWS Regions that stay in transition (RIT).
  • Part 2 covers performance: diagnosing and tuning compaction, the parameters worth changing, and knowing when to engage AWS Support.

What this post covers:

  • How to restore an HBase coordinator that is slow to start or finish initializing.
  • How to recover a RegionServer that stopped or won’t rejoin the cluster.
  • How to resolve regions that stay in transition (RIT).
  • The tools to diagnose each situation, and when each tool is the right one to reach for.

What this post doesn’t cover:

  • Performance tuning during major compaction (see Part 2).
  • Cluster sizing, schema and row key design, or capacity planning.
  • Backup, restore, snapshot, and disaster recovery procedures.
  • Security configuration such as Kerberos, encryption, and authorization.

This post is written for operations teams, data engineers, HBase administrators, site reliability engineers (SREs), and support engineers. These are the people who operate HBase clusters on Amazon EMR and want a repeatable process for keeping them healthy.

If you’re evaluating whether to run HBase on Amazon EMR, or designing a new cluster, start with the Apache HBase on Amazon EMR documentation and the Amazon EMR best practices guide instead.

Port reference for HBase on Amazon EMR showing the HMaster, RegionServer, and ZooKeeper ports

Figure 1: HBase on Amazon EMR port reference, where 16010 is the HMaster (coordinator) web UI, 16030 is the RegionServer web UI, and 2181 is the ZooKeeper client port

Terminology

Apache HBase names the process that coordinates the cluster HMaster, and Amazon EMR runs it on the primary node. This post refers to it as the HBase coordinator. Names that contain master, such as the hbase-master service and the hbase-hbase-master-*.log log files, appear only in commands and log output, where you need the exact name.

In HBase, a Region is a range of rows in a table, and a RegionServer is the process that serves regions. Neither is related to an AWS Region.

Prerequisites

Before you begin, make sure you have the following access in place:

  • HBase web UI (coordinator on port 16010, RegionServer on port 16030): shows live RegionServers, failed RegionServers, and regions in transition. Reach it through an SSH tunnel or the Amazon EMR persistent application user interfaces.
  • SSH access to the primary and core nodes: needed for logs, the HBase shell, and every Level 2 and Level 3 step. See Connect to the primary node using SSH.
  • Read access to /var/log and the Amazon S3 log URI: covers coordinator, RegionServer, ZooKeeper, and Hadoop Distributed File System (HDFS) logs. The Amazon Simple Storage Service (Amazon S3) copy matters when a node has been replaced.
  • Permission to run the HBase shell as the hbase user: use sudo -u hbase hbase shell to keep file ownership consistent.

This post assumes you are familiar with the following:

  • Amazon EMR architecture (primary, core, and task nodes).
  • HBase components (the coordinator process, RegionServers, ZooKeeper, write-ahead log (WAL), MemStore, HFiles, and the hbase:meta table).
  • Your storage mode (HDFS or Amazon S3).
  • Common Linux command line tools.

Before you start, confirm your Amazon EMR release and storage mode:

grep -A2 "hbase.rootdir" /etc/hbase/conf/hbase-site.xml

An s3:// or s3a:// value means you are running HBase on Amazon S3. Log paths, default values, and the correct repair tool all depend on your release and storage mode.

Three levels of troubleshooting

Start with the checks that need the least access, and move to the next level only if you need more information.

  • Level 1 (read-only checks): Web UI, shell commands, and console events. Safe to run anytime, with no cluster impact.
  • Level 2 (intermediate diagnostics): Log analysis, process inspection, and disk and memory checks. Still non-destructive, but requires SSH access.
  • Level 3 (advanced intervention): Thread dumps, heap analysis, and HBCK2 repairs. These can change cluster state, so take a snapshot first and change one thing at a time.
HBase availability triage decision tree branching into three situations, each passing through Level 1, Level 2, and Level 3 gates

Figure 2: HBase availability triage decision tree, where each of the three situations flows through a Level 1 read-only gate, a Level 2 diagnostics gate, and a Level 3 intervention gate before you engage AWS Support

Restore an HBase coordinator that is slow to start

The HBase coordinator runs on the Amazon EMR primary node and handles region assignments, RegionServer health monitoring, and failover. While the coordinator in your HBase cluster initializes, your RegionServers keep serving the regions they already host, so your clients can continue to read from and write to those regions. Until the coordinator finishes initializing, your HBase cluster can’t start new work, such as reassigning regions or recovering from a RegionServer loss. You also can’t run administrative operations such as creating a table. Your goal is to bring it to a fully initialized state quickly.

A coordinator that is slow to finish starting usually points to one of these areas: HDFS, the Java virtual machine (JVM), ZooKeeper, Amazon S3 throttling, or a known Apache HBase behavior already addressed in a later release.

Step 1 (Level 1): Confirm the current state

These checks are read-only.

  • Check the HBase web UI on port 16010. If it loads, the coordinator process is running. A coordinator that is running but reports Initializing for a long time usually means the coordinator cannot assign hbase:meta. You troubleshoot this situation differently from one where the coordinator is not running at all.
  • Check cluster status from the shell:
    sudo -u hbase hbase shell
    hbase> status 'simple'
    hbase> status 'detailed'

    If this returns a PleaseHoldException, the coordinator is running but has not finished initializing. If no coordinator is found, go to Level 2.

  • Identify the active coordinator (on a cluster with multiple primary nodes):
    sudo -u hbase hbase zkcli get /hbase/master

  • Review cluster events and the Amazon EMR console. Note when the coordinator stopped responding, and whether an instance event, scaling action, or configuration change lines up with it.

Step 2 (Level 2): Check the process, ports, and resources

This helps you tell “the coordinator is not running” apart from “I cannot reach the coordinator”:

sudo ss -lntp | grep -E "16000|16010|2181"

# Amazon EMR 6.x and 7.x (systemd)
sudo systemctl status hbase-master
sudo journalctl -u hbase-master --since "1 hour ago" | tail -50

# Confirm the JVM exists
sudo jps -l | grep -i master

A process ID (PID) that changes each time you check tells you the coordinator is restarting repeatedly. That is a useful signal, because the explanation sits at the end of each log cycle.

  • Find the first error in the coordinator log (hbase-hbase-master-*.log):
    grep -n -E "ERROR|FATAL|WARN" /var/log/hbase/hbase-hbase-master-*.log | head -40

  • Check resources. A full disk on the primary node often causes this problem, so check disk usage early:
    df -h / /mnt /emr
    free -m
    top -b -n1 | head -20

  • Search for known log signatures. See the Quick reference table at the end of this post.

Log locations (see View Amazon EMR log files):

  • HBase logs are in /var/log/hbase/.
  • ZooKeeper logs in /var/log/zookeeper/.
  • HDFS logs in /var/log/hadoop-hdfs/.
  • Archived copies are in /mnt/var/log/ and in the Amazon S3 log URI under <cluster-id>/node/<instance-id>/applications/hbase/.

Confirm the paths with ls /var/log on your cluster, because they have varied across releases.

Step 3 (Level 3): Inspect a coordinator that is running but not yet progressing

When the coordinator is running but has not yet made progress, and the log hasn’t pointed you to a cause, SSH into the primary node for a deeper look.

  • Take a thread dump of the coordinator. Capture the process ID first:
    COORD_PID=$(sudo jps -l | grep -i master | awk '{print $1}')
    sudo -u hbase jstack -l "$COORD_PID" > /tmp/hbase-coordinator-jstack-$(date +%s).txt

    Look for BLOCKED threads, threads named ProcedureExecutor, and any deadlock section.

  • Check heap pressure:
    # Check heap usage without pausing the JVM; confirms whether memory pressure is destabilizing the coordinator
    sudo -u hbase jcmd "$COORD_PID" GC.heap_info
    
    # Capture a full heap dump for offline analysis; use only when GC pressure is confirmed.
    # Pauses the JVM while the file is written.
    sudo -u hbase jmap -dump:format=b,file=/tmp/hbase-coordinator-heap-$(date +%s).hprof "$COORD_PID"

Heap dumps are expensive. A full heap dump with jmap -dump pauses the JVM for as long as it takes to write the file. The jmap -histo:live command also pauses the JVM, because the :live option forces a full garbage collection before it builds the histogram. On a large coordinator heap, that pause can be noticeable, so treat jmap -histo:live as a Level 3 action. The jcmd GC.heap_info check shown earlier doesn’t pause the JVM.

HDFS and the NameNode

In HDFS storage mode, the coordinator doesn’t finish initializing until HDFS is fully available:

hdfs dfsadmin -safemode get
hdfs dfsadmin -report | head -20
hdfs fsck /user/hbase -files -blocks | tail -40

Check the NameNode logs in /var/log/hadoop-hdfs/. On clusters with multiple primary nodes, also check the standby NameNode. Check the DataNodes for missing blocks or full disks as well.

Log signatures to look for include SafeModeException, BlockMissingException, cannot obtain block length for LocatedBlock, and NoRouteToHostException. Resolve HDFS first, then restart the coordinator.

JVM and garbage collection

The coordinator runs as a JVM, so garbage collection (GC) pauses can cause it to lose its ZooKeeper session and trigger a failover:

grep -E "JvmPauseMonitor|Detected pause in JVM" /var/log/hbase/hbase-hbase-master-*.log | tail -20

Occasional sub-second pauses are normal. Repeated multi-second pauses are what to address. If the heap is undersized, raise the coordinator heap through the hbase-env configuration classification, and review the GC log configuration in /etc/hbase/conf/hbase-env.sh. Treat repeated failovers caused by pauses as a capacity signal.

ZooKeeper

HBase uses Apache ZooKeeper for coordinator election, RegionServer registration, and startup coordination, so a ZooKeeper condition often affects several components at once:

grep -E "SessionExpired|ConnectionLoss|KeeperErrorCode|Client session timed out|has no quorum" \
/var/log/hbase/hbase-hbase-master-*.log /var/log/zookeeper/*.out | tail -30

Inspect the HBase znodes if needed:

sudo -u hbase hbase zkcli ls /hbase
sudo -u hbase hbase zkcli ls /hbase/rs

Resolve the ZooKeeper condition before you restart the coordinator.

Warning: Don’t delete HBase znodes. Removing /hbase or its children can discard the region assignment state that HBase needs in order to recover, which makes recovery significantly harder. Engage AWS Support if you need help with the HBase ZooKeeper state.

Amazon S3 request throttling

This section applies to HBase on Amazon S3 only. If the coordinator log shows the following, Amazon S3 is throttling your requests:

java.io.IOException: Slow Down (Service: Amazon S3; Status Code: 503; Error Code: 503 Slow Down)

Step 1: Confirm it is throttling by counting occurrences rather than reacting to a single line:

grep -c "Slow Down" /var/log/hbase/hbase-hbase-master-*.log
grep -E "503 Slow Down|500 Internal Error|AmazonS3Exception" \
/var/log/hbase/hbase-hbase-*.log | awk '{print $1, $2}' | uniq -c | tail -20

Step 2: Increase the EMRFS retry limit. By default, EMRFS uses an exponential backoff strategy and retries Amazon S3 requests up to 15 times. Raise the limit through the emrfs-site configuration classification:

[
  {
    "Classification": "emrfs-site",
    "Properties": {
      "fs.s3.maxRetries": "30"
    }
  }
]

For large clusters, you can instead turn on the additive-increase/multiplicative-decrease (AIMD) retry strategy. It’s supported on Amazon EMR releases 6.4.0 and later, and it adapts the request rate based on recent successful requests. For details on both strategies, see Retry Amazon S3 requests with EMRFS. A higher retry limit helps during short periods of throttling. If throttling is continuous, additional retries convert errors into latency, so also reduce the request rate as described in Step 3.

Step 3: Reduce or spread the request rate. Lower compaction pressure (covered in Part 2 of this series). Make sure the local block cache is working so that reads don’t go to Amazon S3 unnecessarily, and spread load across prefixes. See Resolve HTTP 503 “Slow Down” AmazonS3Exception in Amazon EMR and Best practices design patterns: optimizing Amazon S3 performance.

Check whether a later release includes a fix

Before you begin a deep investigation, check whether your symptom is a known bug already fixed in a later release. Read the “Changes, enhancements, and resolved issues” section of the Amazon EMR release guide for releases after yours. Then search for the exact exception in the Apache HBase JIRA. Search for the exception class and the stack trace, because many different causes can produce the same symptom.

Keep RegionServers healthy and recover them quickly

RegionServers host the regions that serve client reads and writes. If a RegionServer leaves your cluster, you are responsible for confirming that the HBase coordinator on your primary node moved that server’s regions to your remaining RegionServers, finding out why the server left, and taking steps to prevent a repeat. Read the coordinator log before the RegionServer log, because the coordinator records why it marked the server as gone, and that is the most direct path to the root cause.

Recover a RegionServer that stopped or won’t rejoin the cluster

Step 1 (Level 1): In the HBase web UI, compare the live and failed RegionServer lists against the number of core nodes you expect. Run status 'detailed' to see which server stopped reporting, so you know exactly where to focus.

Step 2 (Level 2): Read the coordinator log first:

grep -E "ABORTING|YouAreDeadException|ClockOutOfSyncException|ServerCrashProcedure|expired" \
/var/log/hbase/hbase-hbase-master-*.log | tail -40

A RegionServer writes ABORTING to its log when it shuts itself down after a fatal error. A YouAreDeadException means the ZooKeeper session expired, usually because of a GC pause. A ClockOutOfSyncException means there is time skew between nodes, so check the time service.

Then read that server’s own log on the core node:

grep -E "ERROR|FATAL|ABORTING|Detected pause in JVM" \
/var/log/hbase/hbase-hbase-regionserver-*.log | tail -40

In HDFS mode, check the DataNode for missing blocks or failed volumes. Check the node itself:

df -h
free -m

Check WAL splitting progress. Slow WAL splitting can make recovery appear to stall after a RegionServer is lost:

grep -E "SplitWALManager|SplitLogManager|WALSplitter|Error splitting" \
/var/log/hbase/hbase-hbase-master-*.log | tail -30

Use the canary tool to confirm which tables and regions are affected, instead of inferring it from client errors:

sudo -u hbase hbase canary            # one read per region, all tables
sudo -u hbase hbase canary my_table   # narrow to one table

The canary tool writes its results to the console, including each region that it couldn’t read, and saves a log of the results to /var/log/hbase/hbase.log.

Resolve regions that stay in transition (RIT)

A region enters transition state when your HBase cluster opens, closes, splits, or merges the region. HBase typically completes these transitions in seconds as part of normal cluster operations. If a region stays in transition for more than a few minutes, it is worth a closer look. One of these situations typically explains it:

  • A split was in progress when the RegionServer restarted.
  • A ZooKeeper session change occurred partway through.
  • The RegionServer JVM paused for GC, so the transition didn’t complete.
  • A coordinator failover happened during the transition.

Work through the following steps in order.

Step 1 (Level 1): Confirm it is still in transition. Check the UI and note the region, the duration, and the owning procedure from the Procedures and Locks page, or run list_procedures. If the procedure is RUNNABLE and its state changes between checks, let it finish.

Step 2 (Level 2): Find what is blocking it:

grep -E "RegionStateNode|TransitRegionStateProcedure|Unexpected state|holding-pattern" \
/var/log/hbase/hbase-hbase-master-*.log | tail -40

Inspect and report region and meta inconsistencies

If the region is still in transition, inspect and report inconsistencies before you attempt any repair.

Step 1 (Level 1): Confirm without changing anything. Open the HBCK Report tab in the HBase web UI (HBase 2.1.6 and later, at /hbck.jsp). Check the Regions in Transition list and the Procedures and Locks page. Confirm the table state:

hbase> describe 'my_table'
hbase> list_procedures

Step 2 (Level 2): Report the inconsistency. For Amazon EMR 6.x and 7.x (HBase 2.x), use HBCK2 in report mode through bin/hbase with the -j option.

Note: The HBCK2 jar path and version shown in the following commands are examples. Before you run these commands, verify the actual jar location and version on your cluster with find / -name "hbase-hbck2*.jar" 2>/dev/null.

# Report only: does not change anything
sudo -u hbase hbase hbck -j /usr/lib/hbase-operator-tools/hbase-hbck2-1.2.0.jar \
reportMissingRegionsInMeta default:my_table

sudo -u hbase hbase hbck -j /usr/lib/hbase-operator-tools/hbase-hbck2-1.2.0.jar \
extraRegionsInMeta default:my_table

For Amazon EMR 5.x (HBase 1.x), use sudo -u hbase hbase hbck -details to report state. Don’t run HBCK1 repair commands against Amazon EMR 6.x or 7.x clusters. HBCK1’s write facility (-fix) has been removed, and its assessments of an HBase 2.x cluster are inaccurate because it doesn’t understand the internal workings of HBase 2.x.

Step 3 (Level 3): Apply a targeted fix. If a region is unassigned, use HBCK2 assigns. If a procedure is holding a lock, use HBCK2 bypass. Take a snapshot first, and change one thing at a time.

Step 4 (Level 3): Escalate. If clearing znodes looks like the answer, open a case with AWS Support instead. Have your thread dumps, coordinator log extract, procedure IDs, and encoded region names ready.

Quick reference: Log signatures

Search for the first occurrence of a signature. The first error usually identifies the cause:

grep -m1 -n "Detected pause in JVM" /var/log/hbase/hbase-hbase-master-*.log
Log signature What it means Where to look next
SafeModeException HDFS is in safe mode Resolve HDFS. Check the NameNode logs
BlockMissingException Missing HDFS blocks Run hdfs fsck. Check the DataNodes
SessionExpired / ConnectionLoss ZooKeeper session lost Check the ZooKeeper logs and GC pauses
YouAreDeadException The RegionServer’s ZooKeeper session expired GC pause or network partition
ClockOutOfSyncException Time skew between nodes Check the Network Time Protocol (NTP) or time service
503 Slow Down Amazon S3 request throttling Increase EMRFS retries. Spread prefixes
JvmPauseMonitor / Detected pause in JVM GC pause Check heap sizing. Review the GC logs
PleaseHoldException The coordinator has not finished initializing Wait. Check whether hbase:meta can be assigned

Conclusion

In this post, you learned a repeatable way to keep Apache HBase on Amazon EMR highly available by resolving three common situations: a coordinator that is slow to initialize, a RegionServer that leaves the cluster, and regions that stay in transition. Start with the read-only Level 1 checks, use Level 2 log analysis to confirm the cause, and reach for the Level 3 tools only after you’ve confirmed it. Take a snapshot first and make one change at a time.

Part 2 of this series covers slow reads and writes caused by compaction: how to confirm that compaction is the cause, which parameters to tune first, and when to contact AWS Support.

Next steps:

  • Read Part 2 of this series for compaction tuning and guidance on when to contact AWS Support.
  • Review the HBase guidance in the Amazon EMR best practices guide.

 


About the authors

Reekunj Parmar

Reekunj Parmar

Reekunj is a Senior Technical Account Manager at Amazon Web Services, focused on Data Analytics. He works with customers to design and architect solutions based on Analytics services in their enterprise cloud environments. With more than 10 years of experience in Analytics, Reekunj helps organizations build secure, resilient architectures.

Ishan Sharma

Ishan Sharma

Ishan is a Cloud Support Engineer at Amazon Web Services and an Amazon EMR subject matter expert. He specializes in helping enterprise customers troubleshoot, optimize, and architect solutions across Amazon EMR and big data technologies. Ishan works closely with organizations to design and operate reliable, high-performance data processing workloads in the cloud.

Ram Nethi

Ram Nethi

Ram is a Senior Solutions Architect at Amazon Web Services, specializing in generative AI, agentic AI architectures, big data, cloud migrations, and application modernization. He guides enterprise and strategic customers across industry domains from legacy environments to production-ready AI workloads on AWS, designing scalable solutions that span infrastructure, DevOps automation, cybersecurity, and end-to-end cloud-native architectures.

Observing AWS Lambda durable functions with the Durable Execution Telemetry Exporter

Post Syndicated from Pooya Paridel original https://aws.amazon.com/blogs/compute/observing-aws-lambda-durable-functions-with-the-durable-execution-telemetry-exporter/

A durable function is an AWS Lambda function that might run for minutes, days, or even up to a year. You build these functions with the Durable Execution SDK, which provides operations such as steps, waits, and parallel. A single durable execution might be spread across many Lambda invocations, with waits and retries in between. So observing a durable execution, made of many invocations, needs different tools. The question that you want answered is rarely “what did this invocation do?” It’s “how far did my durable execution get, which step failed, how many times did it retry, and how long did the whole thing take?”

After you run thousands of executions, the questions widen from one execution to all of them. Some questions are operational. Which step fails most often, and with which error? Which step causes the most retries? Did a step get slower after last week’s deployment? Other questions are about the business the workflow runs. Which customers did last night’s payment failures affect? How long does each manual approval step take? Of the orders that started, how many reached the payment step, and where did the rest stop? Answering these questions needs per execution telemetry data that includes relevant data such as status, timing, steps, and the input and output fields that you choose to emit.

Traditional Lambda observability works well for a single invocation. Lambda writes a log stream per invocation, so a durable execution that suspends four times writes to four separate log streams, interleaved with every other concurrent execution. Amazon CloudWatch metrics tell you the function’s error rate, but not which of your workflow’s steps is responsible. Distributed tracing, such as AWS X-Ray or OpenTelemetry, shows the timing of one execution. It isn’t built to answer questions across many executions, such as which step failed most often this week. For that, you need one queryable record per execution.

Today we’re introducing the Durable Execution Telemetry Exporter, an observability plugin for AWS Lambda durable functions. We’re also introducing the Durable Execution Telemetry MCP server, a Model Context Protocol (MCP) server that lets an AI coding agent query the telemetry data. The exporter is open source for TypeScript, Python, Java, and Go, in each language’s Durable Execution SDK repository. AWS provides the MCP server as open source in the aws-durable-execution-sdk-js repository.

With a one-line configuration change, you get a record of each execution, with every step, wait, callback, and invoke, including timing, retry attempts, status, and errors. The exporter delivers it to a destination you choose. There’s no custom instrumentation to write and no separate agent to run.

How the durable execution telemetry exporter works

The Durable Execution Telemetry Exporter is a plugin for the durable execution SDK. It runs inside your Lambda function, in the same process as your handler, and subscribes to the SDK’s instrumentation lifecycle. It doesn’t run in your request path.

On every invocation of a durable execution, the plugin builds a cumulative snapshot of that execution, rather than a delta or per-invocation view. Because the durable execution SDK replays your handler from the beginning on each resume and the SDK passes the checkpointed state to the plugin, the plugin can reconstruct the whole execution so far from any invocation. That snapshot is a single JSON document called a DurableExecutionTelemetryRecord:

{
  "recordType": "DurableExecutionTelemetry",
  "schemaVersion": "1.0",
  "executionArn": "arn:aws:lambda:us-east-1:111122223333:function:order-processor:$LATEST/durable-execution/abc123/inv456",
  "executionName": "abc123",
  "functionName": "order-processor",
  "status": "SUCCEEDED",
  "startTime": "2026-06-16T17:00:22.100Z",
  "endTime": "2026-06-16T17:00:27.514Z",
  "durationMs": 5414,
  "input": { "orderId": "order-12345", "customerId": "cust-789" },
  "output": { "orderId": "order-12345", "status": "completed", "charged": 99.99 },
  "operations": [
    { "name": "validate-order",  "type": "STEP", "status": "SUCCEEDED", "durationMs": 250 },
    { "name": "check-inventory", "type": "STEP", "status": "SUCCEEDED", "durationMs": 350 },
    { "name": "cool-down",       "type": "WAIT", "status": "SUCCEEDED", "durationMs": 5000 },
    { "name": "charge-payment",  "type": "STEP", "status": "SUCCEEDED", "durationMs": 80 }
  ]
}

Each record is complete on its own. One row in a table is one durable execution, which means the questions you ask (slowest step, most-retried step, executions that failed after the payment step) become ordinary queries instead of requiring you to correlate logs across streams.

Getting started

Install the plugin alongside the durable execution SDK:

npm install @aws/durable-execution-sdk-js-telemetry-exporter

Then pass it to withDurableExecution:

import { DurableContext, withDurableExecution } from "@aws/durable-execution-sdk-js";
import { durableExecutionTelemetry } from "@aws/durable-execution-sdk-js-telemetry-exporter";

const handler = async (event: OrderEvent, context: DurableContext) => {
  const order = await context.step("validate-order", async () =>
    validateOrder(event.orderId),
  );

  const inventory = await context.step("check-inventory", async () =>
    reserveInventory(order),
  );

  await context.wait({ seconds: 30 });

  return await context.step("charge-payment", async () =>
    chargeCustomer(order, inventory),
  );
};

export const lambdaHandler = withDurableExecution(handler, {
  plugins: [durableExecutionTelemetry({})],
});

That is the entire integration. With no configuration, the default LambdaLogExporter writes records as JSON to your function’s own CloudWatch log group. You don’t need to create any infrastructure or grant additional AWS Identity and Access Management (IAM) permissions, because your function already writes its own logs. You can query the result immediately with Amazon CloudWatch Logs Insights:

fields executionName, status, durationMs
| filter recordType = "DurableExecutionTelemetry" and status = "FAILED"
| sort durationMs desc

Choosing where records go

The plugin includes 13 destination exporters so you can send records where they are useful:

Destination Exporter Good for
Function’s own log group LambdaLogExporter Getting started, zero setup
Any CloudWatch log group CloudWatchLogsExporter Centralizing records across functions
Amazon Simple Storage Service (Amazon S3) S3Exporter Amazon Athena SQL, long-term retention
Amazon DynamoDB DynamoDBExporter Fast lookup by execution, live dashboards
Amazon Aurora AuroraExporter Joining workflow data with business data
Amazon Redshift RedshiftExporter Large-scale cross-function analytics
Amazon OpenSearch Service OpenSearchExporter Full-text search, dashboards
Amazon EventBridge EventBridgeExporter Alerting and remediation on failure
Amazon Data Firehose FirehoseExporter Fan-out to S3, Splunk, or third parties
Amazon Simple Queue Service (Amazon SQS) SQSExporter Decoupled downstream processing
Any OTLP endpoint OTelExporter Third-party observability platforms
Any HTTPS endpoint HttpExporter Custom backends and webhooks
Filesystem or Amazon Elastic File System (Amazon EFS) FileExporter Local development, EFS persistence

The plugin sends records to all configured exporters in parallel. This allows you to route data to different stores based on their characteristics, such as using a fast store for real-time lookups and a less expensive, high-capacity store for long-term storage:

import {
  durableExecutionTelemetry,
  S3Exporter,
  DynamoDBExporter,
  EventBridgeExporter,
} from "@aws/durable-execution-sdk-js-telemetry-exporter";

const telemetry = durableExecutionTelemetry({
  emitMode: "on-complete",
  samplingRate: 1.0,
  exporters: [
    new S3Exporter({ bucket: string }), // Use valid bucket name you own
    new DynamoDBExporter({ tableName: "durable-execution-telemetry-live" }),
    new EventBridgeExporter({}),
  ],
});

With the S3 exporter, the plugin writes records under Hive-style partitions (year=YYYY/month=MM/day=DD/) that an AWS Glue crawler discovers automatically, so Athena queries work without additional modeling:

SELECT op.name, COUNT(*) AS failures, AVG(op.durationms) AS avg_ms
FROM durable_execution_telemetry
CROSS JOIN UNNEST(operations) AS t(op)
WHERE status = 'FAILED' AND year = '2026' AND month = '06'
GROUP BY op.name
ORDER BY failures DESC;

Controlling frequency and content

Three settings govern what a production deployment costs and exposes.

emitMode determines when the plugin sends a record. The default, on-complete, emits once when an execution reaches SUCCEEDED or FAILED. Use on-failure for the lowest overhead when you only care about errors, or on-change when you want to watch executions progress in near real time.

samplingRate reduces frequency. The plugin derives the sampling decision from a hash of the execution ARN. The execution ARN is stable across replays, so the decision is deterministic: a sampled-in execution emits all of its records, and a sampled-out execution emits none. You never receive a half-recorded workflow.

content controls what leaves your function. By default, the plugin includes execution input and output as-is, which is convenient in development and often unacceptable in production. Pass a transform to redact:

const telemetry = durableExecutionTelemetry({
  samplingRate: 0.1,
  content: {
    input: (event) => ({ orderId: event.orderId }),
    output: (result) => ({ status: result.status }),
  },
});

Each destination supports different payload sizes: CloudWatch Logs events at 256 KB, DynamoDB items at 400 KB. Each exporter has a maxRecordSizeBytes, and when a record exceeds it the plugin truncates for one destination without affecting other destinations: operation results first, then whole operations oldest-first, then execution input and output last. The plugin never drops identity and timeline fields, and it marks a trimmed record truncated: true, so a truncated record is always distinguishable from a complete one. We recommend using content transforms to bound payloads deliberately rather than relying on truncation.

Querying execution history from an AI agent

Answering “why did last night’s batch fail” requires knowing which data store you configured, which query dialect it uses, and what the record schema looks like. DynamoDB PartiQL, Athena’s Trino SQL, Aurora PostgreSQL, Amazon Redshift, OpenSearch, and CloudWatch Logs Insights all differ.

The Durable Execution Telemetry MCP server removes that requirement. It’s a local stdio server that exposes your configured destination to any MCP-capable agent, including Kiro, Claude Code, and Cursor. Add it with one command:

kiro-cli mcp add \
  --name durable-telemetry \
  --command npx \
  --args "-y,@aws/durable-execution-sdk-js-telemetry-mcp" \
  --env DURABLE_TELEMETRY_DESTINATION_TYPE=dynamodb \
  --env DURABLE_TELEMETRY_DYNAMODB_TABLE_NAME=durable-execution-telemetry-live \
  --env DURABLE_TELEMETRY_REGION=us-east-1 \
  --scope workspace

Configuration is environment-only and credentials come from the standard AWS SDK provider chain, so there’s no state file and no secret. The server exposes five tools:

  • test_destination runs read-only connectivity checks. If a required variable is unset, it names the exact variable and returns without making any AWS call.
  • describe_schema returns the record schema, query dialect, and row cap for whichever destination is configured. Agents should call this before writing a query.
  • list_executions filters by status, function name, and time range with no query language involved. This handles most questions.
  • get_execution fetches one record by execution ARN.
  • query handles questions the filters cannot express.

You ask a question and the agent picks the tools:

Which steps in order-processor failed most often in the last 24 hours, and what was the average retry count?

On the SQL destinations, write each query as a SELECT statement, or as a WITH statement that ends in a SELECT. These are the only forms the server runs. It checks a query before it makes any AWS call, so a statement that would change data never reaches your destination. On the CloudWatch Logs destinations, the Logs Insights query language has no statements that write data. So every query through the server is read-only.

Best practices and considerations

Choose operationDetail deliberately. The default, top-level, records only top-level operations and produces the same set of operations no matter when a record is emitted. full-tree includes children of contexts such as map items and parallel branches, but by default the durable execution backend prunes finished contexts’ children from the state passed to later invocations. To keep the full tree across a suspend and resume, also set pluginsConfig.childOperationsDepth on withDurableExecution. That preservation has a cost: it forces a replay pass over each preserved context on resume, so enable only the depth you need.

Choose operation names that your destination can query. The plugin uses names verbatim as keys and identifiers and never sanitizes them. A . in a name is a field-path separator in CloudWatch Logs Insights and OpenSearch. Letters, digits, -, and _ are portable everywhere.

Understand what the plugin cannot see. The Durable Execution Telemetry Exporter runs inside your function, so it can only emit records when your function is invoked. Terminal states that originate in the Lambda service without an invocation never reach the plugin: STOPPED from a manual stop, and TIMED_OUT when the execution timeout is exceeded. For complete lifecycle coverage, subscribe to Lambda durable execution lifecycle events on the default Amazon EventBridge bus and update your destination from a small handler:

{
  "source": ["aws.lambda"],
  "detail-type": ["Lambda Durable Execution State Change"],
  "detail": { "status": ["STOPPED", "TIMED_OUT"] }
}

Account for the cost of the destination. The plugin adds at most one export each time it emits a record, because it sends only the latest of any updates that pile up. Each record is a complete snapshot, and the latest supersedes all earlier ones. If updates arrive faster than an exporter can handle, the plugin drops the intermediate snapshots. The charges that matter are the ones your destination incurs: CloudWatch Logs ingestion, DynamoDB writes, Aurora capacity, and so on. Combine samplingRate and emitMode to control them.

Conclusion

The Durable Execution Telemetry Exporter gives AWS Lambda durable functions an observability model that matches how they run: one complete record per execution, sent to a destination that fits your team. The Durable Execution Telemetry MCP server lets an AI agent answer questions against that data directly.

To get started with durable functions, see the AWS Lambda Developer Guide. For the plugin’s full exporter reference, configuration options, and an AWS Cloud Development Kit (AWS CDK) stack that deploys every destination for testing, see the package README.

 


About the author

Pooya Paridel

Pooya Paridel

Pooya, Senior Software Development Engineer at AWS, has over 25 years of software development experience, including more than 7 years at AWS specializing in AWS Step Functions and Lambda Durable Functions. Before shaping the serverless developer experience for Amazon Web Services, he spent years designing high-impact software across entirely different domains, including real-time financial trading engines, stock exchange platforms, Internet of Things (IoT) systems, and CRM applications for real estate.

How Revinate accelerated API adoption with Amazon API Gateway

Post Syndicated from Abe Raghib original https://aws.amazon.com/blogs/architecture/how-revinate-accelerated-api-adoption-with-amazon-api-gateway/

Accelerating API adoption while reducing operational overhead is a challenge that every growing organization faces. For Revinate, a hospitality provider serving over 12,500 hotels worldwide and powering more than 1.25 billion guest profiles, Amazon API Gateway became the foundation of their solution.

Revinate empowers hoteliers to connect directly with guests at every touchpoint, driving $24 billion in lifetime direct revenue through an AI-powered Customer Data Platform (CDP) that helps reduce reliance on online travel agencies (OTAs) and deliver data-driven insights.

With the expansion of CDP capabilities, Revinate needed to expose rich guest data through APIs, so that hotel properties and partners can programmatically access guest profiles, reservation data, and other critical hospitality information.

This post explores how Revinate used Amazon API Gateway and the newly released Amazon API Gateway Portal to create a scalable, secure, and developer-friendly API program.

Business need: Evolving API infrastructure to match growth

As Revinate expanded its CDP capabilities and began exposing guest profile and reservation data through APIs, the limitations of managing API infrastructure in-house became clear. Each new partner integration required manual provisioning, custom security configuration, and ongoing maintenance. The team needed an API gateway solution that could scale with growing partner demand without adding operational burden. Rather than building and maintaining a self-hosted solution, Revinate wanted an approach that would open up engineering time, streamline partner integrations, and align infrastructure costs with actual usage. The team identified four key business drivers:

  • Operational efficiency and agility – Accelerate API deployment cycles and reduce time spent on infrastructure maintenance so the engineering team can focus on building features that directly serve customers.
  • Faster partner and developer onboarding – Helping external developers and partners to discover and adopt Revinate’s APIs required a faster, more self-service experience.
  • Growth aligned costs – Infrastructure costs needed to scale proportionately with revenue generation. An on-demand pricing model, where costs flex with actual API usage rather than fixed overhead, was essential to support sustainable growth. Equally important was the ability to attribute API costs per consumer, enabling transparent cost allocation across hotel properties and partners.
  • Enhanced security and compliance – API security controls including authentication, authorization, rate limiting, and threat protection. Meeting compliance requirements and maintaining customer trust demanded strong security without adding complexity to the development workflow or requiring the team to build and maintain custom security infrastructure.

These requirements shaped the team’s evaluation of available solutions.

Evaluating alternatives

When evaluating API gateway solutions, the team translated the business drivers into four core technical requirements. On-demand pricing was essential to align infrastructure costs with actual API usage and enable per-consumer cost attribution. Authentication federation allows integration with Revinate’s existing identity provider, so partners can onboard faster without building custom auth infrastructure. Rate limiting was needed to protect backend services and enforce fair usage across hotel properties and partners as the API program scales. Finally, strong security, including threat protection, audit logging, and access controls, was required to meet compliance requirements for protecting sensitive guest data.

The engineering team evaluated three approaches. Each approach came with distinct tradeoffs across cost, flexibility, and operational burden.

Self-managed API management

Deploying a self-managed API gateway would provide flexibility and avoid licensing fees, but requires ongoing infrastructure management, security patching, scaling, and monitoring. The team would also need to build a custom developer portal from scratch.

Custom-built

Building a proprietary API gateway tailored to Revinate’s exact needs offers maximum control but demands significant upfront development investment and ongoing maintenance. Every capability, including routing, authentication, rate limiting, and documentation, would need to be built and maintained in-house, diverting engineering resources from core hospitality platform features.

Enterprise API management platforms

Enterprise platforms offer comprehensive out-of-the-box features, but introduce vendor dependencies, higher costs, and fixed-term licensing models where costs misalign with revenue growth.

All three approaches shared a common drawback: they would divert resources, whether engineering time, budget, or both, toward capabilities that don’t differentiate Revinate’s product, delaying time-to-market for features that directly serve hotel customers.

The solution: Amazon API Gateway with Developer Portal

Revinate needed the comprehensive capabilities of an enterprise API management platform without the fixed-term licensing, vendor dependencies, and operational overhead. Amazon API Gateway, combined with the newly released Amazon API Gateway Portal, delivered exactly that, aligning with both the technical requirements and business objectives that shaped the evaluation.

Fully managed infrastructure

Amazon API Gateway removes the need to manage underlying infrastructure, so the engineering team can focus on the core hospitality solution rather than API gateway operations.

Native AWS integration

Amazon API Gateway provides native integration with other AWS services, including Amazon Elastic Kubernetes Service (Amazon EKS) for backend services and AWS Lambda authorizers for federated authentication with an external identity provider. This allows Revinate to authenticate API consumers against the existing identity provider infrastructure with minimal development effort.

Infrastructure as code with Terraform

The team maintains strict infrastructure-as-code practices, using Terraform exclusively for all production deployments. The AWS provider for Terraform enables defining the Amazon API Gateway configuration, including REST APIs, stages, usage plans, and authorizers as version-controlled code. This approach verifies consistency across environments, enables peer review of infrastructure changes, and provides complete audit trails for compliance requirements. The declarative nature of Terraform enables rapidly iterating on the API Gateway configuration during development while maintaining confidence in production deployments.

Cost-effective pay-per-use model

Amazon API Gateway’s pay-per-use pricing model aligned perfectly with Revinate’s growth strategy. During the initial rollout phase, costs remained minimal and scaled naturally as new API consumers onboarded. Usage plans allow Revinate to track and attribute costs per consumer, providing clear visibility into which hotel properties and partners drive API usage. This per-consumer cost attribution, combined with tiered pricing that scales from tens to hundreds of customers, replaced fixed annual licensing fees that required upfront investment regardless of actual usage.

Managed Developer Portal

The November 2025 release of Amazon API Gateway Portal provided a fully managed, AWS-native Developer Portal that served as the central hub for API discovery, documentation, and governance. This removes months of custom development work that building a comparable solution would require.

Developers can use the managed portal to:

  • Set up a branded Developer Portal in minutes rather than months.
  • Provide hotel property developers with self-service API discovery and interactive documentation.
  • Maintain centralized control over API documentation freshness and access governance.
  • Deliver a professional developer experience that accelerates customer onboarding from weeks to days.

Strong security

API Gateway provides built-in security features that meet stringent requirements for protecting sensitive guest data:

  • OAuth2 client credentials for machine-to-machine (M2M) authentication.
  • Authorization logic using AWS Lambda authorizers integrating with an external identity provider of choice.
  • Request throttling and quota management to prevent abuse.
  • Integration with AWS WAF and Amazon CloudFront for layered protection against common web exploits and DDoS threats.
  • Comprehensive audit logging through AWS CloudTrail for compliance and access tracking.
  • Real-time observability through Amazon CloudWatch metrics and dashboards, with support for streaming to third-party observability platforms.

Architecture overview

The solution uses a modern, scalable AWS architecture designed to serve hotel properties globally. Hotel properties access the platform as API consumers through Amazon CloudFront for edge caching and low-latency responses, with AWS WAF providing comprehensive protection against common web threats and bots. Requests flow through Amazon API Gateway, which serves as the unified entry point for API operations. Lambda authorizers handle authentication and authorization by integrating with an identity provider (IdP) to provide secure, token-based access control for each request. After authentication, API Gateway routes traffic to backend services running on Amazon EKS, providing the flexibility and scalability needed for containerized microservices. The EKS application layer orchestrates requests to the Customer Data Platform.

Architecture flow from hotel property consumers through Amazon API Gateway to backend services on Amazon EKS

Figure 1: Architecture diagram showing the end-to-end flow from hotel property consumers accessing the Amazon API Gateway Portal, through Amazon API Gateway, to backend services running on Amazon EKS.

Connecting API Gateway to EKS

A critical design decision emerged: how to securely and efficiently connect API Gateway to backend services in Amazon EKS while keeping traffic within the AWS backbone network using VPC Link. The team evaluated four options:

Option 1: NGINX ingress controller: Route traffic through a Kubernetes-native NGINX Ingress Controller with a Load Balancer service.

Pros: Highly customizable routing, flexible header manipulation, consistent with common Kubernetes patterns.

Cons: Adds extra latency hop, requires manual lifecycle management (upgrades, configs, scaling), non-AWS-native monitoring.

Option 2: AWS load balancer controller: Use the AWS Load Balancer Controller to manage LB resources as Kubernetes Ingress objects.

Pros: Bridges AWS and Kubernetes natively, supports path-based routing, AWS-managed Load Balancer (LB) lifecycle.

Cons: Introduces an additional hop (Amazon API Gateway → LB → service).

Option 3: Target group binding: Directly bind Amazon EKS pods to Network Load Balancer (NLB) Target Groups using the AWS Load Balancer Controller’s TargetGroupBinding feature.

Pros: Removes ingress controller overhead, lowest latency, native AWS integration, cost-efficient (shared NLB across multiple Target Groups), fine-grained control over health checks and scaling.

Cons: More complex initial setup, less Kubernetes-native (more AWS-specific), different applications will need individual NLB.

Option 4: LoadBalancer service: Expose each service directly via a Kubernetes LoadBalancer service (NLB/ALB).

Pros: Most straightforward setup, minimal routing complexity, no ingress controller needed.

Cons: No path-based routing, costly at scale (each service requires its own load balancer), limited observability, requires TLS offloading configuration, different applications will need individual NLB.

The team selected Target group binding because it effectively balances performance, cost-efficiency, and AWS-native integration. By removing the extra hop introduced by traditional ingress controllers, this approach provides direct control over Target Groups and health checks while maintaining sub-second latency at scale.

Security implementation

The API Gateway implementation uses OAuth 2.0 client credentials flow with an external identity provider, delivering strong authentication for machine-to-machine (M2M) communication. This approach provides secure, scalable access control as Revinate onboards new hotel properties and partners.

API Gateway enforces usage plans with configurable throttling and quota limits, for fair usage and protection against abuse.

Sequence diagram of the OAuth 2.0 authentication flow using AWS Lambda authorizers

Figure 2: Sequence diagram illustrating the OAuth 2.0 authentication flow using AWS Lambda authorizers.

AWS Lambda authorizers take the caller’s identity as the input and return an IAM policy as the output. This architecture provides flexibility to implement sophisticated authorization logic while maintaining the simplicity of the API Gateway managed infrastructure. The team also deploys and manages the Lambda authorizer functions through Terraform, maintaining infrastructure as code (IaC) standards.

Developer Portal experience

The Amazon API Gateway Portal serves as the central hub for the API operations, providing developers using APIs with a streamlined experience.

Developer journey through the Amazon API Gateway Portal showing API discovery, interactive documentation, and subscription management

Figure 3: User interface flow showing the developer journey through the Amazon API Gateway Portal, including API discovery, interactive documentation with try-it-now functionality, and subscription management.

Developers can:

  • Browse available REST APIs with comprehensive documentation.
  • Test API endpoints directly in the portal with interactive examples.
  • Access code samples and integration guides.

This self-service model reduced burden on support while accelerating customer time-to-value.

Results and benefits

The implementation of Amazon API Gateway and the Developer Portal delivered significant qualitative benefits across operational efficiency, developer experience, and business scalability.

Reduced operational overhead

By choosing a fully managed API gateway, the engineering team avoided the burden of maintaining, scaling, and troubleshooting self-hosted infrastructure. With the fully managed API gateway, the team can focus on core platform innovations that directly benefit hotel customers rather than undifferentiated gateway operations.

Improved developer experience

The centralized Developer Portal transformed the integration experience for hotel properties and partners. Self-service API discovery and interactive documentation reduced onboarding time from weeks to days. Developers consistently praised the professional portal experience and comprehensive documentation.

Accelerated customer onboarding

With the Developer Portal’s self-service capabilities, new customers can discover APIs and begin integration without waiting for manual provisioning or support intervention. This self-service approach positions Revinate to scale API access to hundreds of hotel properties and partners as demand grows.

Enhanced governance and control

The solution centralized control over API documentation, versioning, and access policies, verifying consistency across customer integrations. A single source of truth for API specifications removes documentation drift and reduces integration errors. Managing infrastructure through Terraform verifies changes follow proper review and approval processes.

Cost optimization

The pay-per-use pricing model aligns costs with actual usage and revenue generation. Usage plans and API keys provide per-consumer cost attribution, giving Revinate clear visibility into infrastructure spend by customer. As usage scales, tiered pricing verifies predictable cost growth that tracks with business value, replacing fixed licensing models that require upfront investment regardless of adoption.

Positioned for growth

The API layer, from Amazon API Gateway to the Developer Portal, scales automatically to meet demand without capacity planning or operational intervention. The team can confidently pursue growth targets knowing the API infrastructure will scale automatically.

Enhanced security posture

Amazon API Gateway provides strong security capabilities built into the platform, including centralized authentication and authorization mechanisms, request throttling and rate limiting to protect against abuse, and automatic threat protection through AWS Shield integration. Built-in security capabilities remove the need to build and maintain custom infrastructure while verifying consistent security policies across API endpoints. The centralized approach reduces the attack surface and provides comprehensive audit trails through CloudWatch integration, so the team can maintain robust security without additional operational overhead.

Key takeaways

The successful implementation of Amazon API Gateway and the Amazon API Gateway Portal offers valuable lessons for organizations exposing APIs to external customers and partners:

Managed services accelerate time-to-market – By using fully managed infrastructure and the new Amazon API Gateway Portal, the team avoided months of custom development work and launched the API program faster than would have been possible with self-managed alternatives.

Developer experience drives adoption – The professional, self-service Amazon API Gateway Portal significantly reduced friction in the customer onboarding process, so API access can rapidly scale as new hotel properties and partners onboard.

Infrastructure as code verifies consistency – Using Terraform for all production deployments provided the infrastructure team with version control, peer review, and audit trails while maintaining deployment consistency across environments.

Pay-per-use aligns costs with value – For organizations in growth mode, pay-per-use pricing removes the risk of overcommitting to fixed costs before achieving product-market fit with API offerings.

OAuth 2.0 delivers strong security at scale – Implementing OAuth 2.0 client credentials flow with an external identity provider enables a robust, scalable authentication foundation that grows securely alongside its expanding customer base.

Native AWS integration reduces complexity – For organizations already running on AWS, API Gateway’s native integration with services like EKS, Lambda, and CloudWatch minimizes architectural complexity and operational overhead.

Future enhancements

With the outbound API program successfully launched, the team is planning to extend API Gateway to inbound APIs, where partners push data into Revinate’s service. This will provide consistent security, monitoring, and governance across API traffic.

The team is also exploring advanced API Gateway features including request and response transformation, caching for improved performance, and deeper integration with AWS WAF for enhanced security against evolving threats.

Conclusion

Choosing Amazon API Gateway with the Developer Portal demonstrates how fully managed services can accelerate innovation while reducing operational complexity. By embracing AWS-native solutions and infrastructure-as-code practices, Revinate built a scalable, secure API program that supports growth as more customers get onboarded.

As the hospitality industry continues its digital transformation, this API-first approach positions them to empower hoteliers with the data and integrations needed to deliver exceptional guest experiences and drive direct revenue growth.

Next steps

Whether you’re in hospitality, software as a service (SaaS), healthcare, or any industry where partners and customers need programmatic access to your service, the pattern Revinate followed is broadly applicable. Start by mapping your business drivers to concrete technical requirements. This grounds your API gateway choices in outcomes, not only features. From there, explore Amazon API Gateway’s REST and HTTP API options to find the right fit for your traffic patterns and integration needs. Use the Amazon API Gateway Portal to give your developers a self-service onboarding experience from day one. If you’re already running workloads on AWS, the native integration with services like EKS, Lambda, and CloudWatch means you can build on your existing architecture rather than introducing new operational complexity. For teams that follow infrastructure as code practices, the Terraform AWS Provider for API Gateway helps you to define your entire API configuration as version-controlled code. To get started, visit the Amazon API Gateway documentation or reach out to your AWS account team for architecture guidance tailored to your use case and scale.

Resources


About the authors

Abe Raghib

Abe Raghib

Abe is a Solutions Architect at Amazon Web Services, where he helps ISV customers architect and implement scalable, secure solutions on AWS. He specializes in API architecture, serverless technologies, Agentic AI adoption, and developer experience optimization.

Giedrius Praspaliauskas

Giedrius Praspaliauskas

Giedrius is a Solutions Architect at Amazon Web Services, focusing on helping customers modernize their infrastructure and adopt cloud-native architectures. He has extensive experience with API management, microservices, and container orchestration.

Jakarry Williams

Jakarry Williams

As a Data Integration Manager at Revinate, Jakarry leads the Engineering Integration team, focusing on how data is ingested, transformed, and published across different platforms. He specializes in data integration architecture, transformation pipelines, and scalable data processing systems.

Satish Katpally

Satish Katpally

Satish is a Principal Product Manager at Amazon Web Services, focusing on building innovative application networking services. He is responsible for innovative application networking services, focusing on VPC Lattice.

Automating agentic AI Well-Architected reviews with the AWS Agentic AI Lens

Post Syndicated from Dinesh Subramani original https://aws.amazon.com/blogs/architecture/automating-agentic-ai-well-architected-reviews-with-the-aws-agentic-ai-lens/

In regulated industries, there’s no room for a move fast and break things approach, especially when AI agents are handling sensitive customer communications data. In this post, we show how Smarsh, a leading archiving and compliance platform for communications intelligence, used the AWS Well-Architected Framework’s Agentic AI Lens to conduct a rigorous, evidence-based review of its first agentic workload. The Agentic AI Lens is available today as prescriptive guidance, though it is not yet selectable as a lens in the AWS Well-Architected Framework.

To operationalize the review, Smarsh built a custom skill for Claude, Anthropic’s AI assistant. The skill assessed the workload against all 150 best practices in the lens, pulling evidence directly from the workload’s GitHub repository and producing a comprehensive review workbook in hours rather than days. In this post, we walk through the skill’s architecture, the assessment methodology, how the team validated the skill itself, and how the resulting findings strengthened Smarsh’s engagement with its AWS account team.

About Smarsh

Smarsh is a recognized global leader in electronic communications archiving and digital communications governance. For over 20 years, the multinational software as a service (SaaS) company has enabled more than 7,000 organizations, from small businesses to large multinational financial institutions, to capture, retain, monitor, and analyze communications across 100+ channels, including email, mobile, voice, video, chat, and AI assistants, at scale. The company’s enterprise archive business runs on Amazon Web Services (AWS), and its next generation of AI capabilities are being built on Amazon Bedrock AgentCore, a platform to build, connect, and optimize agents at scale, with any framework or model. Smarsh uses AgentCore’s runtime, gateway, registry, and identity capabilities to power these solutions. A 2025 AWS Partner of the Year Award winner, Smarsh holds a deep partnership with AWS.

Prerequisites

To follow along with the approach described in this post, you need the following:

  • An AWS account with access to Amazon Bedrock and Amazon Bedrock AgentCore.
  • Familiarity with the AWS Well-Architected Framework and its lens model.
  • A GitHub repository containing your agentic workload’s source code, infrastructure definitions, and documentation.
  • Access to Claude (Anthropic’s AI assistant) with the ability to install custom skills.

The challenge: A lens you can read, but not run

Smarsh operates in a highly regulated industry where compliance and security are paramount. Every agentic solution must pass a Well-Architected review before it reaches an end customer. So when a Smarsh architect set out to review the company’s first multi-agent workload, the natural choice was the AWS Well-Architected Framework’s Agentic AI Lens. That workload is an intelligent agent review system for compliance alerts built on the runtime, gateway, registry, and identity capabilities of Amazon Bedrock AgentCore.

The Serverless Applications Lens and other lenses can be added directly in the AWS Well-Architected Tool. The Agentic AI Lens, by contrast, existed only as published documentation: 150 best practices across 41 questions and six pillars, each with a risk level and a desired outcome, but with no way to run the review natively on the console. That left two apparent options: a multi-day manual effort in which every reviewer structured the assessment differently, or waiting for console support. Smarsh chose a third: make the lens executable, in a way every future workload could reuse.

Solution architecture: The lens as data, the reviewer as a skill

Smarsh packaged the review process as a Claude skill: a versioned bundle of instructions, reference data, and executable scripts that Claude discovers through a frontmatter description and loads on demand. Progressive disclosure keeps the token cost near zero until a review is actually requested. The skill has three components:

  • lens_data.json – All 150 best practices from the published lens documentation, extracted into a structured JSON dataset: best-practice ID, pillar, review question, title, risk level (90 High, 59 Medium, 1 Low), and desired outcome. Risk levels were cross-validated against the lens appendix to catch extraction errors. This dataset is the single source of truth, and the skill is instructed never to invent or renumber items.
  • assessment-guide.md – A five-value status rubric (Compliant, Partially Compliant, Non-Compliant, Not Applicable, and Not Reviewed), an evidence-gathering checklist, per-pillar signals to look for, and a set of honesty rules. The checklist covers README and architecture docs, decision records, infrastructure as code, continuous integration and continuous delivery (CI/CD) workflows, and test and evaluation suites. Every status must cite evidence found in the repository, items with no signal are marked Not Reviewed rather than guessed, and the same underlying fact must produce a consistent status wherever it appears across pillars.
  • build_report.py – A deterministic Python script (openpyxl) that renders the model’s assessment into a formatted workbook. The generator validates its input, so unknown best-practice IDs or invalid statuses abort the build and hallucinated items cannot silently ship. The output includes per-item status with data-validation dropdowns and conditional formatting. It also provides columns for cited evidence, gaps, and remediation, plus a summary sheet whose pillar counts and high-risk exposure tracker are live COUNTIF formulas rather than hardcoded numbers.

The assessment contract between the reasoning and the rendering is in a single JSON document:

{
  "AGENTSEC08-BP01": {
    "status": "Partially Compliant",
    "evidence": "Two-stage input validation (JSON Schema + Pydantic); 5 MB payload cap; typed prompts.",
    "gap": "No prompt-injection screening on message content.",
    "remediation": "Add injection screening; treat communication text as untrusted data in prompts."
  }
}

Running a review is a one-line request: point Claude at a repository and ask for a Well-Architected review. From there, the skill drives the following workflow:

  1. Claude loads the skill and reads the frontmatter description to understand the review scope and methodology.
  2. The skill pulls the lens_data.json dataset containing all 150 best practices across six pillars.
  3. Claude gathers evidence read-only from the target repository: README, architecture docs, infrastructure-as-code, CI/CD workflows, and test suites.
  4. The skill assesses all 150 items against the gathered evidence, applying the five-value rubric and honesty rules from assessment-guide.md.
  5. Claude calls build_report.py to generate the formatted workbook, validating row counts and flagging blank statuses.
  6. The skill returns an executive summary of the top high-risk gaps.
  7. Human reviewers validate findings, feed a remediation backlog, and surface open system questions for a focused AWS deep dive.
A flow chart of Automated Well-Architected reviews for agentic workloads

Figure 1: From published lens documentation to an evidence-backed review workbook

Testing the tester: Evaluating the skill before trusting it

Smarsh evaluated the skill before relying on its output. The team built two synthetic fixture repositories: a moderately mature LangGraph-style workload and a deliberately rough proof of concept, complete with hardcoded credentials and a runaway-cost incident in its history. The team ran reviews both with and without the skill. Each run was graded against eight verifiable expectations per fixture: all 150 lens items present, no blank statuses, evidence cited for every definitive status, honest calibration, and fixture-specific findings such as the hardcoded credential being flagged. With the skill, runs passed 16 of 16 expectations. Baseline runs without it passed only 8 of 16, producing ad-hoc 18–39 item checklists with no lens traceability. The eval set ships inside the skill, so regression testing continues as the skill evolves.

What the first review found

Against the real workload, the skill read the repository’s architecture and authentication documentation, AWS Cloud Development Kit (AWS CDK) infrastructure definitions, GitHub Actions workflows, registry and gateway design records, and test suites. The skill then assessed all 150 items in hours. The workbook showed a credible mix of strengths and gaps. Strengths included per-agent AWS Identity and Access Management (IAM) execution roles scoped to named runtime Amazon Resource Names (ARNs) and SigV4-signed Model Context Protocol (MCP) calls through AgentCore Gateway, a capability of Amazon Bedrock AgentCore. The workbook also recorded schema-validated inputs with typed error contracts, exported decision audit trails, and continuous quality monitoring through AgentCore online evaluations. High-risk gaps included the gateway ingress authorizer running with authentication disabled under a documented risk acceptance, no prompt-injection screening on bad actor-influenced message content, rate limiting recorded as a TODO, and no automated cost controls. Each gap was tied to the lens item, the evidence, and a recommended remediation.

Next, the Smarsh architect brought in the engineering team. Together they triaged the findings, validating statuses against what the team knew, accepting or challenging results right in the workbook, and ranking the remediation backlog. Engineering’s input reshaped the review: several items collapsed into one anomaly-detection epic, and a single finding was upgraded once the team pointed to evidence the repository had overlooked. Dependency scanning was already running on every pull request.

Sharper questions, better AWS engagement

Triage surfaced a class of gaps no repository can answer: system-semantics questions about the AWS services themselves. Rather than booking a general architecture review, the team built a focused agenda for its AWS Solutions Architects, mapping each question to the checklist item it would close. The agenda covered:

  • The durability and consistency of AgentCore runtime, a capability of Amazon Bedrock AgentCore, as a session checkpoint store.
  • The retry and idempotency semantics of the InvokeAgentRuntime API.
  • Break-glass patterns for halting agent invocations.
  • Amazon Bedrock Guardrails patterns for screening untrusted content.
  • Penetration-testing rules of engagement for Amazon Bedrock AgentCore.
  • Amazon GuardDuty and AWS CloudTrail coverage for agentic-runtime threat detection.

The deep dive became a working session with a definition of done.

Why AWS

The security and compliance posture of Amazon Bedrock and Amazon Bedrock AgentCore, spanning runtime, gateway, registry, identity, and evaluation capabilities, meets the bar Smarsh’s regulated customers expect. The AWS Well-Architected Framework already anchors how Smarsh evaluates workloads. Extending it to agentic AI through the published lens, and pairing automated reviews with AWS Solutions Architect expertise to close the hard gaps, is a natural continuation of how the two teams work together.

Results and expected outcomes

These numbers reflect Smarsh’s first internal uses and the outcomes the team is tracking toward.

  1. Review effort – A complete 150-item, evidence-cited draft in hours instead of a multi-day manual effort, with human time refocused on validation and prioritization.
  2. Comparable reviews – Every workload produces the same standardized workbook, which Smarsh expects to translate into faster security approvals and improved time-to-market for agentic solutions.
  3. Sharper use of AWS expertise – Instead of broad discussions, AWS engagements became itemized working sessions, each mapped to a specific best-practice gap.

What’s next

  1. Publish the skill internally as the standard evaluation tool for Smarsh agentic workloads. It has been contributed to the company’s internal AI-SDLC plugin marketplace and has already been run against a second, architecturally different agentic repository.
  2. Bake reviews into the software development lifecycle so well-architected checks run continuously during development, not as a one-time gate at the end.
  3. Enforce governance by making the review workbook required evidence in Smarsh’s project milestone and gate process before agentic workloads reach production.
  4. Expand the lens-as-data pattern to other AWS Well-Architected lenses and additional repositories, eventually covering the broader application portfolio.

Conclusion

The gap Smarsh hit, prescriptive guidance published faster than console tooling can absorb it, is one many customers will meet as agentic AI best practices evolve. The answer generalizes: treat the lens as data, encode the reviewer’s discipline as a skill with enforced honesty rules, validate the tool with its own evaluation suite, keep humans on judgment, and let findings drive precise conversations with AWS. A review that once implied days of manual effort is now a repeatable capability the whole organization can run, before, not after, an agentic workload meets a regulated customer.

To get started:

We’d love to hear how you’re approaching Well-Architected reviews for your own agentic workloads. Share your experience in the comments, or reach out to your AWS account team to get started.


About the authors

Dinesh Subramani

Dinesh Subramani

Dinesh Kumar Subramani is a Principal Machine Learning Architect at Smarsh, leading generative AI, agentic AI and MLOps architecture. He designs scalable AI platforms and guides the end-to-end AI lifecycle, from experimentation to secure, governed production deployment.

Raghu Talakola

Raghu Talakola

Raghu is a Principal Solutions Architect at Amazon Web Services supporting Smarsh.

Introducing time series collections for the next generation of Amazon OpenSearch Serverless

Post Syndicated from Kevin Fallis original https://aws.amazon.com/blogs/big-data/introducing-the-next-generation-of-serverless-time-series-for-amazon-opensearch-service/

Today, we’re announcing support for time series collections on the next generation of Amazon OpenSearch Serverless. With time series collections, you can ingest, store, and analyze logs, metrics, traces, and event data without provisioning or managing clusters. Time series collections absorb ingest spikes automatically, keep recent data fast to query, and make months or years of history searchable at low cost, all in the same collection. Time series collections also bring alerting and anomaly detection to OpenSearch Serverless, so you can find and act on problems as they happen. With support for up to 100 TB of hot storage per collection, they’re built for high-scale observability workloads such as application monitoring, security analytics, and IoT telemetry.

Observability data is voluminous, and it surges sharply during events like bad deployments and outages, right when teams need answers fastest. An undersized cluster falls behind and delays the very logs engineers are waiting for, so teams size for the worst day and pay for that capacity every other day. Hot storage gets expensive as history grows, so teams cut retention or move older data to snapshots that someone must restore before running a query. Clusters also need constant tuning and capacity planning, which pulls engineers away from the investigations the data is meant to support. Every decision becomes a tradeoff between cost, retention, and how quickly you can answer questions about your systems.

Time series collections on OpenSearch Serverless remove that tradeoff. When an incident drives a surge in log volume, compute scales in seconds to keep up, so the logs engineers are waiting for arrive on time. When traffic settles, compute scales back down, all the way to zero, so you stop paying for worst-day capacity. Older data moves to a lower-cost warm tier and stays queryable, so you can keep years of history without cutting retention or restoring snapshots. There are no clusters to size or tune. You set compute limits and a few index settings, and the service handles the rest.

Pay less for the data you query less

Most queries against time series data target the last few hours or days, while older data is less frequently queried but still needs to be available. With the new index.warm.after setting, you decide how long data stays in the hot tier before it moves to the lower-cost warm tier. You can set it in days or hours, from a minimum of 1 day (24h or 1d) up to 10 years (3650d), and it can’t exceed the index’s retention period. If you don’t set it, data moves to warm after 1 day.

PUT /app-logs
{
  "settings": {
    "index.warm.after": "7d"
  }
}

At ingest, each document is written to a low-latency hot tier and to Amazon Simple Storage Service (Amazon S3). As data reaches the age you set, oldest first, the hot copy is released and the data lives in the warm tier on Amazon S3. When a query needs warm data, the service loads that data back into the hot tier to serve it. The first query on that data takes longer, and later queries on the same data run at hot-tier latency. That suits investigations and reporting over older data, where the same time range is often queried repeatedly. When a query spans both tiers, results come back in a single response. You pay hot storage rates only for data in the hot tier.

Data flows from the hot tier to the warm tier after seven days, with all data persisted to Amazon S3 throughout

Figure 1: Data moves from the hot tier to the warm tier after 7 days, persisted to Amazon S3 throughout

Retain data for as long as your workload requires

Retention is set on the index itself, so there is no separate lifecycle policy to create or maintain. Set index.data.retention in an index template, and every index that matches the pattern inherits it. You can retain data for anywhere from 1 day to 3,650 days (10 years), specified as a whole number of days.

PUT /_index_template/app-logs
{
  "index_patterns": ["app-logs*"],
  "template": {
    "settings": {
      "index.data.retention": "30"
    }
  }
}

Tiering and retention are independent. Tiering controls query speed and cost, and retention controls when data is deleted. For example, you can keep application logs hot for 7 days and retain them for 30 days, or keep audit data in the warm tier for years to meet compliance requirements. When an audit comes up, you query that history in the same collection, and search compute scales up to handle the extra load. There is no snapshot restore and no forensic cluster to stand up.

Data tiering controls query speed and cost while retention controls when data is deleted

Figure 2: Data tiering and retention

Designate the event timestamp for each index

Every document in a time series collection must now include a timestamp field. Each index has one designated time field that the service uses to organize and sort your data, and documents with a missing, null, or invalid timestamp are rejected.

By default, the time field is @timestamp. If your events already carry a different field, such as event_time, set index.timestamp_field when you create the index or in an index template, so you don’t need to change your producers. The field must be a top-level date field, and a document’s timestamp can’t be changed after it is indexed.

PUT /app-logs
{
  "settings": {
    "index.timestamp_field": "event_time"
  }
}

Rejections apply to individual documents, not whole requests. In a _bulk request, the valid documents are indexed and the rejected ones are listed in the errors block of the response, so one bad record doesn’t fail the batch.

How the designated time field determines whether each document is indexed or rejected

Figure 3: How the time field determines whether each document is indexed or rejected

Catch problems before they become outages

Time series collections now support alerting and anomaly detection, which Classic serverless collections didn’t offer. Instead of relying on a separate system to tell you when something breaks, you can monitor, detect, and notify from the collection that stores your data. Now, operations teams can get notified when error rates or latency spike, security teams can catch a burst of failed logins, and business teams can spot a sudden drop in orders.

Alerting monitors query your data on a schedule and notify you through the channel you choose when a condition is met. Per-query monitors alert on a single value, such as average latency crossing a threshold. Per-bucket monitors evaluate each group separately, such as every host whose error rate climbs too high. PPL monitors handle more complex logic in Piped Processing Language (PPL).

Anomaly detection uses the Random Cut Forest (RCF) machine learning algorithm to learn your data’s normal pattern and flag deviations in near real time, with no fixed thresholds to guess. Point a monitor at the detector’s results to get notified the moment an anomaly appears.

You manage monitors and detectors in OpenSearch UI workspaces, where access follows the workspace’s collaborator permissions. Read-only collaborators can view monitors and alerts, while read/write and admin collaborators can also create, update, and acknowledge them. The Observability workspace puts alerts alongside dashboards and PPL queries, so your team can go from an alert to the events behind it, across serverless collections and existing Amazon OpenSearch Service domains.

Getting started

For a single-click experience, use Express Create in the Amazon OpenSearch Service console. It sets up the collection group, encryption, network access, and data access for you. To control each step yourself, use the AWS Command Line Interface (AWS CLI) as shown in the following steps.

Express Create setting up the collection group, encryption, and network access with default settings

Figure 4: Express Create sets up the collection group, encryption, and network access with default settings

First, create a next-generation collection group. The collection group sets the compute limits that all of its collections share. A minimum of 0 OpenSearch Compute Units (OCUs) lets the group scale to zero when it’s idle, and the maximum caps your spend.

aws opensearchserverless create-collection-group \
    --name app-logs-group \
    --generation NEXTGEN \
    --standby-replicas ENABLED \
    --capacity-limits '{
        "minIndexingCapacityInOCU": 0,
        "minSearchCapacityInOCU": 0,
        "maxIndexingCapacityInOCU": 96,
        "maxSearchCapacityInOCU": 96
    }'

Next, create a network policy to control where the collection can be reached from, and a data access policy to control which AWS Identity and Access Management (IAM) principals can read and write data.

Then create the time series collection in the collection group:

aws opensearchserverless create-collection \
    --name app-logs \
    --type TIMESERIES \
    --collection-group-name app-logs-group \
    --encryption-config aWSOwnedKey=true

After the collection is active, create an index template with the time field, tiering, and retention settings that fit your workload. Every index whose name matches the pattern picks up these settings automatically:

PUT /_index_template/app-logs
{
  "index_patterns": ["app-logs*"],
  "template": {
    "settings": {
      "index.timestamp_field": "event_time",
      "index.warm.after": "7d",
      "index.data.retention": "30"
    }
  }
}

Finally, ingest your data into the collection, then open the Observability workspace in OpenSearch UI to build your first dashboards, monitors, and anomaly detectors.

Now available

Time series collections are available today in all AWS commercial Regions where the next generation of OpenSearch Serverless is available. You pay for the compute you use in OCUs, and for hot and warm storage in GB-month. For pricing details, visit the Amazon OpenSearch Service pricing page.

To learn more, visit the Amazon OpenSearch Serverless product page and the Amazon OpenSearch Serverless Developer Guide.

Give it a try in the Amazon OpenSearch Service console, and send feedback through AWS re:Post or your usual AWS Support contacts.


About the author

Kevin Fallis

Kevin Fallis

Kevin is a seasoned leader, architect, and developer with experience across many industry verticals and disciplines such as agriculture, ad tech, financial services, networking, security, telecommunications and of course search technologies. His passion helps others leverage the correct mix of AWS services and open-source solutions to achieve success for their business goals. His after-work activities include family, DIY projects, carpentry, horses, playing drums, and all things music.

From Problem to Fix in Minutes: Automating Search Relevance Tuning with the Amazon OpenSearch Service Relevance Agent

Post Syndicated from Aruna Govindaraju original https://aws.amazon.com/blogs/big-data/from-problem-to-fix-in-minutes-automating-search-relevance-tuning-with-the-amazon-opensearch-service-relevance-agent/

Automating search relevance tuning means going from “my NDCG score is low” to “here is a better search query” in minutes. The Amazon OpenSearch Service Search Relevance Agent accelerates search quality improvements. You describe the problem, and the agent investigates your behavioral data, runs sequenced evaluations, and generates an improved query validated against your search quality targets, all without leaving the UI.

In the previous post “Measuring and improving search quality with Amazon OpenSearch Service”, you learned how to capture behavioral signals with User Behavior Insights (UBI), run structured experiments with Search Relevance Workbench (SRW), and arrive at a real Normalized Discounted Cumulative Gain (NDCG) score. That gives you the diagnosis. Now comes the harder part: acting on it.

Improving search quality is a tedious, manual loop. A search engineer studies the dashboards, forms a hypothesis, rewrites the domain-specific language (DSL) query, creates a new configuration, runs an experiment, interprets the results, and, if the numbers hold, deploys the change. Then the catalog shifts, query patterns evolve, and the cycle starts over. Staying ahead of it is practically a full-time job.

The Search Relevance Agent, accessible through the Ask AI button in the OpenSearch UI application, automates this loop. You have a conversation. The agent does both: diagnose and fix.

What is the Search Relevance Agent?

Before diving into the demo, it’s worth being precise about what the agent is and isn’t. Search Relevance Agent is one of the agents supported in OpenSearch Agent Server. The OpenSearch Agent Server is a multi-agent orchestration platform where you can build specialized AI agents that work together within OpenSearch. The agent server is an orchestration server for OpenSearch Dashboards with context-aware routing and Model Context Protocol (MCP) integration.

OpenSearch Agent Server

Figure 1: OpenSearch Agent Server

The Search Relevance Agent is a search relevance tuning tool. It analyzes your UBI search data, generates improved query configurations, and validates those improvements using offline SRW experiments. It operates at the level of query DSL, refining field weights, adjusting scoring strategies, and adding boost functions.

It isn’t an agentic search tool. It doesn’t rewrite user queries at runtime or intercept search requests. It configures the search system so that future searches perform better.

The distinction matters because it tells you what kind of problems it solves: systematic relevance issues that affect a category of queries, not one-off edge cases.

Solution overview

Under the hood, the Search Relevance Agent is powered by three skills of a single agent rather than separate sub-agents wired together as tools. The full loop, from spotting a problem to generating a hypothesis to evaluating it, runs in a single shared context with one tool stack. Nothing is lost when handing off between agents, and the behavior stays predictable.

When you send a message through Ask AI, you are talking to the OpenSearch Agent Server. Depending on what you are asking for, the agent applies one of three skills.

  • User Behavior Analysis. Queries your UBI indexes to surface relevance problems such as low click-through-rate (CTR) queries, zero-result queries, and declining engagement patterns. Deterministic tools handle all metric calculations rather than the large language model (LLM), so the numbers are trustworthy.
  • Hypothesis Generation. Analyzes your current search configuration (search queries), runs a pairwise smoke test, and proposes a new DSL search query as a hypothesis. It explains its reasoning, which fields it changed and why, so you can evaluate the proposal before approving it.
  • Evaluation. Creates the SRW artifacts (query set, search configuration, judgment list) and runs an offline Search Quality Evaluation experiment. It reports NDCG, Mean Average Precision (MAP), and Precision, interprets the tradeoffs, and gives you a plain-language recommendation.

Every agent communicates with your OpenSearch cluster exclusively through the MCP Server, a standardized interface that gives agents access to your UBI data, search configurations, query sets, and experiments. Nothing happens without going through this secure layer.

OpenSearch UI uses the Agent-User Interaction Protocol (AG-UI) to connect AI agents to frontend applications, delivering real-time capabilities through standardized streaming and tool execution. The AG-UI protocol streams agent responses to OpenSearch Dashboards in real time, delivering results continuously rather than all at once.

The Agent Server receives the user’s authenticated identity from OpenSearch Dashboards, so every OpenSearch operation enforces user-level permissions rather than a service account’s, preserving access controls end to end.

Auto Relevancy Tuning Agent

Figure 2: Auto relevancy tuning agent

Prerequisites

To follow along, you need an OpenSearch Service domain running OpenSearch 3.5 or later with the OpenSearch UI application, and a search application you can instrument to emit behavioral records.

Example UBI investigation

Here’s what the agent conversation looks like in practice, working through a real dataset. Figure 3 shows a complete walkthrough of using the agent.

Search improvement example

Figure 3: Search improvement example

Step 1: Open Ask AI

You work in the search workspace within the OpenSearch UI application. After entering the search workspace, choose Ask AI in the upper right corner.

Search Workspace Overview page

Figure 4: Search Workspace Overview page

The agent chat panel opens. You see a welcome message and suggested prompts to get started.

AI Assistant chat panel

Figure 5: AI assistant chat panel

Step 2: Find the problem

Start with a diagnostic question: “What are my most common queries?”. The User Behavior Analysis skill activates. You can watch its tool calls in real time as it queries your UBI indexes. In this example, the skill finds that there were 473 total queries across the product catalog. The top queries include gold and wireless earbuds, but across all those queries, there are only 11 total click events. The agent flags this immediately: a CTR that low is a signal that search isn’t working for users.

Viewing most used search queries

Figure 6: Viewing most used search queries

UBI initial findings

Figure 7: UBI initial findings

This is exactly what UBI is designed to surface. The skill found the pattern itself without a configured threshold.

Step 3: Investigate a specific search query

After you’ve received the summary information, you can investigate a specific search query’s performance more deeply. Ask the AI “What is the click-through-rate for wireless earbuds?”. It returns that users searched for “wireless earbuds” 14 times and clicked 8 times, producing a 57.14 percent CTR. Over 40 percent of searches have no clicks. This is a good opportunity to improve search performance.

AI response for click-through-rate of wireless earbuds

Figure 8: AI response for click-through-rate of wireless earbuds

Step 4: Understand the baseline

The next step is to review the current search configuration. Ask the AI “What is my current search configuration?” The agent retrieves the current configuration and presents it for review.

Step 5: Generate a hypothesis

Next is to figure out how to improve the search configuration. Ask the agent: “Can you help me improve the search configuration for wireless earbuds?”. The agent initiates an investigation of the search configuration performance and how it can be improved.

Investigation details

Figure 9: Investigation details

You can then ask the AI to generate a hypothesis. The Hypothesis Generator skill develops a hypothesis based on the investigation and provides supporting findings.

Hypothesis

Figure 10: Hypothesis

Ask “What are the root causes?”. The skill presents root causes, justification, and a new hypothesis for your review. In this example the root causes returned were:

Root causes

Figure 11: Root causes

Step 6: Validate with an offline evaluation

The Evaluator skill creates all the necessary SRW artifacts and runs a Search Quality Evaluation comparing the baseline and the hypothesis. Ask “Validate with an offline evaluation”, and the evaluation report appears in the chat:

Evaluation metrics

Figure 12: Evaluation metrics

NDCG improved substantially. MAP and Precision show a minor tradeoff. You can then ask the agent to explain the findings. Ask “What does a higher NDCG and MAP tell me? Is this worth deploying?”

NDCG and MAP explanation

Figure 13: NDCG and MAP explanation

If your search configuration uses hybrid search, combining lexical and neural queries, the Search Relevance Workbench includes a Hybrid Search Optimizer that automates parameter tuning. Instead of manually experimenting with normalization techniques, combination methods, and lexical-to-neural weight ratios, you can run a single optimization experiment. The optimizer evaluates all combinations of normalization, combination, and weight distributions as well as Reciprocal Rank Fusion variants. It scores against your judgment list and surfaces the parameter set that maximizes your search quality metrics.

Step 7: Inspect what the agent created

Before deploying anything, check what the agent built by asking “Show me the new search configuration”.

Figure 14: New search configuration

Search configurations: a new entry hypothesis-wireless-earbuds-v1 with the full DSL. You can inspect every line, tweak it, or fork it.

Experiments: the offline evaluation the agent ran. Choose it to see per-query scores, download results as CSV, or share the link with your team.

This is the transparency guarantee: the agent doesn’t ask you to trust a black box. The agent documents and makes every decision auditable.

Step 8: Continue the conversation

The loop doesn’t need to stop here:

“The NDCG looks good but I’m worried about over-promoting popular items. Can you reduce the rating boost factor and re-evaluate?”

“Now look at the ‘gold’ query. It had the highest search volume but very low CTR. What’s going on?”

“I’m happy with the wireless earbuds hypothesis. How do I apply this configuration in production?”

Example follow up questions

Figure 15: Example follow up questions

Each question kicks off a new iteration of the same loop: analyze, hypothesize, and evaluate. But now it takes minutes, not hours.

Continuous improvement, not one-time tuning

The key mindset shift the Search Relevance Agent encourages is to think about search quality as a practice, not a project. Search degrades over time. The configuration you tuned last quarter might be quietly underperforming today, and without a continuous measurement loop, you don’t find out until users stop converting. The agent fits into a continuous, human-in-the-loop improvement cycle:

  1. Collect: UBI captures real user behavior automatically.
  2. Identify: The agent surfaces emerging relevance gaps before they become customer complaints.
  3. Hypothesize: The agent proposes targeted fixes grounded in your actual data.
  4. Evaluate: SRW validates improvements offline before anything touches production.
  5. Deploy: You apply the winning configuration with full visibility into the evidence.
  6. Monitor: UBI closes the loop, feeding new behavior back into step 1.

At each stage, you remain in control. The agent executes, you decide.

Who benefits

Search engineers get tools that eliminate repetitive work. These tools provide root cause analysis, DSL iteration, and experiment setup, all automated. Engineers focus on the problems that require genuine expertise. Product managers and business owners can now participate meaningfully in search tuning without writing a single line of DSL. If a new product category is underperforming, you can ask the agent to investigate and get an actionable recommendation in plain language. Teams without dedicated search expertise get access to advanced relevance engineering techniques such as function_score, cross_fields, and popularity boosting without needing to know the terminology. The agent handles the implementation.

Try it yourself

The Search Relevance Agent is available today in Amazon OpenSearch Service through the Ask AI button in your OpenSearch UI search workspace. To get started open your OpenSearch UI application and navigate to Search Relevance then load the sample UBI data if you haven’t already. Entering the /search-relevance command in the chat from another page will also take you to Search Relevance. Next, choose Ask AI and start with: “What are my most common queries with low engagement?”

For a step-by-step hands-on lab, try the Search Relevance Workbench Workshop on AWS Workshop Studio module 3 which walks through the full Automated Relevance Tuning (ART) agent experience with the ESCI ecommerce sample dataset.

The OpenSearch Search Relevance Agent is part of the OpenSearch application experience in Amazon OpenSearch Service. It requires an OpenSearch application with an associated workspace and data source.

Clean up

To avoid future charges, delete the resources you created for this walkthrough:

  • If you created the domain specifically for this post, delete it to remove everything, including the resources in the previous step. Deleting a domain is irreversible. Don’t delete a domain that serves other workloads.
  • If you keep the domain, optionally delete the ubi_queries and ubi_events indices and the query sets, judgment lists, and experiments you created. These live on the domain and incur no separate charges.
  • Delete the OpenSearch UI application if you created it specifically for this post.


About the authors

Aruna Govindaraju

Aruna Govindaraju

Aruna is an Amazon OpenSearch Specialist Solutions Architect and has worked with many commercial and open source search engines. She is passionate about search, relevancy, and user experience. Her expertise with correlating end-user signals with search engine behavior has helped many customers improve their search experience.

Sean Bjurstrom

Sean Bjurstrom

Sean is an Enterprise Support Lead in ISV accounts at Amazon Web Services, where he specializes in Analytics technologies and draws on his background in consulting to support customers on their analytics and cloud journeys. Sean is passionate about helping businesses harness the power of data to drive innovation and growth. Outside of work, he enjoys running and has participated in several marathons.

Mingshi Liu

Mingshi Liu

Mingshi is a Machine Learning Engineer at AWS, primarily contributing to OpenSearch, ML Commons and Search Processors repo. Her work focuses on developing and integrating machine learning features for search technologies and other open-source projects.

Data governance with annotations in Amazon S3

Post Syndicated from Aditya Jain original https://aws.amazon.com/blogs/architecture/data-governance-with-annotations-in-amazon-s3/

If you run data governance in Amazon Simple Storage Service (Amazon S3), the context that matters most probably lives somewhere other than S3. Think of how an object is classified, which retention policy applies to it, where the data may reside, and whether it holds personally identifiable information (PII). You typically keep that context in a separate database, one system away from the objects it describes.

Amazon S3 annotations closes that gap. You can attach the governance context directly to the S3 object, without rewriting the object. A single object version can carry up to 1,000 annotations. Each one is a UTF-8 payload between 1 byte and 1 MB, in a format such as JSON, XML, YAML, or plain text. That’s room for a complete governance record rather than a few key-value pairs.

Annotations give you five properties that are hard to get from a separate metadata store:

  • Context that travels with the data – S3 stores annotations with the object version rather than in a separate system. When you copy or replicate an object, S3 moves the annotations with it, so a classification or residency label accompanies a disaster-recovery copy.
  • Context you can revise in place – Updating an annotation doesn’t rewrite the object or change its ETag, so a record’s classification can be corrected, or a generated label promoted from proposed to reviewed, as the context is validated.
  • Governance answers without reading the data – A consumer with read-only annotation access can answer a question such as “which objects hold PII and have an expired retention policy” per object through the annotation APIs, or across the bucket through an S3 Metadata annotation table.
  • Context stays readable in any storage class – Even when an object is archived in a cold storage class, its annotations stay directly readable. You can retrieve the governance context for an object in Amazon S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive without restoring the object first. You pay S3 Standard rates for annotations regardless of the parent object’s storage class.
  • SQL at scale – An S3 Metadata annotation table, which is an Apache Iceberg table, makes the same context queryable with Amazon Athena or any Iceberg-compatible engine across a large object population.

This post walks through the pattern end to end, then the handful of S3 behaviors that determine whether the design is correct. Each behavior comes with the documented rule and a working example: an annotation payload, an AWS Identity and Access Management (IAM) policy statement, or an AWS Command Line Interface (AWS CLI) call.

Prerequisites

To follow along and adapt the examples, you need the following:

  • An AWS account with an S3 bucket that has versioning enabled.
  • An AWS Identity and Access Management (IAM) principal with permission to configure bucket policies and annotation actions.
  • The AWS CLI installed and configured.

Familiarity with S3 annotations concepts, object versioning, and IAM identity-based policies is assumed.

The governance record

Consider a governed bucket where each object is a business record such as a contract, policy document, or customer record. You build an enrichment pipeline that reads each new object and records a governance annotation. That annotation captures the classification, the applicable retention policy, the jurisdiction and data residency, a PII inventory, and a short rationale. Annotations aren’t limited to governance context. The same mechanism can attach other object context, such as a short content summary or a processing date. In this pattern, the annotation is written after the upload completes, through the annotation API operations. The same process backfills objects that predate the pipeline, through the separate path shown in the architecture section.

A PutObjectAnnotation call writes exactly one uniquely named annotation on a given object version, and an object version can hold up to 1,000 annotations. How you distribute a governance record across them is a design choice. With granular annotations, you can update one aspect of the context without rewriting the rest, keep an accidental overwrite scoped to a single field, and query finer-grained units in an S3 Metadata annotation table, which you optionally enable for richer queryability. A single annotation that holds the whole record keeps each write and each read to one operation, and keeps the record internally consistent. There’s no partial state across several names to reconcile. This post uses one annotation, named governance-context, because the record here is authored and consumed as a unit.

The payload looks like the following.

{
  "schema_version": "1.0",
  "classification": "confidential",
  "retention": {
    "policy": "contracts-7y",
    "effective_date": "2026-06-01",
    "expires_on": "2033-06-01",
    "status": "active"
  },
  "jurisdiction": "EU",
  "data_residency": "eu-west-1",
  "pii": {
    "present": true,
    "categories": ["name", "email", "national_id"]
  },
  "rationale": "Signed customer contract containing personal data of EU data subjects; classified confidential under the 7-year contracts retention policy.",
  "generated_by": "enrichment-process",
  "generated_at": "2026-06-29T10:15:00Z",
  "review_required": true
}

When a record is reviewed or reclassified, the enrichment process updates the annotation in place with PutObjectAnnotation. The classification changes without rewriting the object or changing its ETag. That in-place update is itself replicated, so a later re-classification on the source keeps a cross-Region copy’s context current without recopying the object. This works as long as the replication role carries the annotation-replication permission described later in this post.

Objects that predate the pipeline need the same context. A backfill pass annotates existing object versions in bulk with the same PutObjectAnnotation call, so the write path covers new objects as they arrive while the backfill path brings the existing population up to the same standard. Both paths appear in the architecture that follows.

On the read side, a consumer with read-only annotation access answers the governance question by listing and retrieving annotation context. There are no object reads and no separate governance database.

At scale, you activate an S3 Metadata annotation table with a bucket metadata configuration that names an IAM role S3 assumes to read your annotations. S3 then provisions and maintains a table in Amazon S3 Tables, a capability of Amazon S3, backed by Apache Iceberg, that you query with SQL. The role trusts the metadata.s3.amazonaws.com service principal. That turns the same question into one Athena statement across a large object population. S3 populates the table asynchronously, and the initial backfill can take minutes to hours depending on how many objects and annotations the bucket holds. Query results reflect annotations as of the most recent table refresh, which typically happens within about an hour, so treat them as eventually consistent rather than real time.

SELECT object_key, object_version_id
FROM "s3tablescatalog/aws-s3"."b_amzn_s3_demo_governance"."annotation"
WHERE name = 'governance-context'
AND json_extract_scalar(text_value, '$.pii.present') = 'true'
AND json_extract_scalar(text_value, '$.retention.status') = 'expired';

Reference architecture for the pattern

The pattern sits inside an event-driven system with S3 at the center, shown in Figure 1. It carries four paths. A write path enriches new objects, a maintenance path keeps context current, a backfill path annotates existing objects, and a read path serves consumers from annotation context alone.

Event-driven S3 annotation architecture showing the write, maintenance, backfill, and read paths

Figure 1: Event-driven architecture for authoring, maintaining, backfilling, and reading S3 annotation governance context.

The numbered steps in Figure 1 trace the four paths:

  1. A producer uploads an object to the governed S3 bucket with PutObject.
  2. S3 emits an object-created event to Amazon EventBridge. When you route through Amazon EventBridge rather than invoking AWS Lambda directly from S3, you can filter on event attributes such as prefix or object size. You can also route the same event to multiple targets without changing the bucket configuration. A direct notification or an Amazon Simple Queue Service (Amazon SQS) queue is a reasonable simpler choice if you don’t need that routing.
  3. Amazon EventBridge invokes the enrichment Lambda function.
  4. The function calls the Amazon Bedrock enrichment agent to classify the object and extract retention, jurisdiction, and PII context. The agent returns the structured context to the function (dashed return arrow). Have the function validate that the output parses as JSON and conforms to your schema before it writes anything. Models often wrap JSON in a Markdown code fence, and an annotation payload must be the raw structured document.
  5. The function writes the context to the object with PutObjectAnnotation. The write emits an s3:ObjectAnnotation:Put event notification that downstream consumers can subscribe to, which fits the event-driven design.
  6. On a schedule, Amazon EventBridge Scheduler re-invokes the enrichment function to re-assess and update annotations in place.
  7. To annotate objects that predate the pipeline, S3 Batch Operations invokes a backfill Lambda function.
  8. The backfill function writes context with PutObjectAnnotation.
  9. A consumer asks the Bedrock consumer agent a governance question, and the agent returns a grounded answer (dashed return arrow).
  10. The consumer agent lists and retrieves the relevant annotations with ListObjectAnnotations and GetObjectAnnotation. S3 returns annotation context only, never the object body (dashed return arrow).
  11. For queries across many objects, the consumer agent queries Athena.
  12. Athena reads the S3 Metadata annotation table, which S3 maintains automatically from the object annotations (dashed “maintains” relationship).

The scheduled update in step 6 needs one guard: a conditional write on the object’s ETag. Pass the ETag with the --object-if-match CLI parameter, which maps to the x-amz-object-if-match request header.

An ETag is the identifier S3 returns for an object version’s content. The function reads it when it fetches the object and passes it back on the write. If the object was overwritten in the meantime, the ETag no longer matches and the annotation write fails. That guards against overwriting context that belongs to a version the function never evaluated.

The behaviors that decide your design

The plumbing is straightforward. The behaviors in this section are where teams most often get a governance design wrong. Each behavior appears in the documentation, and each has a governance implication that becomes clear only when you trace it through. One principle predicts most of them:

An annotation is caller-authored context bound to a specific object version. S3 stores it and moves it, but it doesn’t interpret or validate its meaning. The annotation’s lifecycle follows the object version’s lifecycle.

Two consequences follow. Because an annotation is bound to an object version, versioning behavior governs whether your context stays or disappears: delete markers, version-specific deletes, and overwrites all change what remains attached. And because S3 doesn’t interpret the content, a classification your agent writes is only as trustworthy as the process that produced it. For each behavior, ask what the annotation is bound to, and what the object version’s lifecycle does in that situation.

Deletion is scoped to the object version

A common governance requirement is to delete a data subject’s records on request. The annotation is bound to a specific object version, so it disappears only when that version disappears. Deleting the object and assuming its context goes with it is correct only in a non-versioned bucket.

In a versioned bucket, a DELETE request without a version ID creates a delete marker and leaves the underlying version, along with its annotations, in place. The object no longer appears in a ListObjectsV2 response, so it looks gone. It’s still returned by ListObjectVersions, and the PII context you recorded still exists on that prior version.

To actually remove the annotations, delete the specific version.

aws s3api delete-object \
  --bucket amzn-s3-demo-governance \
  --key contracts/acme-msa.pdf \
  --version-id <VERSION_ID>

To expire noncurrent versions on a schedule instead, apply an S3 Lifecycle configuration such as the following. It permanently deletes noncurrent versions 30 days after they become noncurrent.

{
  "Rules": [
    {
      "ID": "expire-noncurrent-governed-records",
      "Filter": { "Prefix": "contracts/" },
      "Status": "Enabled",
      "NoncurrentVersionExpiration": { "NoncurrentDays": 30 }
    }
  ]
}

A lifecycle rule expires versions on a time schedule. It can’t read annotation values. If you want an object’s classification or retention status to trigger expiration or deletion, your own automation has to read the annotation and issue the delete. If the trigger you need is an event rather than a value, such as a contract closing or an audit completing, Object Lock event holds handle that natively and you don’t need to build the automation.

Don’t rely on a plain delete for a right-to-be-forgotten workflow in a versioned bucket. Decide up front whether you will issue version-targeted deletes or expire noncurrent versions, make that the only supported path in your tooling, and test it against a real object. The failure mode is silent. Version-targeted deletion is also permanent, so tooling that deletes the wrong version destroys data that is recoverable only from a separate backup.

Object Lock freezes annotations

Governance buckets frequently use S3 Object Lock, and annotations count as modifications to the object version, which Object Lock blocks. While a version is under an active Object Lock retention, PutObjectAnnotation and DeleteObjectAnnotation are both denied with AccessDenied and the message “object protected by object lock retention,” in both Governance and Compliance mode. Reading annotations still works, so consumers are unaffected. What you can’t do is add or update a governance annotation on a version whose retention has already started.

That makes sequencing a design rule: Annotate the object first, then apply the retention period. An annotation written before the lock survives and remains readable, but it’s frozen until retention expires. If your agent re-assesses classifications over time, plan the retention duration and the enrichment cadence together. Where retention starts on a future event rather than at write time, there’s no known end to that frozen window when you annotate, so write the complete governance record before the hold goes on.

The retention mode also changes the right-to-be-forgotten path. In Governance mode, a version-targeted delete of a locked version is denied unless the caller holds s3:BypassGovernanceRetention and passes --bypass-governance-retention. That workflow therefore needs the permission and an approval step around it. In Compliance mode, no one can delete the version, including the root user, until retention expires, so a request may not be satisfiable before then.

Event holds add a third case. A version under an event hold is protected while the hold is in place. Releasing the hold starts the retention period rather than ending protection, so releasing it moves a deletion request further away rather than closer. IAM and bucket policy condition keys govern who may set or release a hold and can enforce minimum and maximum durations, which is where the approval gate belongs.

Object Lock and annotations do different jobs. Object Lock enforces retention, including event-based retention through event holds. The annotation records which policy applies and why, which is context Object Lock doesn’t store. One protects the object, the other explains the decision.

Multipart copies drop annotations unless you opt in

Governance labels are only useful if they stay attached as data moves. For a CopyObject request (objects up to 5 GiB), S3 copies annotations along with the object by default.

For larger objects copied with multipart upload, annotations aren’t copied unless you opt in. Multipart upload is what the AWS CLI and SDKs use through their transfer managers above roughly 8 MB. The default is easy to overlook, because the behavior changes with object size rather than with the command you run. A copy that carries its labels on a small object silently drops them once the object crosses the multipart threshold, with no error or warning. With the multipart opt-in, the SDK writes the annotations after the copy completes, so the destination object exists briefly without all its annotations.

aws s3 cp \
  s3://amzn-s3-demo-governance/contracts/acme-msa.pdf \
  s3://amzn-s3-demo-governance-dr/contracts/acme-msa.pdf \
  --copy-props all

When you call CopyObject directly, the x-amz-annotation-directive header gives explicit control. COPY includes the source annotations on the destination object, and EXCLUDE omits them. Reach for EXCLUDE when you deliberately want a reduced-sensitivity copy.

Set this once as a default rather than deciding per call. Standardize on the copy-props opt-in in every annotation-dependent copy path. Confirm it with a test that copies an object larger than the multipart threshold, because a small-object test would pass while hiding the problem.

Annotation deletion and overwrite are irreversible

Object versioning gives you a safety net. Annotations don’t have one. There’s no delete marker and no version history for an annotation, even in a versioned bucket, so after you delete one it’s gone. The same is true of an update: writing a new payload to an existing annotation name overwrites the previous content in place. That makes an accidental overwrite as destructive as a delete.

Treat annotation deletion as a deliberate, gated action rather than routine cleanup. Restrict s3:DeleteObjectAnnotation to a dedicated administrative role, with an approval step. If a record’s context might be needed for an audit, subscribe to the s3:ObjectAnnotation:Put and s3:ObjectAnnotation:Delete event notifications, or use the S3 Metadata journal table, to keep an audit trail of annotation changes, so that removing the annotation doesn’t erase your only copy of the governance decision.

SSE-C objects can’t have annotations

S3 encrypts annotations using the same configuration as their parent object. That covers server-side encryption with Amazon S3 managed keys (SSE-S3), with AWS Key Management Service (AWS KMS) keys (SSE-KMS), and dual-layer SSE-KMS (DSSE-KMS). One exception matters at design time: Objects encrypted with server-side encryption using customer-provided keys (SSE-C) can’t have annotations. The following AWS CLI call attempts to annotate an SSE-C object and shows the error you get back.

aws s3api put-object-annotation \
  --bucket amzn-s3-demo-governance \
  --key contracts/acme-msa.pdf \
  --annotation-name governance-context \
  --annotation-payload governance-context.json \
  --sse-customer-algorithm AES256 \
  --sse-customer-key <BASE64_KEY> \
  --sse-customer-key-md5 <KEY_MD5>

An error occurred (InvalidRequest) when calling the PutObjectAnnotation operation:
Adding metadata to object with CUSTOMER_MANAGED encryption is not supported

If you build a governed bucket on SSE-C and plan to layer annotation-based context on top, the pattern won’t work. This aligns with the broader direction for SSE-C: in April 2026, S3 disabled SSE-C by default for new buckets and select existing buckets. If you use or are considering SSE-C, plan to move to SSE-S3, SSE-KMS, or DSSE-KMS, all of which support annotations.

Scope read, write, and delete access separately

Governance context shouldn’t be writable by everyone who can read it. S3 exposes distinct IAM actions for annotation reads and writes, so an enrichment process can write context while consumers only read it. The following identity-based policy allows an enrichment role to write and read annotations on a governed bucket. On buckets that use SSE-KMS, annotations use the object’s KMS key, so both the enrichment and consumer roles also need kms:Decrypt, and the enrichment role needs kms:GenerateDataKey.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "EnrichmentRoleMayWriteAnnotations",
      "Effect": "Allow",
      "Action": ["s3:PutObjectAnnotation", "s3:GetObjectAnnotation", "s3:GetObjectVersionAnnotation"],
      "Resource": "arn:aws:s3:::amzn-s3-demo-governance/*"
    }
  ]
}

A consumer role receives read-only access to the same context.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ConsumerRoleReadsAnnotations",
      "Effect": "Allow",
      "Action": ["s3:GetObjectAnnotation", "s3:GetObjectVersionAnnotation","s3:ListObjectAnnotations"],
      "Resource": "arn:aws:s3:::amzn-s3-demo-governance/*"
    }
  ]
}

Keep the destructive action separate. Grant s3:DeleteObjectAnnotation only to a dedicated administrative role, not to the enrichment or consumer roles, so a routine process can’t permanently remove governance context. For defense in depth, add an explicit Deny on s3:DeleteObjectAnnotation to the enrichment and consumer role policies, as shown in the following statement.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyAnnotationDeletion",
      "Effect": "Deny",
      "Action": "s3:DeleteObjectAnnotation",
      "Resource": "arn:aws:s3:::amzn-s3-demo-governance/*"
    }
  ]
}

An explicit deny overrides any allow that might reach the role through another policy, so even a future permission change can’t let those roles delete annotations. The deny covers deletion only. The enrichment role can still overwrite governance-context with PutObjectAnnotation, so rely on the audit trail described earlier to detect an unintended change.

Replication has its own controls. To keep classification and residency labels attached to a cross-Region copy, grant s3:GetObjectVersionAnnotationForReplication on the source objects and s3:ReplicateObjectAnnotation on the destination objects.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadSourceAnnotationsForReplication",
      "Effect": "Allow",
      "Action": "s3:GetObjectVersionAnnotationForReplication",
      "Resource": "arn:aws:s3:::amzn-s3-demo-governance/*"
    },
    {
      "Sid": "ReplicateAnnotationsToDestination",
      "Effect": "Allow",
      "Action": "s3:ReplicateObjectAnnotation",
      "Resource": "arn:aws:s3:::amzn-s3-demo-governance-dr/*"
    }
  ]
}

Annotations replicate independently of the object and complete after it, so treat replicated annotations as eventually consistent. The object can show a completed replication status while its annotation is still in transit. You can verify annotation replication through the per-annotation replication_status column in the annotation table. To replicate objects while holding their annotations in the source Region, deny s3:ReplicateObjectAnnotation in the replication role policy. Object replication continues, and only annotation replication is blocked.

Generated labels are proposals, not decisions

When an application or agent generates the classification, the second consequence of the mental model becomes a control rather than a footnote. S3 stores whatever label you write and doesn’t check whether it is correct. If a generated PII flag or retention status feeds an automated expiration or deletion, an incorrect label becomes an incorrect deletion.

Keep a validation boundary between authoring context and acting on it. Use generated annotations to inform and prioritize, and require a verification step before any label drives an irreversible lifecycle operation. That step can be an automated policy check or a human review.

The review_required field in the payload shown earlier encodes this boundary. It starts as true and is set to false only after validation, so downstream automation keys off a reviewed label rather than a raw prediction. The generated_by and generated_at fields give you the audit trail to trace which process produced a label when a decision is later questioned.

Treat the enrichment agent as a proposer, never an approver. For reversible or low-impact actions, the approving step can be an automated rule check. For irreversible or high-impact actions such as deletion, expiring retention, or a cross-border transfer, require explicit human approval regardless of how confident the model is.

When annotations are not the right tool

Annotations occupy a specific niche: larger, structured, mutable context that travels with the object. S3 offers other ways to attach information to objects, and they are not interchangeable.

Object tags are limited to 10 small key-value pairs, but they integrate with IAM policy conditions, S3 Lifecycle rules, and cost allocation. User-defined metadata is fixed at upload time and can’t change without copying the object. An external data source offers rich or specialized queries, but it adds a system to operate and keeps context separate from the data it describes.

Tags and user-defined metadata are also queryable at scale through S3 Metadata live inventory tables, so querying isn’t what makes annotations distinct. The larger, richer, mutable payload is. Annotations are the wrong tool in three cases:

  • Your access pattern is relational or join-heavy.
  • You need policy-condition or lifecycle filtering on the values themselves.
  • You have a very high write rate on the same object.

One more constraint shapes the design. Because annotations are written after the object exists, there is a short window between upload and enrichment during which the object carries no governance context. If your controls can’t tolerate that gap, the context can arrive with the upload itself, through user-defined metadata or a pre-registration step. The following table summarizes the comparison.

Design decision S3 annotations Object tags User-defined metadata External data source
Maximum per object version 1,000 10 Fixed set at upload Not applicable
Maximum size 512-byte name + 1 MB payload 128-char key + 256-char value Up to 2 KB total Effectively unbounded
Data format Any UTF-8 text (JSON, XML, YAML, plain text) Key-value strings Key-value strings Any
Mutable after write Yes Yes No (requires object copy) Yes
Set during upload No (after upload only) Yes Yes Not applicable
IAM condition / lifecycle filtering No Yes No Not applicable
Query at scale S3 Metadata annotation table S3 Metadata live inventory table S3 Metadata live inventory table Rich / relational

Production guidance

Three operational points complete the design:

  • Apply least privilege by separating the enrichment role that writes annotations from the consumer roles that read them, and control annotation replication explicitly.
  • Follow the annotation naming rules. Names are 1–512 bytes, limited to letters, digits, underscore, period, and hyphen, and they can’t begin with the reserved aws or s3 prefixes.
  • Version your payload schema so consumers can evolve with it, and encode any binary content with Base64, because payloads must be valid UTF-8.

When you compare cost, account for each component:

  • The storage that the annotation payloads consume.
  • The request charges for PutObjectAnnotation and the read operations.
  • If you enable an S3 Metadata annotation table, that table’s storage and request costs, plus the Athena scan charges when you query it.

Two points are worth highlighting. You pay S3 Standard rates for annotation storage regardless of the parent object’s storage class, so an annotation on an S3 Glacier Deep Archive object still costs Standard-tier storage. And when an object is copied or replicated, each annotation is copied too and metered as a separate PUT. Bulk-copy and replication paths on objects that carry many annotations therefore incur a request cost proportional to the annotation count.

Weigh the total against the cost of running and querying a separate metadata data source, and against the object reads you avoid by keeping context with the object. Confirm current pricing on the S3 pricing page (see Annotations under Management & Insights) and on the S3 Metadata and Athena pricing pages.

Conclusion

With S3 annotations, you can keep governance context with the data it describes: attached to the object, revisable in place, carried across copies and replication, and queryable with SQL through an S3 Metadata annotation table.

Getting that right depends on a small number of behaviors: version-scoped deletion, Object Lock sequencing, annotation preservation across multipart copies, irreversible annotation deletion, the SSE-C constraint, IAM scoping, and the trust boundary around generated labels. The mental model holds that an annotation is caller-authored context bound to an object version, which S3 stores and moves but doesn’t interpret. With that model, you can reason about each behavior before you build.

To get started, adapt the governance annotation schema in this post to your own classification and retention model, and apply the IAM separation and lifecycle handling described here. Each payload, policy statement, and AWS CLI call is inline, so you can copy it directly into your own environment.


About the author

Aditya Jain

Aditya Jain

Aditya is a Delivery Consultant on the migration team at AWS Professional Services, where he helps customers move on-premises workloads to AWS through infrastructure automation. He focuses on building scalable, automated solutions for cloud-native storage and compute, and on applying AI and machine learning to strengthen those workloads. Connect with him on LinkedIn.

Recommended resilience testing in the next generation of AWS Resilience Hub

Post Syndicated from Jennifer Moran original https://aws.amazon.com/blogs/architecture/recommended-resilience-testing-in-the-next-generation-of-aws-resilience-hub/

Organizations that have defined resilience policies and assessed their applications face a common next step: verifying those applications behave as expected when failures occur. Designing fault injection experiments manually requires deep expertise. You need to know which faults to inject, which resources to target, and how to judge whether the outcome counts as success. Many teams do not know where to start, and experiments built by hand can drift out of date as architectures evolve.

Recommended resilience testing in the next generation of AWS Resilience Hub addresses this. It’s a new capability that helps you validate how your services respond to and recover from failure scenarios. The tests are pre-configured and powered by AWS Fault Injection Service (FIS).

Recommended resilience testing uses what AWS Resilience Hub already knows about your service, including its resources, dependencies, and resilience policy. With this information, AWS Resilience Hub automatically creates FIS experiments, injects faults, and evaluates the results against your success criteria and recovery time objective (RTO). It uses that evaluation to determine a pass or fail outcome. What used to be manual experiment design becomes an out-of-the-box test with built-in success evaluation based on your policy. Each test run auto-generates a report, accessible through the Resilience Hub console.

Customers frequently ask which failure modes to test for and what prescriptive testing guidance we can offer. AWS Resilience Hub answers this by providing four tests at launch, selected based on your service’s architecture and resilience policy.

Availability Zone: recovery – Validates your service can detect and recover from an Availability Zone impairment. The test injects the symptoms of a power interruption in a single Availability Zone, affecting compute, networking, storage, and database resources within that AZ. It confirms your service detects the impaired AZ, continues operating in the healthy AZs, and returns to a healthy state within your defined RTO. It can also help surface single-AZ dependencies you might not be aware of.

Dependency validation – Validates how your service responds when its dependencies within the AWS Region are impaired. If you have enabled dependency discovery, the discovered soft dependency with the highest query volume is pre-selected by default. You can adjust the selection to target individual dependencies or specific groups. The dependency validation test blocks dependencies within the Region to see how your service behaves when they are unavailable. It can help you validate that your service remains healthy when soft dependencies are impaired, and surface dependencies you might not have known were hard. You can also include known hard dependencies to understand their impact and confirm your service detects and responds when they are unavailable. We recommend starting with a single soft dependency and expanding from there.

Multi-Region: isolation – Validates your service can operate independently from a Region when connectivity to another Region is unavailable. The test blocks connectivity between the two Regions, including network traffic, cross-Region data replication, and selected dependencies. This test applies to both active-active and active-passive architectures, and is also a useful precursor to the Multi-Region: recovery test.

Multi-Region: recovery – Validates that your service can recover and serve clients within your defined RTO after a Region is impaired. The test introduces failures into dependencies in the selected Region. Through success alarms, it confirms that your service recovers within your defined RTO in the recovery Region and remains healthy for the duration of the test. You perform the recovery action yourself, such as triggering a failover or executing an Amazon Application Recovery Controller (ARC) Region switch plan.

Each test works at three levels. A test template is the pre-configured recommendation, specifying the fault actions, target resource types, and parameters. A test is your configured instance of a template for your service, with your success alarms, stop conditions, and settings. A test run is a single execution that scopes to your current resources and produces a pass/fail outcome with results and a report. You can run the same test quarterly, monthly, or on demand. To get to that pass/fail outcome you can use success criteria in the test.

Choose success criteria that reflect your service’s health and customer experience, such as order success rate or end-to-end availability, rather than the state of individual resources. The impaired resources are expected to be unhealthy. What you are validating is whether your service as a whole absorbed the failure. Combined with your resilience policy, these criteria determine the pass/fail outcome.

For recovery tests (Availability Zone recovery and Multi-Region recovery), the test passes when all success criteria return to a healthy state within the RTO defined in your policy and hold until the test ends. This validates not just that your service recovered, but that it recovered fast enough to meet your stated objectives.

For sustained tests (Dependency validation and Multi-Region isolation), the test passes when all success criteria hold their thresholds from fault injection through the end of the test, proving your service remained healthy throughout the impairment.

You can also select additional alarms for observability only, such as watching the impaired Region degrade. These appear in results and reports without affecting the outcome.

Deep dive: Dependency validation

Of the four recommended resilience tests, dependency validation was one of the most requested capabilities by our customers, and for good reason. Modern applications depend on dozens of services, and understanding which of those dependencies your application can function without is the key to building a resilient application. The dependency validation test determines whether your application continues to work when a given dependency becomes unavailable.

How dependency validation works

The dependency validation test blocks connectivity to your selected dependencies within an AWS Region to observe how your service behaves when they are unavailable. It validates that your service remains healthy when soft dependencies are impaired and surfaces dependencies you might not have known were hard. You can also include known hard dependencies to understand their failure impact.

This is a sustained test. Unlike recovery tests that measure whether you meet your RTO, the dependency validation test passes when all success alarms remain in OK state from the moment faults are injected through the end of the test.

Dependency discovery

You can define dependencies in two ways:

  1. Turn on dependency discovery. This uses DNS query log analysis with a 35-day look-back window and continuous polling to automatically identify the AWS services, internal endpoints, and third-party endpoints your service calls. Dependency discovery surfaces dependencies you might not be aware of, including unexpected cross-Region calls, critical third-party dependencies, and infrequently accessed services that could cause failures during incidents.
  2. Manually enter DNS endpoints directly when configuring the test.

After you define your dependencies, we recommend classifying each one as a soft or hard dependency.

Classification When to use Example What the test validates
Soft Your service degrades but continues operating without this dependency Analytics API, notification service, feature flags, recommendation engine Application handles absence gracefully. Test should pass
Hard Your service fails if this dependency is unavailable Primary database, authentication service, credential exchange Application detects failure and handles it gracefully. Test might fail (this is expected and informative)

Prerequisites

Before you begin, make sure you have at least one service created and assessed in the next generation of Resilience Hub. You would also require an AWS Identity and Access Management (IAM) service role for the next generation of Resilience Hub to assume when running a resilience test. This role can either be created in the next generation of Resilience Hub console or you can specify an existing one.

Configuring the test

From your service dashboard in the next generation of Resilience Hub, choose the Testing tab. You will see four recommended resilience tests. Select Dependency validation, and then choose Edit test configuration.

The configuration page walks you through six sections:

1. Basic settings

Test duration: The length of time fault actions run. Set any value from 1 minute to 12 hours (default: 30 minutes). After the duration, the test takes a few additional minutes to evaluate success before it ends.

Dependency Region: The AWS Region where your service is deployed that you want to test for dependency failures.

2. Dependencies to block

This is where the distinction between soft and hard dependencies directly drives your test.

Default behavior:

The discovered soft dependency with the highest query volume is pre-selected. If no dependencies have been classified as soft, none are pre-selected.

  • Discovered dependencies: A selection box pre-populated with dependencies found in your service in the selected AWS Region. You can choose up to 10 dependencies to test.
  • (Optional) Additional dependencies: Expand this section to include hard dependencies or dependencies not listed in the primary selection. If you didn’t run any dependency discovery, you can use this field to enter a DNS address that will be blocked as a dependency.

Best practice: Start with a single soft dependency and expand from there, progressively building confidence in your application’s failure handling before including hard dependencies.

3. Test actions (fault actions)

The next generation of Resilience Hub uses AWS FIS actions to block connectivity to your selected dependencies, automatically targeting resources discovered in your service. The fault actions inject 100 percent packet loss at the compute layer, dropping traffic to the selected dependencies:

Fault action What it does
aws:ssm:send-command Drops traffic from Amazon Elastic Compute Cloud (Amazon EC2) instances to the selected dependencies
aws:ecs:task-network-packet-loss Drops traffic from Amazon Elastic Container Service (Amazon ECS) tasks (EC2 and AWS Fargate) to the selected dependencies
aws:eks:pod-network-packet-loss Drops traffic from Amazon Elastic Kubernetes Service (Amazon EKS) pods to the selected dependencies

When the test starts, it matches actions to resources discovered in your service. If no resources match an action’s target type, that action is skipped. This means the test automatically adapts to your compute environment, whether you are running on Amazon EC2, Amazon ECS, Amazon EKS, or a combination.

Additional setup required: The setup for these actions depends on your compute type. You need an AWS Systems Manager Agent container in your Amazon ECS task definition, a Kubernetes service account for Amazon EKS pods, or AWS Systems Manager Agent installed on your Amazon EC2 instances.

4. Test alarms

Alarms determine whether the test passes or fails. Select alarms discovered from your service that reflect service performance and customer experience. For example, order success rate for an ecommerce service or transactions processed for a payments system.

  • Success alarms: The next generation of Resilience Hub uses these to validate whether your service passed or failed the test. Choose alarms that measure your service’s health across the AWS Region.
  • (Optional) Additional alarms: Tracked during the test run and shown in the report, but don’t affect the test outcome. Use additional alarms for observability to monitor how these alarms behave during the dependency impairment.

How to pass: The test passes if all success alarms remain in OK state until the test actions end.

Success criteria and additional alarms share a limit of 5 per configuration update.

5. Stop conditions, reports, and logs

Stop conditions: Amazon CloudWatch alarms that act as guardrails. If breached, they stop the test automatically to protect your workloads. Choose up to five alarms. They must be in the account where the test runs and the AWS Region where the faults are injected.

(Optional) Reports: If you configure an Amazon Simple Storage Service (Amazon S3) bucket as a report destination on your service, the next generation of Resilience Hub generates a report after each test run that includes the test configuration, alarm status, timeline, and results.

Logs: Optionally send test logs to an Amazon S3 bucket or Amazon CloudWatch Logs for deeper analysis. The next generation of Resilience Hub doesn’t charge for sending logs, though ingestion and storage charges apply.

6. Test permissions

The test requires an IAM role to grant access to AWS services and resources. For single account setups, you need one execution role. For multi-account setups, you need an orchestrator role in the account running the test and a target role in each account containing targeted resources. You can create the role directly from AWS Management Console with required permissions pre-configured or use an existing role. Once saved, the role is used by default for future runs.

Note: Updating test settings might change required IAM permissions. Required permissions vary based on the trust policy, fault actions, and test options selected. Always review the IAM role instructions to confirm correct permissions.

Running the test: What success and failure look like

The value of the dependency validation test becomes clear when you compare results across dependency classifications. We walk through two test runs on the same service with the same success alarms: one blocking soft dependencies, one blocking hard dependencies.

Test run: Soft dependencies blocked — PASSED ✅

Dependencies blocked:

  • Payment Gateway.
  • Notification Service.

Success alarms:

  • canary-heartbeat-canary-failure-us-east-2: Monitors service health check availability.
  • canary-order-flow-canary-failure-us-east-2: Monitors end-to-end order processing.
Soft dependency test results: both success alarms in OK state, solid green timeline throughout test duration

Figure 1: Soft dependency test run with both success alarms holding in OK state for the full test duration

What the results show: Both alarms remained in OK state (solid green) from the moment test actions started through the end of the test. The application continued functioning normally without Payment Gateway and Notification Service. The order flow kept processing. The heartbeat kept responding. The service handled the absence of its soft dependencies gracefully, exactly as designed.

What this proves: These dependencies are correctly classified as soft. Your application can tolerate the loss of these dependencies, suppressing notifications without impacting the customer-facing order flow.

Test run: Hard dependencies blocked — FAILED ❌

Dependencies blocked:

  • Amazon Cognito.
  • AWS Security Token Service (AWS STS).

Success alarms:

  • canary-heartbeat-canary-failure-us-east-2: Monitors service health check availability.
  • canary-order-flow-canary-failure-us-east-2: Monitors end-to-end order processing.
Hard dependency test results: order-flow alarm transitions to red immediately after test actions start, heartbeat remains green

Figure 2: Hard dependency test run with the order-flow alarm entering alarm state while the heartbeat alarm stays healthy

What the results show: The heartbeat canary stayed green throughout. The application did not become unavailable. But the order-flow canary transitioned to alarm state (red) immediately after faults were injected and remained there until the test ended. Without Amazon Cognito (authentication) and AWS STS (credential exchange), the application couldn’t complete the business-critical order flow.

What this proves: Amazon Cognito and AWS STS are correctly classified as hard dependencies. The test confirms that their absence impacts critical functionality, but importantly, it also shows the failure was contained. The application did not cascade into a complete failure. It continued responding (heartbeat passed) while the specific business flow that required authentication failed gracefully.

Interpreting results: A decision framework

Test results aren’t simply pass or fail. A passing test can still surface a misclassified dependency, and a failing test can confirm that a dependency is genuinely critical. What matters is reading the outcome against how you classified the dependency, so you know whether your architecture behaved as intended and what to do about it.

The following decision framework helps you interpret the results of each test, understand what they mean, and decide what to do next.

Scenario Expected Outcome What it means What to do next
Soft dependency blocked → test passes Yes Graceful degradation is working. Classification is accurate. No action required. Your architecture handles this failure correctly.
Soft dependency blocked → test fails No The dependency might be misclassified as soft when it’s actually hard. Or your degradation logic has a gap. Review application behavior. Reclassify as hard, or fix the degradation path.
Hard dependency blocked → test fails Yes Confirms the classification. Critical functionality is impacted without this dependency. Verify the failure is graceful (no cascading failures, no data corruption, no hung connections). Consider whether you can add retry/fallback to reclassify as soft in the future.
Hard dependency blocked → test passes No The dependency might be misclassified. It could actually be soft. This could also indicate the dependency isn’t being called as intended. Investigate whether your application is more resilient than expected, or whether the dependency is not being exercised. Reclassify if appropriate or fix the application logic.

Summary

Recommended resilience testing in the next generation of AWS Resilience Hub removes the barrier between knowing your architecture and proving it holds under failure. It provides four AWS recommended tests built on AWS FIS, covering Availability Zone recovery, dependency validation, Multi-Region isolation, and Multi-Region recovery. You can move from policy definition and failure mode assessment to evidence-backed validation without building experiments from scratch.

You can start with the dependency validation test to understand how your application handles the loss of its dependencies. Expand to AZ recovery and multi-Region tests as your program matures. Each test run captures a point-in-time snapshot of your current resources, produces a pass/fail outcome evaluated against your resilience policy, and feeds results into your compliance and reporting workflows over time.

Recommended resilience testing is available today in all AWS commercial Regions where the next generation of AWS Resilience Hub is supported. To learn more and get started, visit the AWS Resilience Hub User Guide and the AWS Resilience Hub product page.

 


About the authors

Jennifer Moran

Jennifer Moran

Jennifer is a Principal Resilience Specialist Solutions Architect at AWS, where she helps customers architect resilient cloud solutions that improve their resilience posture and operational excellence. She is the co-author of Engineering Resilient Systems on AWS (O’Reilly Media). Her interests include fault-tolerant design, scalable architectures, and high-availability systems.

Imran Sadiq

Imran Sadiq

Imran is a Senior Solutions Architect at Amazon Web Services, working with financial services customers across New Zealand. As a resilience specialist, he is passionate about helping organizations prepare for, respond to, and recover from the unexpected. With deep expertise in resilience testing, disaster recovery, and cloud-native resilience patterns, Imran partners with customers to build resilient systems.

Centralized dashboard for monitoring SES identities

Post Syndicated from Manoj Gaddam original https://aws.amazon.com/blogs/messaging-and-targeting/centralized-dashboard-for-monitoring-ses-identities/

Organizations running Amazon Simple Email Service (Amazon SES) across multiple AWS accounts face a common challenge: visibility. When you have dozens or hundreds of accounts sending email, answering basic questions becomes surprisingly difficult:

  • How many SES identities exist across my organization?
  • Which identities are verified and pending?
  • Are there stale or unused identities that should be cleaned up?
  • Which accounts are sending from which domains?
  • Is DKIM properly configured for all sending domains?

Without centralized visibility, security teams can’t audit email-sending capabilities, compliance teams can’t enforce domain policies, and operations teams discover rogue identities only after deliverability issues arise.

This post presents two solutions for building a centralized SES identity dashboard across your AWS Organization. Each collects identity data from all member accounts and presents it through Amazon Athena and Amazon Quick Sight.

  • Option 1: A single AWS Lambda function that scans all accounts sequentially, best for organizations with fewer than 50 accounts.
  • Option 2: An AWS Step Functions state machine with a Map state for parallel execution, best for organizations with 50 or more accounts.

Both solutions provide centralized visibility into your SES posture with minimal member account footprint. You can deploy the option that best suits your needs by following the guidance in this post.

Solution architecture

The following diagram shows the end-to-end scan workflow, from the scheduled trigger through cross-account collection to the Amazon Athena and Amazon Quick Sight presentation layer.

SES identity scan workflow from the scheduled trigger through cross-account collection to Athena and Amazon Quick Sight

Figure 1: End-to-end SES identity scan workflow from the scheduled trigger through cross-account collection to the Athena and Amazon Quick Sight presentation layer

For each identity, the scan collects the attributes Amazon SES reports for that identity: identity name, type (domain or email), verification status, DKIM configuration (signing enabled, status, and current key length), the custom MAIL FROM domain and its status, and whether sending is enabled.

SPF and DMARC are published as DNS records by the domain owner rather than reported by Amazon SES, so they make a natural next layer to add on top of this scan.

Option 1: Single Lambda (fewer than 50 accounts)

A single AWS Lambda function handles the entire scan sequentially, at approximately 30 seconds per account. Because a sequential scan of 50 or more accounts exceeds what one invocation can complete, Option 2 parallelizes the work across accounts.

Option 1 architecture using a single Lambda function to scan accounts sequentially

Figure 2: Option 1 architecture using a single Lambda function to scan accounts sequentially

How Option 1 works

  • Amazon EventBridge triggers the scanner Lambda on a daily schedule (configurable).
  • The Lambda calls organizations:ListAccounts to discover all active member accounts.
  • For each account, it calls sts:AssumeRole to assume the SES-Identity-Reader role. The role’s trust policy requires three conditions: the scanner role’s aws:PrincipalArn, your aws:PrincipalOrgID, and a per-deployment external ID passed as a NoEcho parameter. Generate a unique value for this deployment, and don’t reuse a fixed one.
  • Using the assumed credentials, it calls ec2:DescribeRegions to discover enabled Regions, then ses:ListEmailIdentities and ses:GetEmailIdentity in each Region.
  • Results are written to Amazon S3 as JSON Lines, both a timestamped historical path and a latest/ path for Athena.
  • If any accounts or Regions fail, the Lambda records the failures in scans/summary/latest.json and publishes an error summary to Amazon Simple Notification Service (Amazon SNS). If accounts exist but zero identities are collected, the run fails without overwriting scans/latest (the previous good scan is preserved) so the SES-Scanner-Errors alarm fires.
  • Amazon CloudWatch alarm (a missed-run alarm) fires if no successful scan occurs within 25 hours. Additional alarms cover Lambda Errors and dead-letter-queue depth.

Deploying Option 1 in your AWS account

Prerequisites for Option 1:

  • AWS account access with permissions to deploy CloudFormation stacks and StackSets.
  • Your AWS Organization ID (format: o-xxxxxxxxxx).
  • Your management account ID (12 digits).
  • From the repository, you need the ses-reader-role.yaml and ses-scanner-stack.yaml files found in /option-1/.

Step 1: Deploy the cross-account IAM role

Template: option-1-ses-reader-role.yaml

  • Enable trusted access between CloudFormation StackSets and AWS Organizations. This is a one-time prerequisite for service-managed StackSets and is a no-op if already enabled.
  • In the CloudFormation console, this is offered automatically the first time you create a service-managed StackSet. Alternatively, run the following command from the management account: aws organizations enable-aws-service-access --service-principal member.org.stacksets.amazonaws.com
  • Open the AWS CloudFormation console in your management account.
  • Navigate to StackSets and choose Create StackSet.
  • Upload the ses-reader-role.yaml file.
  • Configure the parameters:
    • ManagementAccountId : Your 12-digit management account ID.
    • OrganizationId : Your organization ID (o-xxxxxxxxxx). Restricts assumption to principals in your organization.
    • ExternalId : A unique random secret you generate for this deployment (8–128 chars). Supply the same value to the scanner stack in Step 2. Don’t reuse the sample value.
    • ScannerRoleName : Leave default (SES-Identity-Scanner-Role) unless you renamed the scanner role.
  • Choose Service-managed permissions.
  • Enable Auto-deployment (so new accounts automatically receive the role).
  • Deploy to your organization root (r-xxxx) in a single Region (IAM roles are global).
  • Wait for the operation to show SUCCEEDED for all member accounts.

This deploys a strictly read-only IAM role (SES-Identity-Reader) to all member accounts. The role grants only the SES v2 read actions it uses (ses:ListEmailIdentities, ses:GetEmailIdentity) plus ec2:DescribeRegions, and no write or other permissions.

Step 2: Deploy the scanner stack

Template: option-1-ses-scanner-stack.yaml

  • Open the AWS CloudFormation console in your management account.
  • Choose Create stack, then With new resources (standard).
  • Upload the ses-scanner-stack.yaml file.
  • Configure the parameters:
    • ScheduleExpression : Scan frequency (default: rate(1 day)).
    • OrganizationId : Your organization ID (o-xxxxxxxxxx). Scopes cross-account sts:AssumeRole through an aws:ResourceOrgID condition.
    • ExternalId : The same value you generated in Step 1.
    • AlertEmail : Email address that receives scan-error summaries and CloudWatch alarms.
  • Acknowledge IAM resource creation and choose Submit.
  • Wait for CREATE_COMPLETE.
  • After the stack is created, confirm the SNS subscription in the email sent to AlertEmail. Until you confirm, error notifications and alarms are not delivered.

The stack creates:

  • Two S3 buckets (a scan-results bucket and an access-logs bucket, both versioned, public access blocked, with lifecycle rules including noncurrent-version expiration).
  • A Lambda function (Python 3.12, 512 MB, 15-minute timeout) with an explicit CloudWatch log group (90-day retention).
  • An Amazon EventBridge rule, an SQS dead-letter queue.
  • CloudWatch alarms (missed run, Lambda Errors, DLQ depth).
  • An SNS topic with an email subscription.
  • An enforced encrypted Athena workgroup.
  • An AWS Glue database with table definition for Athena.

Note on data retention: Timestamped historical scans are written under scans/archive/, and both lifecycle rules (expiration and transition to Infrequent Access) are scoped to that prefix. Three pointers are continuously overwritten: scans/latest/, scans/summary/, and athena-results/. These are deliberately excluded from expiration, so the most recent good scan is always preserved, including when a run fails closed.

Step 3: Test the scanner

  • Open the AWS Lambda console.
  • Select the SES-Identity-Scanner-v2 function.
  • Choose Test, create a test event with payload {}, and choose Test.
  • Review the execution result, which should show accounts scanned, total identities found, and any errors.
  • Verify the JSON Lines file exists in your S3 bucket under scans/latest/.

Step 4: Query with Amazon Athena

  • Open the Amazon Athena console.
  • Select the workgroup the stack creates (<stack-name>-ses-identity). It enforces an encrypted results location inside the hardened scan-results bucket, so you do not set a query result location manually.
  • Select the ses_identity_dashboard database.
  • Run the following queries to explore your organization’s SES posture.

Organization summary:

SELECT account_id,
       COUNT(*) as total_identities,
       SUM(CASE WHEN verified THEN 1 ELSE 0 END) as verified_count,
       SUM(CASE WHEN dkim_status = 'SUCCESS' THEN 1 ELSE 0 END) as dkim_configured
FROM ses_identities
GROUP BY account_id
ORDER BY total_identities DESC;

Identities requiring action:

SELECT account_id, region, identity_name, identity_type, dkim_status
FROM ses_identities
WHERE verified = false
   OR (identity_type = 'DOMAIN' AND dkim_status != 'SUCCESS')
ORDER BY account_id;

More queries: option-1-sample-athena-queries.sql

Step 5: Visualize with Amazon Quick Sight

  • Open the Amazon Quick Sight console.
  • Create a new dataset using Amazon Athena as the data source.
  • Select the ses_identities table from the ses_identity_dashboard database.
  • Import the data into SPICE for fast dashboard performance.
  • Create visualizations: bar chart (identities by account), pie chart (verified and unverified), heat map (identities by Region and account), and a detail table with filters.
  • Schedule SPICE refresh to run after the daily scan completes.
Amazon Quick Sight dashboard showing SES identities by account and verification status Amazon Quick Sight dashboard showing SES identities by Region with a detail table

Option 2: Step Functions with parallel account scanning (50+ accounts)

AWS Step Functions with a Map state provides parallel execution. With up to 40 concurrent per-account scans, an estimated 280 accounts complete in roughly 3–5 minutes, with built-in retry logic and per-account error isolation. The template uses an inline Map, which caps concurrency at 40. To scale beyond 40, switch the ItemProcessor mode to DISTRIBUTED. This additionally requires three actions on the state machine plus S3 ItemReader/ResultWriter permissions.

  • states:StartExecution
  • states:DescribeExecution
  • states:StopExecution
Option 2 architecture using a Step Functions state machine with a Map state for parallel account scanning

Figure 3: Option 2 architecture using a Step Functions state machine with a Map state for parallel account scanning

Prerequisites for Option 2:

  • AWS Organizations enabled with a management account (or delegated administrator).
  • Permissions to deploy CloudFormation StackSets across member accounts.
  • Amazon SES configured in one or more member accounts (identities to scan).
  • Console access to AWS CloudFormation, AWS Lambda, Amazon S3, and Amazon Athena.
  • Clone the repository:
git clone https://github.com/aws-samples/sample-SES-Identity-Dashboard.git

How Option 2 works

Refer to Option 2 image for the workflow:

  • Amazon EventBridge triggers the Step Functions state machine on schedule.
  • The ListAccounts Lambda discovers all active organization accounts and returns them as a JSON array.
  • The Map state iterates over the accounts array with MaxConcurrency: 40 (inline Map. Do not raise above 40 without switching to a Distributed Map).
  • Each Per-Account Scanner Lambda receives a single account ID, assumes the reader role, scans all enabled Regions, and writes per-account results to S3. Per-region and per-identity failures are reported in-band rather than silently dropped.
  • The Consolidate Lambda merges all per-account files into a single JSON Lines file at the scans/latest/ path. It also writes latest.json and fails the execution only when zero identities were collected and at least one account, Region, or identity failed. A legitimately empty organization (every account scanned cleanly with no identities) is treated as healthy, and the previous scans/latest/ is preserved when the run fails closed.
  • On any account failure, Step Functions automatically retries (two attempts, 60-second interval, backoff rate 2.0).
  • Failed accounts are captured in the execution output without stopping the scan for other accounts.

The Map state processes up to 40 accounts concurrently. Each per-account Lambda completes in approximately 30 seconds, so 280 accounts finish in 3–5 minutes. State machine logging and AWS X-Ray tracing are enabled. A SES-Scanner-SFN-Execution-Failed alarm covers failed executions. The Step Functions console provides a visual execution history showing exactly which accounts succeeded or failed.

Deploying Option 2 in your AWS account

Template: option-2-ses-scanner-stepfunctions.yaml

  • Confirm the SES-Identity-Reader role is already deployed to all member accounts (Step 1 from Option 1).
  • Open the AWS CloudFormation console in your management account.
  • Upload the ses-scanner-stepfunctions.yaml file.
  • Configure the parameters:
    • OrganizationId : Your organization ID (o-xxxxxxxxxx). Scopes sts:AssumeRole through aws:ResourceOrgID.
    • ExternalId : The same per-deployment secret used by the reader role.
    • AlertEmail : Address subscribed to the alert SNS topic (confirm the subscription email).
    • ScheduleExpression.
    • and optionally MaxConcurrency (default 40. Bounded 1–40 for the inline Map).
  • Acknowledge IAM resource creation and choose Submit.
  • Wait for CREATE_COMPLETE.
  • The Athena table schema, sample queries, and Amazon Quick Sight dashboard configuration are the same as Option 1. Only the AWS Glue database name differs. Option 2 creates ses_identity_dashboard_sfn, while Option 1 uses ses_identity_dashboard. Point your Athena queries and Amazon Quick Sight dataset at ses_identity_dashboard_sfn. Query results are written to the enforced encrypted workgroup <stack-name>-ses-identity-sfn. Select it in the Athena console. The distinct names let both options run in the same account.

Clean up

To remove all resources created by this solution:

  • Delete the scanner CloudFormation stack from your management account.
  • In StackSets, delete all stack instances, then delete the StackSet itself.
  • If you created test SES identities, delete them from the SES console in each account.
  • Empty and delete the S3 bucket if it was not removed by the stack deletion (buckets with objects require manual emptying).

Conclusion

This solution gives your organization a single, centralized view of SES identities across all accounts, deployed in minutes with minimal member account footprint.

Start with Option 1 for immediate value. When your organization grows beyond 50 accounts, deploy Option 2. The data format, Athena queries, and Amazon Quick Sight dashboards remain unchanged. Only the orchestration layer changes.

To get started, clone the repository and deploy Option 1. For more information, see Amazon SES v2 API reference and Amazon Quick Sight User Guide.


About the authors

Manoj Gaddam

Manoj Gaddam

Manoj is a Technical Account Manager at AWS, where he helps enterprise customers architect, operate, and optimize their cloud solutions. He partners with strategic software and technology customers to help them achieve their business and technical goals on AWS. His focus spans analytics, storage, security, and modern compute and container workloads, as well as helping customers explore and adopt AI and generative AI capabilities on AWS. Outside of work, he enjoys traveling and spending time with friends.

Ajinkya Bhoite

Ajinkya Bhoite

Ajinkya is a Senior Cloud Support Engineer at AWS and a Subject Matter Expert in Amazon Simple Email Service (SES) and Amazon S3, where he helps customers untangle their trickiest SES and S3 problems. Away from the cloud, he’s a reader, a runner, and a published novelist, author of the Kindle fiction Shiva Stone: Hampi’s Hidden Treasure.

Mrinal Sorte

Mrinal Sorte

Mrinal is a Technical Account Manager at AWS, where she helps enterprise customers build secure, resilient, and compliant workloads on AWS. Passionate about AI, automation, and security, she actively contributes to AWS technical communities and enjoys sharing knowledge through workshops and enablement sessions. She works backwards from customer objectives to design and implement scalable solutions that drive innovation, reduce risk, and accelerate growth.

Sassan Hajrasooliha

Sassan Hajrasooliha

Sassan is a Senior Specialist AWS Solutions Architect with AWS. He has been working as an IT professional since 2003 and covers diverse technologies from different vendors in the industry. Throughout his career he has helped customers ranging from startups to multinational enterprises and public agencies get the best out of their IT systems for their businesses and missions. At AWS he is focused on Communication Developer Services like SES and EUM, as well as infrastructure migration and modernization.