Skip to content

Manage sinks

Learn how to:

  • Create and configure sinks for data storage
  • View sink configuration
  • Update sink credentials
  • Delete sinks when no longer needed

Create a sink

Sinks are made available to pipelines as SQL tables using the sink name (for example, INSERT INTO my_sink SELECT * FROM my_stream).

Dashboard

  1. In the Cloudflare dashboard, go to the Basin Pipelines page.

    Go to Pipelines ↗
  2. Select Create Pipeline to launch the pipeline creation wizard.

  3. Complete the wizard to create your sink along with the associated stream and pipeline.

Wrangler CLI

To create a sink, run the basin pipelines sinks create command:

npx wrangler basin pipelines sinks create <SINK_NAME> --type r2 --bucket my-bucket

For sink-specific configuration options, refer to Available sinks.

Alternatively, to use the interactive setup wizard that helps you configure a stream, sink, and pipeline, run the basin pipelines setup command:

npx wrangler basin pipelines setup

View sink configuration

Dashboard

  1. In the Cloudflare dashboard, go to Basin Pipelines > Sinks.

  2. Select a sink to view its configuration.

Wrangler CLI

To view a specific sink, run the basin pipelines sinks get command with either the sink ID or sink name:

npx wrangler basin pipelines sinks get <SINK_NAME_OR_ID>

To list all sinks in your account, run the basin pipelines sinks list command:

npx wrangler basin pipelines sinks list

Update sink credentials

Replace a sink's credentials when its token expires or is revoked. Pipelines that use the sink keep its earlier credentials until you update them.

Dashboard

  1. In the Cloudflare dashboard, go to Basin Pipelines > Sinks.

    Go to Sinks ↗
  2. Select the sink.

  3. In Destination, select Update credentials.

  4. Select Create a new API token, or select Enter credentials and enter the credentials of a token you created.

  5. Select Update credentials.

API

The API token for this request must have Basin Pipelines Edit permission.

For a Basin Catalog sink, send token instead of credentials.

curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pipelines/v1/sinks/$SINK_ID" \
  --request PATCH \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --json '{
    "config": {
      "credentials": {
        "access_key_id": "<ACCESS_KEY_ID>",
        "secret_access_key": "<SECRET_ACCESS_KEY>"
      }
    }
  }'

Delete a sink

Dashboard

  1. In the Cloudflare dashboard, go to Basin Pipelines > Sinks.

  2. Select the sink you want to delete.

  3. On the sink's page, select Delete.

Wrangler CLI

To delete a sink, run the basin pipelines sinks delete command:

npx wrangler basin pipelines sinks delete <SINK_ID>

Limitations

  • Only a sink's credentials and, with the API, its rolling policy can be changed after creation. To change anything else, you must delete and recreate the sink.
  • The Basin Catalog Sink does not currently support writing to R2 buckets into a different jurisdiction.

Was this helpful?