Tidy up event logging in integration hub & reinstate s3 objects to trigger moves#17052
Open
dms1981 wants to merge 4 commits into
Open
Tidy up event logging in integration hub & reinstate s3 objects to trigger moves#17052dms1981 wants to merge 4 commits into
dms1981 wants to merge 4 commits into
Conversation
…fault bus as not immediately manageable through terraform
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to switch the managed file transfer workflow back to using S3 object-created notifications to trigger file moves, while removing Terraform-managed logging for the EventBridge default bus (since it is not meaningfully manageable at component level).
Changes:
- Adds an S3 bucket notification module to send
s3:ObjectCreated:*events to an SQS queue. - Removes Terraform configuration for logging the EventBridge default bus and its CloudWatch log group.
- Removes Transfer Family upload EventBridge rule locals and deletes
moved.tf.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| terraform/environments/integration-hub/managed-file-transfer/s3.tf | Introduces S3→SQS bucket notifications intended to trigger object moves. |
| terraform/environments/integration-hub/managed-file-transfer/moved.tf | Removes Terraform moved blocks previously used for state address migrations. |
| terraform/environments/integration-hub/managed-file-transfer/eventbridge.tf | Removes default bus logging configuration; leaves EventBridge rule modules for GuardDuty (and still contains Transfer upload wiring). |
| terraform/environments/integration-hub/managed-file-transfer/eventbridge-rules.tf | Removes the Transfer Family upload rule local, leaving only GuardDuty malware protection rules. |
| terraform/environments/integration-hub/managed-file-transfer/cloudwatch.tf | Removes the EventBridge log group, leaving only the Transfer log group. |
Comments suppressed due to low confidence (1)
terraform/environments/integration-hub/managed-file-transfer/eventbridge-rules.tf:4
local.eventbridge_transfer_sftp_upload_ruleshas been removed from this file, but it is still referenced bymodule.eventbridge_transfer_upload(terraform/environments/integration-hub/managed-file-transfer/eventbridge.tf:52) and by SQS queue policy locals (terraform/environments/integration-hub/managed-file-transfer/sqs.tf:3). This will cause Terraform evaluation failures because the local no longer exists.
harshvasudev29
previously approved these changes
Jun 5, 2026
harshvasudev29
previously approved these changes
Jun 8, 2026
Comment on lines
+5
to
9
| name = "${local.application_name}-unscanned-s3-notifications" | ||
| use_name_prefix = false | ||
|
|
||
| create_queue_policy = true | ||
| queue_policy_statements = { | ||
| eventbridge = { | ||
| sid = "AllowTransferEventBridgeSendMessage" | ||
| actions = ["sqs:SendMessage"] | ||
|
|
||
| principals = [ | ||
| { | ||
| type = "Service" | ||
| identifiers = ["events.amazonaws.com"] | ||
| } | ||
| ] | ||
|
|
||
| condition = [ | ||
| { | ||
| test = "ArnEquals" | ||
| variable = "aws:SourceArn" | ||
| values = local.sqs_transfer_notifications_source_arns | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| create_queue_policy = false | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR reinstates S3 object notifications as the inciting event for file moves from the
unscannedbucket into theprocessingbucket in the Integration Hub managed file transfer environment.The previous Transfer/EventBridge trigger path introduced an incomplete wiring state. This change returns the flow to a coherent S3 -> SQS -> Lambda pattern.
What Changed
lambda_unscanned_to_processingto consume from the unscanned S3 notifications queue.sqs_unscanned_s3_notifications.eventbridge_transfer_uploadmodule and associated dependencies.s3_bucket_notificationconfiguration on theunscannedbucket to emits3:ObjectCreated:*events to SQS.Behaviour After Change
unscannedbucket.ObjectCreatednotification.sqs_unscanned_s3_notifications.lambda_unscanned_to_processingmoves object intoprocessingbucket.Why
Validation
terraform validatepasses in:terraform/environments/integration-hub/managed-file-transferRisks
Signed-off-by: David Sibley david.sibley@justice.gov.uk