StorageBucket
Property | Value |
---|---|
Google Cloud Service Name | Cloud Storage |
Google Cloud Service Documentation | /storage/docs/ |
Google Cloud REST Resource Name | v1.buckets |
Google Cloud REST Resource Documentation | /storage/docs/json_api/v1/buckets |
Config Connector Resource Short Names | gcpstoragebucket gcpstoragebuckets storagebucket |
Config Connector Service Name | storage.googleapis.com |
Config Connector Resource Fully Qualified Name | storagebuckets.storage.cnrm.cloud.google.com |
Can Be Referenced by IAMPolicy/IAMPolicyMember | Yes |
Supports IAM Conditions | Yes |
Supports IAM Audit Configs | No |
IAM External Reference Format |
{{name}} |
Config Connector Default Average Reconcile Interval In Seconds | 600 |
Custom Resource Definition Properties
Annotations
Fields | |
---|---|
cnrm.cloud.google.com/force-destroy |
|
cnrm.cloud.google.com/project-id |
Spec
Schema
autoclass:
enabled: boolean
bucketPolicyOnly: boolean
cors:
- maxAgeSeconds: integer
method:
- string
origin:
- string
responseHeader:
- string
customPlacementConfig:
dataLocations:
- string
defaultEventBasedHold: boolean
encryption:
kmsKeyRef:
external: string
name: string
namespace: string
lifecycleRule:
- action:
storageClass: string
type: string
condition:
age: integer
createdBefore: string
customTimeBefore: string
daysSinceCustomTime: integer
daysSinceNoncurrentTime: integer
matchesPrefix:
- string
matchesStorageClass:
- string
matchesSuffix:
- string
noncurrentTimeBefore: string
numNewerVersions: integer
withState: string
location: string
logging:
logBucket: string
logObjectPrefix: string
publicAccessPrevention: string
requesterPays: boolean
resourceID: string
retentionPolicy:
isLocked: boolean
retentionPeriod: integer
softDeletePolicy:
retentionDurationSeconds: integer
storageClass: string
uniformBucketLevelAccess: boolean
versioning:
enabled: boolean
website:
mainPageSuffix: string
notFoundPage: string
Fields | |
---|---|
Optional |
The bucket's autoclass configuration. |
Required* |
While set to true, autoclass automatically transitions objects in your bucket to appropriate storage classes based on each object's access pattern. |
Optional |
DEPRECATED. Please use the `uniformBucketLevelAccess` field as this field has been renamed by Google. The `uniformBucketLevelAccess` field will supersede this field. Enables Bucket PolicyOnly access to a bucket. |
Optional |
The bucket's Cross-Origin Resource Sharing (CORS) configuration. |
Optional |
|
Optional |
The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses. |
Optional |
The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method". |
Optional |
|
Optional |
The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin". |
Optional |
|
Optional |
The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains. |
Optional |
|
Optional |
The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. |
Required* |
Immutable. The list of individual regions that comprise a dual-region bucket. See the docs for a list of acceptable regions. Note: If any of the data_locations changes, it will recreate the bucket. |
Required* |
|
Optional |
Whether or not to automatically apply an eventBasedHold to new objects added to the bucket. |
Optional |
The bucket's encryption configuration. |
Required* |
|
Optional |
Allowed value: The `selfLink` field of a `KMSCryptoKey` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
The bucket's Lifecycle Rules configuration. |
Optional |
|
Required* |
The Lifecycle Rule's action configuration. A single block of this type is supported. |
Optional |
The target Storage Class of objects affected by this Lifecycle Rule. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE. |
Required* |
The type of the action of this Lifecycle Rule. Supported values include: Delete, SetStorageClass and AbortIncompleteMultipartUpload. |
Required* |
The Lifecycle Rule's condition configuration. |
Optional |
Minimum age of an object in days to satisfy this condition. |
Optional |
Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition. |
Optional |
Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition. |
Optional |
Number of days elapsed since the user-specified timestamp set on an object. |
Optional |
Number of days elapsed since the noncurrent timestamp of an object. This condition is relevant only for versioned objects. |
Optional |
One or more matching name prefixes to satisfy this condition. |
Optional |
|
Optional |
Storage Class of objects to satisfy this condition. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, DURABLE_REDUCED_AVAILABILITY. |
Optional |
|
Optional |
One or more matching name suffixes to satisfy this condition. |
Optional |
|
Optional |
Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition. |
Optional |
Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition. |
Optional |
Match to live and/or archived objects. Unversioned buckets have only live objects. Supported values include: "LIVE", "ARCHIVED", "ANY". |
Optional |
Immutable. The Google Cloud Storage location. |
Optional |
The bucket's Access & Storage Logs configuration. |
Required* |
The bucket that will receive log objects. |
Optional |
The object prefix for log objects. If it's not provided, by default Google Cloud Storage sets this to this bucket's name. |
Optional |
Prevents public access to a bucket. |
Optional |
Enables Requester Pays on a storage bucket. |
Optional |
Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. |
Optional |
Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. |
Optional |
If set to true, the bucket will be locked and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action. |
Required* |
The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 3,155,760,000 seconds. |
Optional |
The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy. |
Optional |
The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. |
Optional |
The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE. |
Optional |
Enables uniform bucket-level access on a bucket. |
Optional |
The bucket's Versioning configuration. |
Required* |
While set to true, versioning is fully enabled for this bucket. |
Optional |
Configuration if the bucket acts as a website. |
Optional |
Behaves as the bucket's directory index where missing objects are treated as potential directories. |
Optional |
The custom object to return when a requested resource is not found. |
* Field is required when parent field is specified
Status
Schema
conditions:
- lastTransitionTime: string
message: string
reason: string
status: string
type: string
observedGeneration: integer
observedState:
softDeletePolicy:
effectiveTime: string
retentionDurationSeconds: integer
selfLink: string
url: string
Fields | |
---|---|
conditions |
Conditions represent the latest available observation of the resource's current state. |
conditions[] |
|
conditions[].lastTransitionTime |
Last time the condition transitioned from one status to another. |
conditions[].message |
Human-readable message indicating details about last transition. |
conditions[].reason |
Unique, one-word, CamelCase reason for the condition's last transition. |
conditions[].status |
Status is the status of the condition. Can be True, False, Unknown. |
conditions[].type |
Type is the type of the condition. |
observedGeneration |
ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. |
observedState |
The observed state of the underlying GCP resource. |
observedState.softDeletePolicy |
The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy. |
observedState.softDeletePolicy.effectiveTime |
Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format. |
observedState.softDeletePolicy.retentionDurationSeconds |
The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800. |
selfLink |
The URI of the created resource. |
url |
The base URL of the bucket, in the format gs:// |
Sample YAML(s)
Typical Use Case
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucket
metadata:
annotations:
cnrm.cloud.google.com/force-destroy: "false"
labels:
label-one: "value-one"
# StorageBucket names must be globally unique. Replace ${PROJECT_ID?} with your project ID.
name: ${PROJECT_ID?}-sample
spec:
lifecycleRule:
- action:
type: Delete
condition:
age: 7
withState: ANY
versioning:
enabled: true
cors:
- origin: ["http://example.appspot.com"]
responseHeader: ["Content-Type"]
method: ["GET", "HEAD", "DELETE"]
maxAgeSeconds: 3600
uniformBucketLevelAccess: true
softDeletePolicy:
retentionDurationSeconds: 604800