Skip to main content

Create a Bucket

Create a private Cloud Storage bucket and give an application access to it. Buckets are private, encrypted at rest and versioned.

Prerequisites​

  • An Application manifest.
  • The names of your organization, organizational-unit, environment and project.

Steps​

  1. Create the Bucket manifest.

    apiVersion: lowops.manifests.v1
    kind: Bucket
    metadata:
    name: transaction-receipts
    project: payment-gateway
    environment: production
    organizational-unit: retail-banking
    organization: fincorp
    spec:
    region: us-central1
    storageClass: STANDARD # STANDARD | NEARLINE | COLDLINE | ARCHIVE
  2. Grant the application access in its accessControl block.

    spec:
    accessControl:
    buckets:
    - name: transaction-receipts # the Bucket manifest name
    permission: WRITE # READ_ONLY or WRITE
    subPath: "processed/" # optional: limit access to a path
    # mountPath: "/data/receipts" # optional: mount the bucket as a file system

    WRITE grants roles/storage.objectUser. READ_ONLY grants roles/storage.objectViewer. Set promote: true to copy the bucket contents between environments during releases.

  3. Commit both manifests in one pull request and merge it.

warning

A Bucket manifest does not adopt a bucket that already exists. It creates a new bucket. The engine matches a bucket by its full label set, not by its name.

Verify​

The run shows the bucket as created. The application restarts with the access that you granted.

Next​