Learn how to:
- Create and configure sinks for data storage
- View sink configuration
- Update sink credentials
- Delete sinks when no longer needed
Sinks are made available to pipelines as SQL tables using the sink name (for example, INSERT INTO my_sink SELECT * FROM my_stream).
-
In the Cloudflare dashboard, go to the Basin Pipelines page.
Go to Pipelines ↗ -
Select Create Pipeline to launch the pipeline creation wizard.
-
Complete the wizard to create your sink along with the associated stream and pipeline.
To create a sink, run the basin pipelines sinks create command:
npx wrangler basin pipelines sinks create <SINK_NAME> --type r2 --bucket my-bucketyarn wrangler basin pipelines sinks create <SINK_NAME> --type r2 --bucket my-bucketpnpm wrangler basin pipelines sinks create <SINK_NAME> --type r2 --bucket my-bucketFor 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 setupyarn wrangler basin pipelines setuppnpm wrangler basin pipelines setup-
In the Cloudflare dashboard, go to Basin Pipelines > Sinks.
-
Select a sink to view its configuration.
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>yarn wrangler basin pipelines sinks get <SINK_NAME_OR_ID>pnpm 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 listyarn wrangler basin pipelines sinks listpnpm wrangler basin pipelines sinks listReplace a sink's credentials when its token expires or is revoked. Pipelines that use the sink keep its earlier credentials until you update them.
-
In the Cloudflare dashboard, go to Basin Pipelines > Sinks.
Go to Sinks ↗ -
Select the sink.
-
In Destination, select Update credentials.
-
Select Create a new API token, or select Enter credentials and enter the credentials of a token you created.
-
Select Update credentials.
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>"
}
}
}'-
In the Cloudflare dashboard, go to Basin Pipelines > Sinks.
-
Select the sink you want to delete.
-
On the sink's page, select Delete.
To delete a sink, run the basin pipelines sinks delete command:
npx wrangler basin pipelines sinks delete <SINK_ID>yarn wrangler basin pipelines sinks delete <SINK_ID>pnpm wrangler basin pipelines sinks delete <SINK_ID>- 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.