> ## 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.

# List InfrastructureEvents

> List events filtered by resource OR by deploy. Kind filter is
optional; omitting it returns both task-state-change and
service-action events so the drawer can build a unified
timeline in a single call.



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /infrastructure-events
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:
  /infrastructure-events:
    get:
      tags:
        - InfrastructureEvents
      summary: List InfrastructureEvents
      description: |-
        List events filtered by resource OR by deploy. Kind filter is
        optional; omitting it returns both task-state-change and
        service-action events so the drawer can build a unified
        timeline in a single call.
      operationId: ListInfrastructureEvents
      parameters:
        - in: query
          name: deploymentResourceId
          schema:
            nullable: true
            type: string
        - in: query
          name: moduleDeploymentId
          schema:
            nullable: true
            type: string
        - in: query
          name: kind
          schema:
            nullable: true
            type: string
        - $ref: '#/components/parameters/PaginationQueryParams.cursor'
        - $ref: '#/components/parameters/PaginationQueryParams.limit'
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    $ref: '#/components/schemas/InfrastructureEvent.ListResponse'
                required:
                  - data
                type: object
          description: The request has succeeded.
        '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.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  parameters:
    PaginationQueryParams.cursor:
      in: query
      name: cursor
      schema:
        nullable: true
        type: string
    PaginationQueryParams.limit:
      in: query
      name: limit
      schema:
        format: int32
        nullable: true
        type: integer
  schemas:
    InfrastructureEvent.ListResponse:
      additionalProperties: false
      properties:
        data:
          items:
            $ref: '#/components/schemas/InfrastructureEvent.Summary'
          type: array
      required:
        - data
      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
    InfrastructureEvent.Summary:
      additionalProperties: false
      properties:
        awsAccountId:
          type: string
        data:
          $ref: '#/components/schemas/InfrastructureEventData'
        deploymentResourceId:
          description: |-
            The deployment resource this event is about, when there is one
            (task state changes, future Lambda invocation phases). Null
            for deploy-wide events (service actions, future CloudFront
            polls).
          type: string
        detailType:
          type: string
        eventId:
          description: AWS event-envelope idempotency key.
          type: string
        eventTime:
          $ref: '#/components/schemas/UtcDateTime'
        id:
          type: string
        kind:
          $ref: '#/components/schemas/Deployments.InfrastructureEventKind'
        moduleDeploymentId:
          description: |-
            The deploy this event is about, when derivable.
            ECS_SERVICE_ACTION resolves this via the serviceArn bracketed
            against active deploy windows; ECS_TASK_STATE_CHANGE inherits
            it from the task's DeploymentResource.moduleDeploymentId.
          type: string
        region:
          type: string
        source:
          type: string
      required:
        - id
        - kind
        - eventId
        - eventTime
        - source
        - detailType
        - data
      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
    InfrastructureEventData:
      description: |-
        Discriminated union over `data` payloads. Adding a new kind
        (LAMBDA_INVOCATION_PHASE, LAMBDA_EXECUTION_REPORT,
        STATIC_DISTRIBUTION_POLL) adds one enum value on `Kind` and
        one variant here.
      discriminator:
        mapping:
          EC2_ASG_INSTANCE_LIFECYCLE:
            $ref: '#/components/schemas/Deployments.AwsEc2AsgInstanceLifecycleData'
          ECS_DEPLOYMENT_STATE_CHANGE:
            $ref: '#/components/schemas/Deployments.EcsDeploymentStateChangeData'
          ECS_HOOK_STATE_CHANGE:
            $ref: '#/components/schemas/Deployments.EcsHookStateChangeData'
          ECS_SERVICE_ACTION:
            $ref: '#/components/schemas/Deployments.EcsServiceActionData'
          ECS_TASK_STATE_CHANGE:
            $ref: '#/components/schemas/Deployments.EcsTaskStateChangeData'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/Deployments.EcsTaskStateChangeData'
        - $ref: '#/components/schemas/Deployments.EcsServiceActionData'
        - $ref: '#/components/schemas/Deployments.EcsDeploymentStateChangeData'
        - $ref: '#/components/schemas/Deployments.EcsHookStateChangeData'
        - $ref: '#/components/schemas/Deployments.AwsEc2AsgInstanceLifecycleData'
      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
    Deployments.InfrastructureEventKind:
      description: |-
        Which event kind a InfrastructureEvent row carries. Drives the shape
        of its `data` JSON column.
      enum:
        - ECS_TASK_STATE_CHANGE
        - ECS_SERVICE_ACTION
        - ECS_DEPLOYMENT_STATE_CHANGE
        - ECS_HOOK_STATE_CHANGE
        - EC2_ASG_INSTANCE_LIFECYCLE
        - LAMBDA_FUNCTION_UPDATE_STATE_CHANGE
      type: string
    Deployments.AwsEc2AsgInstanceLifecycleData:
      additionalProperties: false
      description: >-
        Raw, append-only projection of an Auto Scaling instance lifecycle
        result.
      properties:
        activityId:
          type: string
        autoScalingGroupName:
          type: string
        availabilityZone:
          type: string
        destination:
          type: string
        instanceId:
          type: string
        origin:
          type: string
        rawDetail:
          additionalProperties: {}
          description: >-
            Original EventBridge detail object retained for forward
            compatibility.
          type: object
        statusCode:
          type: string
        statusMessage:
          type: string
        subnetId:
          type: string
        type:
          enum:
            - EC2_ASG_INSTANCE_LIFECYCLE
          type: string
      required:
        - type
        - autoScalingGroupName
        - rawDetail
      type: object
    Deployments.EcsDeploymentStateChangeData:
      additionalProperties: false
      description: |-
        Typed payload for InfrastructureEvent.data when kind ==
        ECS_DEPLOYMENT_STATE_CHANGE. AWS publishes one of these per
        rolling-deploy transition; the `awsDeploymentId` matches the value
        returned by `UpdateService`, so tower-go can correlate this event
        to the in-flight deploy and short-circuit its waitHealthy poll.
      properties:
        awsDeploymentId:
          description: |-
            AWS-side ECS deployment id (e.g. "ecs-svc/0436798713461887077").
            Matches the `Id` returned by `ecs:UpdateService` so tower-go can
            reject events for stale / superseded deploys.
          type: string
        clusterArn:
          type: string
        eventName:
          description: |-
            AWS detail.eventName — the transition that fired. Known values:
            SERVICE_DEPLOYMENT_IN_PROGRESS, SERVICE_DEPLOYMENT_COMPLETED,
            SERVICE_DEPLOYMENT_FAILED.
          type: string
        eventType:
          description: 'Severity tag AWS attaches: "INFO" | "WARN" | "ERROR".'
          type: string
        rawDetail:
          additionalProperties: {}
          type: object
        reason:
          description: AWS free-form reason, when present.
          type: string
        serviceArn:
          type: string
        serviceDeploymentArn:
          description: |-
            ARN of the AWS service deployment, when the event carries one
            (`ECS Service Deployment State Change` events emitted by native
            blue_green / linear / canary deployments). Used to correlate the
            event to `EcsDeploymentData.serviceDeploymentArn`.
          type: string
        type:
          enum:
            - ECS_DEPLOYMENT_STATE_CHANGE
          type: string
      required:
        - type
        - clusterArn
        - serviceArn
        - eventName
        - eventType
        - awsDeploymentId
        - rawDetail
      type: object
    Deployments.EcsHookStateChangeData:
      additionalProperties: false
      description: |-
        Typed payload for InfrastructureEvent.data when kind ==
        ECS_HOOK_STATE_CHANGE. AWS publishes one of these per lifecycle
        hook transition during a native blue_green / linear / canary
        deployment (`detail-type: "ECS Hook State Change"`). The ingester
        forwards PAUSE-hook transitions to the in-flight deploy workflow
        so it can surface PAUSED state (HOOK_AWAITING_ACTION) or resume
        its poll loop (HOOK_SUCCEEDED / HOOK_FAILED / HOOK_TIMED_OUT)
        without waiting for the next polling tick.
      properties:
        clusterArn:
          type: string
        eventName:
          description: |-
            AWS detail.eventName — the hook transition that fired. Known
            values: HOOK_AWAITING_ACTION, HOOK_SUCCEEDED, HOOK_FAILED,
            HOOK_TIMED_OUT.
          type: string
        eventType:
          description: 'Severity tag AWS attaches: "INFO" | "WARN" | "ERROR".'
          type: string
        expiresAt:
          description: When a pending pause hook auto-resolves (timeoutAction fires).
          format: date-time
          type: string
        hookId:
          description: |-
            Unique id of the hook execution. Pause hooks are continued by
            passing this to `ContinueServiceDeployment`.
          type: string
        hookType:
          description: 'Hook type: "PAUSE" | "AWS_LAMBDA".'
          type: string
        lifecycleStage:
          description: Lifecycle stage the hook ran at (AWS enum spelling).
          type: string
        rawDetail:
          additionalProperties: {}
          type: object
        serviceArn:
          type: string
        serviceDeploymentArn:
          description: ARN of the service deployment this hook belongs to.
          type: string
        type:
          enum:
            - ECS_HOOK_STATE_CHANGE
          type: string
      required:
        - type
        - clusterArn
        - serviceArn
        - eventName
        - eventType
        - hookId
        - rawDetail
      type: object
    Deployments.EcsServiceActionData:
      additionalProperties: false
      description: |-
        Typed payload for InfrastructureEvent.data when kind ==
        ECS_SERVICE_ACTION. These events are about the service / deploy,
        not a specific task — they interleave into the drawer timeline as
        deploy-wide context and are linked via the envelope's
        moduleDeploymentId.
      properties:
        clusterArn:
          type: string
        eventName:
          description: |-
            AWS detail.eventName — the action that fired. Known values:
            SERVICE_STEADY_STATE, SERVICE_DEPLOYMENT_FAILED,
            SERVICE_TASK_START_IMPAIRED, SERVICE_DEPLOYMENT_IN_PROGRESS,
            SERVICE_DEPLOYMENT_COMPLETED, …
          type: string
        message:
          description: |-
            AWS free-form reason, when present. Used as the human-readable
            description in the drawer timeline.
          type: string
        rawDetail:
          additionalProperties: {}
          type: object
        serviceArn:
          type: string
        type:
          enum:
            - ECS_SERVICE_ACTION
          type: string
      required:
        - type
        - clusterArn
        - serviceArn
        - eventName
        - rawDetail
      type: object
    Deployments.EcsTaskStateChangeData:
      additionalProperties: false
      description: |-
        Typed payload for InfrastructureEvent.data when kind ==
        ECS_TASK_STATE_CHANGE. Mirrors the EventBridge detail path so
        the drawer's raw-event view can render any field AWS emitted
        without re-parsing from the saved envelope.

        The ecstaskmerge state machine reads lastStatus + phase timestamps
        out of this shape to fold events into the DeploymentResource.data
        projection. Pull timestamps are extracted here per event; the
        instance projection aggregates them as MIN / MAX.
      properties:
        attachments:
          description: |-
            ENI / attachment snapshots. Used to extract the task's private
            IP for target-group join lookups.
          items:
            additionalProperties: {}
            type: object
          type: array
        availabilityZone:
          type: string
        capacityProviderName:
          type: string
        clusterArn:
          type: string
        connectivity:
          type: string
        containerInstanceArn:
          type: string
        containers:
          description: |-
            Per-container snapshot AWS attached to the event. Shape varies
            by transition — the drawer renders whatever's present.
          items:
            additionalProperties: {}
            type: object
          type: array
        desiredStatus:
          type: string
        exitCode:
          description: |-
            Exit code of the essential container — extracted at ingest time
            from the per-event `containers[]` payload. Surfaced here so the
            drawer's per-event view can show the exit code without
            re-walking the unstructured `containers` array.
          format: int32
          type: integer
        healthStatus:
          type: string
        lastStatus:
          type: string
        launchType:
          type: string
        platformVersion:
          type: string
        pullStartedAt:
          description: |-
            Earliest container pullStartedAt across this event's containers
            array.
          format: date-time
          type: string
        pullStoppedAt:
          description: |-
            Latest container pullStoppedAt across this event's containers
            array.
          format: date-time
          type: string
        rawDetail:
          additionalProperties: {}
          description: |-
            Raw detail payload AWS emitted, kept verbatim so future AWS
            fields surface in the drawer without a code change.
          type: object
        startedAt:
          format: date-time
          type: string
        startedBy:
          type: string
        stopCode:
          type: string
        stoppedAt:
          format: date-time
          type: string
        stoppedReason:
          type: string
        taskArn:
          type: string
        taskDefinitionArn:
          type: string
        taskDefinitionFamily:
          type: string
        taskDefinitionRevision:
          format: int32
          type: integer
        taskGroup:
          type: string
        taskTargetId:
          description: |-
            See EcsTaskData.taskTargetId — same semantics, stored per-event
            so the value is visible even before the instance projection merges.
          type: string
        type:
          enum:
            - ECS_TASK_STATE_CHANGE
          type: string
      required:
        - type
        - taskArn
        - rawDetail
      type: object
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````