dcloud ecr lifecycle-policy put

Set the lifecycle policy

IAM ecr:PutLifecyclePolicyChanges stateAsks before it deletes (-y skips)

{"policy": {"rules": [...]}} in the AWS ECR format; a policy written for ECR pastes in unchanged. Applied hourly. The response lists what it would expire right now (wouldExpire) — the next run expires exactly that. Expired images stay restorable for softDeleteDays (7 for an AWS ECR policy) before they are purged.

Synopsis

dcloud ecr lifecycle-policy put id --policy policy

Arguments

  • <id>Required

    string

    Also accepted as --id. Constraints: uuid

Flags

  • --policyRequired

    object

    The policy: AWS ECR lifecycle JSON ({"rules": [{rulePriority, selection, action}]}, at most 50 rules; expired images stay restorable for 7 days) or ews-lifecycle/v1 ({"version": "ews-lifecycle/v1", rules, keep, softDeleteDays 0–30, default 7}). Stored as given, and the repository switches to its own policy

    Constraints: JSON

Example

dcloud ecr lifecycle-policy put id --policy '{}'

Generated from the API description, the same one the API checks requests against and the CLI is built from.