diff --git a/config/config.yaml.tftpl b/config/config.yaml.tftpl index 9c31bf3b..f647ce53 100644 --- a/config/config.yaml.tftpl +++ b/config/config.yaml.tftpl @@ -197,7 +197,7 @@ vertex_ai: use_private_service_access: false # The `state` defines the state of the pipeline. # In case you don't want to schedule the pipeline, set the state to `PAUSED`. - state: PAUSED # possible states ACTIVE or PAUSED + state: '${pipeline_configuration.feature-creation-auto-audience-segmentation.execution.schedule.state}' # The `pipeline_parameters` defines the parameters that are going to be used to compile the pipeline. # Those values may difer depending on the pipeline type and the pipeline steps being used. # Make sure you review the python function the defines the pipeline. diff --git a/infrastructure/terraform/main.tf b/infrastructure/terraform/main.tf index 4bf297a2..8ac99a5d 100644 --- a/infrastructure/terraform/main.tf +++ b/infrastructure/terraform/main.tf @@ -124,6 +124,7 @@ resource "local_file" "feature_store_configuration" { # TODO: this needs to be specific to environment. location = var.destination_data_location time_zone = var.time_zone + pipeline_configuration = var.pipeline_configuration }) } diff --git a/infrastructure/terraform/variables.tf b/infrastructure/terraform/variables.tf index 9819041a..fa5732e5 100644 --- a/infrastructure/terraform/variables.tf +++ b/infrastructure/terraform/variables.tf @@ -241,3 +241,33 @@ variable "time_zone" { type = string default = "America/New_York" } + +variable "pipeline_configuration" { + description = "Pipeline configuration that will alternate certain settings in the config.yaml.tftpl" + type = map(object({ + execution = object({ + schedule = object({ + state = string + }) + }) + })) + + default = { + feature-creation-auto-audience-segmentation = { + execution = { + schedule = { + state = "PAUSED" + } + } + } + } + validation { + condition = alltrue([ + for k in keys(var.pipeline_configuration) : ( + var.pipeline_configuration[k].execution.schedule.state == "ACTIVE" || + var.pipeline_configuration[k].execution.schedule.state == "PAUSED" + ) + ]) + error_message = "The 'state' field must be either 'PAUSED' or 'ACTIVE' for all pipeline configurations." + } +}