> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenetlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrades

> Roll out a new release: read its release notes, verify the release record, update one value per deploy path, what happens to capacity, and how to roll back.

**An upgrade** is a new image digest rolled through your normal deployment tooling — `image.digest` (Helm), `ImageUri` (CloudFormation) or `image_uri` (Terraform) — with the chart, template or module version that ships alongside it. Tenet can't upgrade your deployment; you schedule and run it.

## When to use it

When Tenet publishes a new version in AWS Marketplace (each version carries its release notes there), and for base-image security fixes. Test in non-production first. Keep each version's release record, so you can always name the digest you run.

Upgrade a running deployment to a new image digest — verifies, rolls out, checks, and stops before touching production.

Upgrade my Tenet PII Engine (Enterprise) deployment to the current release, following [https://docs.tenetlabs.com/pii-engine/operate/upgrades](https://docs.tenetlabs.com/pii-engine/operate/upgrades.md).

Ask me for: platform (Helm release and namespace, CloudFormation stack name and the S3 bucket I upload templates to, or Terraform root module); Region; whether this environment is production; whether I bring my own CMK (CloudFormation KmsKeyArn / Terraform kms\_key\_arn) or manage the IRSA policies myself (EKS).

1. Find the version I run now (the release record I deployed with, or the image digest) and read the release notes in AWS Marketplace for every version after it, up to the current one. List each action they call for. If any says there's no upgrade path from my version, stop.
2. Record the current digest (Helm: `helm get values`; CloudFormation: the ImageUri parameter; Terraform: image\_uri) and keep the release record and the chart, template or module I deployed with, for rollback — the download site serves only the current release. Warn me if the release notes say a rollback can't cross this upgrade.
3. Download and verify the new release exactly as on [https://docs.tenetlabs.com/pii-engine/get-started/marketplace](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md): `cosign verify-blob --key cosign.pub --insecure-ignore-tlog --bundle <record>.sigstore.json <record>.json` must print Verified OK, and the record's `.image.digest` must equal what Marketplace serves for the record's `.image.tag`. Stop on any failure. Don't copy the image: every Region pulls it from the Marketplace registry in us-east-1.
4. Prepare the change and show me the diff: Helm `helm upgrade` with the new chart (and `helm diff` if installed); CloudFormation `aws cloudformation deploy --no-execute-changeset` with the new template, `--s3-bucket`, `--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND` and only ImageUri overridden; Terraform: update the module source and image\_uri, then `terraform plan -out upgrade.plan`.
5. Warn me that during the rollout detect capacity drops (one replica at a time on EKS; half the tasks on ECS at the default 50% minimum healthy) and suggest scaling up first if this is peak time.
6. STOP and wait for my approval. In production, ask again before applying.
7. After applying: wait for the rollout to finish; check readiness (ECS: running = desired for detect and rehydrate and every Lattice target HEALTHY; EKS: `kubectl rollout status` and `tenet-pii-enterprise healthcheck --ready` exec'd in each Deployment); run one signed /deidentify → /reidentify round trip with the tenet-pii-lattice client and synthetic text. If anything fails, tell me and offer the rollback to the recorded digest — unless the rollback crosses a vault-format change.

## Steps

1. **Read the release notes** in AWS Marketplace for every version after the one you run, and apply their upgrade notes first.

2. **Download and verify the new release** — the same commands as the [first install](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md#download-the-release); the files under `/enterprise/current/` are always the newest release. Don't copy the image; every Region pulls it from the Marketplace registry.

3. **Record the current digest**, and keep the release record and the chart, template or module you deployed with, so you can roll back.

4. **Roll out** with the deploy tool you installed with:

   > [tab] Helm
   >
   > ```bash theme={null}
   > # Set image.digest in values.yaml to the new record's .image.digest first. The new chart
   > # presets the new tag, but a stale digest would win and keep the old image.
   > CHART_VERSION=$(jq -r .chart.version "$REC.json")
   > helm pull "oci://$(jq -r .chart.repository "$REC.json")" --version "$CHART_VERSION"
   > helm upgrade tenet "./tenet-pii-enterprise-$CHART_VERSION.tgz" -n tenet-pii -f values.yaml --wait --timeout 15m
   > kubectl -n tenet-pii rollout status deploy/tenet-tenet-pii-enterprise-detect
   > kubectl -n tenet-pii rollout status deploy/tenet-tenet-pii-enterprise-rehydrate
   > ```

   > [tab] CloudFormation
   >
   > ```bash theme={null}
   > # The template exceeds CloudFormation's inline size limit, so it goes through your S3 bucket.
   > # Parameters you don't override keep their current values.
   > aws cloudformation deploy --stack-name tenet-pii --region "$AWS_REGION" \
   >   --template-file tenet-pii-enterprise.yaml --s3-bucket "$TEMPLATE_BUCKET" \
   >   --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
   >   --parameter-overrides ImageUri=<repository>@sha256:<new-digest> \
   >   --no-execute-changeset
   > # Review the change set it prints, then execute it:
   > aws cloudformation execute-change-set --change-set-name <arn from the output>
   > aws cloudformation wait stack-update-complete --stack-name tenet-pii --region "$AWS_REGION"
   > ```
   >
   > Download the new template first: `curl -sO https://platform.tenetlabs.com/enterprise/current/tenet-pii-enterprise.yaml`. A release that changes the template's parameters lists them in its release notes.

   > [tab] Terraform
   >
   > ```bash theme={null}
   > # Keep the previous module (e.g. move ./tenet-pii-enterprise-terraform aside) for rollback.
   > curl -sO https://platform.tenetlabs.com/enterprise/current/tenet-pii-enterprise-terraform.tar.gz
   > tar -xzf tenet-pii-enterprise-terraform.tar.gz
   > # source    = "./tenet-pii-enterprise-terraform/deploy/terraform"   (unchanged)
   > # image_uri = "<repository>@sha256:<new-digest>"
   > terraform init -upgrade
   > terraform plan -out upgrade.plan   # an image-only change touches the task definitions and services
   > terraform apply upgrade.plan
   > ```

5. **Check** both services. The health probes aren't routed through VPC Lattice, so read readiness from the platform:

   ```bash theme={null}
   # ECS: running = desired, and every Lattice target HEALTHY (the target groups health-check /readyz)
   aws ecs describe-services --cluster "$CLUSTER" --services detect rehydrate \
     --query 'services[].{name:serviceName,running:runningCount,desired:desiredCount}'
   # EKS: exits 0 when the model is loaded and the vault answers
   kubectl -n tenet-pii exec deploy/tenet-tenet-pii-enterprise-detect -- tenet-pii-enterprise healthcheck --ready
   ```

   Then one signed `/deidentify` → `/reidentify` round trip, as in the [quickstart](https://docs.tenetlabs.com/pii-engine/quickstart.md).

## Capacity during a rollout

A detect replica uses a whole node, so the defaults replace replicas **in place** instead of surging a new node per deploy:

| Path | Default | During the rollout |
| - | - | - |
| Helm | `rollout.maxSurge: 0`, `maxUnavailable: 1` | One replica fewer while each pod restarts (1 of 2 at the default count). |
| CloudFormation / Terraform | minimum healthy `50`%, maximum `100`% | Half the tasks serve (1 of 2 at the default count). |

Deploy off-peak, or raise the replica count first. To keep full capacity: Helm `maxSurge: 1`, `maxUnavailable: 0` with an autoscaler or spare nodes; ECS `100`/`200` with `AsgMaxSize` headroom for one extra instance per service.

## Rolling back

Re-deploy the recorded previous digest the same way, with the chart, template or module you deployed it with. The download site serves only the current release, so keep those files from each upgrade. Before going back, read the release notes of the versions you're leaving: they say when an image changed something an older one can't run with, such as the vault format or the IAM it needs.

## Gotchas

* **Never change the deployment id** (`deploymentId`, `DeploymentId`, `deployment_id`) during an upgrade. The services refuse to start against a vault stamped with a different id, and every KMS condition pins it.
* **A pending key rotation takes effect at the rollout.** Running replicas pin their current key; new replicas pick up the newest. Expect `session_ref` values in audit records to change from that point. [Key rotation](https://docs.tenetlabs.com/pii-engine/operate/key-rotation.md).
* **Upgrade the chart, template or module with the image.** A new image may need an env var, IAM permission or endpoint the old one doesn't set.
* **Deploy by digest, not by tag.** The release record names the digest; a tag is only a label.

## Links

* [Subscribe and get the image](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md)
* [Key rotation](https://docs.tenetlabs.com/pii-engine/operate/key-rotation.md)
* [Sizing](https://docs.tenetlabs.com/pii-engine/operate/sizing.md)
* [Troubleshooting](https://docs.tenetlabs.com/pii-engine/troubleshooting.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.