diff --git a/code/infra/datafactory_content.tf b/code/infra/datafactory_content.tf index 138b119..a88a987 100644 --- a/code/infra/datafactory_content.tf +++ b/code/infra/datafactory_content.tf @@ -10,3 +10,27 @@ resource "azurerm_resource_group_template_deployment" "data_factory_content_depl parameters_content = jsonencode(jsondecode(templatefile(var.data_factory_published_content.parameters_file, local.data_factory_published_content_template_variables)).parameters) template_content = file(var.data_factory_published_content.template_file) } + +resource "null_resource" "data_factory_triggers_start" { + for_each = toset(var.data_factory_triggers_start) + + provisioner "local-exec" { + command = "az datafactory trigger start --resource-group ${azurerm_data_factory.data_factory.resource_group_name} --factory-name ${azurerm_data_factory.data_factory.name} --name ${each.value}" + } + + depends_on = [ + azurerm_resource_group_template_deployment.data_factory_content_deployment + ] +} + +resource "null_resource" "data_factory_pipelines_run" { + for_each = toset(var.data_factory_pipelines_run) + + provisioner "local-exec" { + command = "az datafactory pipeline create-run --resource-group ${azurerm_data_factory.data_factory.resource_group_name} --factory-name ${azurerm_data_factory.data_factory.name} --name ${each.value}" + } + + depends_on = [ + azurerm_resource_group_template_deployment.data_factory_content_deployment + ] +} diff --git a/code/infra/variables.tf b/code/infra/variables.tf index 80df877..5ba69c3 100644 --- a/code/infra/variables.tf +++ b/code/infra/variables.tf @@ -104,6 +104,20 @@ variable "data_factory_published_content_template_variables" { default = {} } +variable "data_factory_triggers_start" { + description = "Specifies the list of trigger names that should be started after the deployment." + type = list(string) + sensitive = false + default = [] +} + +variable "data_factory_pipelines_run" { + description = "Specifies the list of pipeline names that should be started after the deployment." + type = list(string) + sensitive = false + default = [] +} + variable "kusto_cluster_sku" { description = "Specifies the kusto cluster sku name." type = object({ diff --git a/code/infra/vars.tfvars b/code/infra/vars.tfvars index b1d794e..8668c46 100644 --- a/code/infra/vars.tfvars +++ b/code/infra/vars.tfvars @@ -25,6 +25,14 @@ data_factory_published_content = { template_file = "../../sc4-dev-df001/ARMTemplateForFactory.json" } data_factory_published_content_template_variables = {} +data_factory_triggers_start = [ + "IptvUpload", + "OttUpload", + "Reference" +] +data_factory_pipelines_run = [ + "ReferenceMainPipeline" +] kusto_cluster_sku = { name = "Standard_E2ads_v5", capacity = 2 diff --git a/config/SharedTenant/vars.tfvars b/config/SharedTenant/vars.tfvars index 40c0734..948b44f 100644 --- a/config/SharedTenant/vars.tfvars +++ b/config/SharedTenant/vars.tfvars @@ -31,6 +31,14 @@ data_factory_published_content = { # template_file = "../sample/ARMTemplateForFactory.json" } data_factory_published_content_template_variables = {} +data_factory_triggers_start = [ + "IptvUpload", + "OttUpload", + "Reference" +] +data_factory_pipelines_run = [ + "ReferenceMainPipeline" +] kusto_cluster_sku = { name = "Standard_E2ads_v5", capacity = 2