Account_blob_settings

The AccountBlobSettings resource

API resource describing the external blob storage setting, where Scalr will store this account blobs: e.g. source code, terraform state, and logs.

Key path

Description

type* (string)

Available values: account-blob-settings

id (string)

attributes.google-credentials* (object)

Service Account JSON key. Required IAM roles: Storage Admin assigned on a google-storage-bucket bucket. See: use IAM with bucket.

attributes.google-encryption-key (string)

Optional customer supplied encryption key. Must be exactly 32 bytes, encoded into base64:

$ openssl rand 32 | base64
NfsPPHBVNlU8ZLBU9BeBIoL29rqtduyQAEw3vxf6kaY=

attributes.google-project (string)

Google Cloud project ID.

attributes.google-storage-bucket* (string)

Google Storage bucket name. Bucket must already exist.

links (object)

Delete Blob Settings

DELETE /api/iacp/v3/accounts/{account}/blob-settings

Delete account blob settings.

The DELETE operation (same as PUT) is only allowed if the account has no blobs (e.g. states, configurations, logs) stored in Scalr.

Parameters
  • account (string) – The ID of the account.

Status Codes

Get Blob Settings

GET /api/iacp/v3/accounts/{account}/blob-settings

Show details of account blob storage settings.

Parameters
  • account (string) – The ID of the account.

Example Request:

GET /api/iacp/v3/accounts/{account}/blob-settings HTTP/1.1
Host: my.scalr.io
Prefer: profile=preview
Status Codes
  • 200 OK – Success.

  • 404 Not Found – Account not found or user unauthorized to perform action.

  • 4XX – Client error.

  • 5XX – Server error.

Update Blob Settings

PATCH /api/iacp/v3/accounts/{account}/blob-settings

Update account blob settings credentials.

It’s also possible to override the project, bucket, and encryption key if the Scalr account is empty.

Once the account has at least one blob (e.g. state, configuration, log) stored in Scalr, the project, bucket and encryption key attributes become immutable and API will return 409 on any attempt to modify them.

Parameters
  • account (string) – The ID of the account.

Request body:

Key path

Description

data.type* (string)

Available values: account-blob-settings

data.id (string)

data.attributes.google-credentials* (object)

Service Account JSON key. Required IAM roles: Storage Admin assigned on a google-storage-bucket bucket. See: use IAM with bucket.

data.attributes.google-encryption-key (string)

Optional customer supplied encryption key. Must be exactly 32 bytes, encoded into base64:

$ openssl rand 32 | base64
NfsPPHBVNlU8ZLBU9BeBIoL29rqtduyQAEw3vxf6kaY=

data.attributes.google-project (string)

Google Cloud project ID.

data.attributes.google-storage-bucket* (string)

Google Storage bucket name. Bucket must already exist.

data.links (object)

Example Request:

PATCH /api/iacp/v3/accounts/{account}/blob-settings HTTP/1.1
Host: my.scalr.io
Content-Type: application/vnd.api+json
Prefer: profile=preview

{
    "data": {
        "attributes": {
            "google-credentials": {},
            "google-encryption-key": "********",
            "google-project": "string",
            "google-storage-bucket": "string"
        },
        "id": "string",
        "links": {},
        "type": "account-blob-settings"
    }
}
Status Codes

Replace Blob Settings

PUT /api/iacp/v3/accounts/{account}/blob-settings

Create or Replace account blob storage settings.

The PUT operation (same as DELETE) is allowed only when the account has no blobs (e.g. states, configurations, logs) stored in Scalr yet.

Parameters
  • account (string) – The ID of the account.

Request body:

Key path

Description

data.type* (string)

Available values: account-blob-settings

data.id (string)

data.attributes.google-credentials* (object)

Service Account JSON key. Required IAM roles: Storage Admin assigned on a google-storage-bucket bucket. See: use IAM with bucket.

data.attributes.google-encryption-key (string)

Optional customer supplied encryption key. Must be exactly 32 bytes, encoded into base64:

$ openssl rand 32 | base64
NfsPPHBVNlU8ZLBU9BeBIoL29rqtduyQAEw3vxf6kaY=

data.attributes.google-project (string)

Google Cloud project ID.

data.attributes.google-storage-bucket* (string)

Google Storage bucket name. Bucket must already exist.

data.links (object)

Example Request:

PUT /api/iacp/v3/accounts/{account}/blob-settings HTTP/1.1
Host: my.scalr.io
Content-Type: application/vnd.api+json
Prefer: profile=preview

{
  "data": {
    "attributes": {
      "google-storage-bucket": "scalr-blobs_acc-u4j0dubllrl6a0o",
      "google-credentials": {
        "type": "service_account",
        "project_id": "your-project-id",
        "private_key_id": "a785f43a696cee220c9821e9f192c785e4c86740",
        "private_key": "-----BEGIN PRIVATE KEY-----\n....",
        "client_email": "[email protected]",
        "...": "..."
      }
    },
    "id": "acc-u4j0dubllrl6a0o",
    "links": {
      "self": "https://my.scalr.io/api/iacp/v3/accounts/acc-u4j0dubllrl6a0o/blob-settings"
    },
    "type": "account-blob-settings"
  },
  "included": null,
  "meta": null
}
Status Codes
  • 200 OK

    Success.

    Example Respone:

    HTTP/1.1 200 OK
    Content-Type: application/vnd.api+json
    Preference-Applied: profile=preview
    
    {
      "data": {
        "attributes": {
          "google-storage-bucket": "scalr-blobs_acc-u4j0dubllrl6a0o",
          "google-project": "your-project-id",
          "google-credentials": null,
          "google-encryption-key": null
        },
        "id": "acc-u4j0dubllrl6a0o",
        "links": {
          "self": "https://my.scalr.io/api/iacp/v3/accounts/acc-u4j0dubllrl6a0o/blob-settings"
        },
        "type": "account-blob-settings"
      },
      "included": null,
      "meta": null
    }
    

  • 409 Conflict – Cannot replace settings in a current state.

  • 422 Unprocessable Entity – Invalid arguments.

  • 4XX – Client error.

  • 5XX – Server error.