- Notifications
You must be signed in to change notification settings - Fork0
Modular Cloud SQL database instance for Terraform.
License
afym/terraform-google-sql-db
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
terraform-google-sql makes it easy to create Google CloudSQL instance and implement high availability settings.This module consists of the following submodules:
See more details in each module's README.
- terraform 0.11.x
- terraform-provider-google plugin v1.12.x
In order to execute this module you must have a Service Account with the following:
roles/cloudsql.admin
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
- Cloud SQL API
You can pass the service account credentials into this module by setting the following environment variables:
GOOGLE_CREDENTIALSGOOGLE_CLOUD_KEYFILE_JSONGCLOUD_KEYFILE_JSON
See moredetails.
- bundler
- ruby 2.5.x
- python 2.7.x
- terraform-docs 0.4.5
- google-cloud-sdk
$ make generate_docs
The integration tests for this module leverage kitchen-terraform and kitchen-inspec.
You must set up by manually before running the integration test:
forinstancein mysql-simple mysql-ha postgresql-simple postgresql-ha;do cp"test/fixtures/$instance/terraform.tfvars.example""test/fixtures/$instance/terraform.tfvars"$EDITOR"test/fixtures/$instance/terraform.tfvars"done
And then, you should pass the service account credentials for running inspec by setting the following environment variables:
GOOGLE_APPLICATION_CREDENTIALS
The tests will do the following:
- Perform
bundle installcommand- Installs
test-kitchen,kitchen-terraformandkitchen-inspec
- Installs
- Perform
bundle exec kitchen createcommand- Performs
terraform init
- Performs
- Perform
bundle exec kitchen convergecommand- Performs
terraform apply -auto-approve
- Performs
- Perform
bundle exec kitchen verifycommand- Performs inspec tests
- Perform
bundle exec kitchen destroycommand- Performs
terraform destroy -force
- Performs
You can use the following command to run the integration test in the root directory.
$ make test_integration
The makefile in this project will lint or sometimes just format any shell, Python, golang, Terraform, or Dockerfiles. The linters will only be run if the makefile finds files with the appropriate file extension.
All of the linter checks are in the default make target, so you just have to run
$ make -s
The -s is for 'silent'. Successful output looks like this
Running shellcheckRunning flake8Running go fmt and go vetRunning terraform validateRunning terraform fmtRunning hadolint on DockerfilesChecking for required filesThe following lines have trailing whitespaceGenerating markdown docs with terraform-docsThe lintersare as follows:
- Shell - shellcheck. Can be found in homebrew
- Python - flake8. Can be installed with
pip install flake8 - Golang - gofmt. gofmt comes with the standard golang installation. golang-s a compiled language so there is no standard linter.
- Terraform - terraform has a built-in linter in the
terraform validatecommand. - Dockerfiles - hadolint. Can be found in homebrew
About
Modular Cloud SQL database instance for Terraform.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- HCL53.8%
- Ruby22.9%
- Python17.2%
- Shell4.0%
- Makefile2.1%