[Yandex Cloud documentation](../../../index.md) > [Yandex Data Streams](../../index.md) > [Step-by-step guides](../index.md) > Working with the AWS CLI > Sending data to a stream

# Sending data to a stream in the AWS CLI

{% note info %}

You can create a trigger that will invoke a [function](../../../functions/concepts/function.md) in Cloud Functions or run a [container](../../../serverless-containers/concepts/container.md) in Serverless Containers when data is sent to a stream. Read more about [triggers for Data Streams](../../../functions/operations/trigger/data-streams-trigger-create.md).

{% endnote %}

{% list tabs group=instructions %}

- CLI {#cli}

  To send data to a [stream](../../concepts/glossary.md#stream-concepts), run this command:

  ```bash
  aws kinesis put-record \
    --endpoint <endpoint> \
    --stream-name <stream_ID> \
    --cli-binary-format <binary_format> \
    --data <message> \
    --partition-key <partition_key>
  ```

  Where:

  * `--endpoint`: Specify the `https://yds.serverless.yandexcloud.net` endpoint to send data to a stream over the AWS Kinesis Data Streams protocol.
  * `--stream-name`: Consists of the availability zone, folder ID, Yandex Managed Service for YDB database ID, and stream name.

     >For example, your stream ID will appear as `/ru-central1/aoeu1kuk2dht********/cc8029jgtuab********/aws_stream` if:
     >* `aws_stream`: Stream name.
     >* `ru-central1`: Region.
     >* `aoeu1kuk2dht********`: Folder ID.
     >* `cc8029jgtuab********`: YDB database ID.
  * `--cli-binary-format`: Binary object format.
  * `--data`: Data to transmit.
  * `--partition-key`: [Shard](../../concepts/glossary.md#shard) in the stream where the data is sent.

  Command example:

  ```bash
  aws kinesis put-record \
    --endpoint https://yds.serverless.yandexcloud.net \
    --stream-name /ru-central1/aoeu1kuk2dht********/cc8029jgtuab********/aws_stream \
    --cli-binary-format raw-in-base64-out \
    --data '{"user_id":"user1", "score": 100}' \
    --partition-key 1
  ```

  Result example:

  ```json
  {
    "ShardId": "shard-000001",
    "SequenceNumber": "5851",
    "EncryptionType": "NONE"
  }
  ```

{% endlist %}