agentleFS
lgbarnlgbarn/devops-skills/skills/provider-upgrade-analysis/SKILL.md

provider-upgrade-analysis

Skill15 starsChanged 9 months agoMITView on GitHub

Use when analyzing Terraform provider or module upgrades for breaking changes, deprecations, and migration requirements.

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search for affected resources/attributes:

    line 73
  2. Distinctive:

    Check upgrade guide thoroughly

    line 196
  3. Distinctive:

    Test in non-prod first

    line 198
  4. Distinctive:

    Check for deprecation warnings

    line 203

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Provider Upgrade Analysis

Overview

Analyze the impact of upgrading Terraform providers or modules before making changes. Identify breaking changes, deprecations, and required code modifications.

Announce at start: "I'm using the provider-upgrade-analysis skill to assess this upgrade."

Process

Step 1: Identify Current State

# Current Terraform version
terraform version

# Current provider versions
terraform providers

# Lock file details
cat .terraform.lock.hcl

Step 2: Identify Target Version

Determine what version to upgrade to:

  • Latest stable
  • Specific version requested
  • Next major/minor version

Step 3: Research Breaking Changes

For each provider/module upgrade:

AWS Provider Example

# Check CHANGELOG
# https://github.com/hashicorp/terraform-provider-aws/blob/main/CHANGELOG.md

# Check UPGRADE guide for major versions
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-5-upgrade

Key Sources

ProviderChangelog LocationUpgrade Guide
AWSGitHub CHANGELOG.md/docs/guides/version-X-upgrade
AzureGitHub CHANGELOG.md/docs/guides/X.0-upgrade-guide
GoogleGitHub CHANGELOG.md/docs/guides/version_X_upgrade

Step 4: Analyze Impact

Breaking Changes Categories

CategoryImpactExample
Removed ResourcesHIGHResource type no longer exists
Removed ArgumentsHIGHRequired attribute removed
Changed DefaultsMEDIUMDefault value changed
Renamed ResourcesMEDIUMResource renamed, state migration needed
New Required ArgsMEDIUMNew required argument added
DeprecationsLOWWill be removed in future

Code Scan

Search for affected resources/attributes:

# Find usage of deprecated resource
grep -r "aws_deprecated_resource" --include="*.tf"

# Find usage of removed argument
grep -r "removed_argument" --include="*.tf"

Step 5: Check Memory

Query memory/global/provider-issues.json for:

  • Known issues with target version
  • Past upgrade experiences
  • Workarounds needed

Step 6: Generate Report

## Provider Upgrade Analysis

### Summary

| Provider | Current | Target | Risk Level |
|----------|---------|--------|------------|
| aws | 4.67.0 | 5.0.0 | HIGH |

### Breaking Changes

#### 1. [Change Name]
- **Type:** Removed Argument
- **Affected Resource:** `aws_instance`
- **Attribute:** `ebs_optimized` default changed
- **Impact:** Instances may change on next apply
- **Required Action:** Explicitly set `ebs_optimized = true`
- **Files Affected:**
  - `modules/compute/main.tf:45`
  - `environments/prod/instances.tf:23`

#### 2. [Change Name]
...

### Deprecations (Future Concern)

| Resource/Attribute | Deprecated In | Removed In | Replacement |
|-------------------|---------------|------------|-------------|
| `aws_old_thing` | 4.50.0 | 5.0.0 | `aws_new_thing` |

### State Migration Required

- [ ] Resource `aws_old` → `aws_new` requires state mv
- [ ] [Other migrations]

### Recommended Upgrade Path

1. **Backup state**
   ```bash
   terraform state pull > backup-$(date +%Y%m%d).tfstate
  1. Update version constraint
    terraform {
      required_providers {
        aws = {
          source  = "hashicorp/aws"
          version = "~> 5.0"
        }
      }
    }
  2. Run init
    terraform init -upgrade
  3. Apply code changes [List of required changes]
  4. Run plan
    terraform plan
  5. Review and apply [After careful review]

Risk Assessment

FactorAssessment
Breaking changesX items
State migrationsY required
Code changesZ files
Estimated effort[Low/Medium/High]
Recommended timing[Now/After testing/Wait]

Known Issues

[From memory or research]


### Step 7: Update Memory

Store findings in `memory/global/provider-issues.json`:
```json
{
  "aws": {
    "5.0.0": {
      "known_issues": [...],
      "upgrade_notes": [...],
      "last_updated": "2024-01-15"
    }
  }
}

Common Upgrade Patterns

Major Version Upgrades (e.g., 4.x → 5.x)

  • Usually have breaking changes
  • Check upgrade guide thoroughly
  • Plan for state migrations
  • Test in non-prod first

Minor Version Upgrades (e.g., 5.1 → 5.2)

  • Usually backward compatible
  • Check for deprecation warnings
  • Review CHANGELOG for new features

Patch Version Upgrades (e.g., 5.1.0 → 5.1.1)

  • Bug fixes only
  • Generally safe to apply
  • Still review CHANGELOG

Safety Checklist

Before recommending upgrade:

  • Breaking changes documented
  • Code changes identified
  • State migrations planned
  • Rollback procedure defined
  • Test environment validated
  • User informed of risks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.