Skip to content

Commit 948bcd9

Browse files
authored
fix: Deprecations and Errors (#18)
* fix: Deprecations and Errors * fix: mssql server and database arguments * fix: added random and null in required provider
1 parent f724dcd commit 948bcd9

File tree

14 files changed

+333
-357
lines changed

14 files changed

+333
-357
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
.github/* @clouddrove/approvers
2-
3-
* @clouddrove/clouddrovians @clouddrove/approvers
4-
5-
.github/mergify.yml @clouddrove/admins
6-
.github/CODEOWNERS @clouddrove/admins
1+
# These owners will be the default owners for everything in the repo.
2+
* @anmolnagpal @clouddrove-ci @clouddrove/terraform-azure-admins
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Auto Assign PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
workflow_dispatch:
8+
jobs:
9+
assignee:
10+
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master
11+
secrets:
12+
GITHUB: ${{ secrets.GITHUB }}
13+
with:
14+
assignees: 'clouddrove-ci'

.github/workflows/automerge.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Auto merge
3+
on:
4+
pull_request:
5+
jobs:
6+
auto-merge:
7+
uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master
8+
secrets:
9+
GITHUB: ${{ secrets.GITHUB }}
10+
with:
11+
tfcheck: 'basic-example / Check code format'
12+
...

.github/workflows/readme.yml

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,15 @@
1-
name: 'Create README.md file'
1+
name: Readme Workflow
22
on:
33
push:
44
branches:
55
- master
6-
6+
paths-ignore:
7+
- 'README.md'
8+
- 'docs/**'
9+
workflow_dispatch:
710
jobs:
8-
readme-create:
9-
name: 'readme-create'
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: 'Checkout'
13-
uses: actions/checkout@master
14-
15-
- name: 'Set up Python 3.7'
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.x'
19-
20-
- name: 'create readme'
21-
uses: 'clouddrove/github-actions@v9.0.2'
22-
with:
23-
actions_subcommand: 'readme'
24-
github_token: '${{ secrets.GITHUB }}'
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
28-
29-
- name: 'pre-commit check errors'
30-
uses: pre-commit/action@v2.0.0
31-
continue-on-error: true
32-
33-
- name: 'pre-commit fix erros'
34-
uses: pre-commit/action@v2.0.0
35-
continue-on-error: true
36-
37-
- name: 'push readme'
38-
uses: 'clouddrove/github-actions@v9.0.2'
39-
continue-on-error: true
40-
with:
41-
actions_subcommand: 'push'
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
45-
- name: 'Slack Notification'
46-
uses: clouddrove/action-slack@v2
47-
with:
48-
status: ${{ job.status }}
49-
fields: repo,author
50-
author_name: 'CloudDrove'
51-
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
53-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
54-
if: always()
11+
README:
12+
uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master
13+
secrets:
14+
TOKEN : ${{ secrets.GITHUB }}
15+
SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }}

.github/workflows/semantic-releaser.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/static-checks.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/tf-checks.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: tf-checks
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
workflow_dispatch:
7+
jobs:
8+
complete-example:
9+
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
10+
with:
11+
working_directory: './examples/Simple_SQL_Single_Database_with_Private_Endpoint/'

.github/workflows/tflint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: tf-lint
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
workflow_dispatch:
7+
jobs:
8+
tf-lint:
9+
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master
10+
secrets:
11+
GITHUB: ${{ secrets.GITHUB }}

examples/Simple_SQL_Single_Database_with_Private_Endpoint/main.tf

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
provider "azurerm" {
22
features {}
3+
subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX"
34
}
4-
5+
##-----------------------------------------------------------------------------
6+
## Resource Group
7+
##-----------------------------------------------------------------------------
58
module "resource_group" {
6-
source = "clouddrove/resource-group/azure"
7-
version = "1.0.2"
8-
9+
source = "clouddrove/resource-group/azure"
10+
version = "1.0.2"
911
name = "app"
1012
environment = "test"
1113
label_order = ["name", "environment"]
1214
location = "Canada Central"
1315
}
1416

17+
##-----------------------------------------------------------------------------
18+
## Vnet
19+
##-----------------------------------------------------------------------------
1520
module "vnet" {
1621
source = "clouddrove/vnet/azure"
1722
version = "1.0.4"
@@ -22,9 +27,12 @@ module "vnet" {
2227
address_spaces = ["10.0.0.0/16"]
2328
}
2429

30+
##-----------------------------------------------------------------------------
31+
## Subnet
32+
##-----------------------------------------------------------------------------
2533
module "subnet" {
2634
source = "clouddrove/subnet/azure"
27-
version = "1.1.0"
35+
version = "1.2.1"
2836
name = "app"
2937
environment = "test"
3038
resource_group_name = module.resource_group.resource_group_name
@@ -46,11 +54,28 @@ module "subnet" {
4654
]
4755
}
4856

57+
##-----------------------------------------------------------------------------
58+
## Log Analytics
59+
##-----------------------------------------------------------------------------
60+
module "log-analytics" {
61+
source = "clouddrove/log-analytics/azure"
62+
version = "1.1.0"
63+
name = "app"
64+
environment = "test"
65+
label_order = ["name", "environment"]
66+
create_log_analytics_workspace = true
67+
log_analytics_workspace_sku = "PerGB2018"
68+
resource_group_name = module.resource_group.resource_group_name
69+
log_analytics_workspace_location = module.resource_group.resource_group_location
70+
log_analytics_workspace_id = module.log-analytics.workspace_id
71+
}
4972

73+
##-----------------------------------------------------------------------------
74+
## Mssql Server database
75+
##-----------------------------------------------------------------------------
5076
module "mssql-server" {
51-
depends_on = [module.resource_group, module.vnet]
52-
source = "clouddrove/mssql-db/azure"
53-
77+
depends_on = [module.resource_group, module.vnet]
78+
source = "../.."
5479
name = "app"
5580
environment = "test"
5681
create_resource_group = false
@@ -59,11 +84,12 @@ module "mssql-server" {
5984

6085
sqlserver_name = "mssqldbserver"
6186
database_name = "demomssqldb"
62-
sql_database_edition = "Standard"
63-
sqldb_service_objective_name = "S1"
87+
db_sku_name = "Basic"
6488
sql_server_version = "12.0"
6589
enable_threat_detection_policy = true
6690
enable_private_endpoint = true
6791
virtual_network_name = module.vnet.vnet_name
6892
existing_subnet_id = module.subnet.default_subnet_id[0]
93+
enable_diagnostic = false
94+
# log_analytics_workspace_id = module.log-analytics.workspace_id (Use it when enable_diagnostic = true)
6995
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
terraform {
2+
required_version = ">=1.6.6"
3+
}
4+
5+
terraform {
6+
required_providers {
7+
azurerm = {
8+
source = "hashicorp/azurerm"
9+
version = ">=3.112.0"
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)