Skip to content

Commit

Permalink
Added stepFunction integration test. Not tested yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
Saqib Dhuka committed Oct 4, 2021
1 parent ef59b40 commit 5ea8e37
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"MyAuthorizerFunctionServiceRole8A34C19E",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down Expand Up @@ -313,4 +313,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"MyAuthorizerFunctionServiceRole8A34C19E",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"MyAuthorizerFunctionServiceRole8A34C19E",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down Expand Up @@ -313,4 +313,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,13 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"handlerServiceRole187D5A5A",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"Code": {
"ZipFile": "foo"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"myfnServiceRole7822DC24",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"Code": {
"ZipFile": "exports.handler = function echoHandlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n}"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"BooksHandlerServiceRole5B6A8847",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down Expand Up @@ -87,13 +87,13 @@
"Code": {
"ZipFile": "exports.handler = function echoHandlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n}"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"BookHandlerServiceRole894768AD",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down Expand Up @@ -137,13 +137,13 @@
"Code": {
"ZipFile": "exports.handler = function helloCode(_event, _context, callback) {\n return callback(undefined, {\n statusCode: 200,\n body: 'hello, world!',\n });\n}"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"HelloServiceRole1E55EA16",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,13 @@
"Code": {
"ZipFile": "exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"MyHandlerServiceRoleFFA06653",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"Code": {
"ZipFile": "exports.handler = async function(event) {\n return {\n 'headers': { 'Content-Type': 'text/plain' },\n 'statusCode': 200\n }\n }"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"firstLambdaServiceRoleB6408C31",
"Arn"
]
},
"Runtime": "nodejs10.x",
"FunctionName": "FirstLambda"
"FunctionName": "FirstLambda",
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
"firstLambdaServiceRoleB6408C31"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"Code": {
"ZipFile": "exports.handler = function helloCode(_event, _context, callback) {\n return callback(undefined, {\n statusCode: 200,\n body: 'hello, world!',\n });\n}"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"HelloServiceRole1E55EA16",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@
"MyVpcPublicSubnet1NATGatewayAD3400C1": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "MyVpcPublicSubnet1SubnetF6608456"
},
"AllocationId": {
"Fn::GetAtt": [
"MyVpcPublicSubnet1EIP096967CB",
"AllocationId"
]
},
"SubnetId": {
"Ref": "MyVpcPublicSubnet1SubnetF6608456"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -192,15 +192,15 @@
"MyVpcPublicSubnet2NATGateway91BFBEC9": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "MyVpcPublicSubnet2Subnet492B6BFB"
},
"AllocationId": {
"Fn::GetAtt": [
"MyVpcPublicSubnet2EIP8CCBA239",
"AllocationId"
]
},
"SubnetId": {
"Ref": "MyVpcPublicSubnet2Subnet492B6BFB"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -289,15 +289,15 @@
"MyVpcPublicSubnet3NATGatewayD4B50EBE": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "MyVpcPublicSubnet3Subnet57EEE236"
},
"AllocationId": {
"Fn::GetAtt": [
"MyVpcPublicSubnet3EIPC5ACADAB",
"AllocationId"
]
},
"SubnetId": {
"Ref": "MyVpcPublicSubnet3Subnet57EEE236"
},
"Tags": [
{
"Key": "Name",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import '@aws-cdk/assert-internal/jest';
import * as sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import { Construct } from 'constructs';
import * as apigw from '../lib';

class StepFunctionsRestApiDeploymentStack extends cdk.Stack {
constructor(scope: Construct) {
super(scope, 'StepFunctionsRestApiDeploymentStack');

const passTask = new sfn.Pass(this, 'PassTask', {
result: { value: 'Hello' },
});

const handler = new sfn.StateMachine(this, 'handler', {
definition: passTask,
stateMachineType: sfn.StateMachineType.EXPRESS,
});

new apigw.StepFunctionsRestApi(this, 'StepFunctions-rest-api', { handler });
}
}

const app = new cdk.App();
new StepFunctionsRestApiDeploymentStack(app);
app.synth();

0 comments on commit 5ea8e37

Please sign in to comment.