From a62ce153afbb37b3b13632ec09b0910469857050 Mon Sep 17 00:00:00 2001 From: Pavel Tcholakov Date: Thu, 23 Apr 2026 21:31:37 +0200 Subject: [PATCH] Use RESTATE_AUTH_TOKEN in CDK example for consistency with CLI --- docs/cloud/connecting-services.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/cloud/connecting-services.mdx b/docs/cloud/connecting-services.mdx index f1b1b155..1459b9f3 100644 --- a/docs/cloud/connecting-services.mdx +++ b/docs/cloud/connecting-services.mdx @@ -252,16 +252,16 @@ export class LambdaTsCdkStack extends cdk.Stack { }, }); - if (!process.env.RESTATE_ENV_ID || !process.env.RESTATE_API_KEY) { + if (!process.env.RESTATE_ENV_ID || !process.env.RESTATE_AUTH_TOKEN) { throw new Error( - "Required environment variables RESTATE_ENV_ID and RESTATE_API_KEY are not set, please see README.", + "Required environment variables RESTATE_ENV_ID and RESTATE_AUTH_TOKEN are not set, please see README.", ); } const restateEnvironment = new restate.RestateCloudEnvironment(this, "RestateCloud", { environmentId: process.env.RESTATE_ENV_ID! as restate.EnvironmentId, apiKey: new secrets.Secret(this, "RestateCloudApiKey", { - secretStringValue: cdk.SecretValue.unsafePlainText(process.env.RESTATE_API_KEY!), + secretStringValue: cdk.SecretValue.unsafePlainText(process.env.RESTATE_AUTH_TOKEN!), }), }); const deployer = new restate.ServiceDeployer(this, "ServiceDeployer"); @@ -279,7 +279,7 @@ View an example of deploying to AWS Lambda with SDK for your SDK here: [TS](http - The `RESTATE_ENV_ID` can be found in the Restate Cloud UI in the top left corner when you select your environment. This ID starts with `env_`. -- For the `RESTATE_API_KEY`, create an API key via `Developers` tab of the Restate Cloud UI and give it `Full` permissions. +- For the `RESTATE_AUTH_TOKEN`, create an API key via `Developers` tab of the Restate Cloud UI and give it `Full` permissions. The `RestateCloudEnvironment` automatically creates an IAM role with an appropriate trust policy for the matching Restate Cloud environment. The `ServiceDeployer` construct automatically grants this role permission to invoke any AWS Lambda functions registered with the environment. For more details, consult the relevant [Restate CDK](https://www.npmjs.com/package/@restatedev/restate-cdk) constructs' API documentation.