Skip to content

Attach a resource to an application environment

POST
/api/v3/organizations/{organisation}/resources/{resource}/attachments
curl --request POST \
--url https://dashboard.quantcdn.io/api/v3/organizations/test-org/resources/res-abc123/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "application": "test-app", "environment": "production", "envVarPrefix": "MEDIA" }'

Object storage credentials are written immediately and take effect on the environment’s next deploy. Cache variables are rendered at the next deploy, so a cache may be attached while it is still provisioning. An environment accepts one attachment per resource type.

organisation
required
string

The organisation ID

Example
test-org
resource
required
string

The resource ID

Example
res-abc123
Media typeapplication/json
object
application
required
string
Example
test-app
environment
required
string
Example
production
envVarPrefix

Namespaces every injected variable, so MEDIA yields MEDIA_S3_BUCKET

string
Example
MEDIA

The attachment

Media typeapplication/json
Resource attachment
object
appName
string
envName
string
envVarPrefix

Namespaces every injected variable, so MEDIA yields MEDIA_S3_BUCKET

string
accessKeyId

Object storage only. The secret half is written to the environment’s secrets and never returned.

string
injectedKeys

The exact variable names this attachment wrote, removed precisely on detach

Array<string>
createdAt
string format: date-time
note

When the credentials take effect

string
Example
{
"appName": "test-app",
"envName": "production",
"envVarPrefix": "MEDIA"
}

An attachment of this type already exists for the environment