internal-comms
ANanthropics/skills181k1,119 new stars in the last 7 days
Keep Terraform and CDK infrastructure in sync. Compares terraform/aws-ecs/ and infra/ to identify discrepancies in ECS services, networking, storage, secrets, IAM, and configuration. Reports parity gaps and generates fixes for the target IaC tool. Use when changes are made to either Terraform or CDK infrastructure.
Use this skill when changes are made to either the Terraform (terraform/aws-ecs/) or CDK (infra/) infrastructure and the other needs to be updated to maintain parity.
terraform/aws-ecs/infra/lib/registry/Ask the user (or determine from context):
Read the relevant files from both Terraform and CDK based on the comparison area.
| Comparison Area | Terraform Files | CDK Files |
|---|---|---|
| ECS Services | terraform/aws-ecs/modules/mcp-gateway/ecs-services.tf | infra/lib/registry/registry-service-stack.ts |
| Networking | terraform/aws-ecs/modules/mcp-gateway/networking.tf, terraform/aws-ecs/vpc.tf | infra/lib/registry/registry-network-stack.ts, infra/lib/registry/registry-service-stack.ts (ALB section) |
| Storage (EFS) | terraform/aws-ecs/modules/mcp-gateway/storage.tf | infra/lib/registry/registry-service-stack.ts (EFS section) |
| Storage (DocumentDB) | terraform/aws-ecs/documentdb.tf | infra/lib/registry/registry-data-stack.ts, infra/lib/registry/constructs/documentdb-cluster.ts |
| Secrets | terraform/aws-ecs/modules/mcp-gateway/secrets.tf | infra/lib/registry/registry-service-stack.ts (secrets section) |
| IAM | terraform/aws-ecs/modules/mcp-gateway/iam.tf | infra/lib/registry/constructs/registry-ecs-service.ts (task roles) |
| Keycloak | terraform/aws-ecs/keycloak-ecs.tf, terraform/aws-ecs/keycloak-*.tf | infra/lib/registry/registry-auth-stack.ts, infra/lib/registry/constructs/keycloak-service.ts |
| Observability | terraform/aws-ecs/modules/mcp-gateway/observability.tf | infra/lib/registry/constructs/observability-pipeline.ts |
| CloudFront/WAF | terraform/aws-ecs/cloudfront.tf, terraform/aws-ecs/waf.tf | infra/lib/registry/registry-cdn-stack.ts, infra/lib/registry/constructs/cloudfront-distribution.ts, infra/lib/registry/constructs/waf-rules.ts |
| Secret Rotation | terraform/aws-ecs/secret-rotation.tf | infra/lib/registry/registry-ops-stack.ts, infra/lib/registry/constructs/secret-rotation.ts |
| CI/CD | terraform/aws-ecs/codebuild.tf | infra/lib/registry/registry-build-stack.ts, infra/lib/registry/constructs/codebuild-pipeline.ts |
| Variables/Config | terraform/aws-ecs/variables.tf, terraform/aws-ecs/modules/mcp-gateway/variables.tf | infra/lib/registry/registry-config.ts, infra/config.yaml |
| Monitoring | terraform/aws-ecs/cloudwatch-alarms.tf, terraform/aws-ecs/modules/mcp-gateway/monitoring.tf | infra/lib/registry/registry-service-stack.ts (monitoring section) |
For each comparison area, check the following attributes:
For each service (registry, auth-server, MCP servers, A2A agents):
:username::, :password::)Present findings in this format:
## Infrastructure Parity Report
**Date:** {date}
**Source of Truth:** {Terraform|CDK}
**Scope:** {Full|Targeted area}
### Summary
| Area | Status | Discrepancies |
|------|--------|---------------|
| ECS Services | {In Sync / Diverged} | {count} |
| Networking | {In Sync / Diverged} | {count} |
| Storage | {In Sync / Diverged} | {count} |
| Secrets | {In Sync / Diverged} | {count} |
| IAM | {In Sync / Diverged} | {count} |
| Observability | {In Sync / Diverged} | {count} |
### Discrepancies
#### {Area}: {Description}
| Attribute | Terraform | CDK | Action Required |
|-----------|-----------|-----|-----------------|
| {attr} | {tf value} | {cdk value} | {Fix in TF / Fix in CDK / Intentional} |
### Intentional Differences
These differences are by design and should NOT be synced:
| Feature | CDK | Terraform | Rationale |
|---------|-----|-----------|-----------|
| Circuit Breaker | Enabled | Not configured | Faster failure detection (~4 min vs ~3 hours) |
| HOME=/tmp | Set on registry | Not set | Fixes Path.home() PermissionError in container |
| DocumentDB credentials | Always passed when cluster exists | Gated on storage_backend | Skills repository always uses DocumentDB |
| Keycloak URL fallback | Falls back to http://{alb-dns} | Always https:// | Deployment without Route53/certs |
### Recommendations
1. **Must Fix:** {Critical parity gaps}
2. **Should Fix:** {Important but non-breaking gaps}
3. **Consider:** {Nice-to-have improvements}
If the user wants fixes applied:
cd infra && npx tsc --noEmit to verify TypeScript compilescd terraform/aws-ecs && terraform validate if availableThis is the most common source of drift. For each ECS service, extract and compare every environment variable:
Terraform location: Look for environment = [{ name = "...", value = "..." }] blocks in ecs-services.tf
CDK location: Look for environment: { KEY: "value" } objects in registry-service-stack.ts
Compare line by line. Pay special attention to:
Terraform: Look for secrets = [{ name = "...", valueFrom = "..." }] blocks
CDK: Look for secrets: { KEY: ecs.Secret.fromSecretsManager(...) } objects
Compare the JSON key extraction syntax carefully:
"${aws_secretsmanager_secret.x.arn}:username::"ecs.Secret.fromSecretsManager(secret, 'username')Terraform: Check mount_points and volume blocks in each service definition
CDK: Check efsVolumes property in RegistryEcsService constructor calls
Important: The registry service should have NO EFS mounts in both tools. Only auth-server and specific MCP servers mount EFS.
Terraform: Check aws_lb_listener and aws_lb_target_group resources in networking.tf
CDK: Check listener and target group creation in registry-service-stack.ts
Compare:
Maintain this list of differences that should NOT trigger sync warnings:
Circuit Breaker - CDK enables circuitBreaker: { enable: true, rollback: true } on ECS services. Terraform does not. This is intentional for faster failure detection.
HOME=/tmp - CDK sets HOME=/tmp on the registry container. Terraform does not. This fixes a Path.home() PermissionError that occurs when the container runs as a non-root user without a home directory.
DocumentDB Credential Passing - CDK passes DocumentDB credentials whenever dataStack.documentDbSecretArn exists. Terraform gates on var.storage_backend == "documentdb". CDK's approach is correct because the skills repository always uses DocumentDB regardless of the storage backend setting.
Keycloak URL Fallback - CDK falls back to http://{alb-dns-name} when Route53 is disabled. Terraform always uses https://. CDK's approach allows deployment without DNS/certificates.
grep -n "ENV_VAR_NAME" to quickly find where a variable is defined in both codebasescd infra && npx tsc --noEmit to verify compilationterraform fmt and terraform validateinfra/docs/CDK-INFRASTRUCTURE.md for the latest CDK documentation and parity notesANanthropics/skills181k1,119 new stars in the last 7 days
GAgarrytan/gstack136k883 new stars in the last 7 days
ADaddyosmani/agent-skills106k3,628 new stars in the last 7 days
A pre-launch checklist covering monitoring, staged rollouts and rollback plans.
ADaddyosmani/agent-skills106k3,628 new stars in the last 7 days
PApaperclipai/paperclip101k2,948 new stars in the last 7 days
RUruvnet/RuView98k968 new stars in the last 7 days