Skip to content

Commit

Permalink
Add tf var to disable temporal autosetup
Browse files Browse the repository at this point in the history
  • Loading branch information
topher-lo committed Dec 22, 2024
1 parent d008232 commit fb807ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deployments/aws/ecs/ecs-temporal.tf
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions deployments/aws/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion deployments/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions deployments/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit fb807ca

Please sign in to comment.