Skip to main content
ubx upgrade scans .iac files for deprecated resource types and proposes replacements. Two phases: fast mechanical phase (no AI), then optional AI phase.

Usage

ubx upgrade [path] [flags]

Examples

ubx upgrade                  # check and upgrade all .iac files
ubx upgrade main.iac         # specific file
ubx upgrade --dry-run        # show diff without applying
ubx upgrade --yes            # apply without confirmation
ubx upgrade --check          # exit 1 if any upgrades needed (CI mode)

Flags

FlagDescription
--dry-runShow proposed diff without writing any files
--yesApply all upgrades without confirmation prompt
--checkExit 1 if any upgrades are found; never writes (CI mode)

Output

--- main.iac ---
  aws_s3_bucket → aws_s3_bucket_v2: Renamed in AWS provider v4+

--- a/main.iac
+++ b/main.iac
@@ -3,3 +3,3 @@
-unit "aws_s3_bucket" "assets" {
+unit "aws_s3_bucket_v2" "assets" {
   bucket = "my-assets"
 }

Apply upgrade(s) to 1 file(s)? [y/N]

Mechanical Upgrade Mappings

Applied instantly without an AI call:
DeprecatedCurrentReason
aws_s3_bucketaws_s3_bucket_v2Renamed in AWS provider v4+
aws_rds_cluster_instanceaws_rds_clusterConsolidated in v5+
aws_elasticache_clusteraws_elasticache_replication_groupPreferred for HA
kubernetes_deploymentkubernetes_deployment_v1API version update

AI Phase

When UBX_AI_API_KEY is set, Claude is also consulted for additional upgrade suggestions against the full schema registry. Silently skipped if no key configured.

CI Usage

# Block CI if any resource types are outdated
ubx upgrade --check || exit 1