Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from tiki/release/fix-filter
Browse files Browse the repository at this point in the history
fix: wildcard filter
  • Loading branch information
mike-audi authored Oct 28, 2023
2 parents 57e2c73 + 6255537 commit e5fdbe6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "publish-data-s3"
version = "0.0.7"
version = "0.0.8"
edition = "2021"

[dependencies]
Expand Down
9 changes: 3 additions & 6 deletions infra/function/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ Parameters:
Type: String
Default: csv
Description: Enter the source file type (csv).
StagePrefix:
StageWildcard:
Type: String
Description: Enter the key prefix to filter events by (wildcards allowed)
StageSuffix:
Type: String
Description: Enter the key suffix to filter events by (wildcards allowed)
Description: Enter the wildcard syntax to filter events.
DestBucket:
Type: String
Description: Enter the name of the output file bucket.
Expand All @@ -47,7 +44,7 @@ Resources:
EventBridgeRule:
Type: EventBridgeRule
Properties:
Pattern: !Sub "{\"source\":[\"aws.s3\"],\"detail-type\":[\"Object Created\"],\"detail\":{\"bucket\":{\"name\":[\"mytiki-publish\"]},\"object\":{\"key\":[{\"prefix\":\"${StagePrefix}\"},{\"suffix\":\"${StageSuffix}\"}]}}}"
Pattern: !Sub "{\"source\":[\"aws.s3\"],\"detail-type\":[\"Object Created\"],\"detail\":{\"bucket\":{\"name\":[\"mytiki-publish\"]},\"object\":{\"key\":[{\"wildcard\":\"${StageWildcard}\"}]}}}"
RuleName: !Ref DestTable
State: ENABLED
Environment:
Expand Down
1 change: 1 addition & 0 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use lambda_runtime::{Error, LambdaEvent};
use processor::Processor;

pub async fn handle(event: LambdaEvent<CloudWatchEvent<S3Entity>>) -> Result<(), Error> {
tracing::debug!("{:?}", event);
let processor = &Processor::new()
.from_env()
.auto_schema()
Expand Down

0 comments on commit e5fdbe6

Please sign in to comment.