Skip to content

Commit

Permalink
name container_app resources in a plural form
Browse files Browse the repository at this point in the history
  • Loading branch information
trapeznikov committed Nov 1, 2023
1 parent d6cf79d commit d9ec19b
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "container_app_dapr_component" {
module "container_app_dapr_components" {
source = "./modules/compute/container_app_dapr_component"
for_each = local.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
Expand All @@ -9,7 +9,7 @@ module "container_app_dapr_component" {
settings = each.value
}

output "container_app_dapr_component" {
value = module.container_app_dapr_component
output "container_app_dapr_components" {
value = module.container_app_dapr_components
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "container_app_environment_certificate" {
module "container_app_environment_certificates" {
source = "./modules/compute/container_app_environment_certificate"
for_each = local.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
Expand All @@ -9,7 +9,7 @@ module "container_app_environment_certificate" {
settings = each.value
}

output "container_app_environment_certificate" {
value = module.container_app_environment_certificate
output "container_app_environment_certificates" {
value = module.container_app_environment_certificates
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "container_app_environment_storage" {
module "container_app_environment_storages" {
source = "./modules/compute/container_app_environment_storage"
for_each = local.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
Expand All @@ -12,7 +12,7 @@ module "container_app_environment_storage" {
settings = each.value
}

output "container_app_environment_storage" {
value = module.container_app_environment_storage
output "container_app_environment_storages" {
value = module.container_app_environment_storages
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "container_app_environment" {
module "container_app_environments" {
source = "./modules/compute/container_app_environment"
for_each = local.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)]
Expand All @@ -15,7 +15,7 @@ module "container_app_environment" {
settings = each.value
}

output "container_app_environment" {
value = module.container_app_environment
output "container_app_environments" {
value = module.container_app_environments
}

10 changes: 5 additions & 5 deletions container_app.tf → container_apps.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "container_app" {
module "container_apps" {
source = "./modules/compute/container_app"
for_each = local.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)]
Expand All @@ -15,13 +15,13 @@ module "container_app" {
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_storage = local.combined_objects_container_app_environment_storage
container_app_environment_storages = local.combined_objects_container_app_environment_storages
}
global_settings = local.global_settings
settings = each.value
}

output "container_app" {
value = module.container_app
output "container_apps" {
value = module.container_apps
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ diagnostic_log_analytics = {
}
}

container_app_environment = {
container_app_environments = {
cae1 = {
name = "cont-app-env-001"
region = "region1"
resource_group_key = "rg1"
log_analytics_key = "central_logs_region1"
name = "cont-app-env-001"
region = "region1"
resource_group_key = "rg1"
log_analytics_key = "central_logs_region1"
}
}

container_app = {
container_apps = {
ca1 = {
name = "nginx-app"
container_app_environment_key = "cae1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ network_security_group_definition = {
empty_nsg = {}
}

container_app_environment = {
container_app_environments = {
cae1 = {
name = "cont-app-env-001"
region = "region1"
resource_group_key = "rg1"
log_analytics_key = "central_logs_region1"
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"
Expand All @@ -63,7 +63,7 @@ container_app_environment = {
}
}

container_app = {
container_apps = {
ca1 = {
name = "nginx-app"
container_app_environment_key = "cae1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ storage_accounts = {
}
}

container_app_environment = {
container_app_environments = {
cae1 = {
name = "cont-app-env-001"
region = "region1"
resource_group_key = "rg1"
log_analytics_key = "central_logs_region1"
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"
Expand All @@ -89,7 +89,7 @@ container_app_environment = {
}
}

container_app_dapr_component = {
container_app_dapr_components = {
dapr1 = {
name = "dapr-component-001"
container_app_environment_key = "cae1"
Expand All @@ -116,7 +116,7 @@ container_app_dapr_component = {
}
}

container_app_environment_certificate = {
container_app_environment_certificates = {
caec1 = {
name = "caec-cert-001"
container_app_environment_key = "cae1"
Expand All @@ -125,19 +125,19 @@ container_app_environment_certificate = {
}
}

container_app_environment_storage = {
container_app_environment_storages = {
caes1 = {
name = "caes-storage-001"
container_app_environment_key = "cae1"
storage_account = {
account_key = "sa1"
}
share_name = "fs1"
share_name = "fs1"
access_mode = "ReadWrite"
}
}

container_app = {
container_apps = {
ca1 = {
name = "nginx-app"
container_app_environment_key = "cae1"
Expand All @@ -152,15 +152,15 @@ container_app = {
cpu = 0.5
memory = "1Gi"
liveness_probe = {
port = 80
port = 80
transport = "HTTP"
}
readiness_probe = {
port = 80
port = 80
transport = "HTTP"
}
startup_probe = {
port = 80
port = 80
transport = "HTTP"
}
env = [
Expand All @@ -173,7 +173,7 @@ container_app = {
value = 2
},
{
name = "SECRET_VAR"
name = "SECRET_VAR"
secret_name = "secret1"
}
]
Expand Down Expand Up @@ -217,7 +217,7 @@ container_app = {
custom_domain = {
example = {
certificate_key = "caec1"
name = "example.com"
name = "example.com"
}
}
}
Expand Down
60 changes: 30 additions & 30 deletions examples/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,36 +93,36 @@ module "example" {
communication_services = var.communication_services
}
compute = {
aks_clusters = var.aks_clusters
aro_clusters = var.aro_clusters
availability_sets = var.availability_sets
azure_container_registries = var.azure_container_registries
batch_accounts = var.batch_accounts
batch_applications = var.batch_applications
batch_certificates = var.batch_certificates
batch_jobs = var.batch_jobs
batch_pools = var.batch_pools
bastion_hosts = var.bastion_hosts
container_app = var.container_app
container_app_dapr_component = var.container_app_dapr_component
container_app_environment = var.container_app_environment
container_app_environment_certificate = var.container_app_environment_certificate
container_app_environment_storage = var.container_app_environment_storage
container_groups = var.container_groups
dedicated_host_groups = var.dedicated_host_groups
dedicated_hosts = var.dedicated_hosts
machine_learning_compute_instance = var.machine_learning_compute_instance
proximity_placement_groups = var.proximity_placement_groups
runbooks = var.runbooks
virtual_machine_scale_sets = var.virtual_machine_scale_sets
virtual_machines = var.virtual_machines
vmware_private_clouds = var.vmware_private_clouds
vmware_clusters = var.vmware_clusters
vmware_express_route_authorizations = var.vmware_express_route_authorizations
wvd_applications = var.wvd_applications
wvd_application_groups = var.wvd_application_groups
wvd_host_pools = var.wvd_host_pools
wvd_workspaces = var.wvd_workspaces
aks_clusters = var.aks_clusters
aro_clusters = var.aro_clusters
availability_sets = var.availability_sets
azure_container_registries = var.azure_container_registries
batch_accounts = var.batch_accounts
batch_applications = var.batch_applications
batch_certificates = var.batch_certificates
batch_jobs = var.batch_jobs
batch_pools = var.batch_pools
bastion_hosts = var.bastion_hosts
container_apps = var.container_apps
container_app_dapr_components = var.container_app_dapr_components
container_app_environments = var.container_app_environments
container_app_environment_certificates = var.container_app_environment_certificates
container_app_environment_storages = var.container_app_environment_storages
container_groups = var.container_groups
dedicated_host_groups = var.dedicated_host_groups
dedicated_hosts = var.dedicated_hosts
machine_learning_compute_instance = var.machine_learning_compute_instance
proximity_placement_groups = var.proximity_placement_groups
runbooks = var.runbooks
virtual_machine_scale_sets = var.virtual_machine_scale_sets
virtual_machines = var.virtual_machines
vmware_private_clouds = var.vmware_private_clouds
vmware_clusters = var.vmware_clusters
vmware_express_route_authorizations = var.vmware_express_route_authorizations
wvd_applications = var.wvd_applications
wvd_application_groups = var.wvd_application_groups
wvd_host_pools = var.wvd_host_pools
wvd_workspaces = var.wvd_workspaces
}
diagnostics = {
diagnostic_event_hub_namespaces = var.diagnostic_event_hub_namespaces
Expand Down
10 changes: 5 additions & 5 deletions examples/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -559,19 +559,19 @@ variable "load_balancers" {
variable "ip_groups" {
default = {}
}
variable "container_app_environment" {
variable "container_app_environments" {
default = {}
}
variable "container_app_environment_certificate" {
variable "container_app_environment_certificates" {
default = {}
}
variable "container_app_dapr_component" {
variable "container_app_dapr_components" {
default = {}
}
variable "container_app" {
variable "container_apps" {
default = {}
}
variable "container_app_environment_storage" {
variable "container_app_environment_storages" {
default = {}
}
variable "container_groups" {
Expand Down
6 changes: 3 additions & 3 deletions locals.combined_objects.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ locals {
combined_objects_consumption_budgets_resource_groups = merge(tomap({ (local.client_config.landingzone_key) = module.consumption_budgets_resource_groups }), try(var.remote_objects.consumption_budgets_resource_groups, {}), try(var.data_sources.consumption_budgets_resource_groups, {}))
combined_objects_consumption_budgets_subscriptions = merge(tomap({ (local.client_config.landingzone_key) = module.consumption_budgets_subscriptions }), try(var.remote_objects.consumption_budgets_subscriptions, {}), try(var.data_sources.consumption_budgets_subscriptions, {}))
combined_objects_container_registry = merge(tomap({ (local.client_config.landingzone_key) = module.container_registry }), try(var.remote_objects.container_registry, {}), try(var.data_sources.container_registry, {}))
combined_objects_container_app_environments = merge(tomap({ (local.client_config.landingzone_key) = module.container_app_environment }), try(var.remote_objects.container_app_environment, {}))
combined_objects_container_app_environment_certificates = merge(tomap({ (local.client_config.landingzone_key) = module.container_app_environment_certificate }), try(var.remote_objects.container_app_environment_certificate, {}))
combined_objects_container_app_environment_storage = merge(tomap({ (local.client_config.landingzone_key) = module.container_app_environment_storage }), try(var.remote_objects.container_app_environment_storage, {}))
combined_objects_container_app_environments = merge(tomap({ (local.client_config.landingzone_key) = module.container_app_environments }), try(var.remote_objects.container_app_environments, {}))
combined_objects_container_app_environment_certificates = merge(tomap({ (local.client_config.landingzone_key) = module.container_app_environment_certificates }), try(var.remote_objects.container_app_environment_certificates, {}))
combined_objects_container_app_environment_storages = merge(tomap({ (local.client_config.landingzone_key) = module.container_app_environment_storages }), try(var.remote_objects.container_app_environment_storages, {}))
combined_objects_cosmos_dbs = merge(tomap({ (local.client_config.landingzone_key) = module.cosmos_dbs }), try(var.remote_objects.cosmos_dbs, {}), try(var.data_sources.cosmos_dbs, {}))
combined_objects_cosmosdb_sql_databases = merge(tomap({ (local.client_config.landingzone_key) = module.cosmosdb_sql_databases }), try(var.remote_objects.cosmosdb_sql_databases, {}))
combined_objects_data_factory = merge(tomap({ (local.client_config.landingzone_key) = merge(module.data_factory, try(var.data_sources.data_factory, {})) }), try(var.remote_objects.data_factory, {}))
Expand Down
Loading

0 comments on commit d9ec19b

Please sign in to comment.