With AI coding agents and Amazon Aurora DSQL, you can turn data from existing business systems into applications that support a wide range of use cases across industries. Turning that data into an application can require coordination across application, database, security, and platform teams, which slows prototypes and internal tools.

AI coding agents can shorten that path, but only if they understand the database they build on. Although Amazon Aurora DSQL works with familiar PostgreSQL tools, its distributed architecture requires specific approaches to schema design, data loading, authentication, and transaction handling. An agent relying only on general knowledge or information that doesn’t reflect the latest service capabilities might create an implementation that appears valid but doesn’t follow current Aurora DSQL guidance. This makes it difficult to assess whether the generated architecture and design are appropriate for the service.

Aurora DSQL helps close that gap through steering guidance for plugins, skills, and powers. This guidance gives AI coding agents service-specific context for schema design, data loading, authentication, and transaction handling. Depending on the AI coding agent, the guidance is delivered through a plugin, skill, or power. It can include configuration for the Aurora DSQL Model Context Protocol (MCP) server, which allows the agent to inspect and check its work against a live Aurora DSQL database.

In this post, we use Kiro, an agentic integrated development environment (IDE) and the Aurora DSQL Kiro power which brings Aurora DSQL steering guidance and MCP server configuration into Kiro. We demonstrate a general solution pattern for turning source-system data and business requirements into a working data-driven application on Aurora DSQL, using synthetic manufacturing data as an example. Across four prompts, Kiro recommends a database, creates a development cluster, designs and applies a schema, loads the data with the Aurora DSQL Loader, and builds a local web application. We also demonstrate how the application handles concurrent business actions that update the same data, explain what the power contributed, and discuss what you need to consider before taking a similar application to production.

Aurora DSQL and the agent tooling

Amazon Aurora DSQL is the fastest serverless distributed SQL database for always available applications. There are no instances to size, patch, or upgrade, and you only pay for what you use. Aurora DSQL replicates data across Availability Zones in an AWS Region and supports active-active multi-Region clusters. It uses optimistic concurrency control: when two transactions write the same rows, the one that commits second fails with SQLSTATE 40001, the standard PostgreSQL serialization failure code, and the application retries the whole transaction. For details, see Concurrency control in Aurora DSQL.

Several tools help an AI coding agent build on Aurora DSQL. They solve different problems, and this post uses most of them.

Component What it provides Where it runs Used in this post
Aurora DSQL Kiro power Aurora DSQL guidance for Kiro, loaded on demand, plus configuration for the Aurora DSQL MCP server Kiro IDE Yes
Aurora DSQL agent skill (dsql) The same kind of guidance for other agents, installed with the Skills CLI Claude Code, Codex, Cursor, Kiro CLI, and others Mentioned
databases-on-aws plugin The skill, MCP server configuration, and a verification hook in one install Claude Code, Codex, Cursor Mentioned
Aurora DSQL MCP server Tools to query the live cluster, read its schema, search Aurora DSQL documentation, get recommendations, and lint SQL for compatibility. Read-only unless started with --allow-writes Locally, as a process the IDE starts Yes, read-only
Aurora DSQL Loader A command line tool that loads CSV, TSV, and Parquet files into Aurora DSQL in parallel, with retries and resumable jobs Locally or on another host of your choice Yes

For setup paths for each agent, see Aurora DSQL steering: Plugins, skills, and powers. For a closer look at the MCP server tools, see MCP tools for Amazon Aurora DSQL: Query execution and schema management.

Solution overview

The following diagram shows the two paths in this solution. During development, Kiro uses the Aurora DSQL power for service-specific guidance and a read-only MCP connection to inspect the schema, run read-only checks, and validate SQL for Aurora DSQL compatibility. Kiro applies schema and setup changes through generated scripts and loads the extracts with the Aurora DSQL Loader. These tools connect directly to Aurora DSQL using AWS Identity and Access Management (IAM) authentication. At runtime, the generated application connects directly to Aurora DSQL. Neither Kiro nor the MCP server is in the end-user request path.

Architecture showing Kiro building the data layer and application, which connects directly to Aurora DSQL at runtime

Figure 1: Kiro and the Aurora DSQL power build the data layer and application, which connects directly to Aurora DSQL at runtime

The numbers in the diagram follow the walkthrough:

  1. The builder sends four prompts, approves one plan for building the data layer and another for building the application, and confirms deletion of the demo cluster by entering its recorded cluster ID.
  2. Kiro loads Aurora DSQL guidance from the power as it plans and builds.
  3. Kiro creates the development cluster with the AWS Command Line Interface (AWS CLI).
  4. Kiro checks the database through the read-only MCP server and lints SQL before running it.
  5. Kiro’s setup scripts apply the schema migrations, one DDL statement per transaction.
  6. The Aurora DSQL Loader loads the data.
  7. At runtime, users access the generated application, which connects directly to Aurora DSQL using IAM authentication and TLS. Neither Kiro nor the MCP server is in the application request path.

The solution includes the following components:

  • Kiro IDE with the Aurora DSQL Kiro power – Kiro loads Aurora DSQL guidance from the power and presents one consolidated plan before each build phase. You approve the data-layer and application plans separately.
  • Aurora DSQL MCP server – A workspace-scoped, read-only connection that Kiro uses to query the cluster, check the schema, and lint SQL.
  • Aurora DSQL cluster – A single-Region development cluster in us-east-1 with deletion protection enabled.
  • Aurora DSQL Loader – Loads the canonical extract files into the schema.
  • Local FastAPI application – A server-rendered web app that listens only on 127.0.0.1 and connects to Aurora DSQL as a restricted database role.

Walkthrough use case: Manufacturing material control

To demonstrate this solution pattern, we use a manufacturing material-control scenario involving two assembly plants, one in the United States and one in Mexico, and a central planning team. Both plants build an industrial drive controller whose bill of materials requires a control module, two vibration sensors, and an enclosure. The sample extracts represent data from four source systems: work orders from an enterprise resource planning (ERP) system, inventory lots from a warehouse system, quality holds from a quality system, and material-issue and finished-output records from a manufacturing execution system.

The application supports three tasks:

  1. Determine whether a work order has eligible material.
  2. Trace component lots to finished lots.
  3. Identify work orders and finished lots affected by a quality hold.

The dataset is small (11 CSV files, 39 rows) and fully synthetic, but it includes cases that test the design: a component lot with exactly enough stock for one reservation, a lot that is already on hold, a historical suspect lot with a complete genealogy chain, and negative-test files with a duplicate key and invalid values.

Prerequisites

Before you start, make sure you have the following:

  • An AWS account where you can create an Aurora DSQL cluster in us-east-1. Use a development or sandbox account.
  • An AWS CLI profile that uses temporary credentials from an assumed role, for example through AWS IAM Identity Center. Confirm that aws sts get-caller-identity --profile <your-profile> succeeds. Don’t paste credentials, account IDs, or ARNs into prompts.
  • An IAM policy for that role that allows only what this walkthrough needs. Ask your IAM administrator to grant the following Aurora DSQL actions in a development or sandbox account. Scope resource-level actions to Aurora DSQL clusters in us-east-1. For Aurora DSQL actions that support tag-based conditions, allow cluster creation only when the request includes the tag Purpose=material-control-demo, and allow actions on an existing cluster only when it has the same tag. The walkthrough uses this tag to distinguish the demo cluster from other clusters, and the cleanup script verifies it before deleting the cluster. Because dsql:ListClusters does not support resource-level permissions, specify "Resource": "*" for that action. Validate the final policy against the Aurora DSQL IAM documentation and review it with your security team:
Aurora DSQL actions Purpose
dsql:CreateCluster, dsql:GetCluster, dsql:TagResource, dsql:ListTagsForResource Create and verify the demo cluster
dsql:ListClusters Confirm that no existing cluster has the demo tag
dsql:DbConnectAdmin on the demo cluster Apply schema changes and database role mappings
dsql:DbConnect on the demo cluster Connect using the application database role
dsql:UpdateCluster, dsql:DeleteCluster on the demo cluster Clean up the demo cluster
  • Kiro installed, with no project-specific .kiro/ configuration in the folder you will use.
  • Python 3.12 or later, and AWS CLI version 2.
  • Network access to the AWS endpoints used by the walkthrough, PyPI, and GitHub for the Aurora DSQL Loader release.

Aurora DSQL charges for the database work your cluster performs and for storage. The sample is small, and the cleanup step deletes the cluster. For details, see Aurora DSQL pricing.

Prepare the workspace

Download the sample from our GitHub repository. Clone the repository and go to the sample folder:

git clone https://github.com/aws-samples/aurora-dsql-samples.git cd aurora-dsql-samples/sample-amazon-aurora-dsql-kiro-power-app-dev

The folder contains the walkthrough prompts and a workspace template:

sample-amazon-aurora-dsql-kiro-power-app-dev/ ├── README.md ├── reader-prompts.html ├── reader-prompts.md └── workspace/ ├── data/ └── scripts/ ├── cleanup_demo.sh └── validate_dataset.py

Keep the prompt files outside the workspace that you open in Kiro, so that Kiro starts only from the supplied data and scripts. Create a working copy outside the cloned repository and validate it:

cp -R workspace ~/reader-run-01 cd ~/reader-run-01 (cd data && shasum -a 256 -c SHA256SUMS) python3 scripts/validate_dataset.py

Both validation commands must pass. Then open only reader-run-01 as the Kiro workspace. Keep reader-prompts.html open separately in your browser for copying prompts.

The validator checks that the sample files are complete and internally consistent, including the expected inventory, genealogy, and invalid-data test cases. Kiro validates the database schema, data load, and application in later steps.

Prompt 1 performs analysis only and makes no changes. Prompts 2 and 3 each present one plan for review and continue after a single Approved response. Kiro asks for confirmation again only if the AWS identity or target changes, the work expands beyond the approved plan, or an unplanned change could remove resources or data. Kiro’s standard tool-permission dialogs may still appear and are separate from the plan approval.

Step 1: Ask Kiro to recommend a database

Start with the business problem, not the database. Paste the following prompt:

Using the synthetic extracts in data/, recommend an AWS database for a material-control and lot-genealogy application used by a US assembly plant, a Mexico assembly plant and a central planning team. The application must provide one shared relational data set. A quality hold must immediately block reservation and issue at both plants. Reads and writes must continue through an Availability Zone failure without a failover action. The team wants no database servers, capacity settings, maintenance windows or database upgrade scheduling. Costs should fall substantially during idle weekends; disclose any first-connection behavior after idle. Commands change several related rows atomically. Existing tools use PostgreSQL drivers. For this application, all database users, including administrators, must authenticate with AWS Identity and Access Management (IAM); database passwords aren't allowed. Compare the best recommendation with Aurora PostgreSQL Serverless v2 and RDS for PostgreSQL Multi-AZ. For each candidate, verify from current official AWS API documentation whether the administrator user can use IAM database authentication without retaining a database password. Treat opt-in support as meeting the requirement, but state the required configuration. Use current official AWS documentation for all deciding claims. Keep the answer under 450 words. Include one short comparison table, the main trade-offs, business rules, screens, assumptions and open questions. Do not create files, install software, inspect my AWS account or create resources. Stop after the recommendation.

Kiro reads the extracts and compares the three options against each requirement. In our runs, Kiro recommended a single-Region Aurora DSQL cluster, citing writes that continue through an Availability Zone failure without a failover step, no maintenance windows or capacity settings, and IAM authentication for every user. It also noted the trade-offs you should plan for, including retrying transactions that conflict at commit and testing reporting tools that depend on PostgreSQL features Aurora DSQL doesn’t support.

Comparison of Aurora DSQL, Amazon Aurora PostgreSQL Serverless v2, and RDS for PostgreSQL Multi-AZ against the requirements

Figure 2: Kiro compares Aurora DSQL with Amazon Aurora PostgreSQL Serverless v2 and RDS for PostgreSQL Multi-AZ against the stated requirements

The requirements in this prompt describe a workload that fits Aurora DSQL. With different requirements, for example a need for PostgreSQL extensions that Aurora DSQL doesn’t support, a different database can be the right answer. Check the recommendation against current documentation before you rely on it.

Step 2: Install the Aurora DSQL power

In Kiro, open the powers pane, search for Build applications with Aurora DSQL, and install it. Kiro activates the installed power automatically when a relevant prompt requires it. You can also open it from the Kiro powers registry. This is the only tool you install by hand. You don’t need to install the MCP server separately. The next prompt creates a workspace-scoped connection that runs a pinned version of the same server package.

Kiro activating the Aurora DSQL power and listing the MCP tools it provides before designing the data layer

Figure 3: Kiro confirms the Build applications with Aurora DSQL power and lists the MCP tools it provides before designing the data layer

Step 3: Build the data layer

Paste the following prompt. It asks Kiro to plan the whole data layer, wait for one approval, and then build it.

Build the complete Aurora DSQL data layer for the material-control demonstration in this workspace, using only the synthetic extracts under `data/`. Approval contract: - First perform only local validation and read-only AWS discovery. - Present one consolidated plan covering every file, dependency, AWS resource, database change, load operation and verification in this prompt. - Wait once for my explicit `Approved` response. - That single approval covers all listed workspace files, dependency installations, cluster creation, and direct database setup scripts. It also covers the schema statements, IAM database mappings, data loading, waits, and verification described in the plan. - After approval, do not pause again for an individual file, command, SQL statement, index, role, grant, installation, wait or test already included in the plan. - Stop and ask again only if the AWS identity or target differs, scope expands, a new resource is needed, a destructive action becomes necessary, or an unexpected result occurs. - Use the following defaults instead of presenting optional design decisions. Do not ask me to approve generated requirements or design files separately; validate them and continue within this batch. - Cleanup is outside this approved batch and requires separate confirmation after the application has been explored. Before approval, validate the dataset checksums and validator, confirm the active AWS identity without printing it, inventory Aurora DSQL clusters in `us-east-1` and confirm none is already tagged `Purpose=material-control-demo`; leave every existing cluster untouched; and confirm the Build applications with Aurora DSQL power is active. The approved batch must do all of the following: 1. Create one single-Region Aurora DSQL cluster in us-east-1. Enable deletion protection and use the AWS-owned encryption key. Add these tags: Purpose=material-control-demo, DataClassification=synthetic, Environment=development, and Owner=blog-walkthrough. Use a fixed client token and verify the final state. 2. Store the cluster ID, Region, identity fingerprint and AWS profile alias only in owner-readable, git-ignored `.private/` files required by `scripts/cleanup_demo.sh`. Never print their values into evidence. 3. Create `.kiro/settings/mcp.json` with one workspace server named `mc-dev-dsql-readonly`, pinned to `awslabs.aurora-dsql-mcp-server@1.1.4`, connecting as `admin` with no `--allow-writes`. If Kiro must reload to activate it, ask only for the reload, reopen this chat and continue the already approved batch without requesting approval again. Verify a harmless read query. 4. Keep MCP read-only. Use direct scripts with IAM tokens for approved database writes. Use TLS hostname verification with an explicit trusted CA bundle. Capture command failures privately and show only redacted errors. 5. Create a concise requirements and design record plus restart-safe migrations. Aurora DSQL DDL statements run separately, secondary indexes use `CREATE INDEX ASYNC`, and a migration with an unknown commit result is reconciled from the catalog rather than blindly repeated. Do not inject failures or build an exhaustive recovery-test matrix. 6. Create schema `mc` with the 11 extract tables plus `material_requirement`, `material_reservation`, `command_request` and `initial_load_finalization`. Add `mc_meta.migration_ledger`. 7. Use `inventory_lot` as the shared lot control row for reserve, issue and hold. Use one `material_requirement` row per work order and BOM line as the shared requirement control row for reserve, cancel and issue. Maintain the lot reserved total and the requirement issued/open-reserved totals transactionally. 8. Store an idempotency key and SHA-256 request fingerprint in the same transaction as each successful command. Retry only `40001` by restarting the whole transaction. A reused key with different input is a business conflict. Roll back before reading after `23505`. 9. Create database roles `mc_loader`, `mc_runtime` and `mc_readonly`. Grant `mc_runtime` only the writes used by the application: `UPDATE` on `inventory_lot`; `INSERT` and `UPDATE` on `quality_hold`; `INSERT` on `material_issue`; `UPDATE` on `material_requirement`; `INSERT` and `UPDATE` on `material_reservation`; and `INSERT` on `command_request`. Do not grant it writes on `work_order_output`, `lot_genealogy_edge`, master-data tables, `initial_load_finalization` or the migration ledger. It must have no `DELETE`, `TRUNCATE`, schema `CREATE` or grant options. Validate the live grants against this exact list. Map the one walkthrough IAM principal to all three roles as a documented demo simplification. Production should use separate IAM principals. 10. Use Aurora DSQL Loader v3.3.0 for the canonical load. Verify its release asset by published SHA-256; do not use `--version` as a gate. Account for positional column mapping by generating deterministic loader-compatible copies under `build/` while leaving `data/` unchanged. Use one worker and strict error-on-conflict behavior. Do not claim that loader dry-run or CSV full verification proves authentication, source counts or values. Do not claim the loader verifies server certificates unless that mode is independently proven. 11. Independently check the files against the live schema before loading. Load all 39 canonical rows. In one guarded initial-load finalization transaction as `admin`, set the two delivered open-hold counts and create exactly nine material-requirement rows. The transaction must refuse a rerun or any existing runtime activity. 12. Verify all 39 rows by key and normalized value, the nine requirement rows, the lot and requirement totals, the expected genealogy chain and the exact role grants. Include rollback-only checks showing that `mc_runtime` cannot change master data, write `work_order_output` or `lot_genealogy_edge`, write the finalization or migration ledger, delete rows or create schema objects. Confirm all indexes are valid and run `bash scripts/cleanup_demo.sh --check`. Check mode may append its redacted report but must not change AWS, the database, processes or MCP configuration. Write one redacted summary to `evidence/data-layer-summary.md`. Do not create dozens of evidence files or exhaustive check matrices. Finish with either `DATA LAYER READY` or a specific stopped condition.

What Kiro does before you approve

Kiro validates the sample data, confirms the active AWS identity without displaying its identifiers, checks that no existing cluster has the demo tag, and verifies that the Aurora DSQL power is active. It then presents one consolidated plan. Before replying Approved, confirm that the plan:

  • Creates one cluster in us-east-1 with the specified tags and deletion protection enabled.
  • Leaves existing clusters unchanged.
  • Configures the MCP server only for the current workspace and keeps its write capability disabled by omitting --allow-writes.
  • Creates separate database roles for loading data, running the application, and read-only access, with each role limited to the operations it needs.
  • Lists the dependencies Kiro will install, including the Aurora DSQL Loader release downloaded from GitHub.

What Kiro builds

After your approval, Kiro creates the cluster and verifies its status, deletion protection, encryption, and tags. It writes the workspace MCP configuration and confirms a read query through the MCP server.

In our reader run, Kiro creates the workspace MCP configuration and confirms the connection by running a read-only query. For connection issues, see the Troubleshooting section.

Kiro then creates a concise requirements and design record, generates the migration files, and applies them using a generated setup script. With guidance from the Aurora DSQL power, the data layer follows these Aurora DSQL practices:

  • Data modeling and integrity – The schema uses UUID primary keys, foreign keys, and CHECK constraints to maintain relationships and enforce data rules.
  • Schema migrations – Secondary indexes are created asynchronously, and migrations apply one DDL statement per transaction and wait for each index to become valid.
  • Transaction handling – Commands that modify the same data use shared control rows so that overlapping changes conflict under the optimistic concurrency control of Aurora DSQL. The application retries the complete transaction and uses idempotency records to help prevent duplicate results.
  • Least-privilege access – Separate database roles are used for loading data, running the application, and read-only access. The application role can perform only the database operations required by the application.

Kiro checks the generated SQL for Aurora DSQL compatibility before applying the migrations. After applying them, it verifies the live schema and confirms that the asynchronous indexes were created successfully.

To load the extracts, Kiro downloads the Aurora DSQL Loader and verifies the downloaded release’s checksum. Because the loader maps file fields to table columns by position, Kiro creates loader-compatible copies in the build/ folder without changing the original files. It configures the loader to stop if it encounters a conflicting row rather than silently skipping it.

After loading the data, Kiro runs a guarded finalization step to create the values derived from the source data. It then verifies the loaded data, relationships, indexes, and database permissions. In the final reader run, all 39 source rows loaded and matched the extracts, nine material-requirement rows were created, and all 25 asynchronous indexes were valid. The run ends with DATA LAYER READY.

Figure 4 shows the successful MCP read check that completes the data-layer build.

Kiro verifying the live cluster through the read-only Aurora DSQL MCP server and reporting DATA LAYER READY

Figure 4: Kiro verifies the live cluster through the read-only Aurora DSQL MCP server and reports DATA LAYER READY

Step 4: Build and demonstrate the application

Paste the following prompt:

Build and demonstrate the local material-control application against the verified data layer. Approval contract: - Verify the data-layer preconditions read-only. - Present one consolidated plan for application files, dependencies, tests, demonstration writes and process start. - Wait once for `Approved`. - That approval covers every listed application file, dependency install, test, synthetic database write, demonstration script and local process start. - Do not ask again for an individual file, package, test, command, page or synthetic write already listed. - Use the following implementation defaults instead of presenting optional design choices. Do not ask for separate approval of generated application files or tests. - Stop only for a changed identity or target, expanded scope, destructive action or unexpected result. After approval: 1. Create a minimal server-rendered FastAPI application in `mcapp/` and start exactly `uvicorn mcapp.web:app --host 127.0.0.1 --port 8000`. 2. Show a persistent notice that this is a loopback-only synthetic demonstration with no sign-in and not production guidance. Treat the planner, warehouse and quality selector as a view selector, not authorization. Reject foreign Host headers and cross-origin writes. 3. Connect directly to Aurora DSQL as `mc_runtime` using IAM tokens and TLS hostname verification. Application requests must never use `admin` or MCP. 4. Implement work orders and requirement lines, eligible lots, reserve, cancel, issue, quality hold/release, reservation review and lot genealogy. 5. Preserve the approved transaction design: shared lot and requirement control rows, full-transaction retry only for `40001`, stable idempotency keys and no blind retry of business conflicts. 6. Discard closed, broken or over-age pooled connections. A read-only page query may retry once on a fresh connection after a connection-level failure. Writes must never use that read retry path. 7. Before testing, verify that the operational history tables are empty and that the canonical lot and requirement totals still match the data-layer summary. Add a focused test suite covering database permissions, idempotency, whole-transaction retry, stale-read recovery, Host and Origin guards and the core application screens. Tests must use unit fakes, read-only checks or transactions that are always rolled back. After the suite, prove that no reservation, hold, issue, command-request or inventory total was added or changed. Do not run the committed two-session conflict scenario in the test suite; step 9 is its only live execution. Prove denied writes to master data, `work_order_output`, `lot_genealogy_edge`, initial-load finalization, row deletion and schema creation return `42501` and are rolled back. 8. Run one deterministic HTTP demonstration using fixed scenario names and UUIDv5 idempotency keys, never timestamps or random keys. For `WO-MX-2001` and component `CMP-CTRL-10`, reserve and issue exactly 8 units from `LOT-CTRL-MX-261012-A`. Place and release exactly one `INSPECTION` hold with reason `DEMO_RECHECK` on `LOT-HOUS-US-261014-A`. Trace `LOT-CTRL-US-260925-Z` through `WO-US-0990` to `LOT-FG-US-261008-01`. If this approved step is resumed after an interruption, reuse the same keys and stored results; never create replacement history rows. 9. Run the deterministic two-session conflict demonstration exactly once in each commit order on `LOT-CTRL-US-261015-A` and `WO-US-1001`, using fixed UUIDv5 idempotency keys. Prove both transactions overlap. The later committer must receive `40001`; the whole command retries once and then either commits the hold or returns `LOT_ON_HOLD`. Reset through the application commands. Do not run a second copy for tests or evidence. 10. Verify the final visible history is deterministic. Reservations must contain exactly one consumed 8-unit reservation for `WO-MX-2001` from `LOT-CTRL-MX-261012-A` and one cancelled 10-unit reservation for `WO-US-1001` from `LOT-CTRL-US-261015-A`. Holds must contain the two canonical open QMS holds, one released `DEMO_RECHECK` hold on `LOT-HOUS-US-261014-A`, and two released conflict holds on `LOT-CTRL-US-261015-A`. No `TEST_*` record may appear. Verify there are no open application reservations or holds, the conflict lot is reset to 10 on hand and 0 reserved, the Mexico control lot has 22 on hand, and all invariants hold. Any additional visible history is an unexpected result: stop instead of taking more actions. 11. Prove all committed demonstration commands used the exact `mc_runtime` grants. Redact endpoints, IP addresses, account identifiers and profile names from every displayed error and saved artifact. Write one concise result to `evidence/application-summary.md`. Leave the app running and list the browser URLs for work orders, eligible lots, reservations, quality holds and genealogy. Tell me to open and explore those pages. Finish with `APPLICATION READY TO EXPLORE` or a specific stopped condition.

After your approval, Kiro builds and tests a local web application and starts it at http://127.0.0.1:8000, where it is accessible only from your computer. At runtime, the application connects directly to Aurora DSQL using IAM authentication, TLS, and a database role limited to the operations the application requires. It doesn’t use the MCP server or administrator access.

Explore the application

After Kiro builds and starts the application, open http://127.0.0.1:8000 and use the following screens to explore how the generated solution turns source data and business rules into application workflows. The schema, queries, and transaction flows use the Aurora DSQL guidance supplied by the Build applications with Aurora DSQL power. Figure 5 shows how the Work orders page combines source-system orders with calculated material requirements so users can see what each order still needs.

Work orders page listing each order and the material quantity it still needs, with a loopback-only demo notice

Figure 5: Work orders with the material quantity each one still needs, with a yellow notice marking the app as a loopback-only synthetic demonstration

Figure 6 shows the eligible material for a selected requirement. The application applies plant, component, quality, expiration, and availability rules to present only material that can be used, showing how business rules become focused data queries.

Eligible-material list showing only lots that meet the plant, component, disposition, hold, expiry, and quantity rules

Figure 6: The planner sees only lots that meet the plant, component, disposition, hold, expiry, and available-quantity rules

Figure 7 shows reservation status and material-issue history. The Reservations page records reservations, cancellations, and issues as traceable business events, while the transaction design keeps related inventory and requirement changes together.

Reservations page showing reservation status alongside the warehouse material-issue history

Figure 7: Reservations and their status, with the warehouse view showing the material-issue history

Figure 8 shows open holds received from the source system and holds created through the application. The released inspection hold comes from the standard application demonstration, while the two released supplier holds come from the concurrent reservation-and-hold demonstration described in the next section.

Quality holds page showing open source-system holds and released application-generated holds

Figure 8: Open source-system holds and released application-generated holds, including one inspection hold from the standard demonstration and two supplier holds from the concurrency demonstration

Figure 9 shows how the Genealogy page follows relationships from component material through work orders to finished lots, helping quality teams assess downstream impact. This demonstrates a reusable pattern for linking records from source systems into a traceable application view.

Genealogy page tracing a held component lot forward to the work order and finished lot it went into

Figure 9: Forward trace of a held component lot to the work order and finished lot it went into

Use the View selector to explore the planner, warehouse, and quality perspectives. The selector changes which actions the demonstration shows. It is not authentication or authorization.

What happens behind each screen

Every screen is served by the local application, which connects directly to Aurora DSQL using IAM authentication, TLS, and a database role with limited permissions. The MCP connection used by Kiro during development is read-only, but the generated application has limited write access. Neither Kiro nor the MCP server is part of the application request path.

The application displays work orders, eligible material, reservations, quality holds, and lot genealogy. From the application interface, users can reserve, cancel, and issue material and place or release quality holds. These actions update Aurora DSQL, while the genealogy view is read-only.

Each write is completed in a short transaction. If two actions update the same data at the same time, Aurora DSQL detects the conflict at commit. The application then reads the latest data and retries the complete transaction. Idempotency keys help prevent repeated requests from creating duplicate records. These patterns reflect the service-specific guidance provided by the Aurora DSQL power.

Handling concurrent changes to the same data

To demonstrate how the application handles two users changing the same data at the same time, Kiro runs a controlled scenario in which a planner reserves 10 units while a quality engineer places a SUPPLIER quality hold with reason SUPPLIER_NOTICE on the same inventory lot. A script makes the two transactions overlap and runs the scenario once in each commit order.

Aurora DSQL detects the conflict when the transactions attempt to commit. The first transaction commits, and the second receives SQLSTATE 40001. The application then reads the latest data and retries the complete transaction. If the reservation commits first, the hold succeeds on retry and the reservation is flagged for review. If the hold commits first, the retried reservation returns LOT_ON_HOLD, and no reservation is created.

After each run, the application resets the demonstration data and verifies that it remains consistent. This demonstrates the transaction pattern Kiro generated using Aurora DSQL guidance.

Concurrent reservation and quality hold on the same lot, where the later commit receives SQLSTATE 40001 and retries

Figure 10: A 10-unit reservation and a SUPPLIER quality hold update the same inventory lot concurrently. The later commit receives SQLSTATE 40001, and the application retries the complete transaction once

What the Aurora DSQL power contributed

The Aurora DSQL power provided Kiro with service-specific guidance for designing and building the application. It also provided configuration for the Aurora DSQL MCP server, allowing Kiro to inspect the live database and check its work through a read-only connection.

Using this guidance, Kiro generated an implementation that accounted for the distributed architecture of Aurora DSQL:

  • Data model and schema – Kiro used UUID primary keys, supported database constraints, asynchronous secondary indexes, and the appropriate transaction boundaries for schema changes.
  • Data loading – Kiro used the Aurora DSQL Loader, accounted for its positional column mapping, and configured the load to stop when it encountered conflicting data.
  • Authentication and access – Kiro generated connections that use IAM authentication and TLS, along with separate database roles limited to the operations required for loading, application access, and read-only access.
  • Transaction handling – Kiro generated short transactions, shared control data for concurrent changes, complete-transaction retries for SQLSTATE 40001, and idempotency protection to help prevent duplicate results.
  • Database checks – Through the read-only MCP connection, Kiro inspected the schema, ran queries, and checked generated SQL for Aurora DSQL compatibility.

The power supplied guidance and MCP configuration. It did not make application changes directly. Kiro applied the schema and setup changes through generated scripts and loaded the source data through the Aurora DSQL Loader. The resulting implementation should still go through the application, database, security, and operational reviews required for its intended environment.

Troubleshooting

The following table lists common issues that can occur during the walkthrough and how to resolve them.

Symptom Cause Resolution
Kiro doesn’t use the power’s guidance The power isn’t installed or active Confirm the power is installed and active in the powers pane
The workspace MCP server doesn’t appear The active Kiro session hasn’t discovered the newly written workspace configuration Reconnect MCP servers. If it is still absent, reload Kiro, reopen the saved chat, and continue the already approved batch
MCP queries fail after AWS credentials are refreshed The MCP process still has the temporary credentials it read at startup Reconnect the workspace MCP server
AWS calls return ExpiredToken The temporary CLI profile credentials expired Refresh the profile outside Kiro, then confirm aws sts get-caller-identity --profile <your-profile> succeeds
A TLS certificate error occurs on macOS The PostgreSQL client isn’t using a trusted CA bundle Point it to the verified Amazon Root CA 1 bundle and keep full hostname verification
A migration stops after losing its connection The DDL commit result is unknown Rerun the migration runner. It reconciles the migration ledger and live catalog before deciding whether a statement is absent
A read page fails after an idle connection dies A stale pooled connection was reused Remove unusable or over-age connections and retry a read once on a fresh connection

Clean up

To avoid ongoing charges, delete the resources you created. When you have finished exploring the application, paste the following prompt:

The application review is complete. Clean up only the resources recorded by this reader run. Inspect `scripts/cleanup_demo.sh`, parse it with `bash -n`, and run `bash scripts/cleanup_demo.sh --check`. Check mode may append redacted evidence but must not change AWS, the database, processes or MCP configuration. Stop on any identity, cluster, tag, application-process or workspace-MCP mismatch. Do not create a multi-gate cleanup plan and do not ask me to approve deletion-protection and deletion separately. Explain in a few lines that the script will stop only this workspace app, remove only `mc-dev-dsql-readonly`, disable deletion protection on the exact recorded cluster, delete that cluster and verify its absence. It must preserve the AWS profile, IAM principal, Aurora DSQL power, user-level Kiro MCP configuration, source, data and evidence. Then tell me to run exactly: `bash scripts/cleanup_demo.sh` The script itself asks once for the exact cluster ID before changing anything. A wrong value must cancel with no changes. After I report completion, perform only read-only checks that the cluster, app listener and workspace MCP connection are absent and retained files remain. Use the script redacted report as the cleanup evidence and finish with `CLEANUP COMPLETE` or a specific stopped condition.

Kiro checks the cleanup script and runs it in check mode, which changes nothing. Then run the script yourself:

Source:https://aws.amazon.com/blogs/database/building-a-no-code-ai-app-on-amazon-aurora-dsql-with-agent-skills-plugins-and-mcp/

Related posts