-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add container app module * fix local variables names and format * add container_app variables in example module * name container_app resources in a plural form * add scale_rule support to container_app * add attributes to cae module
- Loading branch information
1 parent
88f840f
commit ea8a5dd
Showing
34 changed files
with
1,176 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module "container_app_dapr_components" { | ||
source = "./modules/compute/container_app_dapr_component" | ||
for_each = local.compute.container_app_dapr_components | ||
|
||
base_tags = local.global_settings.inherit_tags | ||
container_app_environment_id = can(each.value.container_app_environment_id) ? each.value.container_app_environment_id : local.combined_objects_container_app_environments[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.container_app_environment_key].id | ||
client_config = local.client_config | ||
global_settings = local.global_settings | ||
settings = each.value | ||
} | ||
|
||
output "container_app_dapr_components" { | ||
value = module.container_app_dapr_components | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module "container_app_environment_certificates" { | ||
source = "./modules/compute/container_app_environment_certificate" | ||
for_each = local.compute.container_app_environment_certificates | ||
|
||
base_tags = local.global_settings.inherit_tags | ||
container_app_environment_id = can(each.value.container_app_environment_id) ? each.value.container_app_environment_id : local.combined_objects_container_app_environments[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.container_app_environment_key].id | ||
client_config = local.client_config | ||
global_settings = local.global_settings | ||
settings = each.value | ||
} | ||
|
||
output "container_app_environment_certificates" { | ||
value = module.container_app_environment_certificates | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module "container_app_environment_storages" { | ||
source = "./modules/compute/container_app_environment_storage" | ||
for_each = local.compute.container_app_environment_storages | ||
|
||
base_tags = local.global_settings.inherit_tags | ||
container_app_environment_id = can(each.value.container_app_environment_id) ? each.value.container_app_environment_id : local.combined_objects_container_app_environments[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.container_app_environment_key].id | ||
client_config = local.client_config | ||
global_settings = local.global_settings | ||
combined_resources = { | ||
storage_accounts = local.combined_objects_storage_accounts | ||
} | ||
settings = each.value | ||
} | ||
|
||
output "container_app_environment_storages" { | ||
value = module.container_app_environment_storages | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module "container_app_environments" { | ||
source = "./modules/compute/container_app_environment" | ||
for_each = local.compute.container_app_environments | ||
|
||
location = can(local.global_settings.regions[each.value.region]) ? local.global_settings.regions[each.value.region] : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group.key, each.value.resource_group_key)].location | ||
resource_group = local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group_key, each.value.resource_group.key)] | ||
resource_group_name = can(each.value.resource_group.name) || can(each.value.resource_group_name) ? try(each.value.resource_group.name, each.value.resource_group_name) : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group_key, each.value.resource_group.key)].name | ||
base_tags = local.global_settings.inherit_tags | ||
subnet_id = can(each.value.subnet_id) ? each.value.subnet_id : try(local.combined_objects_networking[try(each.value.vnet.lz_key, local.client_config.landingzone_key)][each.value.vnet.vnet_key].subnets[each.value.vnet.subnet_key].id, null) | ||
client_config = local.client_config | ||
combined_diagnostics = local.combined_diagnostics | ||
diagnostic_profiles = try(each.value.diagnostic_profiles, {}) | ||
diagnostics = local.combined_diagnostics | ||
global_settings = local.global_settings | ||
settings = each.value | ||
} | ||
|
||
output "container_app_environments" { | ||
value = module.container_app_environments | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module "container_apps" { | ||
source = "./modules/compute/container_app" | ||
for_each = local.compute.container_apps | ||
|
||
location = can(local.global_settings.regions[each.value.region]) ? local.global_settings.regions[each.value.region] : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group.key, each.value.resource_group_key)].location | ||
resource_group = local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group_key, each.value.resource_group.key)] | ||
resource_group_name = can(each.value.resource_group.name) || can(each.value.resource_group_name) ? try(each.value.resource_group.name, each.value.resource_group_name) : local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group_key, each.value.resource_group.key)].name | ||
base_tags = local.global_settings.inherit_tags | ||
container_app_environment_id = can(each.value.container_app_environment_id) ? each.value.container_app_environment_id : local.combined_objects_container_app_environments[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.container_app_environment_key].id | ||
client_config = local.client_config | ||
combined_diagnostics = local.combined_diagnostics | ||
diagnostic_profiles = try(each.value.diagnostic_profiles, {}) | ||
diagnostics = local.combined_diagnostics | ||
combined_resources = { | ||
keyvaults = local.combined_objects_keyvaults | ||
managed_identities = local.combined_objects_managed_identities | ||
container_app_environment_certificates = local.combined_objects_container_app_environment_certificates | ||
container_app_environment_storages = local.combined_objects_container_app_environment_storages | ||
} | ||
global_settings = local.global_settings | ||
settings = each.value | ||
} | ||
|
||
output "container_apps" { | ||
value = module.container_apps | ||
} | ||
|
52 changes: 52 additions & 0 deletions
52
examples/compute/container_app/101-simple-container-app-env/configuration.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
global_settings = { | ||
default_region = "region1" | ||
regions = { | ||
region1 = "canadacentral" | ||
} | ||
} | ||
|
||
resource_groups = { | ||
rg1 = { | ||
name = "container-app-001" | ||
region = "region1" | ||
} | ||
} | ||
|
||
diagnostic_log_analytics = { | ||
central_logs_region1 = { | ||
region = "region1" | ||
name = "logs" | ||
resource_group_key = "rg1" | ||
} | ||
} | ||
|
||
container_app_environments = { | ||
cae1 = { | ||
name = "cont-app-env-001" | ||
region = "region1" | ||
resource_group_key = "rg1" | ||
log_analytics_key = "central_logs_region1" | ||
} | ||
} | ||
|
||
container_apps = { | ||
ca1 = { | ||
name = "nginx-app" | ||
container_app_environment_key = "cae1" | ||
resource_group_key = "rg1" | ||
|
||
revision_mode = "Single" | ||
template = { | ||
container = { | ||
cont1 = { | ||
name = "nginx" | ||
image = "nginx:latest" | ||
cpu = 0.5 | ||
memory = "1Gi" | ||
} | ||
} | ||
min_replicas = 1 | ||
max_replicas = 1 | ||
} | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
examples/compute/container_app/102-simple-private-container-app-env/configuration.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
global_settings = { | ||
default_region = "region1" | ||
regions = { | ||
region1 = "canadacentral" | ||
} | ||
} | ||
|
||
resource_groups = { | ||
rg1 = { | ||
name = "container-app-001" | ||
region = "region1" | ||
} | ||
} | ||
|
||
diagnostic_log_analytics = { | ||
central_logs_region1 = { | ||
region = "region1" | ||
name = "logs" | ||
resource_group_key = "rg1" | ||
} | ||
} | ||
|
||
vnets = { | ||
cae_re1 = { | ||
resource_group_key = "rg1" | ||
region = "region1" | ||
vnet = { | ||
name = "container-app-network" | ||
address_space = ["100.64.0.0/20"] | ||
} | ||
specialsubnets = {} | ||
subnets = { | ||
cae1 = { | ||
name = "container-app-snet" | ||
cidr = ["100.64.0.0/21"] | ||
nsg_key = "empty_nsg" | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
network_security_group_definition = { | ||
# This entry is applied to all subnets with no NSG defined | ||
empty_nsg = {} | ||
} | ||
|
||
container_app_environments = { | ||
cae1 = { | ||
name = "cont-app-env-001" | ||
region = "region1" | ||
resource_group_key = "rg1" | ||
log_analytics_key = "central_logs_region1" | ||
vnet = { | ||
vnet_key = "cae_re1" | ||
subnet_key = "cae1" | ||
} | ||
internal_load_balancer_enabled = true | ||
|
||
tags = { | ||
environment = "testing" | ||
} | ||
} | ||
} | ||
|
||
container_apps = { | ||
ca1 = { | ||
name = "nginx-app" | ||
container_app_environment_key = "cae1" | ||
resource_group_key = "rg1" | ||
|
||
revision_mode = "Single" | ||
template = { | ||
container = { | ||
cont1 = { | ||
name = "nginx" | ||
image = "nginx:latest" | ||
cpu = 0.5 | ||
memory = "1Gi" | ||
} | ||
} | ||
min_replicas = 1 | ||
max_replicas = 1 | ||
} | ||
} | ||
} |
Oops, something went wrong.