What this prompt does
This prompt asks the AI to generate deployable infrastructure-as-code for a complete AWS architecture in one pass. You choose your [iac_tool] — CDK in TypeScript, CloudFormation, or another flavor — and an [architecture_type] like a three-tier web app, and the model produces networking, compute, database, caching, load balancing, security, and monitoring as code. The eight numbered steps cover a VPC with [vpc_cidr] across [az_count] availability zones, a [compute_resource], a [database_service] with Multi-AZ and encryption, and an ALB terminating HTTPS for [domain].
The structure works because it front-loads the decisions that are painful to retrofit. By specifying least-privilege IAM for [iam_roles], Multi-AZ databases tuned for [db_workload], and a [stack_structure] split with cross-stack references up front, the generated code lands close to deployable rather than as a toy snippet. I treat the output as a strong first draft — review and harden it — instead of writing infrastructure from a blank file.
When to use it
- You are bootstrapping a new environment and want repeatable IaC instead of clicking through the console
- You need a sensible starting point for a
[architecture_type]with networking, compute, and database wired together - You want least-privilege IAM roles scaffolded for
[iam_roles]rather than over-permissioned defaults - You are standardizing on
[iac_tool]and need a reference template that follows current best practices - You want the stack split into
[stack_structure]for maintainability and cross-stack references - You need CloudWatch alarms and a tagging strategy included from the start
Example output
Expect generated IaC files organized into the stacks you requested — for example network, database, compute, and monitoring — each defining its resources with security groups, IAM roles, parameter groups for [db_workload], an ALB with an ACM certificate, and CloudWatch alarms for CPU, memory, and database connections. The code is parameterized and annotated, designed to deploy with minimal modification after your review.
Pro tips
- Match
[iac_tool]to your team's real workflow; CDK in TypeScript gives you loops and abstractions, while raw CloudFormation is more portable but more verbose - Keep
[vpc_cidr]and[az_count]consistent with your other environments so peering and expansion stay clean - Specify
[db_workload]precisely — "read-heavy OLTP with periodic reporting" drives different parameter-group and read-replica choices than a write-heavy workload - Always review the generated IAM for
[iam_roles]; the model aims for least privilege but you should confirm no action is broader than needed before deploying - Treat the output as a draft, not production-ready code — run it through your linter, security scanner, and a plan/diff before applying
- Iterate stack by stack rather than deploying all of
[stack_structure]at once, so failures are easy to isolate - Pin versions for the
[database_service]and[compute_resource]explicitly so a regenerated template doesn't silently bump an engine version on you - Confirm the ALB's ACM certificate for
[domain]is validated in the right region before deploy, since a missing certificate blocks the HTTPS listener