Migrate retry settings with Amazon Ergo
Use Amazon Ergo on Bedrock to plan a retry configuration migration and check the default, explicit zero, field precedence, and rollback in a mixed deployment.
The task
A service is moving its retry count from a flat field to a nested policy. Some deployments need to roll back to a binary that only understands the flat field.
Inputs for this example
The example specifies the old default, the new spelling, precedence during rollout, and three representative configuration files.
Run this on Amazon Ergo
Download the configuration migration preset from the request builder. Its JSON gives Amazon Ergo the old and new field names, their precedence, and the sample files. Keep the JSON beside this script. The request uses global.amazon.ergo-1.0 through Amazon Bedrock. Run it with Boto3 and an AWS identity authorized to invoke the model. Inference is billed to that AWS account.
Read the answer as a rollout sequence. Check the old and new readers against every sample file, including an explicit zero. For a mixed deployment, the transitional file should give both readers the same count. Roll back one reader while leaving the file in place and check that it still interprets the chosen policy the same way.
import json, boto3
from pathlib import Path
request = json.loads(Path("ergo-request.json").read_text(encoding="utf-8"))
reply = boto3.client("bedrock-runtime", region_name="us-west-2").converse(**request)
print("\n".join(part["text"] for part in reply["output"]["message"]["content"] if "text" in part))Prompt and sample data
Plan a two-release migration for a JSON service configuration. Existing binaries read retries as a nonnegative integer, default to 3 if absent, and ignore unknown fields. New binaries should prefer retry.maxAttempts when present, fall back to retries, and otherwise use 3. Both names count retry attempts after the first call. Zero means no retries.
Use these three files:
A {"retries": 0}
B {"retry": {"maxAttempts": 5}}
C {"retries": 2, "retry": {"maxAttempts": 4}}
Give a table with each file’s effective retry count under an existing binary and a new binary. Propose a safe rollout and rollback sequence. Show a configuration that preserves C’s intended value in both binary versions during a rolling deployment. Write one regression test for an explicit zero.
Open this example in the request builder
Check the result
For A, both versions should return zero. For B, the old binary uses three and the new binary uses five. For C, the old binary uses two and the new binary uses four. Try the suggested transitional file in both readers before deploying it.
Why use Amazon Ergo for this task?
AWS describes Ergo as a model for workflows that involve planning and checking successive steps. A configuration migration exercises both skills. Decisions about precedence affect a running service at different times, and the sample files let you test those decisions at each stage of the rollout. Read the AWS model card.