Skip to content

Commit

Permalink
Add NAT Gateway (Azure#99)
Browse files Browse the repository at this point in the history
* Add NAT Gateway resource

* Fix JSON format
  • Loading branch information
Pierca7 authored Nov 13, 2023
1 parent 1a5d969 commit 4ca9561
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ No modules.
| <a name="output_mysql_firewall_rule"></a> [mysql\_firewall\_rule](#output\_mysql\_firewall\_rule) | Mysql Firewall Rule |
| <a name="output_mysql_server"></a> [mysql\_server](#output\_mysql\_server) | Mysql Server |
| <a name="output_mysql_virtual_network_rule"></a> [mysql\_virtual\_network\_rule](#output\_mysql\_virtual\_network\_rule) | Mysql Virtual Network Rule |
| <a name="output_nat_gateway"></a> [nat\_gateway](#output\_nat\_gateway) | NAT Gateway |
| <a name="output_network_ddos_protection_plan"></a> [network\_ddos\_protection\_plan](#output\_network\_ddos\_protection\_plan) | Network Ddos Protection Plan |
| <a name="output_network_interface"></a> [network\_interface](#output\_network\_interface) | Network Interface |
| <a name="output_network_security_group"></a> [network\_security\_group](#output\_network\_security\_group) | Network Security Group |
Expand Down
1 change: 0 additions & 1 deletion docs/missing_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
- spatial_anchors_account
- scheduled_query_rule_log
- express_route_circuit_authorization
- nat_gateway
- network_packet_capture
- network_profile
- packet_capture //deprecated
Expand Down
14 changes: 14 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,16 @@ locals {
scope = "parent"
regex = "^[a-zA-Z0-9-_]+$"
}
nat_gateway = {
name = substr(join("-", compact([local.prefix, "ng", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "ng", local.suffix_unique])), 0, 80)
dashes = true
slug = "ng"
min_length = 1
max_length = 80
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$"
}
network_ddos_protection_plan = {
name = substr(join("-", compact([local.prefix, "ddospp", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "ddospp", local.suffix_unique])), 0, 80)
Expand Down Expand Up @@ -2998,6 +3008,10 @@ locals {
valid_name = length(regexall(local.az.mysql_virtual_network_rule.regex, local.az.mysql_virtual_network_rule.name)) > 0 && length(local.az.mysql_virtual_network_rule.name) > local.az.mysql_virtual_network_rule.min_length
valid_name_unique = length(regexall(local.az.mysql_virtual_network_rule.regex, local.az.mysql_virtual_network_rule.name_unique)) > 0
}
nat_gateway = {
valid_name = length(regexall(local.az.nat_gateway.regex, local.az.nat_gateway.name)) > 0 && length(local.az.nat_gateway.name) > local.az.nat_gateway.min_length
valid_name_unique = length(regexall(local.az.nat_gateway.regex, local.az.nat_gateway.name_unique)) > 0
}
network_ddos_protection_plan = {
valid_name = length(regexall(local.az.network_ddos_protection_plan.regex, local.az.network_ddos_protection_plan.name)) > 0 && length(local.az.network_ddos_protection_plan.name) > local.az.network_ddos_protection_plan.min_length
valid_name_unique = length(regexall(local.az.network_ddos_protection_plan.regex, local.az.network_ddos_protection_plan.name_unique)) > 0
Expand Down
8 changes: 7 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ output "app_service" {
}

output "app_service_environment" {
value = local.az.app_service_environment
value = local.az.app_service_environment
description = "App Service Environment"
}

output "app_service_plan" {
Expand Down Expand Up @@ -735,6 +736,11 @@ output "mysql_virtual_network_rule" {
description = "Mysql Virtual Network Rule"
}

output "nat_gateway" {
value = local.az.nat_gateway
description = "Nat Gateway"
}

output "network_ddos_protection_plan" {
value = local.az.network_ddos_protection_plan
description = "Network Ddos Protection Plan"
Expand Down
11 changes: 11 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,17 @@
"slug": "mysqlvn",
"dashes": true
},
{
"name": "nat_gateway",
"length": {
"min": 1,
"max": 80
},
"regex": "^(?=.{1,80}$)[a-zA-Z0-9][a-zA-Z0-9-._]+[a-zA-Z0-9_]$",
"scope": "resourceGroup",
"slug": "ng",
"dashes": true
},
{
"name": "network_interface",
"length": {
Expand Down

0 comments on commit 4ca9561

Please sign in to comment.