Skip to content

Latest commit

 

History

History

cloud_sql

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Cloud SQL

This template creates a Cloud SQL instance with databases and users.

Prerequisites

Deployment

Resources

Properties

See the properties section in the schema file(s):

Usage

  1. Clone the Deployment Manager samples repository:

    git clone https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit
  2. Go to the dm directory:

    cd dm
  3. Copy the example DM config to be used as a model for the deployment; in this case, examples/cloud_sql.yaml:

    cp templates/cloud_sql/examples/cloud_sql.yaml my_cloud_sql.yaml
  4. Change the values in the config file to match your specific GCP setup (for properties, refer to the schema files listed above):

    vim my_cloud_sql.yaml  # <== change values to match your GCP setup
  5. Create your deployment (replace <YOUR_DEPLOYMENT_NAME> with the relevant deployment name):

    gcloud deployment-manager deployments create <YOUR_DEPLOYMENT_NAME> \
        --config my_cloud_sql.yaml

    To deploy with CFT:

    cft apply my_cloud_sql.yaml
  6. In case you need to delete your deployment:

    gcloud deployment-manager deployments delete <YOUR_DEPLOYMENT_NAME>

    To delete deployment with CFT:

    cft delete my_cloud_sql.yaml

Notes: After a Cloud SQL instance is deleted, its name cannot be reused for up to 7 days.

Examples