Skip to content

Commit 58ac542

Browse files
committed
Update Kotlin-CDK example for latest CDK library
1 parent 79b46ef commit 58ac542

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

kotlin/hello-world-lambda-cdk/cdk/lambda-jvm-cdk-stack.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,23 @@ export class LambdaJvmCdkStack extends cdk.Stack {
2525
systemLogLevel: "DEBUG",
2626
});
2727

28-
const restateInstance = new restate.RestateCloudEndpoint(this, "RestateCloud", {
28+
const environment = new restate.RestateCloudEnvironment(this, "RestateCloud", {
2929
clusterId: props.clusterId,
3030
authTokenSecretArn: props.authTokenSecretArn,
3131
});
3232

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

40-
const handlers = new restate.LambdaServiceRegistry(this, "RestateServices", {
41-
serviceHandlers: {
40+
new restate.LambdaServiceRegistry(this, "RestateServices", {
41+
handlers: {
4242
"greeter.Greeter": greeter,
4343
},
44-
restate: restateInstance,
45-
});
46-
handlers.register({
47-
metaEndpoint: restateInstance.metaEndpoint,
48-
invokerRoleArn: restateInstance.invokerRole.roleArn,
49-
authTokenSecretArn: restateInstance.authToken.secretArn,
50-
});
51-
52-
new cdk.CfnOutput(this, "HandlerFunction", {
53-
value: greeter.functionName,
44+
environment,
5445
});
5546
}
5647
}

0 commit comments

Comments
 (0)