Skip to content

Commit

Permalink
feat(enrichment): Add StepFunction enrichment
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelManke committed Apr 1, 2023
1 parent 0d6f270 commit 1ae4bcd
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/enrichments/StepFunctionEnrichment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { IRole } from 'aws-cdk-lib/aws-iam';
import { CfnPipe } from 'aws-cdk-lib/aws-pipes';
import { IStateMachine } from 'aws-cdk-lib/aws-stepfunctions';
import { IPipeEnrichment } from '../PipeEnrichment';
import { IInputTransformation } from '../PipeInputTransformation';

export interface IStepFunctionEnrichmentProps {
inputTransformation?: IInputTransformation;
}

export class StepFunctionEnrichment implements IPipeEnrichment {
private stepFunction: IStateMachine;
public readonly enrichmentArn: string;
public readonly enrichmentParameters: CfnPipe.PipeEnrichmentParametersProperty;

constructor(stepFunction: IStateMachine, props?: IStepFunctionEnrichmentProps) {
this.stepFunction = stepFunction;
this.enrichmentArn = stepFunction.stateMachineArn;
this.enrichmentParameters = {
inputTemplate: props?.inputTransformation?.inputTemplate,
};
}

grantInvoke(grantee: IRole): void {
this.stepFunction.grantExecution(grantee);
}
}

0 comments on commit 1ae4bcd

Please sign in to comment.