From f8aa14d7250de02144db6a9ce9eff20d69bfa4d8 Mon Sep 17 00:00:00 2001 From: Phil Snyder Date: Fri, 13 Oct 2023 15:43:13 -0700 Subject: [PATCH] hotfix JSON to Parquet Trigger resource If you create two resources with the same output name (JsonToParquetTrigger) where one is created if {condition} and the other is created if {not condition}, then neither resource is created. Super intuitive! This fixes that by using the condition in a much cleaner way. --- templates/glue-workflow.j2 | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/templates/glue-workflow.j2 b/templates/glue-workflow.j2 index 6a1305b3..4a9d3e2f 100644 --- a/templates/glue-workflow.j2 +++ b/templates/glue-workflow.j2 @@ -123,7 +123,6 @@ Resources: Name: !Sub ${Namespace}-JsonToParquetWorkflow JsontoParquetTrigger: - Condition: IsMainNamespace Type: AWS::Glue::Trigger Properties: Name: !Sub "${Namespace}-JsontoParquetTrigger" @@ -132,20 +131,7 @@ Resources: Description: This trigger starts the JSON to Parquet workflow. Type: SCHEDULED Schedule: !Ref JsontoParquetTriggerSchedule - StartOnCreation: true - WorkflowName: !Ref JsonToParquetWorkflow - - JsontoParquetTrigger: - Condition: IsDevelopmentNamespace - Type: AWS::Glue::Trigger - Properties: - Name: !Sub "${Namespace}-JsontoParquetTrigger" - Actions: - - CrawlerName: !Ref StandardCrawler - Description: This trigger starts the JSON to Parquet workflow. - Type: SCHEDULED - Schedule: !Ref JsontoParquetTriggerSchedule - StartOnCreation: false + StartOnCreation: !If [IsMainNamespace, true, false] WorkflowName: !Ref JsonToParquetWorkflow StandardCrawler: