# Production v2 deployment state

Created in AWS account `552185537300`, region `us-west-2`. Slack, Lark, and the
issue handler were redeployed from the local exact legacy APID request-format
changes at 2026-07-24 10:33 UTC. The runtime configuration key
for the Lake project is now consistently `TCLID`; no `TCLS` compatibility
alias remains. Migrated production channels, approved test channels, and the
Enterprise Lake group are enabled in source configuration.

## Resources

- Lambda `slack-bot-v2`, Node.js 24, handler `slack-bot/app.handler`,
  no reserved concurrency
- Lambda `lark-support-bot-v2`, Node.js 24, handler
  `lark-bot/app.handler`, no reserved concurrency
- Lambda `CreateJsmIssueHandler-v2`, Node.js 24, handler
  `create-issue-handler/index.handler`, no reserved concurrency
- Lambda `jsm-orgs-lambda-v2`, Node.js 24, handler
  `org-sync/index.handler`
- Scheduler `jsm-orgs-v2-daily-sync`, state `Enabled`, `rate(24 hours)`,
  timezone `Asia/Shanghai`, maximum retry attempts `3`
- Scheduler execution role `jsm-orgs-lambda-v2-scheduler-role`, scoped to
  invoke only `jsm-orgs-lambda-v2`
- Layer `jsm-production-v2-dependencies:3` attached to all four functions
- Queue `JsmBotTicketQueue-v2`
- DLQ `JsmBotTicketQueue-v2-dlq`, maximum receive count `3`
- SQS event source mapping `6ad3bb0e-3a7d-4a5c-a796-371bbc038c04`, state `Enabled`, batch size `1`
- Slack HTTP API `knj0kkq1sh`, route `ANY /slack-bot-v2`
- Lark HTTP API `abfl58h599`, route `ANY /lark-support-bot-v2`

The corresponding endpoints are:

- `https://knj0kkq1sh.execute-api.us-west-2.amazonaws.com/default/slack-bot-v2`
- `https://abfl58h599.execute-api.us-west-2.amazonaws.com/default/lark-support-bot-v2`

The v2 Bot Lambdas and `CreateJsmIssueHandler-v2` use the existing dev Slack
and Lark application credentials. The callback endpoints are not yet
configured in those applications.

`CreateJsmIssueHandler-v2` currently uses the same Jira identity and token as
the legacy `CreatJsmIssueHandler` for APID compatibility testing. No secret
value is stored in this file.

`slack-bot-v2` was redeployed at 2026-07-24 10:45 UTC after aligning
`C08PE55GQF2` with `C067K20786A`; both now use Shared Organization `62`.

## Deployment validation

- All four AWS code hashes match the locally built archives.
- The locally built Slack, Lark, and issue-handler archives match their
  deployed AWS `CodeSha256` values exactly.
- Every function is `Active` with `LastUpdateStatus: Successful`.
- The three interactive functions use the account concurrency pool, matching
  their production counterparts.
- The issue worker event source mapping is `Enabled`.
- The v2 queue was empty when the mapping was enabled.
- The org synchronizer Scheduler is `Enabled`.
- The production snapshot API is available. A manual synchronization completed
  successfully for all 18 configured orgs after retired orgs were removed.
- All four deployment archives load their configured handler with the shared
  Layer dependencies present.

## IAM parity

Each v2 Lambda has an independent role. Slack, Lark, and issue creation roles
match their current production counterpart: a function-scoped CloudWatch Logs
policy plus `AmazonSQSFullAccess`. The Lark role additionally has the same
self-invocation permission, scoped to `lark-support-bot-v2`.

## Required before sending pilot traffic

1. Configure the dev Slack and Lark applications with the v2 callback URLs.
2. Verify ST, TCID, and TCLID creation through their formal
   `Submit a request` request types.
3. Verify at least one automatic `jsm-orgs-v2-daily-sync` execution.
