Skip to content

Commit

Permalink
Update Kotlin-CDK example for latest CDK library
Browse files Browse the repository at this point in the history
  • Loading branch information
pcholakov committed Jan 15, 2024
1 parent 79b46ef commit 58ac542
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions kotlin/hello-world-lambda-cdk/cdk/lambda-jvm-cdk-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,23 @@ export class LambdaJvmCdkStack extends cdk.Stack {
systemLogLevel: "DEBUG",
});

const restateInstance = new restate.RestateCloudEndpoint(this, "RestateCloud", {
const environment = new restate.RestateCloudEnvironment(this, "RestateCloud", {
clusterId: props.clusterId,
authTokenSecretArn: props.authTokenSecretArn,
});

// Alternatively, you can deploy Restate on your own infrastructure like this. See the Restate CDK docs for more.
// const restateInstance = new restate.SingleNodeRestateInstance(this, "Restate", {
// const environment = new restate.SingleNodeRestateInstance(this, "Restate", {
// logGroup: new logs.LogGroup(this, "RestateLogs", {
// retention: logs.RetentionDays.THREE_MONTHS,
// }),
// });

const handlers = new restate.LambdaServiceRegistry(this, "RestateServices", {
serviceHandlers: {
new restate.LambdaServiceRegistry(this, "RestateServices", {
handlers: {
"greeter.Greeter": greeter,
},
restate: restateInstance,
});
handlers.register({
metaEndpoint: restateInstance.metaEndpoint,
invokerRoleArn: restateInstance.invokerRole.roleArn,
authTokenSecretArn: restateInstance.authToken.secretArn,
});

new cdk.CfnOutput(this, "HandlerFunction", {
value: greeter.functionName,
environment,
});
}
}

0 comments on commit 58ac542

Please sign in to comment.