Skip to content

Commit

Permalink
Add Container App and Container App Environment (Azure#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjcooney authored Nov 13, 2023
1 parent 528b026 commit 1a5d969
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ No modules.
| <a name="output_cdn_endpoint"></a> [cdn\_endpoint](#output\_cdn\_endpoint) | Cdn Endpoint |
| <a name="output_cdn_profile"></a> [cdn\_profile](#output\_cdn\_profile) | Cdn Profile |
| <a name="output_cognitive_account"></a> [cognitive\_account](#output\_cognitive\_account) | Cognitive Account |
| <a name="output_container_app"></a> [container\_app](#output\_container\_app) | Container App |
| <a name="output_container_app_environment"></a> [container\_app\_environment](#output\_container\_app\_environment) | Container App Environment |
| <a name="output_container_group"></a> [container\_group](#output\_container\_group) | Container Group |
| <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 |
Expand Down
2 changes: 2 additions & 0 deletions docs/defined_specs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ az = {
cloud_service = "cld"
notification_hubs = "ntf"
notification_hubs_namespace = "ntfns"
container_app = "ca"
container_app_environment = "cae"

// Databases
azure_sql_database_server = "sql"
Expand Down
28 changes: 28 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,26 @@ locals {
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-]+$"
}
container_app = {
name = substr(join("-", compact([local.prefix, "ca", local.suffix])), 0, 32)
name_unique = substr(join("-", compact([local.prefix, "ca", local.suffix_unique])), 0, 32)
dashes = true
slug = "ca"
min_length = 1
max_length = 32
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$"
}
container_app_environment = {
name = substr(join("-", compact([local.prefix, "cae", local.suffix])), 0, 60)
name_unique = substr(join("-", compact([local.prefix, "cae", local.suffix_unique])), 0, 60)
dashes = true
slug = "cae"
min_length = 1
max_length = 60
scope = "resourceGroup"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$"
}
container_group = {
name = substr(join("-", compact([local.prefix, "cg", local.suffix])), 0, 63)
name_unique = substr(join("-", compact([local.prefix, "cg", local.suffix_unique])), 0, 63)
Expand Down Expand Up @@ -2518,6 +2538,14 @@ locals {
valid_name = length(regexall(local.az.cognitive_account.regex, local.az.cognitive_account.name)) > 0 && length(local.az.cognitive_account.name) > local.az.cognitive_account.min_length
valid_name_unique = length(regexall(local.az.cognitive_account.regex, local.az.cognitive_account.name_unique)) > 0
}
container_app = {
valid_name = length(regexall(local.az.container_app.regex, local.az.container_app.name)) > 0 && length(local.az.container_app.name) > local.az.container_app.min_length
valid_name_unique = length(regexall(local.az.container_app.regex, local.az.container_app.name_unique)) > 0
}
container_app_environment = {
valid_name = length(regexall(local.az.container_app_environment.regex, local.az.container_app_environment.name)) > 0 && length(local.az.container_app_environment.name) > local.az.container_app_environment.min_length
valid_name_unique = length(regexall(local.az.container_app_environment.regex, local.az.container_app_environment.name_unique)) > 0
}
container_group = {
valid_name = length(regexall(local.az.container_group.regex, local.az.container_group.name)) > 0 && length(local.az.container_group.name) > local.az.container_group.min_length
valid_name_unique = length(regexall(local.az.container_group.regex, local.az.container_group.name_unique)) > 0
Expand Down
10 changes: 10 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ output "cognitive_account" {
description = "Cognitive Account"
}

output "container_app" {
value = local.az.container_app
description = "Container App"
}

output "container_app_environment" {
value = local.az.container_app_environment
description = "Container App Environment"
}

output "container_group" {
value = local.az.container_group
description = "Container Group"
Expand Down
22 changes: 22 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,28 @@
"slug": "cog",
"dashes": true
},
{
"name": "container_app",
"length": {
"min": 1,
"max": 32
},
"regex": "^(?=.{1,32}$)(?!.*--)[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$",
"scope": "resourceGroup",
"slug": "ca",
"dashes": true
},
{
"name": "container_app_environment",
"length": {
"min": 1,
"max": 60
},
"regex": "^(?=.{1,32}$)(?!.*--)[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$",
"scope": "resourceGroup",
"slug": "cae",
"dashes": true
},
{
"name": "container_group",
"length": {
Expand Down

0 comments on commit 1a5d969

Please sign in to comment.