Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Data Streams
  • Access management
  • Pricing policy
    • Overview
    • Authenticating and connecting to а database
  • FAQ

In this article:

  • Endpoint
  • Prerequisites
  • Authentication
  • Queue creation example
  • Example of writing and reading a message
  1. Amazon SQS-compatible HTTP API
  2. Authenticating and connecting to а database

Authenticating and connecting to a database via the Amazon SQS-compatible HTTP API

Written by
Yandex Cloud
Updated at October 2, 2026
View in Markdown
  • Endpoint
  • Prerequisites
  • Authentication
  • Queue creation example
  • Example of writing and reading a message

EndpointEndpoint

The connection endpoint is displayed in the management console on your database page. This endpoint is identical for both Amazon Kinesis Data Streams and Amazon Simple Queue Service (SQS) protocols.

PrerequisitesPrerequisites

To authenticate, take these steps:

  1. Create a service account.
  2. Assign the following roles to the service account:
    • To read from a data stream: ydb.viewer.
    • To write to a data stream: ydb.editor.
    • To create or delete a queue: ydb.editor.
  3. Create a static access key for the service account. Save the ID and secret key to a secure location.

AuthenticationAuthentication

Just like Amazon SQS, the Amazon SQS-compatible HTTP API uses Signature Version 4 to authenticate requests.

The following parameters are required:

  • <access_key_id>: Static access key ID.
  • <secret_access_key>: Secret part of the static access key.

Configure the AWS CLI:

  1. Launch the interactive profile setup:

    aws configure
    
  2. Specify the service account key ID you obtained earlier:

    AWS Access Key ID [****************ver_]: <service_account_key_ID>
    
  3. Specify the service account secret key you obtained earlier:

    AWS Secret Access Key [****************w5lb]: <service_account_secret_key>
    
  4. Specify the ru-central1 default region name:

    Default region name [ru-central1]: ru-central1
    
  5. Specify json as the default format for output data:

    Default output format [None]: json
    
  6. To view the current profile settings, run this command:

    aws configure list
    

    Result:

          Name                    Value             Type    Location
          ----                    -----             ----    --------
       profile                <not set>             None    None
    access_key     ****************aBc1 shared-credentials-file
    secret_key     ****************DeF2 shared-credentials-file
        region              ru-central1      config-file    ~/.aws/config
    

Queue creation exampleQueue creation example

This example uses the following parameters:

  • <sqs_api_endpoint>: Endpoint.
  • <stream_name>: Data stream name.
  1. Install the AWS CLI if you have not done that already.

  2. Create a queue:

    aws --endpoint "<sqs_api_endpoint>" sqs create-queue \
      --queue-name "<stream_name>"
    

    This command creates a data stream with the specified name and a shared consumer named ydb-sqs-consumer.

    To create a FIFO queue, specify FifoQueue=true. We recommend appending .fifo to the queue name:

    aws --endpoint "<sqs_api_endpoint>" sqs create-queue \
      --queue-name "<stream_name>.fifo" \
      --attributes FifoQueue=true
    

Example of writing and reading a messageExample of writing and reading a message

This example uses the following parameters:

  • <sqs_api_endpoint>: Endpoint.
  • <stream_name>: Data stream name.
  1. Install the AWS CLI if you have not done that already.

  2. Get the stream QueueUrl:

    QUEUE_URL="$(aws --endpoint "<sqs_api_endpoint>" sqs get-queue-url \
      --queue-name "<stream_name>" \
      --query 'QueueUrl' --output text)"
    
  3. Send a message to the stream:

    aws --endpoint "<sqs_api_endpoint>" sqs send-message \
      --queue-url "$QUEUE_URL" \
      --message-body "test message"
    
  4. Read a message from the stream:

    aws --endpoint "<sqs_api_endpoint>" sqs receive-message \
      --queue-url "$QUEUE_URL" \
      --wait-time-seconds 20 \
      --max-number-of-messages 1
    

For details on working with Data Streams via an Amazon SQS-compatible HTTP API and more examples, refer to the YDB guides.

Was the article helpful?

Previous
Overview
Next
FAQ
© 2026 Direct Cursus Technology L.L.C.