Skip to content

Added AddressManagerTracingPipe#182

Open
FedericaMoschese wants to merge 1 commit intofeature/PN-16895-epicfrom
feature/PN-18310
Open

Added AddressManagerTracingPipe#182
FedericaMoschese wants to merge 1 commit intofeature/PN-16895-epicfrom
feature/PN-18310

Conversation

@FedericaMoschese
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an EventBridge Pipe to forward selected DynamoDB stream events from the PostelBatch table into an SQS “address manager tracing” input queue.

Changes:

  • Introduces new CloudFormation parameters for the tracing SQS queue and PostelBatch DynamoDB Stream ARN.
  • Adds AWS::Pipes::Pipe plus an execution IAM role to ship DynamoDB stream events to SQS.
  • Adds a dev config default for the pipe desired state (STOPPED).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/aws/cfn/microservice.yml Adds parameters and resources for AddressManagerTracingPipe (DynamoDB Stream → SQS) and execution role/policy.
scripts/aws/cfn/microservice-dev-cfg.json Adds AddressManagerTracingPipeDesiredState to dev configuration parameters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +731 to +763
FilterCriteria:
Filters:
- Pattern: >
{
"eventName": ["MODIFY"],
"dynamodb": {
"$or": [
{
"NewImage": {
"fileKey": { "S": [{ "exists": true }] }
}
},
{
"NewImage": {
"outputFileKey": { "S": [{ "exists": true }] }
}
}
]
}
}
Target: !Ref PnAddressManagerTracingInputQueueARN
TargetParameters:
InputTemplate: >
{
"eventType": "NORMALIZER",
"normalizer": {
"batchId": <$.dynamodb.NewImage.batchId.S>,
"oldFileKey": <$.dynamodb.OldImage.fileKey.S>,
"oldOutputFileKey": <$.dynamodb.OldImage.outputFileKey.S>,
"newFileKey": <$.dynamodb.NewImage.fileKey.S>,
"newOutputFileKey": <$.dynamodb.NewImage.outputFileKey.S>
}
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter matches events where either NewImage.fileKey or NewImage.outputFileKey exists, but the InputTemplate always references both $.dynamodb.NewImage.fileKey.S and $.dynamodb.NewImage.outputFileKey.S (and also both OldImage.* keys). This can produce failed transformations or malformed payloads when one of the referenced attributes is absent. Consider tightening FilterCriteria to require all fields used by the template (e.g., batchId + both new keys, and any old keys you need), or adjust the template so it only includes fields guaranteed to exist for matched events.

Copilot uses AI. Check for mistakes.
Comment on lines +757 to +759
"batchId": <$.dynamodb.NewImage.batchId.S>,
"oldFileKey": <$.dynamodb.OldImage.fileKey.S>,
"oldOutputFileKey": <$.dynamodb.OldImage.outputFileKey.S>,
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pipe payload depends on dynamodb.OldImage.* being present in the stream record. That only happens if the DynamoDB Stream is configured with an OLD_IMAGE-containing view type (typically NEW_AND_OLD_IMAGES). Consider documenting this requirement near PostelBatchTableStreamArn / the pipe definition (or otherwise making it explicit in infra) to avoid a deploy that silently produces events without OldImage and breaks the expected payload.

Copilot uses AI. Check for mistakes.
Type: String
Description: Name of address manager tracing input queue

PnAddressManagerTracingInputQueueARN:
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter naming is inconsistent with the other *Arn parameters in this template (...DLQArn, ...TableArn, etc.). Consider renaming PnAddressManagerTracingInputQueueARN to PnAddressManagerTracingInputQueueArn for consistency (and update references accordingly) to reduce confusion and improve maintainability.

Suggested change
PnAddressManagerTracingInputQueueARN:
PnAddressManagerTracingInputQueueArn:

Copilot uses AI. Check for mistakes.

PnAddressManagerTracingInputQueueURL:
Type: String
Description: URL of address manager tracing input
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter description looks truncated/ambiguous. Consider clarifying it to something like URL of address manager tracing input queue to match the other queue-related descriptions and avoid confusion during stack parameterization.

Suggested change
Description: URL of address manager tracing input
Description: URL of address manager tracing input queue

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants