Test a cloud connection
The saved connection, or, with a body, the connection as it would be after PATCH /v1/cloud-connections/{id} with that body (nothing is saved: the stored keys are used unless both are sent). Checks, step by step, what the keys can do: reach the endpoint (public https only, private addresses refused before any request), find the bucket in its region, sign with the keys, write a small file under the prefix, then delete it. Requests go out exactly like deliveries, through the egress proxy when there is one. A key that may write but not delete passes, with a warning and the file's key. The answer is 200 either way: ok says whether deliveries can upload. Up to 10 tests a minute and 60 an hour per workspace, both test routes together.
ApiKeyAuthX-Api-Key<token>id*stringThe cloud connection's id
1 <= lengthapplication/json- body
name?stringYour name for the connection, up to 80 characters
1 <= length <= 80endpoint?|https origin of an S3-compatible store (R2, MinIO, SeaweedFS…); null or absent for AWS S3
length <= 300region?stringThe bucket's region, such as us-east-1, or auto for Cloudflare R2
^[a-z0-9-]{2,40}$bucket?stringThe bucket's name: 3 to 63 lowercase letters, digits, dots and hyphens (S3's rules)
prefix?stringFolder for every file, such as exports/
length <= 200path_style?booleanPath-style URLs (endpoint/bucket/key); default true with an endpoint
access_key_id?stringThe access key id of a key that may write to the bucket; stored encrypted, only shown shortened (access_key_hint)
1 <= length <= 128secret_access_key?stringIts secret access key; stored encrypted and never returned
1 <= length <= 256The report
application/json- response
ok*booleanEvery required step passed: deliveries can upload
steps*array<>test_key*|The test file's key, once it was written
leftover_key*|Set when the test file could not be deleted: remove it yourself
egress*Where your bucket sees the requests come from
policy*stringA minimal IAM policy for the key, as a JSON document to copy: s3:PutObject (and s3:AbortMultipartUpload once deliveries use multipart uploads) under the prefix, s3:DeleteObject for the test file only (optional), from the egress IPs when known
curl -X POST 'https://dataflow.piloterr.com/v1/cloud-connections/string/test' \
-H 'Content-Type: application/json' \
-d '{
"prefix": "exports/"
}'{
"ok": true,
"steps": [
{
"id": "reachable",
"status": "ok",
"required": true,
"code": null,
"message": null
},
{
"id": "bucket",
"status": "ok",
"required": true,
"code": null,
"message": null
},
{
"id": "credentials",
"status": "ok",
"required": true,
"code": null,
"message": null
},
{
"id": "write",
"status": "ok",
"required": true,
"code": null,
"message": null
},
{
"id": "multipart",
"status": "skipped",
"required": false,
"code": "not_used",
"message": "Not needed: deliveries upload each file in a single request"
},
{
"id": "delete",
"status": "ok",
"required": false,
"code": null,
"message": "The test file was removed"
}
],
"test_key": "exports/.piloterr-dataflow-test-1794225600000.txt",
"leftover_key": null,
"egress": {
"enabled": true,
"exit_ips": [
"203.0.113.7"
]
},
"policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"PiloterrDataflowDeliveries\",\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:PutObject\",\n \"s3:DeleteObject\"\n ],\n \"Resource\": \"arn:aws:s3:::acme-dataflow/exports/*\",\n \"Condition\": {\n \"IpAddress\": {\n \"aws:SourceIp\": [\n \"203.0.113.7/32\"\n ]\n }\n }\n }\n ]\n}"
}