LocalStack Aws API

The Aws API from LocalStack — 11 operation(s) for aws.

OpenAPI Specification

localstack-aws-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: info@localstack.cloud
    name: LocalStack Support
    url: https://www.localstack.cloud/contact
  summary: The LocalStack REST API exposes functionality related to diagnostics, health checks, plugins, initialisation hooks, service introspection, and more.
  termsOfService: https://www.localstack.cloud/legal/tos
  title: LocalStack REST API for Community Aws API
  version: latest
servers:
- url: http://{host}:{port}
  variables:
    port:
      default: '4566'
    host:
      default: localhost.localstack.cloud
tags:
- name: Aws
paths:
  /_aws/sqs/messages:
    post:
      summary: Retrieves one or more messages from the specified queue.
      description: 'This API receives messages from an SQS queue.

        https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_ResponseSyntax

        '
      operationId: receive_message
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReceiveMessageRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/ReceiveMessageRequest'
      responses:
        '200':
          content:
            text/xml: {}
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiveMessageResult'
          description: SQS queue messages
        '400':
          content:
            text/xml: {}
            application/json: {}
          description: Bad request
        '404':
          content:
            text/xml: {}
            application/json: {}
          description: Not found
      tags:
      - Aws
    get:
      description: List SQS queue messages without side effects
      operationId: list_all_sqs_messages
      tags:
      - Aws
      parameters:
      - description: SQS queue URL
        in: query
        name: QueueUrl
        required: false
        schema:
          type: string
      responses:
        '200':
          content:
            text/xml:
              schema:
                $ref: '#/components/schemas/ReceiveMessageResult'
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiveMessageResult'
          description: SQS queue messages
        '400':
          content:
            text/xml: {}
            application/json: {}
          description: Bad request
        '404':
          content:
            text/xml: {}
            application/json: {}
          description: Not found
  /_aws/cloudwatch/metrics/raw:
    get:
      description: Retrieve CloudWatch metrics
      operationId: get_cloudwatch_metrics
      tags:
      - Aws
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudWatchMetrics'
          description: CloudWatch metrics
  /_aws/dynamodb/expired:
    delete:
      description: Delete expired items from TTL-enabled DynamoDB tables
      operationId: delete_ddb_expired_items
      tags:
      - Aws
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  ExpiredItems:
                    description: Number of expired items that were deleted
                    type: integer
                required:
                - ExpiredItems
                type: object
          description: Operation was successful
  /_aws/events/rules/{rule_arn}/trigger:
    get:
      description: Trigger a scheduled EventBridge rule
      operationId: trigger_event_bridge_rule
      tags:
      - Aws
      parameters:
      - description: EventBridge rule ARN
        in: path
        name: rule_arn
        required: true
        schema:
          type: string
      responses:
        '200':
          description: EventBridge rule was triggered
        '404':
          description: Not found
  /_aws/lambda/init:
    get:
      description: Retrieve Lambda runtime init binary
      operationId: get_lambda_init
      tags:
      - Aws
      responses:
        '200':
          content:
            application/octet-stream: {}
          description: Lambda runtime init binary
  /_aws/lambda/runtimes:
    get:
      description: List available Lambda runtimes
      operationId: get_lambda_runtimes
      tags:
      - Aws
      parameters:
      - in: query
        name: filter
        required: false
        schema:
          default: supported
          enum:
          - all
          - deprecated
          - supported
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  Runtimes:
                    items:
                      type: string
                    type: array
                required:
                - Runtimes
                type: object
          description: Available Lambda runtimes
  /_aws/ses:
    delete:
      description: Discard sent SES messages
      operationId: discard_ses_messages
      tags:
      - Aws
      parameters:
      - $ref: '#/components/parameters/SesIdFilter'
      responses:
        '204':
          description: Message was successfully discarded
    get:
      description: Retrieve sent SES messages
      operationId: get_ses_messages
      tags:
      - Aws
      parameters:
      - $ref: '#/components/parameters/SesIdFilter'
      - $ref: '#/components/parameters/SesEmailFilter'
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  messages:
                    items:
                      $ref: '#/components/schemas/SesSentEmail'
                    type: array
                required:
                - messages
                type: object
          description: List of sent messages
  /_aws/sns/platform-endpoint-messages:
    delete:
      description: Discard the messages published to a platform endpoint via SNS
      operationId: discard_sns_endpoint_messages
      tags:
      - Aws
      parameters:
      - $ref: '#/components/parameters/SnsAccountId'
      - $ref: '#/components/parameters/SnsRegion'
      - $ref: '#/components/parameters/SnsEndpointArn'
      responses:
        '204':
          description: Platform endpoint message was discarded
    get:
      description: Retrieve the messages sent to a platform endpoint via SNS
      operationId: get_sns_endpoint_messages
      tags:
      - Aws
      parameters:
      - $ref: '#/components/parameters/SnsAccountId'
      - $ref: '#/components/parameters/SnsRegion'
      - $ref: '#/components/parameters/SnsEndpointArn'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SNSPlatformEndpointResponse'
          description: SNS messages via retrospective access
  /_aws/sns/sms-messages:
    delete:
      description: Discard SNS SMS messages
      operationId: discard_sns_sms_messages
      tags:
      - Aws
      parameters:
      - $ref: '#/components/parameters/SnsAccountId'
      - $ref: '#/components/parameters/SnsRegion'
      - $ref: '#/components/parameters/SnsPhoneNumber'
      responses:
        '204':
          description: SMS message was discarded
    get:
      description: Retrieve SNS SMS messages
      operationId: get_sns_sms_messages
      tags:
      - Aws
      parameters:
      - $ref: '#/components/parameters/SnsAccountId'
      - $ref: '#/components/parameters/SnsRegion'
      - $ref: '#/components/parameters/SnsPhoneNumber'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SNSSMSMessagesResponse'
          description: SNS messages via retrospective access
  /_aws/sns/subscription-tokens/{subscription_arn}:
    get:
      description: Retrieve SNS subscription token for confirmation
      operationId: get_sns_subscription_token
      tags:
      - Aws
      parameters:
      - description: '`subscriptionArn` resource of subscription token'
        in: path
        name: subscription_arn
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  subscription_arn:
                    type: string
                  subscription_token:
                    type: string
                required:
                - subscription_token
                - subscription_arn
                type: object
          description: Subscription token
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnsSubscriptionTokenError'
          description: Bad request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnsSubscriptionTokenError'
          description: Not found
  /_aws/sqs/messages/{region}/{account_id}/{queue_name}:
    get:
      description: List SQS messages without side effects
      operationId: list_sqs_messages
      tags:
      - Aws
      parameters:
      - description: SQS queue region
        in: path
        name: region
        required: true
        schema:
          type: string
      - description: SQS queue account ID
        in: path
        name: account_id
        required: true
        schema:
          type: string
      - description: SQS queue name
        in: path
        name: queue_name
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            text/xml: {}
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiveMessageResult'
          description: SQS queue messages
        '400':
          content:
            text/xml: {}
            application/json: {}
          description: Bad request
        '404':
          content:
            text/xml: {}
            application/json: {}
          description: Not found
components:
  schemas:
    SMSMessages:
      type: object
      description: 'SMS messages retrieved via the retrospective endpoint.

        The phone number is the key with a list of messages as value.

        '
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/SNSMessage'
    SNSPlatformEndpointMessages:
      type: object
      description: 'Messages sent to the platform endpoint retrieved via the retrospective endpoint.

        The endpoint ARN is the key with a list of messages as value.

        '
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/SNSPlatformEndpointMessage'
    CloudWatchMetrics:
      additionalProperties: false
      properties:
        metrics:
          items:
            additionalProperties: false
            properties:
              account:
                description: Account ID
                type: string
              d:
                description: Dimensions
                items:
                  additionalProperties: false
                  properties:
                    n:
                      description: Dimension name
                      type: string
                    v:
                      description: Dimension value
                      oneOf:
                      - type: string
                      - type: integer
                  required:
                  - n
                  - v
                  type: object
                type: array
              n:
                description: Metric name
                type: string
              ns:
                description: Namespace
                type: string
              region:
                description: Region name
                type: string
              t:
                description: Timestamp
                oneOf:
                - type: string
                  format: date-time
                - type: number
              v:
                description: Metric value
                oneOf:
                - type: string
                - type: integer
            required:
            - ns
            - n
            - v
            - t
            - d
            - account
            - region
            type: object
          type: array
      required:
      - metrics
      type: object
    SesSentEmail:
      additionalProperties: false
      properties:
        Body:
          additionalProperties: false
          properties:
            html_part:
              type: string
            text_part:
              type: string
          required:
          - text_part
          type: object
        Destination:
          $ref: '#/components/schemas/SESDestination'
        Id:
          type: string
        RawData:
          type: string
        Region:
          type: string
        Source:
          type: string
        Subject:
          type: string
        Template:
          type: string
        TemplateData:
          type: string
        Timestamp:
          type: string
      required:
      - Id
      - Region
      - Timestamp
      - Source
      type: object
    Message:
      type: object
      properties:
        MessageId:
          type:
          - string
          - 'null'
        ReceiptHandle:
          type:
          - string
          - 'null'
        MD5OfBody:
          type:
          - string
          - 'null'
        Body:
          type:
          - string
          - 'null'
        Attributes:
          type: object
        MessageAttributes:
          type: object
    SNSSMSMessagesResponse:
      type: object
      additionalProperties: false
      description: Response payload for the /_aws/sns/sms-messages endpoint
      properties:
        region:
          type: string
          description: The AWS region, e.g., us-east-1
        sms_messages:
          $ref: '#/components/schemas/SMSMessages'
      required:
      - region
      - sms_messages
    SnsSubscriptionTokenError:
      additionalProperties: false
      properties:
        error:
          type: string
        subscription_arn:
          type: string
      required:
      - error
      - subscription_arn
      type: object
    ReceiveMessageRequest:
      type: object
      description: https://github.com/boto/botocore/blob/develop/botocore/data/sqs/2012-11-05/service-2.json
      required:
      - QueueUrl
      properties:
        QueueUrl:
          type: string
          format: uri
        AttributeNames:
          type: array
          items:
            type: string
        MessageSystemAttributeNames:
          type: array
          items:
            type: string
        MessageAttributeNames:
          type: array
          items:
            type: string
        MaxNumberOfMessages:
          type: integer
        VisibilityTimeout:
          type: integer
        WaitTimeSeconds:
          type: integer
        ReceiveRequestAttemptId:
          type: string
    SESDestination:
      type: object
      description: Possible destination of a SES message
      properties:
        ToAddresses:
          type: array
          items:
            type: string
            format: email
        CcAddresses:
          type: array
          items:
            type: string
            format: email
        BccAddresses:
          type: array
          items:
            type: string
            format: email
      additionalProperties: false
    SNSMessage:
      type: object
      description: Message sent via SNS
      properties:
        PhoneNumber:
          type: string
        TopicArn:
          type:
          - string
          - 'null'
        SubscriptionArn:
          type:
          - string
          - 'null'
        MessageId:
          type: string
        Message:
          type: string
        MessageAttributes:
          type: object
        MessageStructure:
          type:
          - string
          - 'null'
        Subject:
          type:
          - string
          - 'null'
    ReceiveMessageResult:
      type: object
      description: https://github.com/boto/botocore/blob/develop/botocore/data/sqs/2012-11-05/service-2.json
      properties:
        Messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
    SNSPlatformEndpointMessage:
      type: object
      description: Message sent to a platform endpoint via SNS
      additionalProperties: false
      properties:
        TargetArn:
          type: string
        TopicArn:
          type: string
        Message:
          type: string
        MessageAttributes:
          type: object
        MessageStructure:
          type: string
        Subject:
          type:
          - string
          - 'null'
        MessageId:
          type: string
    SNSPlatformEndpointResponse:
      type: object
      additionalProperties: false
      description: Response payload for the /_aws/sns/platform-endpoint-messages endpoint
      properties:
        region:
          type: string
          description: The AWS region, e.g., us-east-1
        platform_endpoint_messages:
          $ref: '#/components/schemas/SNSPlatformEndpointMessages'
      required:
      - region
      - platform_endpoint_messages
  parameters:
    SesEmailFilter:
      description: Filter for the `source` field in SES message
      in: query
      name: email
      required: false
      schema:
        type: string
    SnsRegion:
      description: '`region` field of the resource'
      in: query
      name: region
      required: false
      schema:
        default: us-east-1
        type: string
    SnsAccountId:
      description: '`accountId` field of the resource'
      in: query
      name: accountId
      required: false
      schema:
        default: '000000000000'
        type: string
    SnsEndpointArn:
      description: '`endpointArn` field of the resource'
      in: query
      name: endpointArn
      required: false
      schema:
        type: string
    SnsPhoneNumber:
      description: '`phoneNumber` field of the resource'
      in: query
      name: phoneNumber
      required: false
      schema:
        type: string
    SesIdFilter:
      description: Filter for the `id` field in SES message
      in: query
      name: id
      required: false
      schema:
        type: string
externalDocs:
  description: LocalStack Documentation
  url: https://docs.localstack.cloud