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

# Start a rollback deployment

> Start a rollback: create a new deployment that redeploys the exact
task definition revision a previously-successful deploy registered —
no new revision is created. The target deployment ID is in the URL
path. Description is auto-generated.



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml post /deployments/{id}/rollback
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Describe
paths:
  /deployments/{id}/rollback:
    post:
      tags:
        - Deployments
      summary: Start a rollback deployment
      description: |-
        Start a rollback: create a new deployment that redeploys the exact
        task definition revision a previously-successful deploy registered —
        no new revision is created. The target deployment ID is in the URL
        path. Description is auto-generated.
      operationId: RollbackDeployment
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '201':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    $ref: '#/components/schemas/Deployment.Model'
                required:
                  - data
                type: object
          description: >-
            The request has succeeded and a new resource has been created as a
            result.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The server cannot find the requested resource.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Client error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    Deployment.Model:
      additionalProperties: false
      properties:
        completedAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          description: Timestamp when the deployment completed
          readOnly: true
        createdAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          readOnly: true
        data:
          allOf:
            - $ref: '#/components/schemas/DeploymentData'
          description: |-
            Typed deployment-type-specific metadata (clusterArn /
            serviceArn / TD snapshots for ECS; functionArn / aliasName /
            version for Lambda; etc.). Stored as a JSON column on the
            ModuleDeployment row; payload shape is defined in
            `@fc/schemas/deployments/tsp`.
          readOnly: true
        deploymentType:
          description: Deployment type (e.g., "aws:ecs")
          type: string
        description:
          description: User-provided description
          type: string
        environmentId:
          description: Environment ID
          type: string
        error:
          allOf:
            - $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: User-facing error data, formatted from raw ErrorData stored in DB
          readOnly: true
        externalDeploymentId:
          description: |-
            Cloud-assigned deployment identity. ECS uses values like
            `ecs-svc/9124318887254438708`; the deployment list uses this to
            match ECS service-revision ARNs back to Ravion deployment rows.
          readOnly: true
          type: string
        id:
          readOnly: true
          type: string
        moduleInstanceId:
          description: Module instance ID this deployment targets
          type: string
        organizationId:
          readOnly: true
          type: string
        pipelineRunId:
          description: Pipeline run ID executing this deployment
          type: string
        projectId:
          description: Project ID
          type: string
        redeployOfDeploymentId:
          description: |-
            Populated on redeploy deployments — references the source
            deployment whose task definition revision was redeployed.
          readOnly: true
          type: string
        resourceArn:
          description: |-
            Hot-path correlation key for event ingestion. ECS →
            serviceArn; Lambda → functionArn; Static →
            primary CloudFront distribution id. Indexed on the DB row so
            event ingesters can resolve an incoming event to a deploy
            without JSON_EXTRACT.
          readOnly: true
          type: string
        resourceName:
          description: Human-readable name derived from the resource ARN.
          readOnly: true
          type: string
        rollbackToDeploymentId:
          description: |-
            Populated on rollback deployments — references the deployment
            that was rolled back to.
          readOnly: true
          type: string
        startedAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          description: Timestamp when the deployment started executing
          readOnly: true
        status:
          description: Deployment status
          enum:
            - PENDING
            - IN_PROGRESS
            - SUCCESS
            - ERROR
            - CANCELLED
            - ROLLING_BACK
            - ROLLED_BACK
          readOnly: true
          type: string
        stepExecutionId:
          description: |-
            Step execution that produced this deployment. Set when
            triggerSource=PIPELINE — points at the exact `deploy`/`deploy-swap`
            step inside `pipelineRunId` so the UI can deep-link without
            guessing by stepType.
          type: string
        triggerSource:
          description: How the deployment was triggered
          type: string
        updatedAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          readOnly: true
      required:
        - id
        - createdAt
        - updatedAt
        - organizationId
        - moduleInstanceId
        - projectId
        - environmentId
        - description
        - status
        - deploymentType
        - triggerSource
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    UtcDateTime:
      description: UTC RFC3339 timestamp with a required Z suffix
      format: date-time
      pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$
      type: string
      x-go-type: apitypes.UTCDateTime
      x-go-type-import:
        name: apitypes
        path: ravion/api-go/pkg/apitypes
    DeploymentData:
      description: |-
        Discriminated union over deployment-type metadata. Variants are
        added as deployment types land:
        `aws:ecs`    → `Deployments.EcsDeploymentData`
        `aws:ec2`    → `Deployments.AwsEc2DeploymentData`
        `aws:static` → `Deployments.AwsStaticDeploymentData`
        `aws:lambda` → `Deployments.AwsLambdaDeploymentData`
        Variants live in `@fc/schemas/deployments/tsp/aws-ecs.tsp` and
        `aws-static.tsp` / `aws-lambda.tsp`; this union wires them up
        with the shared `type` discriminator so consumers can narrow on
        `data.type` without parsing opaque JSON.
      discriminator:
        mapping:
          aws:ec2:
            $ref: '#/components/schemas/Deployments.AwsEc2DeploymentData'
          aws:ecs:
            $ref: '#/components/schemas/Deployments.EcsDeploymentData'
          aws:lambda:
            $ref: '#/components/schemas/Deployments.AwsLambdaDeploymentData'
          aws:static:
            $ref: '#/components/schemas/Deployments.AwsStaticDeploymentData'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/Deployments.EcsDeploymentData'
        - $ref: '#/components/schemas/Deployments.AwsEc2DeploymentData'
        - $ref: '#/components/schemas/Deployments.AwsStaticDeploymentData'
        - $ref: '#/components/schemas/Deployments.AwsLambdaDeploymentData'
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
    Deployments.AwsEc2DeploymentData:
      additionalProperties: false
      description: |-
        Typed payload for `ModuleDeployment.deploymentData` when
        `deploymentType == AWS_EC2`.

        Mirrors `AwsLambdaDeploymentData` — all per-deploy state folded into
        this JSON column so adding a deployment type costs zero new SQL
        tables.

        Indexed columns the workflow also denormalizes onto
        `ModuleDeployment` (`resourceArn`, `resourceName`,
        `externalDeploymentId`):
        - `resourceArn`          ← Auto Scaling Group ARN (when known)
        - `resourceName`         ← `autoScalingGroupName`
        - `externalDeploymentId` ← SSM `commandId` (commit identity).
      properties:
        autoScalingGroupName:
          description: Name of the Auto Scaling Group the deploy targets.
          type: string
        awsAccountNumber:
          description: |-
            Twelve-digit AWS account number that owns the Auto Scaling Group.
            Combined with region and ASG name for unambiguous EventBridge
            correlation when the group ARN is not present.
          type: string
        commandCompletedAt:
          description: Set when `commandStatus` reaches `SUCCESS` or `FAILED`.
          format: date-time
          type: string
        commandFailureReason:
          description: |-
            AWS error message if `commandStatus == FAILED` before any
            invocation ran (SendCommand itself failed). Per-instance failures
            land on `instanceResults[].outputTail` instead.
          type: string
        commandId:
          description: |-
            SSM command ID returned by SendCommand. Acts as the deploy's
            commit identity for downstream tooling.
          type: string
        commandStatus:
          $ref: '#/components/schemas/Deployments.AwsEc2CommandStatus'
        deployedDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsEc2DeploymentDefinition'
          description: Snapshot of the resolved definition this deploy applied.
        instanceResults:
          description: |-
            The InService instance snapshot the command was sent to, with each
            instance's terminal invocation status.
          items:
            $ref: '#/components/schemas/Deployments.AwsEc2InstanceResult'
          type: array
        logGroupName:
          description: |-
            CloudWatch log group receiving app output. Streams are named
            `deployment/<moduleDeploymentId>/instance/<instanceId>`. Absent for
            deployments created from module versions that predate runtime logs.
          type: string
        maxConcurrency:
          description: MaxConcurrency the command was sent with (count or percentage).
          type: string
        maxErrors:
          description: MaxErrors the command was sent with (count or percentage).
          type: string
        previousDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsEc2DeploymentDefinition'
          description: |-
            Snapshot of the resolved definition from the last SUCCESS-status
            EC2 deploy on this module instance, if any. Null on the very
            first EC2 deploy.
        region:
          description: AWS region of the group and document.
          type: string
        source:
          allOf:
            - $ref: '#/components/schemas/Pipeline.GitSource'
          description: >-
            Optional deploy.source used by a manual deploy. The stored ref is
            the

            immutable commit resolved before SSM dispatch.
        ssmDocumentName:
          description: |-
            Name of the SSM command document the deploy ran: the
            convention-derived `<asg-name>-deploy` (both runtimes).
          type: string
        targetGroupArn:
          description: |-
            ARN of the service target group, when the service is
            load-balanced. Informational — the document owns drain and
            re-register.
          type: string
        type:
          enum:
            - aws:ec2
          type: string
      required:
        - type
        - autoScalingGroupName
        - ssmDocumentName
        - region
        - awsAccountNumber
        - commandStatus
      type: object
    Deployments.EcsDeploymentData:
      additionalProperties: false
      description: |-
        Typed payload for ModuleDeployment.deploymentData when
        deploymentType == AWS_ECS. Merged in from the old
        EcsModuleDeployment table.

        clusterArn + serviceArn live here in the JSON; the serviceArn is
        also denormalized onto the indexed ModuleDeployment.resourceArn
        column so the event-ingestion hot path (aws.ecs events) can
        resolve a deploy by service ARN without JSON_EXTRACT.
      properties:
        acceptedPauseControl:
          allOf:
            - $ref: >-
                #/components/schemas/Deployments.EcsDeploymentAcceptedPauseControl
          description: |-
            Latest PAUSED lifecycle hook control accepted by the API. This is
            cleared implicitly by mismatch: when a newer PAUSED event becomes
            latest, its hook/stage/timestamp no longer matches this object and
            the UI shows controls again.
        clusterArn:
          type: string
        deployedTaskDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsTaskDefinitionSnapshot'
          description: |-
            Snapshot of the task definition this deploy registered. Populated
            once RegisterTaskDefinition succeeds.
        ecsModuleDeploymentId:
          description: |-
            Preserved during migration from the old EcsModuleDeployment
            table so legacy log / ticket / Temporal-payload references can
            still be traced. New code should use the parent
            ModuleDeployment.id as the deploy identifier.
          type: string
        elbListenerState:
          description: |-
            ALB listener topology, one entry per load balancer the service
            is attached to. Written by the deploy workflow's
            `CaptureEcsServiceListeners` activity at phase-start only
            (topology rarely changes mid-deploy). Replaces the old
            `ECS_SERVICE_LISTENERS` snapshot kind.
          items:
            $ref: '#/components/schemas/Deployments.EcsElbListenerState'
          type: array
        events:
          description: |-
            Append-only progress timeline. The deploy workflow writes one
            entry per phase transition via JSON_ARRAY_APPEND so the row
            update fires the existing ModuleDeployment WebSocket broadcast.
            The frontend reads the last entry as the current phase to drive
            the deploy progress bar
          items:
            $ref: '#/components/schemas/Deployments.EcsDeploymentEvent'
          type: array
        postDeployEnabled:
          description: |-
            True when the resolved deploy config carried a non-empty
            `post_deploy` hook. Symmetric to preDeployEnabled.
          type: boolean
        preDeployEnabled:
          description: |-
            True when the resolved deploy config carried a non-empty
            `pre_deploy` hook. Written once at deploy-start, before any
            hook task runs. Drives the UI's pre-deploy phase slot
            rendering. Reads default to `false` when absent (legacy
            deployments that predate the hook feature).
          type: boolean
        previousTaskDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsTaskDefinitionSnapshot'
          description: |-
            Snapshot of the task definition that was running before this
            deploy registered a new one. Null on the very first deploy of a
            module instance.
        revertExternalDeploymentId:
          description: |-
            AWS deployment id (`ecs-svc/<rev>`) of the rollback UpdateService
            issued by the rolling revert path. Distinct from
            ModuleDeployment.externalDeploymentId, which stays bound to the
            failed deploy's own AWS deployment.
          type: string
        revertRequestedAt:
          description: |-
            Stamped by the rolling-strategy failure path just before its
            snapshot-revert UpdateService call. The revert starts a brand-new
            AWS service deployment whose id isn't known until UpdateService
            returns, so this flag lets event ingestion attribute that
            deployment's first events to this deploy (as its rollback) even
            when they beat the identity write below — instead of minting a
            phantom "external" deployment row.
          format: date-time
          type: string
        revertServiceDeploymentArn:
          description: |-
            Service-deployment ARN of the rollback deployment started by the
            rolling revert path. Companion to revertExternalDeploymentId for
            events that only carry the ARN.
          type: string
        serviceArn:
          type: string
        serviceDeploymentArn:
          description: |-
            ARN of the AWS service deployment
            (arn:aws:ecs:…:service-deployment/cluster/service/id) driving
            this deploy. Populated for non-rolling strategies once the
            UpdateService call resolves it via ListServiceDeployments; used
            by StopServiceDeployment / ContinueServiceDeployment and for
            EventBridge correlation.
          type: string
        serviceDeploymentState:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsServiceDeploymentState'
          description: |-
            Latest ECS service-deployment state captured from
            DescribeServiceDeployments. This mirrors ECS's target/source service
            revisions and drives Live / Standby badges without inferring traffic
            roles from row order or old Ravion phase events.
        strategy:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsDeployStrategy'
          description: |-
            Deployment strategy this deploy ran with. Absent on legacy rows
            (which predate native-strategy support and were always rolling
            or dual-service blue/green).
        type:
          enum:
            - aws:ecs
          type: string
      required:
        - type
        - clusterArn
        - serviceArn
      type: object
    Deployments.AwsLambdaDeploymentData:
      additionalProperties: false
      description: |-
        Typed payload for `ModuleDeployment.deploymentData` when
        `deploymentType == AWS_LAMBDA`.

        Mirrors `AwsStaticDeploymentData` — all per-deploy state folded into
        this JSON column so adding a deployment type costs zero new SQL
        tables.

        Indexed columns the workflow also denormalizes onto
        `ModuleDeployment` (`resourceArn`, `resourceName`,
        `externalDeploymentId`):
        - `resourceArn`         ← `functionArn`
        - `resourceName`        ← `functionName`
        - `externalDeploymentId` ← `<functionArn>:<publishedVersion>`
        (commit identity for the deploy).
      properties:
        aliasArn:
          description: Alias ARN after the successful UpdateAlias call.
          type: string
        aliasFailureReason:
          description: |-
            AWS error message if `aliasUpdateStatus == FAILED`. Most common
            cause is RevisionId mismatch from a racing deploy.
          type: string
        aliasName:
          description: |-
            Alias the deploy flips after publishing the new version. Defaults
            to `live` when the module YAML omits it.
          type: string
        aliasNewRevisionId:
          description: RevisionId returned by the successful UpdateAlias call.
          type: string
        aliasPreviousRevisionId:
          description: |-
            RevisionId observed on the alias *before* the UpdateAlias call —
            the value passed as `RevisionId` precondition so concurrent
            deploys can't silently clobber each other.
          type: string
        aliasUpdateCompletedAt:
          description: Set when `aliasUpdateStatus` transitions to `SUCCESS` or `FAILED`.
          format: date-time
          type: string
        aliasUpdateStatus:
          $ref: '#/components/schemas/Deployments.AwsLambdaAliasUpdateStatus'
        deployedDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsLambdaDeploymentDefinition'
          description: |-
            Snapshot of the resolved definition this deploy applied. Populated
            once the workflow finishes resolving inputs (before
            UpdateFunctionCode).
        functionArn:
          description: Full ARN of the Lambda function the deploy targets.
          type: string
        functionName:
          description: Short function name parsed from the ARN.
          type: string
        previousDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsLambdaDeploymentDefinition'
          description: |-
            Snapshot of the resolved definition from the last SUCCESS-status
            Lambda deploy on this module instance, if any. Null on the very
            first Lambda deploy. Used by the deploy detail drawer to render
            the definition diff.
        previousPublishedVersion:
          description: |-
            Function version the alias was pointing at *before* this deploy —
            the rollback target. Captured by the `CaptureLambdaPreviousAlias`
            activity. Null when this is the first deploy that created the
            alias.
          type: string
        publishFailureReason:
          description: AWS error message if `publishStatus == FAILED`.
          type: string
        publishStatus:
          $ref: '#/components/schemas/Deployments.AwsLambdaPublishStatus'
        publishedVersion:
          description: |-
            Numeric version produced by PublishVersion (e.g. `"42"`). Acts as
            the deploy's commit identity for downstream tooling.
          type: string
        publishedVersionArn:
          description: |-
            Qualified ARN of the published version
            (`<functionArn>:<publishedVersion>`). Denormalized for the UI.
          type: string
        region:
          description: AWS region of the function.
          type: string
        s3ArtifactBucket:
          description: |-
            Optional S3 bucket the build step uploads the zip artifact into.
            Captured for audit even when the deploy itself targets an
            IMAGE-packaged function (a single module may switch between
            packaging modes across deploys).
          type: string
        type:
          enum:
            - aws:lambda
          type: string
        updateCompletedAt:
          description: Set when `updateStatus` transitions to `SUCCESS` or `FAILED`.
          format: date-time
          type: string
        updateFailureReason:
          description: AWS error message if `updateStatus == FAILED`.
          type: string
        updateRevisionId:
          description: |-
            RevisionId returned by UpdateFunctionCode — captures the function
            configuration revision the deploy actually wrote. Useful for
            cross-correlating with Lambda's own audit log.
          type: string
        updateStatus:
          $ref: '#/components/schemas/Deployments.AwsLambdaUpdateStatus'
      required:
        - type
        - functionArn
        - functionName
        - region
        - aliasName
        - updateStatus
        - publishStatus
        - aliasUpdateStatus
      type: object
    Deployments.AwsStaticDeploymentData:
      additionalProperties: false
      description: |-
        Typed payload for `ModuleDeployment.deploymentData` when
        `deploymentType == AWS_STATIC`.

        Replaces the originally-planned per-deploy `AwsStaticModuleDeployment`
        child table — the deployment-manager refactor folded all per-type
        data into this JSON column so adding a deployment type costs zero
        new SQL tables.

        Indexed columns the workflow also denormalizes onto
        `ModuleDeployment` (`resourceArn`, `resourceName`,
        `externalDeploymentId`):
        - `resourceArn`         ← `kvsArn`         (so KVS-event ingesters
        can resolve a deploy
        by KVS arn without
        JSON_EXTRACT)
        - `resourceName`        ← `s3Bucket`       (UI breadcrumb)
        - `externalDeploymentId` ← `kvsETag`       (commit identity, audit
        trail for promotion).
      properties:
        deployedDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsStaticDeploymentDefinition'
          description: |-
            Snapshot of the resolved definition this deploy promoted.
            Populated once the workflow finishes resolving inputs (before
            KVS write).
        deployedKvsState:
          additionalProperties:
            type: string
          description: |-
            KVS contents this deploy promoted, captured directly by the PutKey
            activity from the same `(key, value)` pair it wrote to CloudFront.
            This is the source of truth for the "after" side of the deploy
            detail diff — the renderer doesn't synthesize it from the resolved
            definition's directory field. Populated when `kvsStatus`
            transitions to SUCCESS.
          type: object
        distributions:
          description: |-
            Distributions whose CloudFront function reads from `kvsArn`.
            Captured at deploy phase-start by the
            `CaptureStaticDistributions` activity, mirroring how
            `CaptureEcsServiceListeners` works for ECS. Drives the deploy
            detail UI's domains list.
          items:
            $ref: '#/components/schemas/Deployments.AwsCloudfrontDistributionInfo'
          type: array
        invalidations:
          description: |-
            One entry per distribution the deploy was asked to invalidate.
            Empty / omitted when the deploy's definition specified no
            `cloudfront_invalidation_paths`. Updated incrementally by the
            background invalidation activity — the deploy itself completes
            the moment KVS PutKey succeeds, regardless of invalidation
            state.
          items:
            $ref: '#/components/schemas/Deployments.AwsCloudfrontInvalidationRecord'
          type: array
        kvsArn:
          description: ARN of the CloudFront KeyValueStore holding the `active` key.
          type: string
        kvsCompletedAt:
          description: Set when `kvsStatus` transitions to `SUCCESS` or `FAILED`.
          format: date-time
          type: string
        kvsETag:
          description: |-
            ETag returned by the successful `PutKey` call (the `ETag`
            response header). Acts as the deploy's commit identity and is
            the value the *next* deploy's `If-Match` header must carry to
            satisfy KVS optimistic concurrency. Also denormalized to
            `ModuleDeployment.externalDeploymentId` for indexed lookups.
          type: string
        kvsFailureReason:
          description: |-
            AWS error message if `kvsStatus == FAILED`. Most common cause is
            ETag mismatch from a racing deploy.
          type: string
        kvsPreviousETag:
          description: |-
            ETag observed on the `active` key immediately before this
            deploy's PutKey attempt. Captured for audit so post-mortem
            tooling can reconstruct the optimistic-concurrency chain across
            concurrent deploys.
          type: string
        kvsStatus:
          $ref: '#/components/schemas/Deployments.AwsStaticKvsWriteStatus'
        previousDefinition:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsStaticDeploymentDefinition'
          description: |-
            Snapshot of the resolved definition from the last SUCCESS-status
            static deploy on this module instance, if any. Null on the very
            first static deploy. Used by the deploy detail drawer to render
            the definition diff in lieu of a task-definition diff.
        previousKvsState:
          additionalProperties:
            type: string
          description: |-
            KVS contents *before* this deploy's PutKey, copied at create time
            from the prior successful deploy's `deployedKvsState`. Today this
            is a single-key map (`{[active]: <prior directory>}`) — modeled as
            a Record so the diff viewer doesn't have to know which keys the
            workflow promotes, and so multi-key promotions land without a UI
            rework. Null on the very first static deploy for a module instance.
          type: object
        prunedDirectories:
          description: |-
            Directories the prune activity removed from the hosting bucket
            for this deploy. Bounded by `keepLatestSuccessfulDeployCount` on
            the resolved definition. Empty when the count threshold wasn't
            exceeded.
          items:
            type: string
          type: array
        s3Bucket:
          description: Hosting bucket name (resolved `s3_bucket`).
          type: string
        s3Region:
          description: |-
            Hosting bucket region — needed by the prune activity to talk to
            the right S3 endpoint.
          type: string
        type:
          enum:
            - aws:static
          type: string
      required:
        - type
        - kvsArn
        - s3Bucket
        - s3Region
        - kvsStatus
      type: object
    Deployments.AwsEc2CommandStatus:
      description: |-
        Status of the SendCommand dispatch + ListCommandInvocations poll
        loop as a whole.
      enum:
        - PENDING
        - IN_PROGRESS
        - SUCCESS
        - FAILED
      type: string
    Deployments.AwsEc2DeploymentDefinition:
      additionalProperties: false
      description: |-
        Snapshot of the resolved `Module.Ec2ModuleDeployment.definition`
        (from `packages/schemas/modules/tsp/deployment.tsp`) captured at
        deploy time. Stored twice on `AwsEc2DeploymentData` (the prior
        successful deploy's snapshot + this deploy's snapshot) so the deploy
        detail drawer can render the definition diff.

        Open `raw` field — the underlying module-side definition schema can
        grow without forcing a schema migration here.
      properties:
        commands:
          description: Shell commands the deploy ran on each instance, in order.
          items:
            type: string
          type: array
        imageUri:
          description: |-
            Full image URI the deploy resolved (repository + tag or
            `@sha256:` digest). Renders as the deploy's UI tag for container
            deploys.
          type: string
        raw:
          additionalProperties: {}
          description: |-
            Raw resolved-definition JSON, kept verbatim so future fields
            surface in the diff viewer without a schema migration here.
          type: object
        runtime:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsEc2Runtime'
          description: |-
            Which runtime this deploy used. Drives which release fields below
            carry values.
      required:
        - runtime
        - raw
      type: object
    Deployments.AwsEc2InstanceResult:
      additionalProperties: false
      description: One instance's command invocation result.
      properties:
        completedAt:
          description: Set when the invocation reached a terminal status.
          format: date-time
          type: string
        instanceId:
          description: EC2 instance ID the document ran on.
          type: string
        outputTail:
          description: |-
            Tail of the invocation's stdout/stderr, captured for failed
            invocations so the deploy error surfaces the on-instance cause
            without an extra AWS round trip.
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsEc2InstanceInvocationStatus'
          description: Invocation status.
      required:
        - instanceId
        - status
      type: object
    Pipeline.GitSource:
      additionalProperties: false
      description: Git source configuration for fetching code
      properties:
        base_path:
          default: .
          description: |-
            Base path within the repository to use as the working root
            Example:
            base_path: packages/api
            Optional — defaults to "."
          type: string
          x-templateable: true
        branch:
          description: |-
            Branch to check out
            Example:
            branch: main
            Required
          minLength: 1
          type: string
          x-templateable: true
        ref:
          description: >-
            Git ref to check out — branch, commit SHA, tag, or other ref.
            Overrides branch HEAD if set.

            Example:

            ref: v1.2.3

            Optional
          type: string
          x-templateable: true
        repo:
          allOf:
            - $ref: '#/components/schemas/Pipeline.GitRepoUrl'
          description: |-
            Full repository URL including host
            Example:
            repo: https://gitlab.com/my-org/my-group/my-repo
            Required
          x-templateable: true
        type:
          description: Source type identifier
          enum:
            - git
          type: string
          x-templateable: true
      required:
        - type
        - repo
        - branch
      type: object
    Deployments.EcsDeploymentAcceptedPauseControl:
      additionalProperties: false
      properties:
        acceptedAt:
          description: When the API accepted and persisted this operator decision.
          format: date-time
          type: string
        action:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsDeploymentPauseControlAction'
          description: Accepted operator decision.
        eventStartedAt:
          description: |-
            `startedAt` from the PAUSED event that was resolved, when known.
            Lets consumers distinguish repeated pauses that use the same stage.
          format: date-time
          type: string
        hookId:
          description: |-
            Hook id the decision was sent for. Mirrors the PAUSED event's
            `hookId`; empty string when the event/API request omitted one.
          type: string
        labelKind:
          allOf:
            - $ref: >-
                #/components/schemas/Deployments.EcsDeploymentAcceptedPauseControlLabelKind
          description: Backend-derived label intent for the persisted operator decision.
        lifecycleStage:
          description: |-
            Lifecycle stage from the PAUSED event that was resolved, when
            known. Used by the UI to avoid hiding controls for a later pause.
          type: string
      required:
        - action
        - hookId
        - acceptedAt
      type: object
    Deployments.EcsTaskDefinitionSnapshot:
      additionalProperties: false
      description: |-
        Snapshot of an ECS task definition captured at deploy time. Carries
        AWS's assigned ARN + revision plus the raw task-definition payload
        AWS returned. Stored twice on EcsDeploymentData (before / after the
        deploy's RegisterTaskDefinition call) so the drawer can diff them.

        `definition` is an open-shape map of the `DescribeTaskDefinition`
        JSON AWS returned, keys normalized to the camelCase shape the AWS
        public API uses. We deliberately do NOT coerce into
        `Module.EcsTaskDefinition` (the user YAML schema) here — that
        schema is a subset of the AWS surface, so coercion would silently
        drop fields AWS includes but users don't get to set directly
        (registeredAt, status, requiresAttributes, revision, etc.).
      properties:
        arn:
          description: |-
            Full ARN returned by RegisterTaskDefinition, e.g.
            arn:aws:ecs:us-east-1:123:task-definition/my-svc:42
          type: string
        definition:
          additionalProperties: {}
          description: |-
            Raw AWS `DescribeTaskDefinition` response, keys normalized to
            camelCase. Every field AWS returns (containerDefinitions,
            networkMode, requiresCompatibilities, taskRoleArn, registeredAt,
            …) is present verbatim so the drawer's diff viewer can render
            the complete before / after.
          type: object
        revision:
          description: |-
            Revision number AWS assigned. Duplicated from the ARN tail so
            consumers that parse family:revision directly don't need to
            string-split the ARN.
          format: int32
          type: integer
      required:
        - arn
        - revision
        - definition
      type: object
    Deployments.EcsElbListenerState:
      additionalProperties: false
      description: |-
        Listener topology for one load balancer. Stored on
        `EcsDeploymentData.elbListenerState` as one entry per LB the
        service is attached to. Captured once at phase-start — listeners
        change when the user edits the module, not on every deploy tick.
      properties:
        capturedAt:
          description: When this topology was captured.
          format: date-time
          type: string
        loadBalancerArn:
          type: string
        loadBalancerDnsName:
          type: string
        rules:
          description: |-
            One entry per (listener, rule) pair on the load balancer. The
            drawer filters by targetGroupArn to surface only the rules that
            route to the task's TG.
          items:
            $ref: '#/components/schemas/Deployments.EcsListenerRule'
          type: array
      required:
        - loadBalancerArn
        - loadBalancerDnsName
        - rules
        - capturedAt
      type: object
    Deployments.EcsDeploymentEvent:
      additionalProperties: false
      description: |-
        One progress entry in `EcsDeploymentData.events`. Appended atomically
        via JSON_ARRAY_APPEND from the deploy workflow at every phase
        transition; the row update fires the existing ModuleDeployment
        WebSocket broadcast so the dashboard updates without polling.

        The array is append-only; consumers read the last entry as the
        current phase, and the full array as the deploy timeline.
      properties:
        currentStep:
          description: 1-indexed current step. Used by the progress bar denominator.
          format: int32
          type: integer
        desiredCount:
          description: |-
            ECS service desiredCount once the snapshot phase has run. Used
            by the frontend to render "running tasks: N/M" during the
            WAIT_HEALTHY phase. Omitted on events fired before snapshot.
          format: int32
          type: integer
        hookId:
          description: |-
            Pending PAUSE hook id (PAUSED events only). The continue API
            echoes this back via `ContinueServiceDeployment`.
          type: string
        lifecycleStage:
          description: |-
            ECS lifecycle stage that produced this event, when known
            (TRAFFIC_SHIFT / BAKE / PAUSED events). AWS enum spelling, e.g.
            POST_TEST_TRAFFIC_SHIFT, PRE_PRODUCTION_TRAFFIC_SHIFT.
          type: string
        message:
          description: |-
            Free-form human message captured alongside terminal events
            (root-cause string on FAILED). Omitted on intermediate phases.
          type: string
        startedAt:
          description: When the workflow recorded this event.
          format: date-time
          type: string
        stepCode:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsDeployPhaseCode'
          description: Phase identifier — see EcsDeployPhaseCode.
        totalSteps:
          description: Total user-visible steps in the deploy. Constant per workflow.
          format: int32
          type: integer
        trafficPhase:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsDeploymentTrafficPhase'
          description: |-
            Backend-classified production/standby meaning for this event,
            derived from `stepCode` and `lifecycleStage`. Omitted when the event
            has no traffic-role implication.
      required:
        - stepCode
        - currentStep
        - totalSteps
        - startedAt
      type: object
    Deployments.EcsServiceDeploymentState:
      additionalProperties: false
      description: |-
        Current ECS service-deployment snapshot captured from
        DescribeServiceDeployments. This is the source of truth for deployment
        list Live / Standby badges: target/source revisions and lifecycle stage
        are what ECS believes at observation time.
      properties:
        acceptsNativeStandbyRevert:
          description: |-
            True while ECS still accepts a native StopServiceDeployment call for
            reverting production traffic to the source revision.
          type: boolean
        lifecycleStage:
          description: |-
            AWS lifecycle stage, e.g. POST_TEST_TRAFFIC_SHIFT,
            PRODUCTION_TRAFFIC_SHIFT, BAKE_TIME, CLEAN_UP.
          type: string
        observedAt:
          format: date-time
          type: string
        serviceDeploymentArn:
          type: string
        sourceServiceRevisions:
          items:
            $ref: '#/components/schemas/Deployments.EcsServiceRevisionTrafficState'
          type: array
        status:
          description: |-
            AWS service deployment status, e.g. PENDING, IN_PROGRESS,
            SUCCESSFUL, ROLLBACK_IN_PROGRESS, STOPPED.
          type: string
        statusReason:
          type: string
        strategy:
          description: |-
            AWS deployment strategy spelling from deploymentConfiguration,
            e.g. ROLLING, BLUE_GREEN, LINEAR, CANARY.
          type: string
        targetServiceRevision:
          $ref: '#/components/schemas/Deployments.EcsServiceRevisionTrafficState'
        trafficPhase:
          allOf:
            - $ref: '#/components/schemas/Deployments.EcsDeploymentTrafficPhase'
          description: |-
            Backend-classified traffic phase for the lifecycle stage. Omitted
            when ECS reports an unknown/empty stage and traffic weights are not
            enough by themselves to classify the snapshot.
      required:
        - serviceDeploymentArn
        - status
        - acceptsNativeStandbyRevert
        - observedAt
      type: object
    Deployments.EcsDeployStrategy:
      description: |-
        Deployment strategy executed by the native ECS deployment
        controller. Mirrors `Module.EcsDeploymentStrategyConfig.type` —
        the user-facing module YAML values, not the AWS enum spelling.
      enum:
        - rolling
        - blue_green
        - linear
        - canary
      type: string
    Deployments.AwsLambdaAliasUpdateStatus:
      description: |-
        Status of `UpdateAlias` — the commit point that flips traffic onto
        the newly published version.
      enum:
        - PENDING
        - SUCCESS
        - FAILED
      type: string
    Deployments.AwsLambdaDeploymentDefinition:
      additionalProperties: false
      description: |-
        Snapshot of the resolved `Module.LambdaModuleDeployment.definition`
        (from `packages/schemas/modules/tsp/deployment.tsp`) captured at
        deploy time. Stored twice on `AwsLambdaDeploymentData` (the prior
        successful deploy's snapshot + this deploy's snapshot) so the deploy
        detail drawer can render the definition diff.

        Open `raw` field — the underlying module-side definition schema can
        grow without forcing a schema migration here.
      properties:
        architectures:
          description: CPU architecture(s) — single-element array on AWS today.
          items:
            type: string
          type: array
        deadLetterTargetArn:
          description: Dead-letter target ARN (SQS queue or SNS topic).
          type: string
        description:
          description: Function description.
          type: string
        environment:
          additionalProperties:
            type: string
          description: |-
            Environment variables applied to the function. Replaces — Lambda
            doesn't merge.
          type: object
        ephemeralStorageSize:
          description: Ephemeral `/tmp` storage size in MiB.
          format: int32
          type: integer
        fileSystemConfigs:
          description: EFS file system mounts.
          items:
            $ref: '#/components/schemas/Deployments.AwsLambdaFileSystemConfigSnapshot'
          type: array
        handler:
          description: Handler entrypoint (e.g. `index.handler`) — Zip only.
          type: string
        imageConfig:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsLambdaImageConfigSnapshot'
          description: Image-config overrides — Image-packaged functions only.
        imageUri:
          description: |-
            Full ECR image URI (with `@sha256:` digest preferred over a
            mutable tag — the workflow records the resolved digest where
            possible so the deploy is reproducible).
          type: string
        kmsKeyArn:
          description: KMS key ARN for environment variable encryption.
          type: string
        layers:
          description: Lambda layer ARNs (versioned).
          items:
            type: string
          type: array
        loggingConfig:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsLambdaLoggingConfigSnapshot'
          description: CloudWatch logging configuration.
        memorySize:
          description: Memory size in MiB.
          format: int32
          type: integer
        packageType:
          allOf:
            - $ref: '#/components/schemas/Deployments.AwsLambdaPackageType'
          description: |-
            Which packaging mode this deploy used. Drives which of the
            zip- vs image-prefixed fields below carry values.
        raw:
          additionalProperties: {}
          description: |-
            Raw resolved-definition + configuration JSON, kept verbatim so
            future fields surface in the diff viewer without a schema
            migration here.
          type: object
        role:
          description: IAM execution role ARN.
          type: string
        runtime:
          description: Lambda runtime (e.g. `nodejs20.x`, `python3.12`) — Zip only.
          type: string
        s3Bucket:
          description: |-
            S3 bucket holding the zip artifact (resolved
            `infrastructure.s3_artifact_bucket`, denormalized into the
            per-deploy snapshot so each deploy's exact source is
            reconstructable from this JSON alone).
          type: string
        s3Key:
          description: |-
            S3 key the deploy uploaded into. Renders as the deploy's UI tag
            for Zip deploys.
          type: string
        snapStartApplyOn:
          description: SnapStart mode (`None` | `PublishedVersions`).
          type: string
        timeout:
          description: |-
            Wall-clock timeout in seconds (Lambda function-level, distinct
            from the deploy-level `timeout` on the module deployment).
          format: int32
          type: integer
        tracingMode:
          description: X-Ray tracing mode (`Active` | `PassThrough`).
          type: string
        vpcSecurityGroupIds:
          description: VPC security group IDs attached to the function's ENIs.
          items:
            type: string
          type: array
        vpcSubnetIds:
          description: VPC subnet IDs the function's ENIs are placed into.
          items:
            type: string
          type: array
      required:
        - packageType
        - raw
      type: object
    Deployments.AwsLambdaPublishStatus:
      description: |-
        Status of `PublishVersion` — mints a new immutable numbered version
        of the function pointing at the just-uploaded code + configuration.
      enum:
        - PENDING
        - SUCCESS
        - FAILED
      type: string
    Deployments.AwsLambdaUpdateStatus:
      description: |-
        Status of `UpdateFunctionCode` + the subsequent `WaitForLambdaUpdated`
        poll loop. UpdateFunctionCode itself returns synchronously, but
        `LastUpdateStatus` on the function config is what tells us the new
        package is actually live.
      enum:
        - PENDING
        - IN_PROGRESS
        - SUCCESS
        - FAILED
      type: string
    Deployments.AwsStaticDeploymentDefinition:
      additionalProperties: false
      description: |-
        Snapshot of the resolved `Module.AwsStaticDeploymentDefinition`
        (from `packages/schemas/modules/tsp/deployment.tsp`) captured at
        deploy time. Stored twice on `AwsStaticDeploymentData` (the prior
        successful deploy's snapshot + this deploy's snapshot) so the deploy
        detail drawer can render the definition diff the user requested.

        Open shape because the underlying module-side definition schema can
        grow — capturing the raw JSON keeps existing snapshots renderable
        when new optional fields land.
      properties:
        cloudfrontInvalidationPaths:
          description: |-
            Optional CloudFront invalidation paths the user requested for
            this deploy. Empty array means "no invalidation".
          items:
            type: string
          type: array
        directory:
          description: |-
            Resolved `s3_directory` value — the directory under the hosting
            bucket that holds this deploy's built artifacts. Pulled to a
            named field because it doubles as the deploy's UI tag.
          type: string
        keepLatestSuccessfulDeployCount:
          description: |-
            How many successful static deploys to retain in the hosting
            bucket before pruning older directories. Null means "keep all".
          format: int32
          type: integer
        raw:
          additionalProperties: {}
          description: |-
            Raw resolved-definition JSON, kept verbatim so future fields on
            `AwsStaticDeploymentDefinition` surface in the diff viewer without
            a schema migration here.
          type: object
      required:
        - directory
        - raw
      type: object
    Deployments.AwsCloudfrontDistributionInfo:
      additionalProperties: false
      description: |-
        One CloudFront distribution attached to this hosting bucket.
        Captured at deploy phase-start so the deploy detail's "details
        table" can list every domain alias without round-tripping
        CloudFront on render.
      properties:
        defaultDomain:
          description: |-
            AWS-assigned default CloudFront domain (e.g.
            `d111111abcdef8.cloudfront.net`). Always present — useful as a
            fallback when the user hasn't configured an alias.
          type: string
        distributionArn:
          description: |-
            Full ARN, e.g.
            arn:aws:cloudfront::123456789012:distribution/E1ABCDEF.
          type: string
        distributionId:
          description: |-
            Short id parsed from the ARN tail (e.g. `E1ABCDEF`). Duplicated
            so the UI can render the id without splitting the ARN.
          type: string
        domainAliases:
          description: |-
            All domain aliases configured on the distribution
            (`Aliases.Items` from `GetDistributionConfig`). Drives the
            "domains" row in the deploy detail UI.
          items:
            type: string
          type: array
      required:
        - distributionArn
        - distributionId
        - domainAliases
      type: object
    Deployments.AwsCloudfrontInvalidationRecord:
      additionalProperties: false
      description: |-
        One CloudFront invalidation issued by this deploy. Populated by
        the background invalidation activity, one entry per
        distribution-arn the deploy was asked to invalidate.
      properties:
        completedAt:
          description: Set when `status` transitions out of `IN_PROGRESS`.
          format: date-time
          type: string
        distributionArn:
          description: Distribution this invalidation targets.
          type: string
        failureReason:
          description: AWS error message if `status == FAILED`.
          type: string
        invalidationId:
          description: |-
            AWS invalidation id from `CreateInvalidation` (e.g.
            `I2J0MWVNIHERZJ`). Null if the call itself failed before AWS
            assigned an id.
          type: string
        paths:
          description: |-
            Paths submitted to CreateInvalidation — usually `["/*"]` but
            callers can scope narrower. Captured for audit.
          items:
            type: string
          type: array
        startedAt:
          format: date-time
          type: string
        status:
          $ref: '#/components/schemas/Deployments.AwsCloudfrontInvalidationStatus'
      required:
        - distributionArn
        - paths
        - status
        - startedAt
      type: object
    Deployments.AwsStaticKvsWriteStatus:
      description: |-
        Status of writing the resolved directory value to the CloudFront
        KeyValueStore `active` key. PutKey is the deploy's commit point —
        once `SUCCESS`, traffic flips to the promoted directory immediately.
      enum:
        - PENDING
        - SUCCESS
        - FAILED
      type: string
    Deployments.AwsEc2Runtime:
      description: |-
        Which runtime the deploy targets — drives which release fields on
        `AwsEc2DeploymentDefinition` carry values.
      enum:
        - CONTAINER
        - MANUAL
      type: string
    Deployments.AwsEc2InstanceInvocationStatus:
      description: |-
        Terminal + in-flight states of one instance's command invocation.
        Mirrors the SSM invocation status value space.
      enum:
        - PENDING
        - IN_PROGRESS
        - SUCCESS
        - FAILED
        - TIMED_OUT
        - CANCELLED
      type: string
    Pipeline.GitRepoUrl:
      description: |-
        Full git repository URL including host.
        Examples:
        - https://github.com/my-org/my-repo
        - github.com/my-org/my-repo
        - https://github.com/my-org/my-repo.git
        - git
      minLength: 1
      pattern: >-
        ^((https?://)?[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z]{2,}/[a-zA-Z0-9._-]+(/[a-zA-Z0-9._-]+)+|git@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z]{2,}:[a-zA-Z0-9._-]+(/[a-zA-Z0-9._-]+)+)(\.git)?$
      type: string
    Deployments.EcsDeploymentPauseControlAction:
      description: |-
        Operator action accepted for a paused ECS lifecycle hook. Stored
        outside the append-only `events` timeline so accepting a hook does
        not mutate historical PAUSED events, while still giving every
        dashboard session a persisted source of truth after refresh.
      enum:
        - CONTINUE
        - ROLLBACK
      type: string
    Deployments.EcsDeploymentAcceptedPauseControlLabelKind:
      description: |-
        UI label intent for an accepted pause control. The backend derives this
        from the operator action plus the AWS lifecycle stage that was resolved.
      enum:
        - continue
        - traffic_shift
        - revert_standby
      type: string
    Deployments.EcsListenerRule:
      additionalProperties: false
      description: |-
        One ALB listener rule. A single DescribeListeners/DescribeRules
        capture often produces many rows — the same listener can have
        multiple rules forwarding to different target groups (e.g.
        `/api/*` → service A, `/admin/*` → service B).
      properties:
        hostHeaders:
          description: host-header condition values. Empty for the default rule.
          items:
            type: string
          type: array
        isDefaultRule:
          type: boolean
        listenerArn:
          type: string
        pathPatterns:
          description: path-pattern condition values. Empty for the default rule.
          items:
            type: string
          type: array
        port:
          format: int32
          type: integer
        protocol:
          type: string
        ruleArn:
          type: string
        rulePriority:
          description: |-
            Numeric priority of the rule. Null for the listener's default
            rule (which has no priority).
          format: int32
          type: integer
        targetGroupArn:
          description: |-
            Target group this rule forwards to. Used by the drawer to pick
            the rules relevant to a given task (whose TG is resolved from
            the task's slot).
          type: string
        targetGroupName:
          description: |-
            Short target-group name for UI display (derived from the ARN
            tail). Optional because older rows predate the capture activity
            that populates it.
          type: string
      required:
        - listenerArn
        - port
        - protocol
        - ruleArn
        - isDefaultRule
        - targetGroupArn
      type: object
    Deployments.EcsDeployPhaseCode:
      description: |-
        Phase of an ECS deploy run, persisted on each progress event the
        workflow appends to `EcsDeploymentData.events`. The frontend
        branches on this code (not the human-readable label) to render
        step UI; label rendering lives entirely in the frontend.
      enum:
        - INIT
        - PROVISION
        - SNAPSHOT
        - PRE_DEPLOY
        - UPDATE
        - WAIT_HEALTHY
        - POST_DEPLOY
        - ACTIVATE
        - COMPLETE
        - FAILED
        - TRAFFIC_SHIFT
        - BAKE
        - PAUSED
        - ROLLBACK
      type: string
    Deployments.EcsDeploymentTrafficPhase:
      description: |-
        Backend-classified traffic role for an ECS deployment event or
        DescribeServiceDeployments snapshot. This keeps AWS lifecycle-stage
        bucket logic on the backend, where the raw ECS status model is
        interpreted, instead of duplicating those string sets in the UI.
      enum:
        - standby
        - production
      type: string
    Deployments.EcsServiceRevisionTrafficState:
      additionalProperties: false
      description: |-
        One ECS service revision entry from DescribeServiceDeployments.
        ECS reports target and source revisions in terms of service-revision
        ARNs rather than Ravion deployment IDs; consumers match the ARN tail
        to `ModuleDeployment.externalDeploymentId` (`ecs-svc/<tail>`) to
        identify the corresponding row.
      properties:
        pendingTaskCount:
          format: int32
          type: integer
        requestedProductionTrafficWeight:
          description: |-
            Percentage of production traffic ECS reports for this revision.
            Optional because AWS omits it for deployment shapes that do not
            expose traffic weights.
          format: double
          type: number
        requestedTaskCount:
          format: int32
          type: integer
        requestedTestTrafficWeight:
          description: |-
            Percentage of test traffic ECS reports for this revision. Optional
            for the same reason as requestedProductionTrafficWeight.
          format: double
          type: number
        runningTaskCount:
          format: int32
          type: integer
        serviceRevisionArn:
          description: |-
            ARN such as
            arn:aws:ecs:us-east-2:123:service-revision/cluster/service/912...
          type: string
      required:
        - serviceRevisionArn
        - requestedTaskCount
        - runningTaskCount
        - pendingTaskCount
      type: object
    Deployments.AwsLambdaFileSystemConfigSnapshot:
      additionalProperties: false
      description: EFS mount snapshot.
      properties:
        arn:
          type: string
        localMountPath:
          type: string
      required:
        - arn
        - localMountPath
      type: object
    Deployments.AwsLambdaImageConfigSnapshot:
      additionalProperties: false
      description: Image-config snapshot — Image-packaged functions only.
      properties:
        command:
          items:
            type: string
          type: array
        entryPoint:
          items:
            type: string
          type: array
        workingDirectory:
          type: string
      type: object
    Deployments.AwsLambdaLoggingConfigSnapshot:
      additionalProperties: false
      description: Logging configuration snapshot.
      properties:
        applicationLogLevel:
          type: string
        logFormat:
          type: string
        logGroup:
          type: string
        systemLogLevel:
          type: string
      type: object
    Deployments.AwsLambdaPackageType:
      description: |-
        Which packaging mode the deploy targets — drives which code-source
        fields on `AwsLambdaDeploymentDefinition` carry values.
      enum:
        - ZIP
        - IMAGE
      type: string
    Deployments.AwsCloudfrontInvalidationStatus:
      description: Status of an individual CloudFront `CreateInvalidation` call.
      enum:
        - IN_PROGRESS
        - COMPLETED
        - FAILED
      type: string
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````