From 0022ef51b10245cd26453a34441a647474abbb55 Mon Sep 17 00:00:00 2001 From: Ajay Mudgal Date: Mon, 1 Sep 2025 11:05:47 +0100 Subject: [PATCH 1/2] Updating pipeline trigger mechanism --- .../cicd_blue_green_deployment_pipeline.tf | 2 +- .../cicd_shared_resources_pipeline.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure/stacks/development-and-deployment-tools/cicd_blue_green_deployment_pipeline.tf b/infrastructure/stacks/development-and-deployment-tools/cicd_blue_green_deployment_pipeline.tf index 77a4d0666..c74a0f32b 100644 --- a/infrastructure/stacks/development-and-deployment-tools/cicd_blue_green_deployment_pipeline.tf +++ b/infrastructure/stacks/development-and-deployment-tools/cicd_blue_green_deployment_pipeline.tf @@ -21,7 +21,7 @@ resource "aws_codepipeline" "cicd_blue_green_deployment_pipeline" { configuration = { S3Bucket = var.cicd_blue_green_deployment_pipeline_artefact_bucket S3ObjectKey = "repository.zip" - PollForSourceChanges = "True" + DetectChanges = "True" } } } diff --git a/infrastructure/stacks/development-and-deployment-tools/cicd_shared_resources_pipeline.tf b/infrastructure/stacks/development-and-deployment-tools/cicd_shared_resources_pipeline.tf index aab7e5b4b..c0a6289e7 100644 --- a/infrastructure/stacks/development-and-deployment-tools/cicd_shared_resources_pipeline.tf +++ b/infrastructure/stacks/development-and-deployment-tools/cicd_shared_resources_pipeline.tf @@ -20,7 +20,7 @@ resource "aws_codepipeline" "cicd_shared_resources_deployment_pipeline" { configuration = { S3Bucket = var.cicd_shared_resoures_deployment_pipeline_artefact_bucket S3ObjectKey = "repository.zip" - PollForSourceChanges = "True" + DetectChanges = "True" } } } From c1addcb59cdc65311b1d4af4e62d1690f3325d77 Mon Sep 17 00:00:00 2001 From: Ajay Mudgal Date: Tue, 2 Sep 2025 13:53:11 +0100 Subject: [PATCH 2/2] Updating pipeline trigger mechanism to even based --- build/automation/var/project.mk | 2 ++ .../eventbridge_pipeline_trigger/main.tf | 22 ++++++++++++++ .../eventbridge_pipeline_trigger/outputs.tf | 9 ++++++ .../eventbridge_pipeline_trigger/variables.tf | 30 +++++++++++++++++++ .../cicd_blue_green_deployment_pipeline.tf | 19 ++++++++++-- .../cicd_shared_resources_pipeline.tf | 18 ++++++++++- .../variables.tf | 11 +++++++ .../stacks/shared-resources/dynamodb.tf | 8 ++--- infrastructure/stacks/shared-resources/waf.tf | 6 ++-- 9 files changed, 115 insertions(+), 10 deletions(-) create mode 100644 infrastructure/modules/eventbridge_pipeline_trigger/main.tf create mode 100644 infrastructure/modules/eventbridge_pipeline_trigger/outputs.tf create mode 100644 infrastructure/modules/eventbridge_pipeline_trigger/variables.tf diff --git a/build/automation/var/project.mk b/build/automation/var/project.mk index f1530429f..3a4961307 100644 --- a/build/automation/var/project.mk +++ b/build/automation/var/project.mk @@ -50,6 +50,8 @@ TF_VAR_pipeline_topic_name := $(PROJECT_ID)-$(ENVIRONMENT)-pipeline-topic TF_VAR_pipeline_notification_name := $(PROJECT_ID)-$(ENVIRONMENT)-pipeline-notification TF_VAR_cicd_blue_green_deployment_pipeline_nofitication_name := $(PROJECT_ID)-$(ENVIRONMENT)-blue-green-pipeline-notification TF_VAR_cicd_shared_resources_deployment_pipeline_nofitication_name := $(PROJECT_ID)-$(ENVIRONMENT)-shared-resources-pipeline-notification +TF_VAR_cicd_blue_green_deployment_pipeline_eventbridge_rule_name := $(PROJECT_ID)-$(ENVIRONMENT)-trigger-blue-green-pipeline +TF_VAR_cicd_shared_resources_deployment_pipeline_eventbridge_rule_name := $(PROJECT_ID)-$(ENVIRONMENT)-trigger-shared-resources-pipeline TF_VAR_pipeline_chatbot_channel := $(PROJECT_ID)-cicd-slk-channel TF_VAR_nightly_rule_name := $(PROJECT_ID)-$(ENVIRONMENT)-performance-pipeline-nightly-rule diff --git a/infrastructure/modules/eventbridge_pipeline_trigger/main.tf b/infrastructure/modules/eventbridge_pipeline_trigger/main.tf new file mode 100644 index 000000000..1c321ddf7 --- /dev/null +++ b/infrastructure/modules/eventbridge_pipeline_trigger/main.tf @@ -0,0 +1,22 @@ +resource "aws_cloudwatch_event_rule" "trigger_pipeline" { + name = var.rule_name + description = var.description + event_pattern = <