aws-fargate-best-practices

aws-fargate-best-practices is a cursor rule for Cursor from beettlle/pi-spine. It costs 0 tokens per session (3,085 once invoked), scanned A, original, MIT.

A set of rules for AWS Fargate, a service that runs containers without requiring you to manage servers. It covers ECS task definitions, services, container security, resources, and logging.

In plain words
What is it for?
Use it when defining and deploying Fargate tasks and services, securing containers, assigning resources, loading secrets, and configuring logs.
Why use it?
It helps prevent exposed secrets, unsafe containers, incorrect resource sizing, and incomplete logs. The guidance promotes storing sensitive values in AWS Secrets Manager instead of plain task settings.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when defining and deploying Fargate tasks and services, securing containers, assigning resources, loading secrets, and configuring logs.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/beettlle/pi-spine/aws-fargate-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/beettlle/pi-spine

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aws-fargate-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/rules/beettlle/pi-spine/aws-fargate-best-practices/github.svg)](https://agentmods.dev/rules/beettlle/pi-spine/aws-fargate-best-practices)
Your own site
<a href="https://agentmods.dev/rules/beettlle/pi-spine/aws-fargate-best-practices"><img src="https://agentmods.dev/badge/rules/beettlle/pi-spine/aws-fargate-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aws-fargate-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/rules/beettlle/pi-spine/aws-fargate-best-practices"><img src="https://agentmods.dev/badge/rules/beettlle/pi-spine/aws-fargate-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,085 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03085
Opus 5 $0.00000 $0.01543
Sonnet 5 $0.00000 $0.00617
Haiku 4.5 $0.00000 $0.00309

Measured 11d ago against content hash da5d913fef8c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

aws-fargate-best-practices scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

✅ Good: Fargate task health checks configured (`"healthCheck": {"command": ["CMD-SHELL", "curl -f http://localhost:8888/health || exit 1"], "interval": 30, "timeout": 5, "retries": 3, "startPeriod": 60}`), application he
.cursor/rules/aws-fargate-best-practices.mdc · 207 lines

How it starts

The opening of the file, as written. The whole thing — 207 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Persona: AWS ECS/Fargate Specialist

  • Role: Container orchestration expert. Philosophy: "Secure by default, right-sized by design."
  • Traits: Security-first (non-root containers), Performance-aware (resource optimization), Observability-focused (comprehensive logging)

AWS Fargate Best Practices

This file contains Fargate-specific anti-patterns and best practices for container orchestration on AWS.

For general AWS patterns: See aws-general-best-practices.mdc For project-specific Fargate patterns: See project-specific rules file or project-conventions.md For universal anti-patterns: See general-llm-anti-patterns.mdc


Category 1: Task Definition Anti-Patterns (CRIT)

1.1 Hardcoded Secrets in Task Definitions (CRIT)

CRITICAL: Never pass secrets (database passwords, API keys) via environment variables in task definitions.

❌ Bad: "environment": [{"name": "DB_PASSWORD", "value": "secret123"}] (secrets in plaintext) ✅ Good: Use AWS Secrets Manager in task definitions ("secrets": [{"name": "DATABASE_PASSWORD", "valueFrom": "arn:aws:secretsmanager:..."}]), IAM task role has permission to read specific secrets only ⚠️ Why: Environment variables visible in task definitions, CloudWatch logs, and container inspection; secrets in plaintext violate security best practices 🔧 Fix: Store secrets in AWS Secrets Manager, reference using secrets field in task definition, use IAM permissions to restrict access 📍 See: aws-general-best-practices.mdc section 1.4

Detect: Secrets in environment field, plaintext passwords in CloudFormation/CDK, secrets in container environment variables, missing IAM permissions for Secrets Manager, secrets visible in CloudWatch Logs


1.2 Missing IAM Task Roles (CRIT)

CRITICAL: Fargate tasks must use IAM task roles, not hardcoded credentials or user access keys.

❌ Bad: Fargate task without task role, using root account credentials, passing AWS credentials via environment variables ✅ Good: Configure separate task execution role and task role (executionRoleArn for ECR/CloudWatch/Secrets Manager, taskRoleArn for application AWS API calls), separate task roles for web service and crawler/indexer service ⚠️ Why: Task execution role has different permissions than task role; separation enables least privilege; long-lived credentials are security risk 🔧 Fix: Create separate IAM roles for task execution and task, attach task role to task definition, grant only required permissions to each role 📍 See: aws-general-best-practices.mdc section 1.1

Read the full file on GitHub · 207 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 207 lines · 0 tokens per session scan A da5d913fef8c

Subscribe to this mod's changes

aws-fargate-best-practices is a cursor rule published in the GitHub repository beettlle/pi-spine (3 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,085 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.