← Back to list

How I Use GitHub Copilot for DevOps Daily — 7 Workflows That Save Me 2+ Hours

Copilot isn’t just for app developers. Here are 7 DevOps workflows where it’s become my second brain.

AbdulRahman Mostafa · 2026-06-18 14:01 · 3 claps · 6.3 min read paywalled
#github-copilot #devops #ai #automation #programming
Open on Medium ↗
Wiki topics: LLM · Large Language Models AI · AI · General 💻 · Programming ☁️ · DevOps & Cloud 🔓 · Open Source ⏱️ · Productivity

How I Use GitHub Copilot for DevOps Daily — 7 Workflows That Save Me 2+ Hours

My teammates watch me write Terraform, and they think I’m fast. I’m not. I have a co-pilot.

Not a person — a tab-completion AI that writes 60% of my infrastructure code while I write the other 40% as comments that tell it what I want. I type what I need in plain English, press Tab, and review what it generates.

Not a Member?? Click Here

GitHub Copilot isn’t a toy for writing React components. It’s a legitimate DevOps productivity tool — and after six months of daily use, I can trace exactly where it saves me time. Seven workflows. Two hours per day. Every day.

I covered the strategic best practices in Best Practices for Using GitHub Copilot in DevOps. This article is the practical, workflow-by-workflow breakdown.

Prerequisites

  • GitHub Copilot subscription (Individual or Business)
  • VS Code with the Copilot and Copilot Chat extensions installed
  • DevOps project files open: Terraform, Dockerfiles, YAML, Python scripts

One Comment. Entire Terraform Module.

This is the workflow that saves me the most time every single day. I type a comment describing the infrastructure I need, and Copilot generates the complete Terraform resource block.

I type this:

# Create an S3 bucket with versioning enabled,
# AES-256 server-side encryption,
# and a lifecycle rule that moves objects
# to Glacier after 90 days

Copilot generates:

resource "aws_s3_bucket" "archive" {
  bucket = "my-archive-bucket"
}
resource "aws_s3_bucket_versioning" "archive" {
  bucket = aws_s3_bucket.archive.id
  versioning_configuration { status = "Enabled" }
}
resource "aws_s3_bucket_server_side_encryption_configuration" "archive" {
  bucket = aws_s3_bucket.archive.id
  rule {
    apply_server_side_encryption_by_default {
      sse_algorithm = "AES256"
    }
  }
}

Plus the lifecycle configuration resource. The entire module, syntactically correct, using the current Terraform AWS provider patterns. What would take me 15–20 minutes of writing and referencing documentation takes 90 seconds of reviewing and tweaking.

The rule I never break: Always review generated IAM policies. Copilot tends to be overly permissive — it’ll give you "*" resources and broad action lists. Every IAM block gets manually scoped before it leaves my editor.

Time saved: ~25 minutes/day on Terraform alone.

Production-Ready Dockerfiles in One Comment

I open a new Dockerfile, type a comment, and Tab:

# Multi-stage build for Python Flask app
# Builder stage installs deps, final stage uses slim image
# Run as non-root user, expose port 8080

Copilot generates a multi-stage build with python:3.12-slim, --no-install-recommends, proper COPY --from=builder patterns, a non-root user, and the correct EXPOSE and CMD. It even adds .dockerignore-aware patterns if that file is open in another tab.

The key insight: Copilot uses context from open tabs. If your requirements.txt is open, it knows to COPY requirements.txt . before RUN pip install. If your app.py references port 8080, it picks that up.

Time saved: ~15 minutes/day on Dockerfile creation and optimization.

GitHub Actions Workflows Without the YAML Headache

GitHub Actions YAML is verbose. I used to spend 20 minutes scaffolding a CI workflow, double-checking indentation, verifying action names and versions. Now I type:

# CI workflow triggered on push to main
# Steps: checkout, lint with flake8, run pytest,
# build Docker image, push to ECR, deploy to ECS

Copilot scaffolds the entire workflow — jobs, steps, correct action references, environment variable patterns for ECR login, even the aws-actions/configure-aws-credentials step with OIDC.

Always verify action versions. Copilot sometimes suggests @v3 when @v4 is current, or references deprecated actions. Cross-check every uses: line against the action’s GitHub repo.

Time saved: ~20 minutes/day on CI/CD workflow authoring.

PromQL Queries I’d Otherwise Have to Google

This one surprised me. PromQL is notoriously unintuitive — nested functions, label matchers, rate calculations. I type a comment in a Grafana dashboard JSON file or a Prometheus alert rule:

# Alert: HTTP error rate exceeds 5% over 5 minutes

Copilot generates:

sum(rate(
  http_requests_total{status=~"5.."}[5m]
)) / sum(rate(
  http_requests_total[5m]
)) > 0.05

Correct syntax. Correct use of rate() for counters. Correct regex label matcher. The kind of query that would take me 5 minutes of reading PromQL docs to write correctly. I explored more AI-powered query generation patterns in The 6 Prompt Engineering Hacks That Saved My DevOps Sanity.

Time saved: ~10 minutes/day on PromQL and monitoring queries.

[embed]Best Practices for Using GitHub Copilot in DevOps: Automate Smarter, Deploy Faster How DevOps Engineers Use GitHub Copilot to Supercharge Automation, CI/CD, and Code Qualitydevsecopsai.today

Bash Scripts That Handle AWS CLI Query Syntax Better Than I Do

The AWS CLI --query parameter uses JMESPath, which I can never remember correctly. Copilot can.

# Find all EC2 instances with no Name tag
# Output: instance ID, launch time, instance type

Copilot generates:

aws ec2 describe-instances \
  --query "Reservations[].Instances[?!Tags[?Key=='Name']].[InstanceId,LaunchTime,InstanceType]" \
  --output table

That JMESPath expression with the negation operator and nested key filter? I would have spent 10 minutes on Stack Overflow constructing it. Copilot nailed it on the first Tab.

Time saved: ~15 minutes/day on bash scripting and AWS CLI queries.

Kubernetes YAML Without the Indentation Anxiety

Kubernetes manifests are the YAML equivalent of a landmine field. One wrong indent and your deployment fails with a cryptic error. Copilot eliminates the boilerplate entirely.

# Deployment: 3 replicas, nginx:1.25
# CPU limit 500m, memory limit 256Mi
# Readiness probe on /health port 80 every 10s

Copilot generates the complete deployment manifest — correct apiVersion, proper label selectors matching the pod template, resource requests and limits nested correctly, and a fully configured readinessProbe with httpGet, periodSeconds, and initialDelaySeconds.

Check resource limits carefully. Copilot tends to default to generous limits — 1 CPU and 512Mi memory for a simple Nginx container that needs a fraction of that. Always right-size based on actual workload, not Copilot’s defaults.

Time saved: ~15 minutes/day on Kubernetes manifest creation.

Python boto3 Scripts with Built-In Pagination

Every DevOps engineer writes boto3 scripts. Every DevOps engineer forgets about pagination. Copilot doesn’t.

# List all unattached EBS volumes
# with volume ID, size in GB, and creation date

Copilot generates:

import boto3
ec2 = boto3.client('ec2')
paginator = ec2.get_paginator('describe_volumes')
for page in paginator.paginate(
    Filters=[{'Name': 'status', 'Values': ['available']}]
):
    for vol in page['Volumes']:
        print(f"{vol['VolumeId']} | {vol['Size']}GB | {vol['CreateTime']}")

It used the paginator. Automatically. Most engineers — including me before Copilot — would write a simple describe_volumes call and miss results beyond the first page. I wrote about these kinds of AWS automation patterns in The Power of Automation in DevOps.

Time saved: ~20 minutes/day on Python boto3 scripting.

[embed]I’ve Used 100+ ChatGPT Prompts in DevOps — Here’s What I Stopped Doing After trying over 100 prompts with ChatGPT in DevOps workflows, here’s what I stopped doing — and how it made…aws.plainenglish.io

The Full Breakdown: Where 2 Hours Goes

Four Rules for Getting the Most Out of Copilot in DevOps

  • Write detailed comments first. The quality of Copilot’s output is directly proportional to the specificity of your comment. “Create an S3 bucket” gives you a bare resource. “Create an S3 bucket with versioning, encryption, and a 90-day lifecycle rule” gives you a production-ready module.
  • Keep related files open. Copilot reads context from open tabs. If your variables.tf is open while you write main.tf, Copilot references your declared variables. If your docker-compose.yml is open, it picks up service names and port mappings.
  • Use Copilot Chat for errors. Paste a cryptic Terraform error or a failing PromQL query into Copilot Chat and ask “why is this failing?” It’s faster than Stack Overflow and usually more contextual. I explored this pattern deeply in 100+ ChatGPT Prompts in DevOps — What I Stopped Doing.
  • Never trust IAM, security groups, or secrets blindly. Copilot optimizes for functionality, not for least-privilege. Every generated policy, every security group rule, every environment variable gets a manual review before it ships. This is non-negotiable.

Seven workflows. Two hours saved every day. Not because I’m faster — because I have a co-pilot that handles the boilerplate while I focus on the architecture.

Copilot doesn’t replace DevOps knowledge. It amplifies it. The engineer who understands what a correctly scoped IAM policy looks like will use Copilot to generate one in 10 seconds and verify it in 30. The engineer who doesn’t will ship a wildcard policy to production and have a very different kind of day.

“The tool doesn’t make you good. It makes a good engineer faster. And a careless engineer dangerous.”

Follow me for more real DevOps guides: Abdo Boshy

If this saved you time, a clap means more than you think.

[embed]I Tried Passing the AWS Solutions Architect Exam Using Only AI — Here’s What Happened After 60 Days AI helped me move faster — until it confidently taught me the wrong AWS. Here’s the verification loop that kept my…abdoboshy.medium.com

[embed]The Power of Automation in DevOps: Boosting Productivity & Reducing Errors Introductionabdoboshy.medium.com


메타데이터
post_id
a5b420e30b6d
slug
how-i-use-github-copilot-for-devops-daily-7-workflows-that-save-me-2-hours-a5b420e30b6d
url
https://medium.com/@abdoboshy/how-i-use-github-copilot-for-devops-daily-7-workflows-that-save-me-2-hours-a5b420e30b6d
canonical_url
https://medium.com/@abdoboshy/how-i-use-github-copilot-for-devops-daily-7-workflows-that-save-me-2-hours-a5b420e30b6d
author_url
https://medium.com/@abdoboshy
status
ok
fetched_at
2026-07-14 00:09:08