[Yandex Cloud documentation](../index.md) > [Yandex Message Queue](index.md) > Getting started > Quick start

# Getting started with Message Queue

Let's perform the basic actions using the [AWS CLI](https://aws.amazon.com/cli/), one of the [tools](instruments/index.md) you can use to work with Message Queue.

1. [Install](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) the AWS CLI, a command line utility for working with Message Queue.
1. [Create](../iam/operations/sa/create.md) a service account with the `editor` role.
1. [Create](../iam/operations/authentication/manage-access-keys.md#create-access-key) static access keys. Save the ID and secret key to a secure location. You will not be able to view the secret key parameters again after you close the window.
1. Configure the AWS CLI:

   1. Launch the interactive profile setup:
   
      ```bash
      aws configure
      ```
   
   1. Specify the service account key ID you obtained earlier:
   
      ```bash
      AWS Access Key ID [****************ver_]: <service_account_key_ID>
      ```
   
   1. Specify the service account secret key you obtained earlier:
   
      ```bash
      AWS Secret Access Key [****************w5lb]: <service_account_secret_key>
      ```
   
   1. Specify the `ru-central1` default region name:
   
      ```bash
      Default region name [ru-central1]: ru-central1
      ```
   
   1. Specify `json` as the default format for output data:
   
      ```bash
      Default output format [None]: json
      ```
   
   1. To view the current profile settings, run this command:
   
      ```bash
      aws configure list
      ```
   
      Result:
   
      ```text
            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
      ```

1. Create a queue named `sample-queue`:

   {% list tabs group=instructions %}

   - AWS CLI {#cli}

     ```bash
     aws sqs create-queue \
       --queue-name <queue_name> \
       --endpoint <endpoint>
     ```

     Where:

     * `--queue-name`: Name of the new queue, e.g., `sample-queue`.
     * `--endpoint`: Endpoint in the `https://message-queue.api.cloud.yandex.net/` value.

     Result:

     ```json
     {
         "QueueUrl": "https://message-queue.api.cloud.yandex.net/aoeaql9r10cd********/000000000000********/sample-queue"
     }
     ```

     Save the obtained queue URL. You will need it at the next steps.

   - Management console

     1. In the [management console](https://console.yandex.cloud), select the folder to create the queue in.
     1. Navigate to **Message Queue**.
     1. Click **Create queue**.
     1. Enter a name for the queue: `sample-queue`.

        The name may contain lowercase Latin letters, numbers, hyphens, and underscores. The FIFO queue name must end with the `.fifo` suffix. The name may not be longer than 80 characters.

     1. Select the `Standard` type. Do not change other settings.
     1. Click **Create**.
     1. Open the queue you created.
     1. In the **Overview** tab, under **General information**, copy the queue URL as you will need it later.


   {% endlist %}

1. Send a message to the created queue using the saved queue URL:

   {% list tabs group=instructions %}

   - AWS CLI {#cli}

     ```bash
     aws sqs send-message \
       --message-body "<message_text>" \
       --endpoint <endpoint> \
       --queue-url <queue_URL>
     ```

     Where:

     * `--message-body`: Text of the message you want to send to the queue, e.g., `Hello World`.
     * `--endpoint`: Endpoint in the `https://message-queue.api.cloud.yandex.net/` value.
     * `--queue-url`: URL of the queue the message will be sent to.

     Result:

     ```json
     {
         "MD5OfMessageBody": "67e63db14341b5a696596634********",
         "MessageId": "765ff4d2-fa4bc83-6cfcc***-*****"
     }
     ```

   {% endlist %}

1. Accept the message from the queue:

   {% list tabs group=instructions %}

   - AWS CLI {#cli}

     ```bash
     aws sqs receive-message \
       --endpoint <endpoint> \
       --queue-url <queue_URL>
     ```

     Where:

     * `--endpoint`: Endpoint in the `https://message-queue.api.cloud.yandex.net/` value.
     * `--queue-url`: URL of the queue to receive the message from.

     Result:

     ```json
     {
         "Messages": [
             {
                 "MessageId": "948de7-9ec8d787-c*******-*",
                 "ReceiptHandle": "EAEggbj********",
                 "MD5OfBody": "ed076287532e86365e841e92********",
                 "Body": "Hello World",
                 "Attributes": {
                     "ApproximateFirstReceiveTimestamp": "15459********",
                     "ApproximateReceiveCount": "1",
                     "SentTimestamp": "15459********",
                     "SenderId": "abcdefkbh72is78********"
                 }
             }
         ]
     }
     ```

     Save the `ReceiptHandle` parameter value. You will need it at the next steps.

   {% endlist %}

1. Delete the message from the queue.

   After messages are processed, they should be deleted from the queue for applications not to process them again.

   To delete a message received from the queue, use the `ReceiptHandle` parameter value you saved earlier:

   {% list tabs group=instructions %}

   - AWS CLI {#cli}

     ```bash
     aws sqs delete-message \
       --endpoint <endpoint> \
       --queue-url <queue_URL>
       --receipt-handle <receipt_ID>
     ```
     Where:

     * `--endpoint`: Endpoint in the `https://message-queue.api.cloud.yandex.net/` value.
     * `--queue-url`: URL of the queue to delete the message from.
     * `--receipt-handle`: Previously saved message receipt ID (`ReceiptHandle`).

   {% endlist %}

1. Delete the queue:

   {% list tabs group=instructions %}

   - AWS CLI {#cli}

     ```bash
     aws sqs delete-queue \
       --endpoint <endpoint> \
       --queue-url <queue_URL>
     ```

     Where:

     * `--endpoint`: Endpoint in the `https://message-queue.api.cloud.yandex.net/` value.
     * `--queue-url`: URL of the queue you need to delete.

   - Management console

     1. In the [management console](https://console.yandex.cloud), select the folder the queue belongs to.
     1. Navigate to **Message Queue**.
     1. Click ![image](../_assets/console-icons/ellipsis.svg) next to the appropriate queue and select **Delete**.
     1. In the window that opens, click **Delete**.

   {% endlist %}