A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Sample Generative AI tool for evaluating Infrastructure as Code and architecture diagrams against AWS Well-Architected b

Well-Architected Infrastructure as Code (IaC) Analyzer is a sample project that demonstrates how generative AI can be used to evaluate infrastructure code for alignment with best practices.
It features a modern web application built with React and AWS Cloudscape Design System, allowing users to upload IaC documents (e.g., AWS CloudFormation, Terraform, or AWS CDK templates), complete IaC projects (multiple files or zip archives), or architecture diagrams for assessment. The application leverages Amazon Bedrock to analyze the infrastructure against AWS Well-Architected best practices. These best practices are sourced from AWS Well-Architected whitepapers and synchronized with the Amazon Bedrock knowledge base.
This tool provides users with insights into how well their infrastructure code aligns with or deviates from established AWS best practices, offering suggestions for improving cloud architecture designs. Users can also upload supporting documents to provide additional context for more accurate analysis results. For architecture diagrams, it can even generate corresponding IaC templates following AWS best practices.
Additionally, an interactive Analyzer Assistant chatbot enables users to ask questions, seek clarification, and receive personalized guidance about analysis results and Well-Architected best practices.
Note: This is a sample project, for non-production usage. You should work with your security and legal teams to meet your organizational security, regulatory and compliance requirements before deployment
NEW 🎯 Prioritization Framework with Eisenhower Matrix:
NEW 🧠 Enhanced AI Capabilities with Latest Anthropic Models:
🚀 Accelerated Analysis with Parallel Processing:
💰 Cost-Optimized Vector Storage with Amazon S3 Vectors:





You have three options for deploying this solution:
This option uses AWS CloudFormation to create a temporary deployment environment to deploy the Well-Architected IaC Analyzer solution. This approach doesn't require any tools to be installed on your local machine.
Download the CloudFormation template: iac-analyzer-deployment-stack.yaml
Open the AWS CloudFormation console:
On the "Create stack" page:
iac-analyzer-deployment-stack.yaml templateOn the "Specify stack details" page. Enter or change the stack name, then:
Change the stack parameters as needed. Check the CloudFormation Configuration Parameters section below for details
Security Note: By default, the stack deploys with a Public Application Load Balancer (internet-facing) with authentication enabled. For maximum security, we strongly recommend keeping authentication enabled for internet-facing deployments. If you disable authentication, your application will be publicly accessible without any security controls.
Model Selection Note: The tool currently defaults to Claude Sonnet 4.6. If you want to use a different model (E.g. Claude Fable 5, Claude Opus 4.8, or Claude Opus 4.7), you'll need to explicitly add the model ID in the stack "Amazon Bedrock Model ID" configuration parameter. Please note that not all models are available in all AWS regions, so verify availability in your region before deployment.
Geographic and Global Cross-Region Inference Note: The default Claude Sonnet 4.6 model ID uses a GLOBAL cross-Region inference profile (global.anthropic.claude-sonnet-4-6), which routes requests to any supported AWS commercial Region worldwide for optimal performance and cost savings. If your organization has data residency or compliance requirements, consider using a GEOGRAPHIC inference profile instead (e.g., "us." or "eu." prefix). For more information visit the documentation Choosing between Geographic and Global cross-Region inference
Choose "Next" until reaching the "Review" page and choose "Submit".
The deployment process typically takes 15-20 minutes.
Once complete, you'll find a new CloudFormation stack named WA-IaC-Analyzer-{region}-GenAIStack containing all the deployed resources for this solution. Find the application URL in the stack outputs:
If you enabled authentication with a custom domain:
If you created a new Cognito user pool:
Access your deployed application using the URL from the CloudFormation outputs (or your CNAME or Alias pointing to the ALB)
If you encounter issues during deployment, you can check the deployment logs in CloudWatch:
iac-deployment-logs-<region>-<unique-id>
{instance_id}-user-data: Contains deployment instance initialization and setup logs{instance_id}-deploy: Contains the complete Well-Architected IaC Analyzer deployment logsYou can also find a direct link to these logs in the Outputs tab of your CloudFormation deployment stack.
The following tools must be installed on your local machine:
Note: If you would like to change the default Load Balancer scheme, AI model or authentication options, check the Configuration Options For Manual Deployments section first before deploying.
git clone https://github.com/aws-samples/well-architected-iac-analyzer.git
cd well-architected-iac-analyzer
chmod +x deploy-wa-analyzer.sh
# Deploy using Docker
./deploy-wa-analyzer.sh -r us-west-2 -c docker
# Or deploy using Finch
./deploy-wa-analyzer.sh -r us-west-2 -c finch
The script will automatically:
After successful deployment, you can find the Application Load Balancer (ALB) DNS name in:
deploy-wa-analyzer.sh scriptWA-IaC-Analyzer-{region}-GenAIStack in the AWS ConsoleThe following tools must be installed on your local machine:
Note: If you would like to change the default Load Balancer scheme, AI model or authentication options, check the Configuration Options For Manual Deployments section first before deploying.
git clone https://github.com/aws-samples/well-architected-iac-analyzer.git
cd well-architected-iac-analyzer
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Linux/macOS:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Verify you're in the virtual environment
# You should see (.venv) at the beginning of your prompt
Install Python dependencies:
pip3 install -r requirements.txt
Install CDK dependencies:
npm install
Install Frontend dependencies:
cd ecs_fargate_app/frontend
npm install
cd ../..
Install Backend dependencies:
cd ecs_fargate_app/backend
npm install
cd ../..
Set the AWS region and ignore ECR credentials storage during CDK deployment:
export CDK_DEPLOY_REGION=us-west-2
export AWS_ECR_IGNORE_CREDS_STORAGE=true
Set the container runtime:
export CDK_DOCKER=finch # For Finch
# OR
export CDK_DOCKER=docker # For Docker
Bootstrap CDK (if not already done):
cdk bootstrap
Deploy the stack:
cdk deploy
After successful deployment, you can find the Application Load Balancer (ALB) DNS name in:
cdk deploy commandWA-IaC-Analyzer-{region}-GenAIStack in the AWS ConsoleDeploy with internet-facing Application Load Balancer? (PublicLoadBalancer)
True (Default): Deploys an internet-facing load balancer accessible from the internetFalse: Deploys an internal load balancer accessible only within your VPC networkTrue), your application will be publicly accessible without any security controls. We strongly recommend keeping authentication enabled for public-facing deployments.Amazon Bedrock Model ID (ModelId)
global.anthropic.claude-sonnet-4-6 (Claude Sonnet 4.6)Analysis Batch Size (BatchSize)
5Enable Authentication (Authentication)
True (Default): Enables authentication via the selected methodFalse (Not Recommended): No authentication required to access the applicationAuthentication Method (AuthType)
new-cognito (Default): Creates a new Amazon Cognito user poolexisting-cognito: Uses an existing Amazon Cognito user pooloidc: Uses an OpenID Connect provider (Auth0, Okta, etc.)none (Not Recommended): No authenticationSSL Certificate ARN (CertificateArn)
Authentication is set to Truearn:aws:acm:region:account:certificate/certificate-idThese parameters are required when AuthType is set to new-cognito:
Cognito Domain Prefix (CognitoDomainPrefix)
wa-analyzer)your-prefix.auth.region.amazoncognito.comAllowed Callback URLs (CallbackUrls)
/oauth2/idpresponsehttps://wa-analyzer.example.com/oauth2/idpresponseLogout Redirect URL (LogoutUrl)
https://wa-analyzer.example.comThese parameters are required when AuthType is set to existing-cognito:
Existing Cognito User Pool ARN (ExistingUserPoolArn)
arn:aws:cognito-idp:region:account:userpool/pool-idExisting Cognito Client ID (ExistingUserPoolClientId)
Existing Cognito Domain (ExistingUserPoolDomain)
your-prefix.auth.region.amazoncognito.comauth.your-domain.comExisting Cognito Logout URL (ExistingCognitoLogoutUrl)
https://wa-analyzer.example.comThese parameters are required when AuthType is set to oidc:
OIDC Issuer URL (OidcIssuer)
https://your-tenant.us.auth0.com/authorizeOIDC Client ID (OidcClientId)
OIDC Authorization Endpoint URL (OidcAuthorizationEndpoint)
https://your-tenant.us.auth0.com/authorizeOIDC Token Endpoint URL (OidcTokenEndpoint)
https://your-tenant.us.auth0.com/oauth/tokenOIDC User Info Endpoint URL (OidcUserInfoEndpoint)
https://your-tenant.us.auth0.com/userinfoOIDC Logout URL (OidcLogoutUrl)
https://your-tenant.us.auth0.com/v2/logout?client_id=your-client-id&returnTo=https://wa-analyzer.example.comImportant OIDC Note: Before deploying with OIDC authentication, you must create a secret in AWS Secrets Manager named
WAIaCAnalyzerOIDCSecretcontaining your OIDC client secret in the same region where you'll deploy the stack:hljs language-bash# Using AWS CLI aws secretsmanager create-secret \ --name WAIaCAnalyzerOIDCSecret \ --secret-string "your-oidc-client-secret" \ --region <aws-region>
If you want to use a different model than the default Claude Sonnet 4.6, update the config.ini with the correct model ID:
[settings]
model_id = global.anthropic.claude-sonnet-4-6
Note: This application has been primarily tested with Anthropic models (Claude Fable 5, Claude Opus 4.8, Claude Opus 4.7, Claude Sonnet 4.6, Claude Opus 4.6, Claude Sonnet 4.5, and Claude Opus 4.5). While other Bedrock models may work, using different models might lead to unexpected results. The default model ID is set to
global.anthropic.claude-sonnet-4-6. Claude Fable 5 uses always-on Adaptive Thinking with high effort and natively supports a 1M token context window. Claude Opus 4.8 and 4.7 models use Adaptive Thinking with xhigh effort and natively support 1M token context window. Claude 4.6 models use Adaptive Thinking with high effort and natively support 1M token context window, while Claude 4.5 models use Extended Thinking with budget tokens.
The batch size controls how many Well-Architected questions are processed in parallel during analysis. You can adjust this value in the config.ini file:
[settings]
batch_size = 5
Guidelines:
If you experience API throttling errors during analysis, consider reducing the batch_size value.
By default, this project will deploy the Load Balancer scheme as internet-facing (Public load balancer), making it accessible from the internet.
If you need to change the load balancer scheme to internal, you can modify the public_load_balancer parameter in the config.ini file:
[settings]
public_load_balancer = False
To access an internal load balancer, you will need to be in the private network connected to the deployed VPC, either via:
⚠️ Security Warning: The load balancer is internet-facing by default with authentication enabled for security. We strongly recommend keeping authentication enabled for internet-facing deployments. If you disable authentication (by setting authentication = False), the application and all its functionalities will be accessible directly through the Internet without any security controls. Proceed with caution and understand the security implications.
Note: Before defining authentication settings, make sure you have a valid AWS Certificate Manager (ACM) certificate covering the DNS domain name (CNAME or Alias) that you plan to use to point to this application's ALB.
For Example:
- If you own the domain
*.example.com- And you plan to access the application via
wa-analyzer.example.com(with a CNAME or Alias pointing to the ALB deployed by this stack)- You must first create or import a certificate in ACM that covers either:
*.example.com, orwa-analyzer.example.com- Then, you can add the certificate's ARN in the
certificate_arnparameter below when deploying the stack
The application can be deployed with different authentication configurations managed via the config.ini file.
A. New Cognito User Pool (Default Deployment)
# In below example, "wa-analyzer.example.com" is the DNS alias that you would create pointing to the ALB deployed by this CDK stack
authentication = True
auth_type = new-cognito
certificate_arn = arn:aws:acm:region:account:certificate/certificate-id
cognito_domain_prefix = your-domain-prefix
allback_urls = https://wa-analyzer.example.com/oauth2/idpresponse
logout_url = https://wa-analyzer.example.com
B. Existing Cognito User Pool
# In below example, "wa-analyzer.example.com" is the DNS alias that you would create pointing to the ALB deployed by this CDK stack
authentication = True
auth_type = existing-cognito
certificate_arn = arn:aws:acm:region:account:certificate/certificate-id
existing_user_pool_arn = arn:aws:cognito-idp:<aws-region>:<aws-account-id>:userpool/<user-pool-id>
existing_user_pool_client_id = <user-pool-client-id>
existing_user_pool_domain = <your-existing-cognito-domain-prefix>.auth.<aws-region>.amazoncognito.com # Example using Cognito prefix domain: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-assign-domain-prefix.html
# Or; existing_user_pool_domain = wa-analyzer-auth.example.com # Example of custom domain (e.g. wa-analyzer-auth.example.com): https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html)
existing_cognito_logout_url = https://wa-analyzer.example.com
C. OpenID Connect (OIDC)
D. No Authentication (Not Recommended)
authentication = False
auth_type = none
If you plan to use OIDC authentication (auth_type = oidc), follow these steps:
Before deployment, create a secret in AWS Secrets Manager named WAIaCAnalyzerOIDCSecret containing your OIDC client secret before deploying the stack. The secret must be created in the same AWS region where you plan to deploy the stack:
# Using AWS CLI
aws secretsmanager create-secret \
--name WAIaCAnalyzerOIDCSecret \
--secret-string "your-oidc-client-secret" \
--region <aws-region>
# Or you can create it via the AWS Console:
# 1. Go to AWS Secrets Manager console
# 2. Choose "Store a new secret"
# 3. Choose "Other type of secret"
# 4. Enter your OIDC client secret as a plaintext value
# 5. Set the secret name exactly as: WAIaCAnalyzerOIDCSecret
# 6. Do not add any automatic rotation
# 7. Complete the secret creation
Configure OIDC settings in config.ini:
# Below is an example when using Okta as your OIDC IdP, refer to the config.ini file for more examples.
# In below example, "wa-analyzer.example.com" is the DNS alias that you would create pointing to the ALB deployed by this CDK stack
authentication = True
auth_type = oidc
certificate_arn = arn:aws:acm:region:account:certificate/certificate-id
oidc_issuer = https://<okta-tenant-id>.us.auth0.com/authorize
oidc_client_id = <okta-client-id>
oidc_authorization_endpoint = https://<okta-tenant-id>.us.auth0.com/authorize
oidc_token_endpoint = https://<okta-tenant-id>.us.auth0.com/oauth/token
oidc_user_info_endpoint = https://<okta-tenant-id>.us.auth0.com/userinfo
oidc_logout_url = https://<okta-tenant-id>.us.auth0.com/v2/logout?client_id=<oidc-client-id>&returnTo=https://wa-analyzer.example.com (# Refer to https://auth0.com/docs/authenticate/login/logout)
You have two options to remove all resources created by this solution:
WA-IaC-Analyzer-{region}-GenAIStackchmod +x destroy-wa-analyzer.sh
# Clean up using Docker
./destroy-wa-analyzer.sh -r us-west-2 -c docker
# Or clean up using Finch
./destroy-wa-analyzer.sh -r us-west-2 -c finch
The script will automatically:
For development purposes, you can run the application locally using either Finch or Docker containers. This allows you to make changes to the code and see them reflected immediately without having to deploy code changes into your AWS stack.
In addition to the main prerequisites, ensure you have:
Note for Existing Stack Users: If you have already deployed this CDK stack in your AWS account, you can skip the manual resource creation steps below. Instead:
- Go to the CloudFormation console and find your stack (it starts with "WA-IaC-Analyzer-")
- In the "Outputs" tab of the CDK CloudFormation stack, find:
KnowledgeBaseID: Use this value for KNOWLEDGE_BASE_ID in your .env file (for "Setting up Local Development Environment" section below)WellArchitectedDocsS3Bucket: Use this value for WA_DOCS_S3_BUCKET in your .env file (for "Setting up Local Development Environment" section below)LensMetadataTableName: Use this value for LENS_METADATA_TABLE in your .env file (for "Setting up Local Development Environment" section below)AnalysisStorageBucketName: Use this value for ANALYSIS_STORAGE_BUCKET in your .env file (for "Setting up Local Development Environment" section below)AnalysisMetadataTableName: Use this value for ANALYSIS_METADATA_TABLE in your .env file (for "Setting up Local Development Environment" section below)If you haven't deployed the stack yet, follow the steps below:
To simplify setup for development, you can deploy just the required Knowledge Base and Storage layer components:
Navigate to the local development directory:
cd local_development
Set Up Python Virtual Environment
# Create virtual environment
python -m venv .venv
# Activate virtual environment
# On Linux/macOS:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Verify you're in the virtual environment
# You should see (.venv) at the beginning of your prompt
Install the required dependencies:
pip3 install -r requirements.txt
Deploy the KB storage stack:
# Set your preferred AWS region
export CDK_DEPLOY_REGION=us-west-2 # Or your preferred region where you have enabled the LLM models
export CDK_DOCKER=finch # Or docker
# Bootstrap CDK (if you haven't done this before)
cdk bootstrap
# Deploy the dev stack (which only deploys Bedrock KB and storage layer resources)
cdk deploy --require-approval never
After deployment completes, note the outputs from the CloudFormation stack:
KnowledgeBaseID: Use for KNOWLEDGE_BASE_ID in your .env file in the following section.WellArchitectedDocsS3Bucket: Use for WA_DOCS_S3_BUCKET in your .env file in the following section.LensMetadataTableName: Use for LENS_METADATA_TABLE in your .env file in the following section.AnalysisStorageBucketName: Use for ANALYSIS_STORAGE_BUCKET in your .env file in the following section.AnalysisMetadataTableName: Use for ANALYSIS_METADATA_TABLE in your .env file in the following section..env file in the root directory with the following variables:# AWS Authentication
AWS_REGION=your-aws-region-key
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_SESSION_TOKEN=your-session-token
# Well-Architected Framework Resources
WA_DOCS_S3_BUCKET=your-knowledgebase-source-bucket-name
LENS_METADATA_TABLE=your-lens-metadata-table-name
KNOWLEDGE_BASE_ID=your-kb-id
MODEL_ID=global.anthropic.claude-sonnet-4-5-20250929-v1:0
# Analysis Configuration
BATCH_SIZE=5
# Storage Configuration
STORAGE_ENABLED=true
ANALYSIS_STORAGE_BUCKET=your-analysis-storage-bucket-name
ANALYSIS_METADATA_TABLE=your-analysis-metadata-table-name
Security Note: It is encouraged the use of temporary credentials (including AWS_SESSION_TOKEN) when running the application locally. More details in Temporary security credentials in IAM. Temporary credentials have a limited lifetime and automatically expire, providing an additional layer of security.
# Make sure you are in the root directory of this project
chmod +x dev.sh
# Using Docker
./dev.sh -c docker -up
# Or using Finch
./dev.sh -c finch -up
This will:
# Using Docker
./dev.sh -c docker -down
# Or using Finch
./dev.sh -c finch -down
# Start development environment
./dev.sh -c <container_tool> -up
# Stop development environment
./dev.sh -c <container_tool> -down
# Show help and usage information
./dev.sh -h
Where <container_tool> is either docker or finch.
See CONTRIBUTING for more information.
Want to add support for a new language? Check out our localization guide for step-by-step instructions.
This library is licensed under the MIT-0 License. See the LICENSE file.
Native macOS app to monitor Claude AI usage limits and watch your coding sessions live
npx CLI installing 100+ agents, commands, hooks, and integrations in one command
干净、强大、属于你的 AI Agent 平台 --AI agents, without the clutter.
Pocket Flow: Codebase to Tutorial