-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjobs.tf
More file actions
29 lines (25 loc) · 1.02 KB
/
jobs.tf
File metadata and controls
29 lines (25 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module "db_setup" {
source = "../dtos-devops-templates/infrastructure/modules/container-app-job"
name = "${var.app_short_name}-dbm-${var.environment}"
container_app_environment_id = var.container_app_environment_id
resource_group_name = azurerm_resource_group.main.name
container_command = ["/bin/sh", "-c"]
container_args = [
"python manage.py migrate"
]
secret_variables = var.deploy_database_as_container ? { DATABASE_PASSWORD = resource.random_password.admin_password[0].result } : {}
docker_image = var.docker_image
user_assigned_identity_ids = flatten([
[module.azure_blob_storage_identity.id],
[module.azure_queue_storage_identity.id],
var.deploy_database_as_container ? [] : [module.db_connect_identity[0].id]
])
environment_variables = merge(
local.common_env,
var.deploy_database_as_container ? local.container_db_env : local.azure_db_env
)
depends_on = [
module.queue_storage_role_assignment,
module.blob_storage_role_assignment
]
}