google::bucket¶
Creates a Bucket within a specified region.
Example¶
google::bucket bucket-1
name: 'example-one'
location: 'us-central1'
predefined-acl: 'publicRead'
default-event-based-hold: true
storage-class: 'NEARLINE'
labels: {
foo: 'bar_1901'
}
cors
max-age-seconds: 3200
method: ['GET', 'POST']
origin: ['*']
response-header: ['application-x-test']
end
billing
requester-pays: false
end
iam-configuration
uniform-bucket-level-access
enabled: false
end
end
iam-policy
bindings
role: 'roles/storage.legacyBucketOwner'
members: ['projectEditor:<<PROJECT-ID-GOES-HERE>>']
end
bindings
role: 'roles/storage.legacyBucketReader'
members: ['projectViewer:<<PROJECT-ID-GOES-HERE>>']
end
bindings
role: 'roles/storage.legacyBucketReader'
members: ['allAuthenticatedUsers']
condition
title: 'example bucket iam policy condition'
expression: 'request.time < timestamp(\"2021-01-01T00:00:00Z\")'
end
end
end
lifecycle
rule
action
type: 'Delete'
end
condition
age: 7
end
end
rule
action
type: 'Delete'
end
condition
num-newer-versions: 10
end
end
rule
action
type: 'Delete'
end
condition
is-live: true
age: 15
end
end
end
logging
log-bucket: $(google::bucket logs)
log-object-prefix: 'gyro'
end
retention-policy
retention-period: 3300
end
website
main-page-suffix: 'index.html'
not-found-page: '404.jpg'
end
end
Attributes¶
Attribute | Description |
---|---|
predefined-acl | Sets predefined access controls to the bucket. Valid values are authenticatedRead , private , projectPrivate , publicRead or publicReadWrite . See Access Control Lists. |
predefined-default-object-acl | Set predefined default object access controls to the bucket. Valid values are authenticatedRead , bucketOwnerFullControl , bucketOwnerRead , private , projectPrivate or publicRead . See Access Control Lists. |
user-project | The project to be billed for this request. |
name | A unique name for the Bucket conforming to the bucket naming guidelines. (Required) |
labels map | Optional set of up to 64 key:value metadata pairs. Each key:value must conform to Label guidelines. |
location | The geographic region objects within the bucket will reside. See Bucket locations. |
cors list | Configure the cross origin request policies (CORS) for the bucket. |
billing subresource | Configure the billing for the Bucket.
|
default-event-based-hold | When true automatically apply an GCP “eventBasedHold”, or object hold, to new objects added to the bucket. |
iam-configuration subresource | The bucket’s IAM configuration. See also Cloud Identity and Access Management.
|
iam-policy subresource | The bucket’s IAM Policy. See also Cloud IAM Permissions.
|
lifecycle subresource | The bucket’s lifecycle configuration. See also Object Lifecycle Management.
|
logging subresource | The bucket’s logging configuration.
|
retention-policy subresource | Minimum age an object in the bucket must reach before it can be deleted or overwritten. See also Retention policies.
|
storage-class | Bucket’s default storage class used whenever no storageClass is specified for a newly-created object. Defaults to STANDARD . Valid values are STANDARD , NEARLINE , COLDLINE , MULTI-REGIONAL , REGIONAL or DURABLE_REDUCED_AVAILABILITY . |
versioning subresource | The bucket’s versioning configuration. |
website subresource | The bucket’s website configuration controlling how the service behaves when accessing bucket contents as a web site.
|
Outputs¶
Attribute | Description |
---|---|
id | The generated ID for the bucket. |
self-link | The generated URI of this bucket. |