Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foreverXZC/terraform-azurerm-mysql
Terraform module creating a MySQL Database on Azure
https://github.com/foreverXZC/terraform-azurerm-mysql
Last synced: 7 days ago
JSON representation
Terraform module creating a MySQL Database on Azure
- Host: GitHub
- URL: https://github.com/foreverXZC/terraform-azurerm-mysql
- Owner: foreverXZC
- License: mit
- Created: 2018-07-18T09:10:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-30T19:45:03.000Z (about 5 years ago)
- Last Synced: 2024-08-02T00:26:26.395Z (3 months ago)
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-terraform - terraform-azurerm-mysql - Create MySql Database on Azure. (Community Modules / Miscellaneous)
- awesome-tf - terraform-azurerm-mysql - Create MySql Database on Azure. (Community Modules / Miscellaneous)
README
# terraform-azurerm-mysql
[![Build Status](https://travis-ci.org/foreverXZC/terraform-azurerm-mysql.svg?branch=master)](https://travis-ci.org/foreverXZC/terraform-azurerm-mysql)
## Create a MySQL Database
This Terraform module creates a basic MySQL Database on Azure.
## Usage
```hcl
module "mysql" {
source = "foreverXZC/mysql/azurerm"
db_name = "mydatabase"
location = "westeurope"
admin_username = "azureuser"
password = "P@ssw0rd12345!"
}
```## Test
### Configurations
- [Configure Terraform for Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-install-configure)
We provide 2 ways to build, run, and test the module on a local development machine. [Native (Mac/Linux)](#native-maclinux) or [Docker](#docker).
### Native(Mac/Linux)
#### Prerequisites
- [Ruby **(~> 2.3)**](https://www.ruby-lang.org/en/downloads/)
- [Bundler **(~> 1.15)**](https://bundler.io/)
- [Terraform **(~> 0.11.7)**](https://www.terraform.io/downloads.html)
- [Golang **(~> 1.10.3)**](https://golang.org/dl/)#### Environment setup
We provide simple script to quickly set up module development environment:
```sh
$ curl -sSL https://raw.githubusercontent.com/Azure/terramodtest/master/tool/env_setup.sh | sudo bash
```#### Run test
Then simply run it in local shell:
```sh
$ cd $GOPATH/src/{directory_name}/
$ bundle install
$ rake build
$ rake e2e
```### Docker
We provide a Dockerfile to build a new image based `FROM` the `microsoft/terraform-test` Docker hub image which adds additional tools / packages specific for this module (see Custom Image section). Alternatively use only the `microsoft/terraform-test` Docker hub image [by using these instructions](https://github.com/Azure/terraform-test).
#### Prerequisites
- [Docker](https://www.docker.com/community-edition#/download)
#### Build the image
```sh
$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-mysql-module .
```#### Run test (Docker)
This runs the build and unit tests:
```sh
$ docker run --rm azure-mysql-module /bin/bash -c "bundle install && rake build"
```This runs the end to end tests:
```sh
$ docker run --rm azure-mysql-module /bin/bash -c "bundle install && rake e2e"
```This runs the full tests:
```sh
$ docker run --rm azure-mysql-module /bin/bash -c "bundle install && rake full"
```## Authors
Originally created by [foreverXZC](http://github.com/foreverXZC)
## License
[MIT](LICENSE)