GoogleCloudPlatform/chef-google-sql

Name: chef-google-sql

Owner: Google Cloud Platform

Description: null

Created: 2017-06-22 19:52:27.0

Updated: 2018-05-11 00:24:44.0

Pushed: 2018-05-23 23:00:04.0

Homepage: null

Size: 103

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Google Cloud SQL Chef Cookbook

This cookbook provides the built-in types and services for Chef to manage Google Cloud Compute 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/sqlservice.admin'



_instance  "sql-test-#{ENV['sql_instance_suffix']}" do
tion :create
oject 'google.com:graphite-playground'
edential 'mycred'


_database 'webstore' do
tion :create
arset 'utf8'
stance "sql-test-#{ENV['sql_instance_suffix']}"
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/sqlservice.admin'


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

Resources
gsql_instance

Represents a Cloud SQL instance. Cloud SQL instances are SQL databases hosted in Google's cloud. The Instances resource provides methods for common configuration and management tasks.

Example
_instance "sql-test-#{ENV['sql_instance_suffix']}" do
tion :create
tabase_version 'MYSQL_5_7'
ttings({
tier: 'db-n1-standard-1',
ip_configuration:  {
  authorized_networks: [
    # The ACL below is for example only. (do NOT use in production as-is)
    {
      name: 'google dns server',
      value: '8.8.8.8/32'
    }
  ]
}

gion 'us-central1'
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
_instance 'id-for-resource' do
ckend_type          'FIRST_GEN', 'SECOND_GEN' or 'EXTERNAL'
nnection_name       string
tabase_version      'MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7' or 'POSTGRES_9_6'
ilover_replica      {
available boolean,
name      string,

stance_type         'CLOUD_SQL_INSTANCE', 'ON_PREMISES_INSTANCE' or 'READ_REPLICA_INSTANCE'
_addresses          [
{
  ip_address     string,
  time_to_retire time,
  type           'PRIMARY' or 'OUTGOING',
},
...

v6_address          string
ster_instance_name  string
x_disk_size         integer
me                  string
gion                string
plica_configuration {
failover_target               boolean,
mysql_replica_configuration   {
  ca_certificate            string,
  client_certificate        string,
  client_key                string,
  connect_retry_interval    integer,
  dump_file_path            string,
  master_heartbeat_period   integer,
  password                  string,
  ssl_cipher                string,
  username                  string,
  verify_server_certificate boolean,
},
replica_names                 [
  string,
  ...
],
service_account_email_address string,

ttings              {
ip_configuration {
  authorized_networks [
    {
      expiration_time time,
      name            string,
      value           string,
    },
    ...
  ],
  ipv4_enabled        boolean,
  require_ssl         boolean,
},
tier             string,

oject               string
edential            reference to gauth_credential

Actions Properties 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”

gsql_database

Represents a SQL database inside the Cloud SQL instance, hosted in Google's cloud.

Example
p: Remember to define gsql_instance to match the 'instance' property.
_database 'webstore' do
tion :create
arset 'utf8'
stance "sql-test-#{ENV['sql_instance_suffix']}"
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
_database 'id-for-resource' do
arset    string
llation  string
stance   reference to gsql_instance
me       string
oject    string
edential reference to gauth_credential

Actions Properties 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”

gsql_user

The Users resource represents a database user in a Cloud SQL instance.

Example
p: Remember to define gsql_instance to match the 'instance' property.
_user 'john.doe' do
tion :create
ssword 'secret-password'
st '10.1.2.3'
stance "sql-test-#{ENV['sql_instance_suffix']}"
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
_user 'id-for-resource' do
st       string
stance   reference to gsql_instance
me       string
ssword   string
oject    string
edential reference to gauth_credential

Actions Properties Label

Set the u_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”

gsql_ssl_cert

Represents an SSL certificate created for a Cloud SQL instance. To use the SSL certificate you must have the SSL Client Certificate and the associated SSL Client Key. The Client Key can be downloaded only when the SSL certificate is created with the insert method.

Example
p: Remember to define gsql_instance to match the 'instance' property.
_ssl_cert 'server-certificate' do
rt_serial_number '729335786'
mmon_name 'CN=www.mydb.com,O=Acme'
a1_fingerprint '8fc295bf77a002db5182e04d92c48258cbc1117a'
stance "sql-test-#{ENV['sql_instance_suffix']}"
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
_ssl_cert 'id-for-resource' do
rt               string
rt_serial_number string
mmon_name        string
eate_time        time
piration_time    time
stance           reference to gsql_instance
a1_fingerprint   string
oject            string
edential         reference to gauth_credential

Actions Properties Label

Set the sc_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”

gsql_flag

Represents a flag that can be configured for a Cloud SQL instance.

Example
_flag 'group_concat_max_len' do
n_value 4
x_value 4294967295
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
_flag 'id-for-resource' do
lowed_string_values [
string,
...

plies_to            [
string,
...

x_value             integer
n_value             integer
me                  string
quires_restart      boolean
pe                  string
oject               string
edential            reference to gauth_credential

Actions Properties Label

Set the f_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”

gsql_tier

The Tiers resource represents a service configuration that can be used to define a Cloud SQL instance. Each tier has an associated RAM, maximum storage, and list of regions in which the tier can be used. Available tiers vary depending on whether you use PostgreSQL, MySQL Second Generation, or MySQL First Generation instances.

Example
_tier 'D0' do
m 134217728 # we'll confirm that tier has enough RAM for us
oject 'google.com:graphite-playground'
edential 'mycred'

Reference
_tier 'id-for-resource' do
sk_quota integer
m        integer
gion     [
string,
...

er       string
oject    string
edential reference to gauth_credential

Actions Properties Label

Set the t_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.