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
Applicationmanifest. - The names of your
organization,organizational-unit,environmentandproject.
Steps
-
Create the
Bucketmanifest.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 -
Grant the application access in its
accessControlblock.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 systemWRITEgrantsroles/storage.objectUser.READ_ONLYgrantsroles/storage.objectViewer. Setpromote: trueto copy the bucket contents between environments during releases. -
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.