Skip to content

Commit

Permalink
Update build, Added new resources (Azure#73)
Browse files Browse the repository at this point in the history
* Ignore .terraform.lock.hcl generated during make

* Add firewall_policy
Add firewall_policy_rule_collection_group

* Upgrade terraform-docs to current version

* Update pre-commit hooks and README.md

* Add description to improve searchability

* Add Managed Cassandra resource support

* Add virtual_network_gateway_connection

* Correct virtual_network_gateway_connection scope

* Update pre-commit hooks so they match upstream changes

* Reverted wront provider version on doc caused by leftover lock file

* feat: ✨ Add cosmosdb postgres

* chore: 🔧 Update terraform files
  • Loading branch information
daniel-anova authored May 27, 2023
1 parent 87755e9 commit 3c1d123
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.terraform/

*.tfstate*
terraform-azurerm-naming
.terraform.lock.hcl
.terraform.lock.hcl
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: terraform_fmt
- id: terraform_docs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ postgresql_server = {

| Name | Version |
|------|---------|
| <a name="provider_random"></a> [random](#provider\_random) | 3.3.2 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.4.3 |

## Modules

Expand Down Expand Up @@ -157,6 +157,9 @@ No modules.
| <a name="output_container_registry"></a> [container\_registry](#output\_container\_registry) | Container Registry |
| <a name="output_container_registry_webhook"></a> [container\_registry\_webhook](#output\_container\_registry\_webhook) | Container Registry Webhook |
| <a name="output_cosmosdb_account"></a> [cosmosdb\_account](#output\_cosmosdb\_account) | Cosmosdb Account |
| <a name="output_cosmosdb_cassandra_cluster"></a> [cosmosdb\_cassandra\_cluster](#output\_cosmosdb\_cassandra\_cluster) | Cosmosdb Cassandra Cluster |
| <a name="output_cosmosdb_cassandra_datacenter"></a> [cosmosdb\_cassandra\_datacenter](#output\_cosmosdb\_cassandra\_datacenter) | Cosmosdb Cassandra Datacenter |
| <a name="output_cosmosdb_postgres"></a> [cosmosdb\_postgres](#output\_cosmosdb\_postgres) | Cosmosdb Postgres |
| <a name="output_custom_provider"></a> [custom\_provider](#output\_custom\_provider) | Custom Provider |
| <a name="output_dashboard"></a> [dashboard](#output\_dashboard) | Dashboard |
| <a name="output_data_factory"></a> [data\_factory](#output\_data\_factory) | Data Factory |
Expand Down Expand Up @@ -211,6 +214,8 @@ No modules.
| <a name="output_firewall_ip_configuration"></a> [firewall\_ip\_configuration](#output\_firewall\_ip\_configuration) | Firewall Ip Configuration |
| <a name="output_firewall_nat_rule_collection"></a> [firewall\_nat\_rule\_collection](#output\_firewall\_nat\_rule\_collection) | Firewall Nat Rule Collection |
| <a name="output_firewall_network_rule_collection"></a> [firewall\_network\_rule\_collection](#output\_firewall\_network\_rule\_collection) | Firewall Network Rule Collection |
| <a name="output_firewall_policy"></a> [firewall\_policy](#output\_firewall\_policy) | Firewall Policy |
| <a name="output_firewall_policy_rule_collection_group"></a> [firewall\_policy\_rule\_collection\_group](#output\_firewall\_policy\_rule\_collection\_group) | Firewall Policy Rule Collection Group |
| <a name="output_frontdoor"></a> [frontdoor](#output\_frontdoor) | Frontdoor |
| <a name="output_frontdoor_firewall_policy"></a> [frontdoor\_firewall\_policy](#output\_frontdoor\_firewall\_policy) | Frontdoor Firewall Policy |
| <a name="output_function_app"></a> [function\_app](#output\_function\_app) | Function App |
Expand Down Expand Up @@ -353,11 +358,11 @@ No modules.
| <a name="output_virtual_machine_scale_set_extension"></a> [virtual\_machine\_scale\_set\_extension](#output\_virtual\_machine\_scale\_set\_extension) | Virtual Machine Scale Set Extension |
| <a name="output_virtual_network"></a> [virtual\_network](#output\_virtual\_network) | Virtual Network |
| <a name="output_virtual_network_gateway"></a> [virtual\_network\_gateway](#output\_virtual\_network\_gateway) | Virtual Network Gateway |
| <a name="output_virtual_network_gateway_connection"></a> [virtual\_network\_gateway\_connection](#output\_virtual\_network\_gateway\_connection) | Virtual Network Gateway Connection |
| <a name="output_virtual_network_peering"></a> [virtual\_network\_peering](#output\_virtual\_network\_peering) | Virtual Network Peering |
| <a name="output_virtual_wan"></a> [virtual\_wan](#output\_virtual\_wan) | Virtual Wan |
| <a name="output_windows_virtual_machine"></a> [windows\_virtual\_machine](#output\_windows\_virtual\_machine) | Windows Virtual Machine |
| <a name="output_windows_virtual_machine_scale_set"></a> [windows\_virtual\_machine\_scale\_set](#output\_windows\_virtual\_machine\_scale\_set) | Windows Virtual Machine Scale Set |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

# Contributing
Expand Down
84 changes: 84 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,36 @@ locals {
scope = "resourceGroup"
regex = "^[a-z0-9][a-z0-9-_.]+[a-z0-9]$"
}
cosmosdb_cassandra_cluster = {
name = substr(join("-", compact([local.prefix, "mcc", local.suffix])), 0, 44)
name_unique = substr(join("-", compact([local.prefix, "mcc", local.suffix_unique])), 0, 44)
dashes = true
slug = "mcc"
min_length = 1
max_length = 44
scope = "parent"
regex = "^[a-z0-9][a-zA-Z0-9-]+[a-z0-9]$"
}
cosmosdb_cassandra_datacenter = {
name = substr(join("-", compact([local.prefix, "mcdc", local.suffix])), 0, 44)
name_unique = substr(join("-", compact([local.prefix, "mcdc", local.suffix_unique])), 0, 44)
dashes = true
slug = "mcdc"
min_length = 1
max_length = 44
scope = "parent"
regex = "^[a-z0-9][a-zA-Z0-9-]+[a-z0-9]$"
}
cosmosdb_postgres = {
name = substr(join("-", compact([local.prefix, "cospos", local.suffix])), 0, 63)
name_unique = substr(join("-", compact([local.prefix, "cospos", local.suffix_unique])), 0, 63)
dashes = true
slug = "cospos"
min_length = 1
max_length = 63
scope = "resourceGroup"
regex = "^[a-z0-9][a-z0-9-_.]+[a-z0-9]$"
}
custom_provider = {
name = substr(join("-", compact([local.prefix, "prov", local.suffix])), 0, 64)
name_unique = substr(join("-", compact([local.prefix, "prov", local.suffix_unique])), 0, 64)
Expand Down Expand Up @@ -916,6 +946,26 @@ locals {
scope = "parent"
regex = "^[a-zA-Z0-9][a-zA-Z0-9\\-\\._]+[a-zA-Z0-9_]$"
}
firewall_policy = {
name = substr(join("-", compact([local.prefix, "afwp", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "afwp", local.suffix_unique])), 0, 80)
dashes = true
slug = "afwp"
min_length = 1
max_length = 80
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$"
}
firewall_policy_rule_collection_group = {
name = substr(join("-", compact([local.prefix, "fwprcg", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "fwprcg", local.suffix_unique])), 0, 80)
dashes = true
slug = "fwprcg"
min_length = 1
max_length = 80
scope = "parent"
regex = "^[a-zA-Z0-9][a-zA-Z0-9\\-\\._]+[a-zA-Z0-9_]$"
}
frontdoor = {
name = substr(join("-", compact([local.prefix, "fd", local.suffix])), 0, 64)
name_unique = substr(join("-", compact([local.prefix, "fd", local.suffix_unique])), 0, 64)
Expand Down Expand Up @@ -2276,6 +2326,16 @@ locals {
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$"
}
virtual_network_gateway_connection = {
name = substr(join("-", compact([local.prefix, "vcn", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "vcn", local.suffix_unique])), 0, 80)
dashes = true
slug = "vcn"
min_length = 1
max_length = 80
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$"
}
virtual_network_peering = {
name = substr(join("-", compact([local.prefix, "vpeer", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "vpeer", local.suffix_unique])), 0, 80)
Expand Down Expand Up @@ -2454,6 +2514,18 @@ locals {
valid_name = length(regexall(local.az.cosmosdb_account.regex, local.az.cosmosdb_account.name)) > 0 && length(local.az.cosmosdb_account.name) > local.az.cosmosdb_account.min_length
valid_name_unique = length(regexall(local.az.cosmosdb_account.regex, local.az.cosmosdb_account.name_unique)) > 0
}
cosmosdb_cassandra_cluster = {
valid_name = length(regexall(local.az.cosmosdb_cassandra_cluster.regex, local.az.cosmosdb_cassandra_cluster.name)) > 0 && length(local.az.cosmosdb_cassandra_cluster.name) > local.az.cosmosdb_cassandra_cluster.min_length
valid_name_unique = length(regexall(local.az.cosmosdb_cassandra_cluster.regex, local.az.cosmosdb_cassandra_cluster.name_unique)) > 0
}
cosmosdb_cassandra_datacenter = {
valid_name = length(regexall(local.az.cosmosdb_cassandra_datacenter.regex, local.az.cosmosdb_cassandra_datacenter.name)) > 0 && length(local.az.cosmosdb_cassandra_datacenter.name) > local.az.cosmosdb_cassandra_datacenter.min_length
valid_name_unique = length(regexall(local.az.cosmosdb_cassandra_datacenter.regex, local.az.cosmosdb_cassandra_datacenter.name_unique)) > 0
}
cosmosdb_postgres = {
valid_name = length(regexall(local.az.cosmosdb_postgres.regex, local.az.cosmosdb_postgres.name)) > 0 && length(local.az.cosmosdb_postgres.name) > local.az.cosmosdb_postgres.min_length
valid_name_unique = length(regexall(local.az.cosmosdb_postgres.regex, local.az.cosmosdb_postgres.name_unique)) > 0
}
custom_provider = {
valid_name = length(regexall(local.az.custom_provider.regex, local.az.custom_provider.name)) > 0 && length(local.az.custom_provider.name) > local.az.custom_provider.min_length
valid_name_unique = length(regexall(local.az.custom_provider.regex, local.az.custom_provider.name_unique)) > 0
Expand Down Expand Up @@ -2670,6 +2742,14 @@ locals {
valid_name = length(regexall(local.az.firewall_network_rule_collection.regex, local.az.firewall_network_rule_collection.name)) > 0 && length(local.az.firewall_network_rule_collection.name) > local.az.firewall_network_rule_collection.min_length
valid_name_unique = length(regexall(local.az.firewall_network_rule_collection.regex, local.az.firewall_network_rule_collection.name_unique)) > 0
}
firewall_policy = {
valid_name = length(regexall(local.az.firewall_policy.regex, local.az.firewall_policy.name)) > 0 && length(local.az.firewall_policy.name) > local.az.firewall_policy.min_length
valid_name_unique = length(regexall(local.az.firewall_policy.regex, local.az.firewall_policy.name_unique)) > 0
}
firewall_policy_rule_collection_group = {
valid_name = length(regexall(local.az.firewall_policy_rule_collection_group.regex, local.az.firewall_policy_rule_collection_group.name)) > 0 && length(local.az.firewall_policy_rule_collection_group.name) > local.az.firewall_policy_rule_collection_group.min_length
valid_name_unique = length(regexall(local.az.firewall_policy_rule_collection_group.regex, local.az.firewall_policy_rule_collection_group.name_unique)) > 0
}
frontdoor = {
valid_name = length(regexall(local.az.frontdoor.regex, local.az.frontdoor.name)) > 0 && length(local.az.frontdoor.name) > local.az.frontdoor.min_length
valid_name_unique = length(regexall(local.az.frontdoor.regex, local.az.frontdoor.name_unique)) > 0
Expand Down Expand Up @@ -3214,6 +3294,10 @@ locals {
valid_name = length(regexall(local.az.virtual_network_gateway.regex, local.az.virtual_network_gateway.name)) > 0 && length(local.az.virtual_network_gateway.name) > local.az.virtual_network_gateway.min_length
valid_name_unique = length(regexall(local.az.virtual_network_gateway.regex, local.az.virtual_network_gateway.name_unique)) > 0
}
virtual_network_gateway_connection = {
valid_name = length(regexall(local.az.virtual_network_gateway_connection.regex, local.az.virtual_network_gateway_connection.name)) > 0 && length(local.az.virtual_network_gateway_connection.name) > local.az.virtual_network_gateway_connection.min_length
valid_name_unique = length(regexall(local.az.virtual_network_gateway_connection.regex, local.az.virtual_network_gateway_connection.name_unique)) > 0
}
virtual_network_peering = {
valid_name = length(regexall(local.az.virtual_network_peering.regex, local.az.virtual_network_peering.name)) > 0 && length(local.az.virtual_network_peering.name) > local.az.virtual_network_peering.min_length
valid_name_unique = length(regexall(local.az.virtual_network_peering.regex, local.az.virtual_network_peering.name_unique)) > 0
Expand Down
30 changes: 30 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ output "cosmosdb_account" {
description = "Cosmosdb Account"
}

output "cosmosdb_cassandra_cluster" {
value = local.az.cosmosdb_cassandra_cluster
description = "Cosmosdb Cassandra Cluster"
}

output "cosmosdb_cassandra_datacenter" {
value = local.az.cosmosdb_cassandra_datacenter
description = "Cosmosdb Cassandra Datacenter"
}

output "cosmosdb_postgres" {
value = local.az.cosmosdb_postgres
description = "Cosmosdb Postgres"
}

output "custom_provider" {
value = local.az.custom_provider
description = "Custom Provider"
Expand Down Expand Up @@ -446,6 +461,16 @@ output "firewall_network_rule_collection" {
description = "Firewall Network Rule Collection"
}

output "firewall_policy" {
value = local.az.firewall_policy
description = "Firewall Policy"
}

output "firewall_policy_rule_collection_group" {
value = local.az.firewall_policy_rule_collection_group
description = "Firewall Policy Rule Collection Group"
}

output "frontdoor" {
value = local.az.frontdoor
description = "Frontdoor"
Expand Down Expand Up @@ -1126,6 +1151,11 @@ output "virtual_network_gateway" {
description = "Virtual Network Gateway"
}

output "virtual_network_gateway_connection" {
value = local.az.virtual_network_gateway_connection
description = "Virtual Network Gateway Connection"
}

output "virtual_network_peering" {
value = local.az.virtual_network_peering
description = "Virtual Network Peering"
Expand Down
33 changes: 33 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,17 @@
"slug": "cosmos",
"dashes": true
},
{
"name": "cosmosdb_postgres",
"length": {
"min": 1,
"max": 63
},
"regex": "^(?=.{1,63}$)[a-z0-9][a-z0-9-_.]+[a-z0-9]$",
"scope": "resourceGroup",
"slug": "cospos",
"dashes": true
},
{
"name": "custom_provider",
"length": {
Expand Down Expand Up @@ -802,6 +813,17 @@
"slug": "fw",
"dashes": true
},
{
"name": "firewall_policy",
"length": {
"min": 1,
"max": 80
},
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
"scope": "resourceGroup",
"slug": "afwp",
"dashes": true
},
{
"name": "frontdoor",
"length": {
Expand Down Expand Up @@ -2133,6 +2155,17 @@
"slug": "vgw",
"dashes": true
},
{
"name": "virtual_network_gateway_connection",
"length": {
"min": 1,
"max": 80
},
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
"scope": "resourceGroup",
"slug": "vcn",
"dashes": true
},
{
"name": "virtual_network_peering",
"length": {
Expand Down
33 changes: 33 additions & 0 deletions resourceDefinition_out_of_docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,39 @@
"slug": "fwnetrc",
"dashes": true
},
{
"name": "firewall_policy_rule_collection_group",
"length": {
"min": 1,
"max": 80
},
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9\\\\-\\\\._]+[a-zA-Z0-9_]$",
"scope": "parent",
"slug": "fwprcg",
"dashes": true
},
{
"name": "cosmosdb_cassandra_cluster",
"length": {
"min": 1,
"max": 44
},
"regex": "^(?=.{3,63}$)[a-z0-9][a-zA-Z0-9-]+[a-z0-9]$",
"scope": "parent",
"slug": "mcc",
"dashes": true
},
{
"name": "cosmosdb_cassandra_datacenter",
"length": {
"min": 1,
"max": 44
},
"regex": "^(?=.{3,63}$)[a-z0-9][a-zA-Z0-9-]+[a-z0-9]$",
"scope": "parent",
"slug": "mcdc",
"dashes": true
},
{
"name": "network_ddos_protection_plan",
"length": {
Expand Down

0 comments on commit 3c1d123

Please sign in to comment.