weclaudecode/kiro/python-devops-aws

Claude Code and agent skill by weclaudecode/kiro

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when writing Python scripts, CLI tools, or automation that runs outside Lambda and interacts with AWS via boto3 — covers boto3 client/resource patterns, credentials and assume-role, retries and pagination, error handling, logging, packaging, and testing

Install

npx vskill@latest install weclaudecode/kiro/python-devops-aws

SKILL.md

The same SKILL.md was published earlier as weclaudecode/kiro/python-devops-aws.

Python for DevOps with AWS

Overview

Production Python for DevOps is explicit, observable, and idempotent. boto3 has sharp edges — implicit sessions, default retries that hide throttling, list APIs that silently truncate at 1000 items, and credential resolution that varies by execution environment. This skill collects the patterns and reusable helpers that keep AWS automation honest in scripts, CLIs, and long-running jobs running on EC2, ECS, developer laptops, and CI runners.

When to Use

Use this skill when:

  • Writing a script that calls AWS APIs from a CI runner, EC2 instance, ECS task, or local laptop
  • Building a CLI tool that wraps AWS operations (deployments, IAM audits, cost reports, S3 sync)
  • Automating IAM, S3, EC2, RDS, or other AWS resources from a runner
  • Writing one-off remediation scripts that need to be safe and re-runnable
  • Creating shared platform tooling distributed to multiple engineers
  • Building data-pipeline glue that orchestrates AWS services from a long-running process

When NOT to use: for AWS Lambda handler code, see the python-lambda skill. Lambda has a different cold-start, packaging, and credential model that is covered there.

The 5 things to get right

  • Explicit `boto3.Session` — never call module-level boto3.client(...); pass a session into every function
  • Always `get_paginator()` — never assume a single list_* / describe_* call returns everything
  • Catch `ClientError` — parse e.response["Error"]["Code"]; never catch bare Exception
  • Structured logging with `RequestId` — include response["ResponseMetadata"]["RequestId"] on every log line
  • `botocore.config.Config` for retries — set retries={"mode": "standard" | "adaptive", "max_attempts": N} per client

Project skeleton

Use PEP 621 metadata, a lockfile (uv.lock), and the src/ layout. Copy assets/pyproject.toml as a starting point — it is wired for boto3, boto3-stubs, structlog, typer, pytest, moto, mypy, and ruff, with a [project.scripts] entry point ready to rename.

Reusable helpers

NeedFile
Assume role into another accountscripts/aws_session.py
Paginate any list operationscripts/paginate.py
Retry with exponential backoffscripts/retry.py
Structured JSON loggingscripts/logging_setup.py

Each script is self-contained Python 3.11+ with type hints, docstrings, and a __main__ demo. Drop them into src/<package>/ and import directly.

Deeper reference

FileCovers
references/boto3-patterns.mdClient vs resource, sessions, credential resolution, assume-role, region, type hints
references/reliability.mdRetry modes, pagination, idempotency tokens, eventual-consistency backoff, waiters
references/error-handling.mdClientError patterns, common service codes, typed domain exceptions, decorators
references/logging-and-cli.mdstructlog setup, Typer CLIs, --dry-run/--yes defaults, packaging and execution
references/testing.mdProject layout, moto fixtures, Stubber for error paths, when to use which

Common Mistakes

MistakeWhy it bitesFix
Using the default boto3.client(...) in a multi-account scriptHidden process-wide state crosses credentials between accountsPass boto3.Session explicitly into every function
Calling list_objects_v2 / describe_* once and trusting the resultSilently truncates at 1000 items in productionUse client.get_paginator(...).paginate(...) always
Catching Exception around a boto3 callSwallows code bugs and AWS errors alike, hides the error codeCatch ClientError and match on e.response["Error"]["Code"]
Hard-coding region_name="us-east-1"Script runs in the wrong region in another account or CI environmentRequire --region or AWS_REGION env var, fail loud if missing
time.sleep(30) while waiting for a resourceBrittle, slow, fails under loadUse built-in waiters; for custom waits, exponential backoff with jitter
Logging event or full API responseLeaks credentials, signed URLs, PII into logsWhitelist fields; always log RequestId, never raw responses
def helper(items: list = []):Mutable default shared across calls causes phantom dataUse `items: list \None = None` and assign inside the function
boto3.resource("s3") for new codeResource interface is being deprecated in boto3 v2Use client and write thin wrappers if OO ergonomics matter
Running scripts as chmod +x foo.py from random checkoutsNo dep pinning, no reproducibility, version driftPackage as a project, install with uv tool install ., run via entry point
print() for status output in unattended jobsCannot filter by level, no structure, breaks when pipedstructlog + JSON renderer; print only for interactive CLI output

Quick Reference

NeedOne-liner
Explicit sessionsession = boto3.Session(profile_name=..., region_name=...)
Tuned retriesConfig(retries={"mode": "adaptive", "max_attempts": 10})
Paginateclient.get_paginator(op).paginate(**params)
Wait for stateclient.get_waiter(name).wait(...)
Parse error codeexc.response["Error"]["Code"] on ClientError
Mock AWS in testswith mock_aws(): ... from moto
Stub specific callStubber(client).add_response(...) / add_client_error(...)
Typed clientsboto3-stubs[s3,ec2,sts,iam] + TYPE_CHECKING import

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Refreshed 19 Nov 2026, 8 days ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/weclaudecode/kiro/python-devops-aws/badge)](https://verified-skill.com/skills/weclaudecode/kiro/python-devops-aws)

Something wrong with this skill or its page? Tell us.