const app = new cdk.App();
const stack = new cdk.Stack(app, "e2e-RestateServerEC2", {
env: { account: app.node.getContext("account"), region: app.node.getContext("region") },
});
const handler: lambda.Function = new lambda.Function(stack, "Service", {
runtime: lambda.Runtime.NODEJS_LATEST,
code: lambda.Code.fromAsset("bundle.js"),
handler: "handler",
});
const environment = new SingleNodeRestateDeployment(stack, "Restate", {
logGroup: new logs.LogGroup(stack, "RestateLogs", {
retention: logs.RetentionDays.ONE_MONTH,
removalPolicy: cdk.RemovalPolicy.DESTROY,
}),
});
const deployer = new ServiceDeployer(stack, "ServiceDeployer", {
logGroup: new logs.LogGroup(stack, "Deployer", {
retention: logs.RetentionDays.ONE_MONTH,
removalPolicy: cdk.RemovalPolicy.DESTROY,
}),
// vpc,
// vpcSubnets,
});
deployer.deployService("Greeter", handler.currentVersion, environment, {
private: false,
insecure: true, // self-signed certificate
skipInvokeFunctionGrant: true,
});
UPDATE_ROLLBACK_COMPLETE: Received response status [FAILED] from custom resource. Message returned: Giving up after 3 attempts. Last error: Registration failed (500): {"message":"[META0003] client error: lambda service returned error: dispatch failure: other: an error occurred while loading credentials: service error: unhandled error (AccessDenied): Error { code: \"AccessDenied\", message: \"User: arn:aws:sts::663487780041:assumed-role/LambdaTsCdkStack-RestateInstanceRoleACC59A6F-Eoxwkukngoh4/i-07ee19f38ba94329c is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::663487780041:role/LambdaTsCdkStack-RestateInstanceRoleACC59A6F-Eoxwkukngoh4\", aws_request_id: \"25ae3770-3216-4073-b358-977683c0cafa\" } (DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: ProviderError(ProviderError { source: ServiceError(ServiceError { source: Unhandled(Unhandled { source: ErrorMetadata { code: Some(\"AccessDenied\"), ...