Skip to content

Instantly share code, notes, and snippets.

@mgjam
Last active October 27, 2019 16:31
Show Gist options
  • Save mgjam/66c4ada8da13c03f2d74d2903f9732b0 to your computer and use it in GitHub Desktop.
Save mgjam/66c4ada8da13c03f2d74d2903f9732b0 to your computer and use it in GitHub Desktop.
private createOutputDataSource(
api: appsync.CfnGraphQLApi,
outputLambda: lambda.Function,
): appsync.CfnDataSource {
const name = 'OutputDataSource';
const invokeRole = this.createOutputLambdaInvokeRole(outputLambda);
const outputDataSource = new appsync.CfnDataSource(this, name, {
apiId: api.attrApiId,
name: name,
type: 'AWS_LAMBDA',
lambdaConfig: {
lambdaFunctionArn: outputLambda.functionArn
},
serviceRoleArn: invokeRole.roleArn
});
outputDataSource.addDependsOn(api);
return outputDataSource;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment