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: add support for Step Functions #827

Merged
merged 38 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6a76727
Model the Amazon States Language
adilosa Jul 12, 2018
d74e4c8
Change to classes to make jsii happy
Jul 14, 2018
61f310b
Added ChoiceState, validations, and basic serialization tests
adilosa Jul 16, 2018
1fbdee3
Add method and class documentation
Jul 26, 2018
b4bad6b
Add unit tests
Jul 27, 2018
f33cd7b
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Aug 28, 2018
a7deb69
WIP
Aug 28, 2018
a5dd0b3
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Aug 28, 2018
813f4a4
First iteration of object model and builder
Aug 29, 2018
385ae1f
WIP
Sep 3, 2018
4a1172c
Make an activity be possible to be the resource for a Task
Sep 3, 2018
9e54761
Making all tests pass with mutable interface
Sep 3, 2018
c4e849f
Add TODO
Sep 3, 2018
0c32d6d
Some more tests
Sep 3, 2018
2b402f9
Add defaultRetry, get rid of internal ugliness in public API
Sep 3, 2018
9a80554
Add integration test
Sep 3, 2018
766d0c8
Add metrics
Sep 4, 2018
006f98e
Metric tests for activities
Sep 4, 2018
abb85ef
Add comments to all states
Sep 4, 2018
dc74909
Add resultPath to error handler
Sep 4, 2018
b23fe58
Add some more supported input/output/resultpaths
Sep 4, 2018
bd4f1da
Support "Result" field on "Pass"
Sep 4, 2018
9645ade
Small fixes to deal with oddities of mutable state
Sep 4, 2018
c53238d
Shorten generated name if necessary
Sep 4, 2018
d46454d
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Sep 21, 2018
f8d534e
Update to latest API on 'master'
Sep 21, 2018
9a84c20
Finish first iteration
Sep 21, 2018
beebb71
Review comments
Oct 9, 2018
a9a5fa4
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Oct 9, 2018
6c979a0
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Oct 9, 2018
8307cd3
Update to new API
Oct 9, 2018
584645d
Work around jsii bug that does not register implicitly created proper…
Oct 9, 2018
fe43fbd
Removing obsolete DESIGN_NOTES
rix0rrr Oct 10, 2018
ffe3533
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Oct 11, 2018
4f792c8
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Oct 12, 2018
b88b2ff
Merge remote-tracking branch 'origin/master' into huijbers/step-funct…
Oct 15, 2018
ae693ab
Method renames
Oct 16, 2018
0e8cc0e
Merge branch 'huijbers/step-functions' of github.com:awslabs/aws-cdk …
Oct 16, 2018
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
16 changes: 15 additions & 1 deletion packages/@aws-cdk/aws-lambda/lib/lambda-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import events = require('@aws-cdk/aws-events');
import iam = require('@aws-cdk/aws-iam');
import logs = require('@aws-cdk/aws-logs');
import s3n = require('@aws-cdk/aws-s3-notifications');
import stepfunctions = require('@aws-cdk/aws-stepfunctions');
import cdk = require('@aws-cdk/cdk');
import { cloudformation } from './lambda.generated';
import { Permission } from './permission';
Expand Down Expand Up @@ -39,7 +40,7 @@ export interface FunctionRefProps {

export abstract class FunctionRef extends cdk.Construct
implements events.IEventRuleTarget, logs.ILogSubscriptionDestination, s3n.IBucketNotificationDestination,
ec2.IConnectable {
ec2.IConnectable, stepfunctions.IStepFunctionsTaskResource {

/**
* Creates a Lambda function object which represents a function not defined
Expand Down Expand Up @@ -352,6 +353,19 @@ export abstract class FunctionRef extends cdk.Construct
};
}

public asStepFunctionsTaskResource(_callingTask: stepfunctions.Task): stepfunctions.StepFunctionsTaskResourceProps {
return {
resourceArn: this.functionArn,
metricPrefixSingular: 'LambdaFunction',
metricPrefixPlural: 'LambdaFunctions',
metricDimensions: { LambdaFunctionArn: this.functionArn },
policyStatements: [new iam.PolicyStatement()
.addResource(this.functionArn)
.addActions("lambda:InvokeFunction")
]
};
}

private parsePermissionPrincipal(principal?: iam.PolicyPrincipal) {
if (!principal) {
return undefined;
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"@aws-cdk/aws-s3": "^0.12.0",
"@aws-cdk/aws-s3-notifications": "^0.12.0",
"@aws-cdk/aws-sqs": "^0.12.0",
"@aws-cdk/aws-stepfunctions": "^0.12.0",
"@aws-cdk/cdk": "^0.12.0",
"@aws-cdk/cx-api": "^0.12.0"
},
Expand Down
Loading