Skip to content
Terraform Azure RM Module for Database
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Add Terratest for Database Module (#11) Aug 22, 2018
.gitignore Add Terratest for Database Module (#11) Aug 22, 2018
.travis.yml Add Terratest for Database Module (#11) Aug 22, 2018
Dockerfile
Gemfile Add Terratest for Database Module (#11) Aug 22, 2018
Gopkg.lock
Gopkg.toml
LICENSE Introduce terraform module test framework (#8) Jan 16, 2018
README.md Add Terratest for Database Module (#11) Aug 22, 2018
Rakefile
main.tf
outputs.tf
variables.tf

README.md

terraform-azurerm-database

Build Status

Create an Azure SQL Database

This Terraform module creates a basic Azure SQL Database.

Usage

module "sql-database" {
  source              = "Azure/database/azurerm"
  resource_group_name = "myapp"
  location            = "westus"
  db_name             = "mydatabase"
  sql_admin_username  = "mradministrator"
  sql_password        = "P@ssw0rd12345!"

  tags             = {
                        environment = "dev"
                        costcenter  = "it"
                      }
  
}

Test

Configurations

We provide 2 ways to build, run, and test the module on a local development machine. Native (Mac/Linux) or Docker.

Native(Mac/Linux)

Prerequisites

Environment setup

We provide simple script to quickly set up module development environment:

$ curl -sSL https://raw.githubusercontent.com/Azure/terramodtest/master/tool/env_setup.sh | sudo bash

Run test

Then simply run it in local shell:

$ 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.

Prerequisites

Build the image

$ 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-database-module .

Run test (Docker)

This runs the build and unit tests:

$ docker run --rm azure-database-module /bin/bash -c "bundle install && rake build"

This runs the end to end tests:

$ docker run --rm azure-database-module /bin/bash -c "bundle install && rake e2e"

This runs the full tests:

$ docker run --rm azure-database-module /bin/bash -c "bundle install && rake full"

Authors

Originally created by James Earle

License

MIT

You can’t perform that action at this time.