Aws infrastructure

From event4u-app/agent-config · View interactive version

Aws infrastructure is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when working with AWS resources — ECS Fargate, ECR, EFS, Secrets Manager, gomplate templates, multi-env deployments — even when the user says 'deploy to staging' without naming AWS.

How to use this skill

Skill file

aws-infrastructure

When to use

Use this skill when working with AWS infrastructure, deployment configurations, ECS task definitions, or environment-specific settings.

Do NOT use when:

Procedure: Modify AWS infrastructure

  1. Read the .aws/ directory (or equivalent) for environment configs and templates.
  2. Read CI/CD workflows (e.g., .github/workflows/) for the deployment pipeline.
  3. Check the environment-specific vars files.
  4. Read project-level overrides — check agents/overrides/skills/aws-infrastructure.md for project-specific service names, prefixes, and infrastructure details.

Architecture overview

Environments (typical setup)

| Environment | Trigger | Notes |

|---|---|---|

| Review | PR with label | Ephemeral, per-branch |

| Stage | Push to main | Persistent, pre-production |

| Production | Release tag | Persistent, live |

Common AWS services

| Service | Purpose |

|---|---|

| ECS Fargate | Container orchestration (no EC2 instances) |

| ECR | Docker image registry |

| EFS | Shared filesystem (private + public access points) |

| Secrets Manager | .env file storage per environment |

| IAM Roles | OIDC-based GitHub Actions authentication |

| VPC | Networking (security groups, subnets) |

Vars file structure

Environment-specific config files (e.g., .aws/*.vars.yaml) typically contain:

AWS:
  GlobalPrefix: {project}-{env}     # Resource naming prefix
  Region: eu-central-1              # AWS region
  RoleArn: arn:aws:iam::...        # GitHub Actions OIDC role
  ECS:
    Cluster: {project}-{env}       # ECS cluster name
  VPC:
    SecurityGroups: [...]
    Subnets: [...]
  EFS:
    FileSystemId: fs-...

Read the actual vars files in the project for concrete values.

Template structure

Templates commonly use gomplate for rendering. Typical templates:

| Template | Purpose |

|---|---|

| task-definition-web.tpl.yaml | Web server (app + reverse proxy) |

| task-definition-worker.tpl.yaml | Queue worker |

| task-definition-scheduler.tpl.yaml | Task scheduler (cron) |

| task-definition-migrations.tpl.yaml | One-shot migration runner |

Template variables:

Deployment flow

Standard (Stage/Production)

  1. Build: Docker image → ECR (tag: SHA + latest)
  2. Migrations: Run as ECS task (one-shot), wait for completion
  3. Deploy Services: Update ECS services with new task definitions

Review environments

  1. Build: Docker image → ECR (tag: SHA + branch-hash)
  2. Deploy: Create or update single ECS service (combined task)
  3. Comment: Post deployment URL on PR

Conventions

Authentication

Image tagging

Secrets

Platform

Infrastructure as Code

The underlying AWS resources (ECS clusters, ALBs, RDS, Redis, IAM roles, security groups, etc.)

are typically managed via Terraform + Terragrunt in a separate infrastructure repository.

See the terraform and terragrunt skills for general IaC conventions.

Least privilege and permissive defaults

The conventions above describe how this project deploys. This section is the

floor underneath them, and it holds whether or not a given resource is managed

here or in the infrastructure repo.

role enumerates its actions and its resource ARNs. Action: * and

Resource: * are not shorthand for "we will scope it later" - one

compromised task credential then reaches every service and object in the

account. A wildcard needs a named, reviewed exception written beside it.

narrowest source that works: another security group id, a prefix list, a

known CIDR. An internet-wide source belongs to a public listener and nothing

else.

a database with publicly_accessible left true, a volume or snapshot with no

encryption block - each of these works either way, which is why it survives

review. Treat an absent security block as a finding, not as a silence.

password, token, or key in a .vars.yaml or a task-definition template is

the same defect as one in .tf, and the state and template files are as

readable as the code.

Do not restate the mitigation here. The abuse case, the required controls, and

the negative test for each of the four live in the infrastructure surface

class of CODE0's corpus, which is

their single authority. Ask that skill's grounded-corpus step for the

infrastructure surface class - it carries the invocation - describing the

change, e.g. iam role with a wildcard action.

Those rows carry a Decided by: clause naming the check that actually decides

each one. For the IAM, networking, storage, and encryption rows it reads NO

CHECK IN THIS REPOSITORY; only the credential-in-a-file row names a real gate.

Nothing here parses IAM policy documents or cloud config, so the discipline

above is the enforcement, and saying otherwise would claim coverage this

package does not have.

See also the terraform skill's *Permissive defaults and missing security

blocks* section for the backstop greps over a .tf tree.

Output format

  1. Modified infrastructure config/template files
  2. Environment-specific changes clearly separated
  3. Summary of what changed and which environments are affected

Auto-trigger keywords

Gotcha

Do NOT

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.