Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

google-gspanner (1) Versions 0.1.0

A Chef cookbook to manage Google Cloud Spanner resources

Berkshelf
Policyfile
Knife
cookbook 'google-gspanner', '~> 0.1.0'
cookbook 'google-gspanner', '~> 0.1.0', :supermarket
knife supermarket install google-gspanner
knife supermarket download google-gspanner
README
Dependencies
Changelog
Quality 63%

Google Spanner Chef Cookbook

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

Requirements

Platforms

Supported Operating Systems

This cookbook was tested on the following operating systems:

  • RedHat 6, 7
  • CentOS 6, 7
  • Debian 7, 8
  • Ubuntu 12.04, 14.04, 16.04, 16.10
  • SLES 11-sp4, 12-sp2
  • openSUSE 13
  • Windows Server 2008 R2, 2012 R2, 2012 R2 Core, 2016 R2, 2016 R2 Core

Example

gspanner_instance 'my-spanner' do
  action :create
  display_name 'My Spanner Instance'
  node_count 2
  labels [
    {
      'cost-center' => 'ti-1700004'
    }
  ]
  config 'regional-us-central1'
  project ENV['PROJECT']
  credential 'mycred'
end

gspanner_database 'webstore' do
  action :create
  instance 'my-spanner'
  extra_statements [
    'CREATE TABLE customers (
       customer_id INT64 NOT NULL,
       last_name STRING(MAX)
     ) PRIMARY KEY (customer_id)'
  ]
  project ENV['PROJECT']
  credential 'mycred'
end

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

gauth_credential 'mycred' do
  action :serviceaccount
  path ENV['CRED_PATH'] # e.g. '/path/to/my_account.json'
  scopes [
    'https://www.googleapis.com/auth/spanner.admin'
  ]
end

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

Resources

  • gspanner_instance_config - A possible configuration for a Cloud Spanner instance. Configurations define the geographic placement of nodes and their replication.
  • gspanner_instance - An isolated set of Cloud Spanner resources on which databases can be hosted.
  • gspanner_database - A Cloud Spanner Database which is hosted on a Spanner instance.

gspanner_instance_config

A possible configuration for a Cloud Spanner instance. Configurations define the geographic placement of nodes and their replication.

Example


Reference

gspanner_instance_config 'id-for-resource' do
  display_name string
  name         string
  project      string
  credential   reference to gauth_credential
end

Actions

  • create - Converges the gspanner_instance_config resource into the final state described within the block. If the resource does not exist, Chef will attempt to create it.
  • delete - Ensures the gspanner_instance_config resource is not present. If the resource already exists Chef will attempt to delete it.

Properties

  • name - A unique identifier for the instance configuration. Values are of the form projects/<project>/instanceConfigs/[a-z][-a-z0-9]*

  • display_name - Output only. The name of this instance configuration as it appears in UIs.

Label

Set the ic_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"

gspanner_instance

An isolated set of Cloud Spanner resources on which databases can be hosted.

Example

gspanner_instance 'my-spanner' do
  action :create
  display_name 'My Spanner Instance'
  node_count 2
  labels({
    'cost-center' => 'ti-1700004'
  })
  config 'regional-us-central1'
  project ENV['PROJECT']
  credential 'mycred'
end

Reference

gspanner_instance 'id-for-resource' do
  config       reference to gspanner_instance_config
  display_name string
  labels       namevalues
  name         string
  node_count   integer
  project      string
  credential   reference to gauth_credential
end

Actions

  • create - Converges the gspanner_instance resource into the final state described within the block. If the resource does not exist, Chef will attempt to create it.
  • delete - Ensures the gspanner_instance resource is not present. If the resource already exists Chef will attempt to delete it.

Properties

  • name - A unique identifier for the instance, which cannot be changed after the instance is created. Values are of the form projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9]. The final segment of the name must be between 6 and 30 characters in length.

  • config - A reference to the instance configuration.

  • display_name - Required. The descriptive name for this instance as it appears in UIs. Must be unique per project and between 4 and 30 characters in length.

  • node_count - The number of nodes allocated to this instance.

  • labels - Cloud Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. Cloud Labels can be used to filter collections of resources. They can be used to control how resource metrics are aggregated. And they can be used as arguments to policy management rules (e.g. route, firewall, load balancing, etc.). Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])?. Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?. No more than 64 labels can be associated with a given resource. See https://goo.gl/xmQnxf for more information on and examples of labels. If you plan to use labels in your own code, please note that additional characters may be allowed in the future. And so you are advised to use an internal label representation, such as JSON, which doesn't rely upon specific characters being disallowed. For example, representing labels as the string: name + "" + value would prove problematic if we were to allow "" in a future release. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Label

Set the i_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"

gspanner_database

A Cloud Spanner Database which is hosted on a Spanner instance.

Example

gspanner_instance 'my-spanner' do
  action :create
  display_name 'My Spanner Instance'
  node_count 2
  labels({
      'cost-center' => 'ti-1700004'
  })
  config 'regional-us-central1'
  project ENV['PROJECT']
  credential 'mycred'
end

gspanner_database 'webstore' do
  action :create
  instance 'my-spanner'
  extra_statements [
    'CREATE TABLE customers (
       customer_id INT64 NOT NULL,
       last_name STRING(MAX)
     ) PRIMARY KEY (customer_id)'
  ]
  project ENV['PROJECT']
  credential 'mycred'
end

Reference

gspanner_database 'id-for-resource' do
  extra_statements [
    string,
    ...
  ]
  instance         reference to gspanner_instance
  name             string
  project          string
  credential       reference to gauth_credential
end

Actions

  • create - Converges the gspanner_database resource into the final state described within the block. If the resource does not exist, Chef will attempt to create it.
  • delete - Ensures the gspanner_database resource is not present. If the resource already exists Chef will attempt to delete it.

Properties

  • name - A unique identifier for the database, which cannot be changed after the instance is created. Values are of the form projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9]. The final segment of the name must be between 6 and 30 characters in length.

  • extra_statements - An optional list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created.

  • instance - Required. The instance to create the database on.

Label

Set the d_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"

Dependent cookbooks

google-gauth < 0.3.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Changelog

0.1.0 (2017-10-10)

Initial release

Collaborator Number Metric
            

0.1.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.1.0 passed this metric

Foodcritic Metric
            

0.1.0 passed this metric

No Binaries Metric
            

0.1.0 passed this metric

Publish Metric
            

0.1.0 passed this metric

Supported Platforms Metric
            

0.1.0 passed this metric

Testing File Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number