open_rightsizing_pr
Apply cloud resource rightsizing recommendations to Terraform files and open a GitHub PR to implement cost savings.
Instructions
Apply rightsizing recommendations to Terraform source, optionally opening a GitHub PR.
nable reads your Terraform state (terraform.tfstate or terraform show -json) to
automatically resolve AWS instance IDs to their Terraform resource addresses. No
manual mapping needed as long as your tf_dir has state available.
Resolution order:
Terraform state (automatic, reads instance IDs from state)
resource_overrides (manual fallback if state is unavailable)
recommended_config stored in DB
Modes: dry_run=True Show diffs only. Nothing written to disk. patch_only=True Write .tf files locally. No git, no PR. Use your own workflow. default Write files, commit to a branch, push, open GitHub PR.
After merging and running terraform apply, nable auto-verifies savings by
checking AWS and updates the recommendation to "verified".
Args: tf_dir: Path to the Terraform working directory. github_repo: "owner/repo" for GitHub PR. Not needed for dry_run or patch_only. recommendation_ids: Specific rec IDs to act on. Omit to process all open rightsizing recs. resource_overrides: Manual fallback if state resolution fails. Format: [{"recommendation_id": 42, "tf_resource_type": "aws_instance", "tf_resource_name": "api_server"}, ...] branch: Branch to create. Defaults to "fix/rightsizing". base_branch: PR target branch. Defaults to "main". pr_title: PR title. Auto-generated from saving amount if omitted. dry_run: Show diffs without writing files or creating the PR. patch_only: Patch files locally, skip git and GitHub.
Examples: - "Show me what the rightsizing changes would look like" - "Apply the rightsizing fixes to my Terraform repo" - "Open a rightsizing PR against acme/infra" - "Patch the Terraform files but don't create a PR, I'll handle the git flow"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | fix/rightsizing | |
| tf_dir | Yes | ||
| dry_run | No | ||
| pr_title | No | ||
| patch_only | No | ||
| base_branch | No | main | |
| github_repo | No | ||
| recommendation_ids | No | ||
| resource_overrides | No |