Interview Prep/Python for DevOps/Best practices & rapid-fire commands

Rapid fire: what are the three questions you ask before running any destructive Python script in production?

BeginnerConceptBest practices & rapid-fire commands
Answer
  1. What will it touch? Run it with --dry-run (and EC2 DryRun=True where available) and read the plan, including the account (sts get-caller-identity) and region.
  2. Can I undo it? Snapshots, backups, versioning, or a documented rollback exist before the run.
  3. What limits the blast radius? Scoped IAM role, explicit filters (tags, account, region), a maximum-items safety cap, and confirmation for counts above a threshold.

Interviewers ask this to see whether you treat automation as production code.

All Python for DevOps questions Roadmap: Python for automation

More on Best practices & rapid-fire commands