GoogleCloudPlatform/chef-google-storage

Name: chef-google-storage

Owner: Google Cloud Platform

Description: null

Created: 2017-06-22 19:50:40.0

Updated: 2018-04-23 17:17:52.0

Pushed: 2018-05-01 18:58:52.0

Homepage: null

Size: 68

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Google Cloud Storage Chef Cookbook

This cookbook provides the built-in types and services for Chef to manage Google Cloud Storage resources, as native Chef types.

Requirements
Platforms
Supported Operating Systems

This cookbook was tested on the following operating systems:

Example
h_credential 'mycred' do
tion :serviceaccount
th ENV['CRED_PATH'] # e.g. '/path/to/my_account.json'
opes [
'https://www.googleapis.com/auth/devstorage.full_control'



rage_bucket 'storage-bucket' do
tion :create
oject 'google.com:graphite-playground'
edential 'mycred'

Credentials

All Google Cloud Platform cookbooks use an unified authentication mechanism, provided by the google-gauth cookbook. Don't worry, it is automatically installed when you install this module.

Example
h_credential 'mycred' do
tion :serviceaccount
th ENV['CRED_PATH'] # e.g. '/path/to/my_account.json'
opes [
'https://www.googleapis.com/auth/devstorage.full_control'


For complete details of the authentication cookbook, visit the google-gauth cookbook documentation.

Resources
gstorage_bucket

The Buckets resource represents a bucket in Google Cloud Storage. There is a single global namespace shared by all buckets. For more information, see Bucket Name Requirements.

Buckets contain objects which can be accessed by their own methods. In addition to the acl property, buckets contain bucketAccessControls, for use in fine-grained manipulation of an existing bucket's access controls.

A bucket is always owned by the project team owners group.

Example
is is a simple example of a bucket creation/ensure existence. If you want a
re thorough setup of its ACL please refer to 'examples/bucket~acl.pp'
nifest.
rage_bucket 'storage-module-test' do
tion :create
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
rage_bucket 'id-for-resource' do
l                           [
{
  bucket       reference to gstorage_bucket,
  domain       string,
  email        string,
  entity       string,
  entity_id    string,
  id           string,
  role         'OWNER', 'READER' or 'WRITER',
  project_team {
    team           'editors', 'owners' or 'viewers',
    project_number string,
  },
},
...

rs                          [
{
  max_age_seconds integer,
  method          [
    string,
    ...
  ],
  origin          [
    string,
    ...
  ],
  response_header [
    string,
    ...
  ],
},
...

                            string
fecycle                     {
rule [
  {
    action    {
      storage_class string,
      type          'Delete' or 'SetStorageClass',
    },
    condition {
      age_days              integer,
      created_before        time,
      is_live               boolean,
      matches_storage_class [
        string,
        ...
      ],
      num_newer_versions    integer,
    },
  },
  ...
],

cation                      string
gging                       {
log_bucket        string,
log_object_prefix string,

tageneration                integer
me                          string
ner                         {
entity    string,
entity_id string,

edefined_default_object_acl 'authenticatedRead', 'bucketOwnerFullControl', 'bucketOwnerRead', 'private', 'projectPrivate' or 'publicRead'
orage_class                 'MULTI_REGIONAL', 'REGIONAL', 'STANDARD', 'NEARLINE', 'COLDLINE' or 'DURABLE_REDUCED_AVAILABILITY'
me_created                  time
dated                       time
rsioning                    {
enabled boolean,

bsite                       {
main_page_suffix string,
not_found_page   string,

oject_number                integer
oject                       string
edential                    reference to gauth_credential

Actions Properties Label

Set the b_label property when attempting to set primary key of this object. The primary key will always be referred to by the initials of the resource followed by “_label”

gstorage_bucket_access_control

The BucketAccessControls resource represents the Access Control Lists (ACLs) for buckets within Google Cloud Storage. ACLs let you specify who has access to your data and to what extent.

There are three roles that can be assigned to an entity:

READERs can get the bucket, though no acl property will be returned, and list the bucket's objects. WRITERs are READERs, and they can insert objects into the bucket and delete the bucket's objects. OWNERs are WRITERs, and they can get the acl property of a bucket, update a bucket, and call all BucketAccessControls methods on the bucket. For more information, see Access Control, with the caveat that this API uses READER, WRITER, and OWNER instead of READ, WRITE, and FULL_CONTROL.

Example
cket Access Control requires a bucket. Please ensure its existence with
e gstorage_bucket { ... } resource
rage_bucket_access_control 'user-nelsona@google.com' do
tion :create
cket 'storage-module-test'
tity 'user-nelsona@google.com'
le 'WRITER'
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
rage_bucket_access_control 'id-for-resource' do
cket       reference to gstorage_bucket
main       string
ail        string
tity       string
tity_id    string
           string
le         'OWNER', 'READER' or 'WRITER'
oject_team {
team           'editors', 'owners' or 'viewers',
project_number string,

oject      string
edential   reference to gauth_credential

Actions Properties Label

Set the bac_label property when attempting to set primary key of this object. The primary key will always be referred to by the initials of the resource followed by “_label”


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.