Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/cloud/connecting-services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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.

Expand Down
Loading