Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
.github/* @clouddrove/approvers

* @clouddrove/clouddrovians @clouddrove/approvers

.github/mergify.yml @clouddrove/admins
.github/CODEOWNERS @clouddrove/admins
# These owners will be the default owners for everything in the repo.
* @anmolnagpal @clouddrove-ci @clouddrove/terraform-azure-admins
14 changes: 14 additions & 0 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign PRs

on:
pull_request:
types: [opened, reopened]

workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
assignees: 'clouddrove-ci'
12 changes: 12 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Auto merge
on:
pull_request:
jobs:
auto-merge:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'complete-example / Check code format'
...
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
secrets: inherit
with:
branch: 'master'
branch: 'master'
30 changes: 0 additions & 30 deletions .github/workflows/semantic-releaser.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/static-checks.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
complete-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
secrets: inherit
with:
working_directory: './examples/complete/'

basic-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
secrets: inherit
with:
working_directory: './examples/basic/'

mysql-flexible-server-replication-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
secrets: inherit
with:
working_directory: './examples/mysql-flexible-server-replication/'
11 changes: 11 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-lint
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
2 changes: 1 addition & 1 deletion .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
secrets: inherit
with:
working_directory: '.'
working_directory: '.'
25 changes: 22 additions & 3 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Run `make readme` to rebuild the `README.md`
#


# Name of this project
name: Terraform AZURE FLEXIBLE MYSQL

Expand All @@ -19,20 +18,40 @@ badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v1.1.7-green"
url: "https://www.terraform.io"
- name: "tfsec"
image: "https://github.com/clouddrove/terraform-azure-flexible-mysql/actions/workflows/tfsec.yml/badge.svg"
url: "https://github.com/clouddrove/terraform-azure-flexible-mysql/actions/workflows/tfsec.yml"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"
- name: "Changelog"
image: "https://img.shields.io/badge/Changelog-blue"
url: "CHANGELOG.md"

# Prerequesties to display
prerequesties:
- name: Terraform
url: https://learn.hashicorp.com/terraform/getting-started/install.html
version: ">= 1.7.8"

providers:
- name: azure
url: https://azure.microsoft.com/
version: ">= 3.39.0"

module_dependencies:
- name: Labels Module
url: https://github.com/clouddrove/terraform-azure-labels
description: Provides resource tagging.

# description of this project
description: |-
Terraform module to create flexible-mysql resource on AZURE.

# extra content
include:
- "terraform.md"

# How to use this project
# yamllint disable rule:line-length
usage: |-
### Simple Example
Here is an example of how you can use this module in your inventory structure:
Expand Down
1 change: 0 additions & 1 deletion examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module "flexible-mysql" {
virtual_network_id = "/subscriptions/---------------<vnet_id>---------------"
delegated_subnet_id = "/subscriptions/---------------<delegated_subnet_id>---------------"
mysql_version = "8.0.21"
mysql_server_name = "testmysqlserver"
private_dns = true
zone = "1"
admin_username = "mysqlusername"
Expand Down
101 changes: 76 additions & 25 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
provider "azurerm" {
features {}
subscription_id = "068245d4-3c94-42fe-9c4d-9e5e1cabc60c"
}

provider "azurerm" {
features {}
alias = "peer"
subscription_id = "068245d4-3c94-42fe-9c4d-9e5e1cabc60c"
}

data "azurerm_client_config" "current_client_config" {}

locals {
name = "app"
environment = "test"
name = "lacoster-23"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert it to app and test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

environment = "maximum-32"
label_order = ["name", "environment"]
}

Expand Down Expand Up @@ -60,12 +69,52 @@ module "subnet" {
}
}

##-----------------------------------------------------------------------------
## Key Vault module call.
##-----------------------------------------------------------------------------
module "vault" {
source = "clouddrove/key-vault/azure"
version = "1.2.0"

providers = {
azurerm.dns_sub = azurerm.peer,
azurerm.main_sub = azurerm
}

name = "oliveware-23"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use local here in name and environment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

environment = "vilod-32"
label_order = ["name", "environment", ]
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
admin_objects_ids = [data.azurerm_client_config.current_client_config.object_id]
virtual_network_id = module.vnet.vnet_id[0]
subnet_id = module.subnet.default_subnet_id[0]
enable_rbac_authorization = true
enabled_for_disk_encryption = false
#private endpoint
enable_private_endpoint = false
network_acls = null
########Following to be uncommnented only when using DNS Zone from different subscription along with existing DNS zone.

# diff_sub = true
# alias = ""
# alias_sub = ""

#########Following to be uncommmented when using DNS zone from different resource group or different subscription.
# existing_private_dns_zone = ""
# existing_private_dns_zone_resource_group_name = ""

#### enable diagnostic setting
diagnostic_setting_enable = false
log_analytics_workspace_id = module.log-analytics.workspace_id ## when diagnostic_setting_enable enable, add log analytics workspace id
}

##-----------------------------------------------------------------------------
## Log Analytics module call.
##-----------------------------------------------------------------------------
module "log-analytics" {
source = "clouddrove/log-analytics/azure"
version = "1.0.1"
version = "1.1.0"
name = local.name
environment = local.environment
label_order = local.label_order
Expand All @@ -77,35 +126,37 @@ module "log-analytics" {
internet_query_enabled = true
resource_group_name = module.resource_group.resource_group_name
log_analytics_workspace_location = module.resource_group.resource_group_location
log_analytics_workspace_id = module.log-analytics.workspace_id
}

##-----------------------------------------------------------------------------
## Flexible Mysql server module call.
##-----------------------------------------------------------------------------
module "flexible-mysql" {
depends_on = [module.resource_group, module.vnet]
source = "../../"
name = local.name
environment = local.environment
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
virtual_network_id = module.vnet.vnet_id[0]
delegated_subnet_id = module.subnet.default_subnet_id[0]
mysql_version = "8.0.21"
mysql_server_name = "testmysqlserver"
private_dns = true
zone = "1"
admin_username = "mysqlusername"
admin_password = "ba5yatgfgfhdsv6A3ns2lu4gqzzc"
sku_name = "GP_Standard_D8ds_v4"
db_name = "maindb"
charset = "utf8mb3"
collation = "utf8mb3_unicode_ci"
auto_grow_enabled = true
iops = 360
size_gb = "20"
##azurerm_mysql_flexible_server_configuration
depends_on = [module.resource_group, module.vnet, module.vault]
source = "../../"
name = local.name
environment = local.environment
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
virtual_network_id = module.vnet.vnet_id[0]
delegated_subnet_id = module.subnet.default_subnet_id[0]
mysql_version = "8.0.21"
private_dns = true
zone = "1"
admin_username = "mysqlusername"
admin_password = "ba5yatgfgfhdsv6A3ns2lu4gqzzc"
sku_name = "GP_Standard_D8ds_v4"
db_name = "maindb"
charset = "utf8mb3"
collation = "utf8mb3_unicode_ci"
auto_grow_enabled = true
iops = 360
size_gb = "20"
server_configuration_names = ["interactive_timeout", "audit_log_enabled", "audit_log_events"]
values = ["600", "ON", "CONNECTION,ADMIN,DDL,TABLE_ACCESS"]
log_analytics_workspace_id = module.log-analytics.workspace_id
key_vault_id = module.vault.id
key_vault_with_rbac = true
cmk_enabled = true
}
Loading