dcloud ecr lifecycle-defaults put

Set the default and whether it is active, preview-only or off

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

Organizations created before the defaults existed see them preview-only until they enable them here. The answer says what would expire across the inheriting repositories.

Synopsis

dcloud ecr lifecycle-defaults put --policy policy --mode mode

Flags

  • --policyRequired

    object

    The default, in ews-lifecycle/v1 only (the AWS ECR format is accepted per repository, not here): {"version": "ews-lifecycle/v1", rules (at most 50), keep, softDeleteDays 1–30}. softDeleteDays 0 is refused with 400: a default always keeps expired images restorable for at least a day

    Constraints: JSON

  • --modeRequired

    enum

    active: the hourly run expires what the default selects in every inheriting repository; preview: it only reports; off: the default does nothing

    One of: active, preview, off

Example

dcloud ecr lifecycle-defaults put --policy '{}' --mode active

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