Deploy with AWS CDK
Deploy the tutorial app with AWS CDK v2, TypeScript, and CloudFormation.
Deploy the app from Prepare the app with AWS CDK v2. CDK turns TypeScript into AWS CloudFormation stacks, groups of resources managed together. This page creates Postgres, three SQS queues, two app functions, a timer, and a container worker.
The shared maintenance entry point uses runlane.createMaintenanceHandler() and starts lazily. Export the handler directly; it ignores event and context arguments.
Before you start
Finish Prepare the app first. Use its app directory for every command below. You need Node.js 24, npm, Docker running, and the AWS CLI. Configure AWS credentials that can deploy these resources.
Use a disposable account and test data. The database accepts connection attempts from the internet. Removing these stacks deletes its data without a final snapshot. See Prepare for production before real use.
Choose one region for the whole tutorial:
export AWS_REGION=us-east-1
aws sts get-caller-identityThe identity command should show your intended AWS account.
Add CDK to the app
Install these versions in the same project. The CLI and library have separate version numbers:
npm install --save-dev --save-exact aws-cdk-lib@2.275.0 constructs@10.8.1 aws-cdk@2.1146.1 tsx@4.23.15
npx cdk --version
mkdir -p infratsx runs the TypeScript CDK app. Keep the updated package-lock.json.
{
"app": "npx tsx infra/app.ts"
}Replace tsconfig.json with this version. It adds infra/ to the existing check, so npm run typecheck checks both app and infrastructure code:
{
"compilerOptions": {
"target": "ES2024",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"types": ["node"]
},
"include": ["src/**/*.ts", "runlane.config.ts", "infra/**/*.ts"]
}Add these entries to .gitignore. The output file below contains resource names and a password-free URL, but .env will contain the password.
node_modules/
dist/
.env*
cdk.out/
cdk-outputs.json
cdk-data-outputs.jsonDefine the infrastructure
Create infra/app.ts. Append each TypeScript block in this section to that same file, in order.
Data stack and network
A virtual private cloud (VPC) is your AWS network. A subnet is a range of addresses within it. A security group holds network access rules.
import {
App,
CfnOutput,
Duration,
IgnoreMode,
RemovalPolicy,
SecretValue,
Stack,
type StackProps,
} from 'aws-cdk-lib'
import * as ec2 from 'aws-cdk-lib/aws-ec2'
import { Platform } from 'aws-cdk-lib/aws-ecr-assets'
import * as ecs from 'aws-cdk-lib/aws-ecs'
import * as iam from 'aws-cdk-lib/aws-iam'
import * as lambda from 'aws-cdk-lib/aws-lambda'
import * as logs from 'aws-cdk-lib/aws-logs'
import * as rds from 'aws-cdk-lib/aws-rds'
import * as scheduler from 'aws-cdk-lib/aws-scheduler'
import * as targets from 'aws-cdk-lib/aws-scheduler-targets'
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'
import * as sqs from 'aws-cdk-lib/aws-sqs'
import { type Construct } from 'constructs'
const name = 'runlane-tutorial'
const databaseSecretName = `${name}/database`
const publicSubnets = { subnetType: ec2.SubnetType.PUBLIC }
/** Owns the network, database, and queues shared by each release. */
class DataStack extends Stack {
readonly vpc: ec2.Vpc
readonly databaseUrl: string
readonly defaultQueue: sqs.Queue
readonly longRunningQueue: sqs.Queue
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props)
const stack = this
const vpc = new ec2.Vpc(stack, 'Network', {
vpcName: name,
maxAzs: 2,
natGateways: 0,
subnetConfiguration: [{ name: 'public', subnetType: ec2.SubnetType.PUBLIC }],
})
const databaseSecurityGroup = new ec2.SecurityGroup(stack, 'DatabaseAccess', { vpc })
databaseSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(5432))This creates public subnets in two Availability Zones, separate locations within the region. natGateways: 0 turns off CDK's default NAT gateways. A NAT gateway gives private workloads outbound internet access; this tutorial uses public paths instead. Lambda stays outside the VPC and has no fixed outbound IP. The database rule allows TCP 5432 from any IPv4 address.
The stack leaves its account and region unset. It can synthesize without credentials; deployment uses your AWS account and selected region. See CDK environments.
Database
const databaseSecret = new secretsmanager.Secret(stack, 'DatabaseCredentials', {
secretName: databaseSecretName,
generateSecretString: {
secretStringTemplate: JSON.stringify({ username: 'runlane' }),
generateStringKey: 'password',
passwordLength: 32,
excludePunctuation: true,
includeSpace: false,
},
removalPolicy: RemovalPolicy.DESTROY,
})
const database = new rds.DatabaseInstance(stack, 'Database', {
instanceIdentifier: name,
engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_17 }),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T4G, ec2.InstanceSize.MICRO),
allocatedStorage: 20,
storageType: rds.StorageType.GP3,
storageEncrypted: true,
databaseName: 'runlane',
credentials: rds.Credentials.fromSecret(databaseSecret),
vpc,
vpcSubnets: publicSubnets,
securityGroups: [databaseSecurityGroup],
publiclyAccessible: true,
multiAz: false,
backupRetention: Duration.days(0),
deletionProtection: false,
deleteAutomatedBackups: true,
removalPolicy: RemovalPolicy.DESTROY,
})
const databaseUrlTemplate = `postgresql://runlane:PASSWORD_FROM_SECRET@${database.dbInstanceEndpointAddress}:${database.dbInstanceEndpointPort}/runlane?sslmode=verify-full`
const databaseUrl = databaseUrlTemplate.replace(
'PASSWORD_FROM_SECRET',
SecretValue.secretsManager(databaseSecretName, { jsonField: 'password' }).unsafeUnwrap(),
)Secrets Manager generates a 32-character password with only letters and digits. The secret name is runlane-tutorial/database. Keep it stable for later releases. Like the other fixed names here, it allows one tutorial deployment per account and region. It has secret storage and API request charges. The RDS instance uses PostgreSQL 17, db.t4g.micro, and 20 GB of gp3 storage. DESTROY skips the final snapshot. RDS encrypts stored data. This test database keeps no backups.
SecretValue.secretsManager() uses the literal secret name, as AWS documents. The secret id has no cross-stack import. unsafeUnwrap() embeds that dynamic reference, not a plain password, in the template. CloudFormation resolves it during deployment. Lambda and ECS still receive the full URL in their environment. This is the tutorial's secret-handling trade-off; restrict who can read workload settings. See dynamic references and the production checklist.
Queues
const deadLetterQueue = new sqs.Queue(stack, 'DeadLetterQueue', {
queueName: `${name}-dead-letter`,
retentionPeriod: Duration.days(14),
removalPolicy: RemovalPolicy.DESTROY,
})
const defaultQueue = new sqs.Queue(stack, 'DefaultQueue', {
queueName: `${name}-default`,
visibilityTimeout: Duration.minutes(6),
deadLetterQueue: { queue: deadLetterQueue, maxReceiveCount: 5 },
removalPolicy: RemovalPolicy.DESTROY,
})
const longRunningQueue = new sqs.Queue(stack, 'LongRunningQueue', {
queueName: `${name}-long-running`,
visibilityTimeout: Duration.minutes(6),
deadLetterQueue: { queue: deadLetterQueue, maxReceiveCount: 5 },
removalPolicy: RemovalPolicy.DESTROY,
})
this.vpc = vpc
this.databaseUrl = databaseUrl
this.defaultQueue = defaultQueue
this.longRunningQueue = longRunningQueue
new CfnOutput(stack, 'databaseUrl', { value: databaseUrlTemplate })
new CfnOutput(stack, 'databaseSecretArn', { value: databaseSecret.secretArn })
new CfnOutput(stack, 'defaultQueueUrl', { value: defaultQueue.queueUrl })
new CfnOutput(stack, 'longRunningQueueUrl', { value: longRunningQueue.queueUrl })
new CfnOutput(stack, 'deadLetterQueueUrl', { value: deadLetterQueue.queueUrl })
new CfnOutput(stack, 'region', { value: stack.region })
}
}A dead-letter queue (DLQ) holds messages after repeated delivery failures. Both work queues move messages there after five receives. Their six-minute visibility timeout meets the Lambda SQS timeout rule for the one-minute delivery function.
App stack and Lambda functions
CDK has no deploy-time local command. Use two stacks so the data stack can finish before the CLI runs migrations. Deploy the app stack only after that command succeeds. Pass the data resources through constructor props:
/** Data-stack values used by the Lambda functions and worker. */
interface AppStackProps extends StackProps {
readonly vpc: ec2.IVpc
readonly databaseUrl: string
readonly defaultQueue: sqs.IQueue
readonly longRunningQueue: sqs.IQueue
}
/** Owns workloads deployed only after the release migration step succeeds. */
class AppStack extends Stack {
constructor(scope: Construct, id: string, props: AppStackProps) {
super(scope, id, props)
const stack = this
const { vpc, databaseUrl, defaultQueue, longRunningQueue } = props
const environment = {
DATABASE_URL: databaseUrl,
RUNLANE_ENVIRONMENT: 'tutorial',
RUNLANE_DEFAULT_QUEUE_URL: defaultQueue.queueUrl,
RUNLANE_LONG_RUNNING_QUEUE_URL: longRunningQueue.queueUrl,
}
const workQueueArns = [defaultQueue.queueArn, longRunningQueue.queueArn]
const logOptions = {
retention: logs.RetentionDays.ONE_WEEK,
removalPolicy: RemovalPolicy.DESTROY,
}
const functionOptions = {
runtime: lambda.Runtime.NODEJS_24_X,
architecture: lambda.Architecture.X86_64,
memorySize: 512,
}
const lambdaEnvironment = {
...environment,
NODE_EXTRA_CA_CERTS: '/var/task/certificates/rds-global-bundle.pem',
}
const deliveryRole = new iam.Role(stack, 'DeliveryRole', {
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
})
const delivery = new lambda.Function(stack, 'Delivery', {
...functionOptions,
functionName: `${name}-delivery`,
role: deliveryRole,
code: lambda.Code.fromAsset('dist/lambda'),
handler: 'delivery.handler',
timeout: Duration.minutes(1),
environment: lambdaEnvironment,
logGroup: new logs.LogGroup(stack, 'DeliveryLogs', {
...logOptions,
logGroupName: `/aws/lambda/${name}-delivery`,
}),
})
const maintenanceRole = new iam.Role(stack, 'MaintenanceRole', {
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
})
const maintenance = new lambda.Function(stack, 'Maintenance', {
...functionOptions,
functionName: `${name}-maintenance`,
role: maintenanceRole,
code: lambda.Code.fromAsset('dist/lambda'),
handler: 'maintenance.handler',
timeout: Duration.minutes(2),
environment: lambdaEnvironment,
logGroup: new logs.LogGroup(stack, 'MaintenanceLogs', {
...logOptions,
logGroupName: `/aws/lambda/${name}-maintenance`,
}),
})
delivery.logGroup.grantWrite(deliveryRole)
maintenance.logGroup.grantWrite(maintenanceRole)
delivery.addToRolePolicy(
new iam.PolicyStatement({
actions: ['sqs:ReceiveMessage', 'sqs:DeleteMessage', 'sqs:GetQueueAttributes'],
resources: [defaultQueue.queueArn],
}),
)
for (const fn of [delivery, maintenance]) {
fn.addToRolePolicy(
new iam.PolicyStatement({
actions: ['sqs:SendMessage'],
resources: workQueueArns,
}),
)
}CDK packages the existing ES module assets without bundling them again. The pinned library has Runtime.NODEJS_24_X. Lambda supplies AWS_REGION itself. The CA file enables verified database TLS.
An IAM role is an AWS identity with permission policies. Delivery can receive and delete default-queue messages and publish to both work queues. Maintenance can publish to both queues. Each role can write only to its own one-week log group.
Passing an explicit role avoids CDK's broad managed log policy. grantWrite grants only logs:CreateLogStream and logs:PutLogEvents on that group.
Delivery and maintenance schedule
const deliveryMapping = delivery.addEventSourceMapping('DefaultQueueMapping', {
eventSourceArn: defaultQueue.queueArn,
batchSize: 10,
reportBatchItemFailures: true,
maxConcurrency: 2,
})
deliveryMapping.node.addDependency(delivery)
new scheduler.Schedule(stack, 'MaintenanceSchedule', {
scheduleName: `${name}-maintenance`,
schedule: scheduler.ScheduleExpression.rate(Duration.minutes(1)),
timeWindow: scheduler.TimeWindow.off(),
target: new targets.LambdaInvoke(maintenance),
})An event source mapping polls SQS and calls Lambda. This mapping caps calls at two and accepts partial batch failures. It leaves function reserved concurrency unset; new accounts may lack quota to reserve it.
EventBridge Scheduler is AWS's timer service. It calls maintenance at rate(1 minute) with no flexible time window. Its role can invoke only maintenance. The target grant includes that function and its versions and aliases. Both are created by the app stack after migrations succeed.
Fargate worker
Fargate runs containers without servers for you to manage. An ECS task definition describes the image, resources, roles, and settings. ECS is the service that manages the worker. ECR, the Elastic Container Registry, stores its image.
const cluster = new ecs.Cluster(stack, 'Cluster', { vpc, clusterName: name })
const taskDefinition = new ecs.FargateTaskDefinition(stack, 'WorkerTask', {
cpu: 256,
memoryLimitMiB: 512,
runtimePlatform: {
cpuArchitecture: ecs.CpuArchitecture.X86_64,
operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
},
})
taskDefinition.addToTaskRolePolicy(
new iam.PolicyStatement({
actions: ['sqs:ReceiveMessage', 'sqs:DeleteMessage', 'sqs:ChangeMessageVisibility'],
resources: [longRunningQueue.queueArn],
}),
)
taskDefinition.addToTaskRolePolicy(
new iam.PolicyStatement({
actions: ['sqs:SendMessage'],
resources: workQueueArns,
}),
)
const workerLogs = new logs.LogGroup(stack, 'WorkerLogs', {
...logOptions,
logGroupName: `/runlane/${name}/worker`,
})
taskDefinition.addContainer('Worker', {
image: ecs.ContainerImage.fromAsset('.', {
platform: Platform.LINUX_AMD64,
ignoreMode: IgnoreMode.DOCKER,
exclude: ['cdk.out', 'infra', 'cdk*.json'],
}),
environment: {
...environment,
AWS_REGION: stack.region,
NODE_EXTRA_CA_CERTS: '/app/certificates/rds-global-bundle.pem',
},
logging: ecs.LogDrivers.awsLogs({ logGroup: workerLogs, streamPrefix: 'worker' }),
stopTimeout: Duration.seconds(60),
})
const worker = new ecs.FargateService(stack, 'WorkerService', {
cluster,
serviceName: `${name}-worker`,
taskDefinition,
desiredCount: 1,
minHealthyPercent: 100,
assignPublicIp: true,
vpcSubnets: publicSubnets,
circuitBreaker: { rollback: true },
})The worker gets 0.25 vCPU and 0.5 GB of memory. stopTimeout gives it 60 seconds to drain after SIGTERM. Its public IP lets it pull the image and reach SQS without NAT. Its task role can consume only long-running and publish to both work queues. CDK creates a separate execution role for image pulls and platform logs. The image asset grants pulls from only its bootstrap ECR repository. The log driver grants writes to only the worker log group. Neither role uses managed policies. ECR requires ecr:GetAuthorizationToken on *. The task role does not get sqs:GetQueueAttributes.
CDK reads the app's .dockerignore and adds the exclude patterns. This keeps node_modules, .git, .env*, the Lambda asset, and CDK output out of the staged image context. The Dockerfile copies the prebuilt worker and certificates. Platform.LINUX_AMD64 keeps Apple silicon builds compatible. See CDK image assets.
The deployment circuit breaker stops a rollout that cannot reach a steady state. It rolls back to a prior completed deployment when one exists. On the first deploy, there is no prior worker deployment to restore. Crashes after ECS declares success need runtime alarms.
The data stack creates no IAM roles. This VPC has no helper to change its default security group. Explicit log groups avoid log-retention helpers. Bootstrap roles belong to CDKToolkit, outside these app stacks; they manage deployments and shared assets.
Outputs
new CfnOutput(stack, 'deliveryFunctionName', { value: delivery.functionName })
new CfnOutput(stack, 'maintenanceFunctionName', { value: maintenance.functionName })
new CfnOutput(stack, 'workerLogGroup', { value: workerLogs.logGroupName })
new CfnOutput(stack, 'clusterName', { value: cluster.clusterName })
new CfnOutput(stack, 'serviceName', { value: worker.serviceName })
}
}
const app = new App()
const data = new DataStack(app, 'runlane-tutorial-data')
const workloads = new AppStack(app, 'runlane-tutorial-app', {
vpc: data.vpc,
databaseUrl: data.databaseUrl,
defaultQueue: data.defaultQueue,
longRunningQueue: data.longRunningQueue,
})
workloads.addStackDependency(data)
app.synth()CloudFormation cannot expose a secret value as an output. Here databaseUrl is a URL template with a PASSWORD_FROM_SECRET marker. databaseSecretArn locates the secret; the script below resolves it on your laptop. The data stack exposes the database, queue, and region keys. The app stack exposes the workload keys. They match Check the deployment.
Deploy
Bootstrap once per AWS account and region. This creates CDK's shared asset storage and deploy roles:
export AWS_ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"
npx cdk bootstrap "aws://$AWS_ACCOUNT_ID/$AWS_REGION"Build before every deploy. Synthesis packages the assets but does not deploy them or need credentials:
npm run typecheck
npm run build
npx cdk synth
npx cdk deploy runlane-tutorial-data --outputs-file cdk-data-outputs.jsonSynthesis warns about public RDS and the open port 5432 rule. These match the tutorial network. It also warns that cross-stack references default to strong. A strong reference stops CloudFormation from deleting a data stack resource while the app stack still uses it, which suits this two-stack layout. It also reports unconfigured feature flags. This page uses CDK's default behavior, so neither notice blocks the deploy.
Review and approve the IAM changes. This first deploy creates only the network, database, secret, and queues. RDS creation takes several minutes. It writes the data outputs to cdk-data-outputs.json. No app workloads start yet.
Next, save the env values and run migrations below. Then deploy the app stack. Follow this same order on every release. Do not deploy both stacks with --all, use hotswap, or disable rollback.
Save the outputs for the CLI
Your laptop needs secretsmanager:GetSecretValue on databaseSecretArn. This script reads the password through the AWS CLI without printing it. It writes .env with owner-only access and saves the resolved data output keys in .env.outputs.json.
import { execFileSync } from 'node:child_process'
import { chmodSync, readFileSync, writeFileSync } from 'node:fs'
const outputs = JSON.parse(readFileSync('cdk-data-outputs.json', 'utf8'))['runlane-tutorial-data']
const secret = JSON.parse(
execFileSync(
'aws',
[
'secretsmanager',
'get-secret-value',
'--secret-id',
outputs.databaseSecretArn,
'--region',
outputs.region,
'--query',
'SecretString',
'--output',
'text',
'--no-cli-pager',
],
{ encoding: 'utf8' },
),
)
outputs.databaseUrl = outputs.databaseUrl.replace('PASSWORD_FROM_SECRET', secret.password)
const values = {
DATABASE_URL: outputs.databaseUrl,
RUNLANE_ENVIRONMENT: 'tutorial',
RUNLANE_DEFAULT_QUEUE_URL: outputs.defaultQueueUrl,
RUNLANE_LONG_RUNNING_QUEUE_URL: outputs.longRunningQueueUrl,
AWS_REGION: outputs.region,
}
for (const [path, content] of [
[
'.env',
Object.entries(values)
.map(([key, value]) => `${key}=${value}`)
.join('\n') + '\n',
],
['.env.outputs.json', JSON.stringify(outputs, null, 2) + '\n'],
]) {
writeFileSync(path, content, { mode: 0o600 })
chmodSync(path, 0o600)
}Run it from the app root after the data stack finishes. Then run migrations:
node scripts/save-cdk-env.mjs
export NODE_EXTRA_CA_CERTS="$PWD/certificates/rds-global-bundle.pem"
npm exec -- runlane adapter postgres migrateBoth generated files contain the password. Keep them private; .gitignore and .dockerignore exclude .env*. The URL ends with ?sslmode=verify-full. Node reads the CA variable at process start, so export it before CLI commands. If .env.local exists, remove stale values that would override .env.
Deploy the app stack
Continue only if migrations exit with code zero. A failure stops the release; read the CLI output and fix the cause before retrying. Your release script or CI/CD job must keep this gate. CDK cannot run the local migration step for you.
npx cdk deploy runlane-tutorial-app --outputs-file cdk-outputs.jsonCDK builds the worker image through Docker and uploads the app assets. The app stack depends on the data stack. That stack dependency orders AWS resources; the CLI step above gates workload changes on migrations.
Merge the app outputs into the resolved data outputs for the checks:
import { chmodSync, readFileSync, writeFileSync } from 'node:fs'
const data = JSON.parse(readFileSync('.env.outputs.json', 'utf8'))
const app = JSON.parse(readFileSync('cdk-outputs.json', 'utf8'))['runlane-tutorial-app']
writeFileSync('.env.outputs.json', JSON.stringify({ ...data, ...app }, null, 2) + '\n', {
mode: 0o600,
})
chmodSync('.env.outputs.json', 0o600)node scripts/save-cdk-app-outputs.mjsFor later releases, repeat: build, deploy the data stack, refresh .env, run migrations, then deploy the app stack. Refresh the merged outputs too. Existing workers can keep running during this process, so use compatible task and schema changes.
Check it works
Follow Check the deployment to run both tasks and prove the timer works. Use .env.outputs.json for its output keys. Then prepare for production or remove the tutorial resources.
Remove everything
This deletes the database and its data without a final snapshot. It also deletes the three queues, app log groups, functions, schedule, worker service, cluster, and database secret:
npx cdk destroy --all
rm -f .env .env.outputs.json cdk-outputs.json cdk-data-outputs.jsonCloudFormation force-deletes the secret without a recovery window. This differs from normal Secrets Manager deletion, which waits at least seven days. Deletion still runs in the background. Before a fresh deploy, check that the old secret is gone:
aws secretsmanager describe-secret --secret-id runlane-tutorial/database --region "$AWS_REGION"Wait for ResourceNotFoundException; other errors do not prove deletion. Then the same name can be used again. If creation still reports a name conflict, wait and retry. After the new data stack deploys, rerun scripts/save-cdk-env.mjs. It reads the new secret ARN from the outputs, so no script change is needed.
The image and Lambda archives live in the shared bootstrap storage. Once both stacks are deleted, remove unused assets with CDK garbage collection:
npx cdk gc "aws://$AWS_ACCOUNT_ID/$AWS_REGION" --unstable=gc --created-buffer-days=0Review its deletion prompt. This scans unused CDK assets across the account and region, including older tutorial images. Run it only when other deployments have finished. The zero-day setting includes assets created today. Confirm the tutorial image is removed from ECR and its log groups and RDS instance are gone.
The CDKToolkit bootstrap stack keeps its S3 bucket, ECR repository, and IAM roles for later deploys. To remove these too, first check that no other CDK stacks need them. Delete CDKToolkit in CloudFormation, then empty and delete any retained bucket and repository. For a versioned bucket, remove all object versions and delete markers too.
Troubleshoot CDK
| Symptom | Fix |
|---|---|
| Bootstrap version or asset bucket error | Run cdk bootstrap for the same account and region as the deployment. Check your selected AWS profile. |
Synthesis cannot find dist/lambda | Run npm run build from the app root before cdk synth or cdk deploy. |
| Docker is unavailable during deploy | Start Docker. Keep the image context at the app root and build for linux/amd64. |
| Migration CLI fails | Read its output. Check .env, the CA path, and database access. Fix the cause and rerun the command before deploying the app stack. |
A failed first deploy leaves ROLLBACK_COMPLETE | Inspect the failure, then delete the failed stack before deploying again. Deleting the data stack also deletes the test database. |
| A function or queue name already exists | Remove a stale tutorial stack or use another account or region. These names are fixed for this exercise. |
For database, TLS, SQS, or worker failures, use the shared deployment troubleshooting guide.