Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pipes): EventBridge Pipes alpha module #28388

Merged
merged 43 commits into from
Jan 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b2ed712
feat(pipe): init pipe alpha module
RaphaelManke Dec 15, 2023
0f09dfa
feat(pipes): add pipes base implementation
RaphaelManke Dec 17, 2023
3198b12
feat(pipes): add basic integ test
RaphaelManke Dec 17, 2023
aadf154
chore(pipes): reorder properties
RaphaelManke Dec 19, 2023
39bc844
feat(pipes): add unittest for pipe
RaphaelManke Dec 19, 2023
db4187c
chore(pipes): update integ test
RaphaelManke Dec 19, 2023
b62b438
feat(pipes): add log configuration
RaphaelManke Dec 19, 2023
ae96b3e
feat(pipes): add log configuration
RaphaelManke Dec 21, 2023
7cc3538
chore(pipes): rename pipe property name for log destinations
RaphaelManke Dec 21, 2023
a41dab4
feat(pipes): extend integ test
RaphaelManke Dec 21, 2023
5ebc46c
chore(pipes): update README
RaphaelManke Dec 21, 2023
1de47ab
chore(pipes): fix duplicated headline
RaphaelManke Dec 21, 2023
a3862f2
chore(pipes): remove 'Pipe' prefix from interfaces and classes
RaphaelManke Dec 21, 2023
827c690
chore(pipes): replace cfn interfaces with custom ones
RaphaelManke Dec 28, 2023
ff501ef
feat(pipes): rename sourceFilter to filter and split FilterPattern
RaphaelManke Dec 28, 2023
ac47dee
feat(pipes): replace cfn interface with custom ones
RaphaelManke Dec 28, 2023
122f221
tests(pipes): add test for targetParameters
RaphaelManke Dec 28, 2023
79d98fd
fix(pipes): fix formatting issues
RaphaelManke Dec 31, 2023
b48ce13
fix(pipes): fix interfaces
RaphaelManke Dec 31, 2023
8de906e
fix(pipes): line ending
RaphaelManke Dec 31, 2023
3847e30
fix(pipes): formatting
RaphaelManke Dec 31, 2023
f46b7ee
chore(pipes): apply review comments
RaphaelManke Dec 31, 2023
2442ab4
chore(pipes): introduce test classes
RaphaelManke Jan 2, 2024
54584cc
chore(pipes): update to year 2024
RaphaelManke Jan 2, 2024
afe0812
feat(pipes): Add DynamicInput class and fromPipeName method
RaphaelManke Jan 2, 2024
7bfc3ad
chore(pipes): remove todos
RaphaelManke Jan 2, 2024
91d3ad5
fix(pipes): unused import
RaphaelManke Jan 2, 2024
57f13b7
feat(pipes): make inputTransformation token compatible
RaphaelManke Jan 5, 2024
a864b4b
fix(pipes): ignore unused type error for PipeVariables
RaphaelManke Jan 5, 2024
e7be523
tests(pipes): extend integration tests with input transformations
RaphaelManke Jan 5, 2024
a54a0d9
tests(pipes): extend inputTransformation tests
RaphaelManke Jan 5, 2024
6763cb6
chore(pipes): refactor to bind methods
RaphaelManke Jan 6, 2024
641c2b3
chore(pipes): apply review comments
RaphaelManke Jan 20, 2024
945ba91
chore(pipes): make Dynamic input type explicit.
RaphaelManke Jan 20, 2024
b03d1ac
chore(pipes): Update README
RaphaelManke Jan 20, 2024
dc7d75d
chore(pipes): Extract arn property to parent interface
RaphaelManke Jan 21, 2024
9ec27f5
chore(pipes): Extend code coverage
RaphaelManke Jan 21, 2024
030ee88
chore(pipes): Remove interface complexity of InputTransformation
RaphaelManke Jan 21, 2024
0621a2d
docs(pipes): Add examples to README
RaphaelManke Jan 21, 2024
de14528
chore(pipes): fix integ runner command
RaphaelManke Jan 29, 2024
0dfbeae
Merge branch 'main' into raphaelmanke/rfc-473-eventbridge-pipe
mergify[bot] Jan 29, 2024
27d92cd
Merge branch 'main' into raphaelmanke/rfc-473-eventbridge-pipe
mergify[bot] Jan 29, 2024
2684de3
Merge branch 'main' into raphaelmanke/rfc-473-eventbridge-pipe
mergify[bot] Jan 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(pipes): rename sourceFilter to filter and split FilterPattern
RaphaelManke committed Jan 28, 2024

Verified

This commit was signed with the committer’s verified signature.
RaphaelManke Raphael Manke
commit ff501ef1493fb5d917ddd68634c0d37df236a368
Original file line number Diff line number Diff line change
@@ -13,29 +13,17 @@ export interface IFilterPattern {
/**
* The collection of event patterns used to filter events.
*/
export interface ISourceFilter {
export interface IFilter {
/**
* Filters for the source.
*/
filters: IFilterPattern[];
}

/**
* Generate a filter pattern from an input.
*/
export class GenericFilterPattern {
/**
* Generates a filter pattern from a JSON object.
*/
static fromJson(patternObject: Record<string, any>): IFilterPattern {
return { pattern: JSON.stringify(patternObject) };
}
}

/**
* The collection of event patterns used to filter events.
*/
export class SourceFilter implements ISourceFilter {
export class Filter implements IFilter {
/**
* Filters for the source.
*/
14 changes: 14 additions & 0 deletions packages/@aws-cdk/aws-pipes-alpha/lib/filterPattern.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { IFilterPattern } from './filter';

/**
* Generate a filter pattern from an input.
*/

export class FilterPattern {
RaphaelManke marked this conversation as resolved.
Show resolved Hide resolved
/**
* Generates a filter pattern from a JSON object.
*/
static fromJson(patternObject: Record<string, any>): IFilterPattern {
return { pattern: JSON.stringify(patternObject) };
}
}
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-pipes-alpha/lib/index.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ export * from './inputTransformation';
export * from './logs';
export * from './pipe';
export * from './source';
export * from './sourceFilter';
export * from './filter';
export * from './filterPattern';
export * from './target';
export * from './targetParameter';
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-pipes-alpha/lib/pipe.ts
Original file line number Diff line number Diff line change
@@ -3,9 +3,9 @@ import { IRole, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
import { CfnPipe, CfnPipeProps } from 'aws-cdk-lib/aws-pipes';
import { Construct } from 'constructs';
import { IEnrichment } from './enrichment';
import { IFilter } from './filter';
import { ILogDestination, IncludeExecutionData, LogDestinationProperties, LogLevel } from './logs';
import { ISource } from './source';
import { ISourceFilter } from './sourceFilter';
import { ITarget } from './target';

/**
@@ -70,7 +70,7 @@ export interface PipeProps {
* @see https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-filtering.html
* @default - no filter
*/
readonly filter?: ISourceFilter;
readonly filter?: IFilter;

/**
* Enrichment step to enhance the data from the source before sending it to the target.
30 changes: 30 additions & 0 deletions packages/@aws-cdk/aws-pipes-alpha/test/filter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Filter } from '../lib';

describe('Filter', () => {
describe('constructor', () => {
it('should set filters', () => {
// GIVEN
const filter ={
pattern: JSON.stringify( {
Metadata1: ['pattern1'],
data: { Data1: ['pattern2'] },
}),
};

// WHEN
const result = new Filter([filter]);

// THEN
expect(result).toEqual(
{
filters:
[
{
pattern: '{"Metadata1":["pattern1"],"data":{"Data1":["pattern2"]}}',
},
],
},
);
});
});
});
22 changes: 22 additions & 0 deletions packages/@aws-cdk/aws-pipes-alpha/test/filterPattern.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { FilterPattern } from '../lib';

describe('FilterPattern', () => {
describe('fromJson', () => {
it('should stringify pattern', () => {
// GIVEN
const filter = {
Metadata1: ['pattern1'],
data: { Data1: ['pattern2'] },
};

// WHEN
const result = FilterPattern.fromJson(filter);

// THEN
expect(result).toEqual(
{ pattern: '{"Metadata1":["pattern1"],"data":{"Data1":["pattern2"]}}' },
);
});
});

});