diff --git a/deployments/aws/ecs/ecs-temporal.tf b/deployments/aws/ecs/ecs-temporal.tf index 5d6dfa13f..4be309dd0 100644 --- a/deployments/aws/ecs/ecs-temporal.tf +++ b/deployments/aws/ecs/ecs-temporal.tf @@ -1,5 +1,6 @@ # ECS Task Definition for Temporal Service resource "aws_ecs_task_definition" "temporal_task_definition" { + count = var.disable_temporal_autosetup ? 0 : 1 family = "TracecatTemporalTaskDefinition" network_mode = "awsvpc" requires_compatibilities = ["FARGATE"] @@ -55,9 +56,10 @@ resource "aws_ecs_task_definition" "temporal_task_definition" { } resource "aws_ecs_service" "temporal_service" { + count = var.disable_temporal_autosetup ? 0 : 1 name = "temporal-server" cluster = aws_ecs_cluster.tracecat_cluster.id - task_definition = aws_ecs_task_definition.temporal_task_definition.arn + task_definition = aws_ecs_task_definition.temporal_task_definition[0].arn launch_type = "FARGATE" desired_count = 1 diff --git a/deployments/aws/ecs/variables.tf b/deployments/aws/ecs/variables.tf index e212d5734..ab088affe 100644 --- a/deployments/aws/ecs/variables.tf +++ b/deployments/aws/ecs/variables.tf @@ -111,6 +111,12 @@ variable "disable_temporal_ui" { default = false } +variable "disable_temporal_autosetup" { + type = bool + description = "Whether to disable the Temporal auto-setup service in the deployment" + default = false +} + variable "TFC_CONFIGURATION_VERSION_GIT_COMMIT_SHA" { description = "Terraform Cloud only: the git commit SHA of that triggered the run" type = string diff --git a/deployments/aws/main.tf b/deployments/aws/main.tf index cea1d7933..b23e6d9cb 100644 --- a/deployments/aws/main.tf +++ b/deployments/aws/main.tf @@ -71,11 +71,12 @@ module "ecs" { saml_idp_certificate_arn = var.saml_idp_certificate_arn saml_idp_metadata_url_arn = var.saml_idp_metadata_url_arn - # Temporal UI + # Temporal temporal_auth_provider_url = var.temporal_auth_provider_url temporal_auth_client_id_arn = var.temporal_auth_client_id_arn temporal_auth_client_secret_arn = var.temporal_auth_client_secret_arn disable_temporal_ui = var.disable_temporal_ui + disable_temporal_autosetup = var.disable_temporal_autosetup # Compute / memory api_cpu = var.api_cpu diff --git a/deployments/aws/variables.tf b/deployments/aws/variables.tf index 011c10165..0a8cf1a71 100644 --- a/deployments/aws/variables.tf +++ b/deployments/aws/variables.tf @@ -62,6 +62,12 @@ variable "disable_temporal_ui" { default = false } +variable "disable_temporal_autosetup" { + type = bool + description = "Whether to disable the Temporal auto-setup service in the deployment" + default = false +} + ### Secret ARNs variable "tracecat_db_encryption_key_arn" {