Skip to content

Add --region-id to compute-config scaling groups - #1239

Open
mani-j9 wants to merge 1 commit into
mani/cli-lambdafrom
mani/cli-region-id
Open

mani-j9 wants to merge 1 commit into
mani/cli-lambdafrom
mani/cli-region-id

Conversation

@mani-j9

@mani-j9 mani-j9 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Related issues

temporalio/api#875 (region_ids), released in api-go v1.64.0. Stacked on the compute-config command tree PR.

What changed?

  • aws-lambda create and aws-lambda update take --region-id, which can be passed more than once. A scaling group with regions is only used while the Namespace is active in one of them.
  • aws-lambda update --region-id on its own changes only the regions. The values passed replace the existing ones.
  • compute-config describe shows each scaling group's regions, under RegionIds in the text output and regionIds in JSON.
  • Bumps go.temporal.io/api to v1.64.0, the first release with region_ids, and go.temporal.io/sdk to v1.49.0, which renames StartActivityOptions.Details to StaticDetails.

Checklist

  • No breaking changes; adds a flag and output fields
  • Help text follows the style guide in commands.yaml
  • Functional tests (SharedServerSuite)

Manual tests

I ran 10 scenarios against a Temporal Cloud test cell with a Namespace replicated across aws-us-west-2 and aws-us-east-1, and an AWS Lambda function in each region. All of them behaved as expected.

Setup: a Worker Deployment YourDeploymentName, an AWS Lambda function in each region, and an IAM role that the Temporal server can assume.

Happy path

$ temporal worker deployment version compute-config aws-lambda create \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-west-2 \
    --region-id aws-us-west-2 \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully created worker deployment version

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-west-2
  RegionIds     aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

Add a scaling group for the other region, a fallback without regions, a scaling group for several regions (repeated values are kept once), and a regional scaling group for one Task Queue type:

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-east-1 \
    --region-id aws-us-east-1 \
    --function-arn YourOtherRegionLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group multi \
    --task-queue-type activity \
    --region-id aws-us-west-2 \
    --region-id aws-us-east-1 \
    --region-id aws-us-west-2 \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-east-1-wf \
    --region-id aws-us-east-1 \
    --task-queue-type workflow \
    --function-arn YourOtherRegionLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionIds     aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup    aws-us-east-1-wf
  TaskQueueTypes  workflow
  RegionIds       aws-us-east-1
  Provider        aws-lambda
  Scaler          no-sync

  ScalingGroup  aws-us-west-2
  RegionIds     aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup    multi
  TaskQueueTypes  activity
  RegionIds       aws-us-east-1, aws-us-west-2
  Provider        aws-lambda
  Scaler          no-sync

--region-id on its own replaces only the regions, and other updates keep them:

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group multi \
    --region-id aws-us-east-1
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-east-1 \
    --scale-up-cooloff-ms 500
Successfully updated worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionIds     aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync (scale_up_cooloff_ms 500)

  ScalingGroup    aws-us-east-1-wf
  TaskQueueTypes  workflow
  RegionIds       aws-us-east-1
  Provider        aws-lambda
  Scaler          no-sync

  ScalingGroup  aws-us-west-2
  RegionIds     aws-us-west-2
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup    multi
  TaskQueueTypes  activity
  RegionIds       aws-us-east-1
  Provider        aws-lambda
  Scaler          no-sync

Error case

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group YourScalingGroup \
    --region-id "" \
    --function-arn YourLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Error: --region-id cannot be empty
$ echo $?
1

$ temporal worker deployment version compute-config aws-lambda update \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group second-catch-all \
    --region-id aws-us-east-1 \
    --function-arn YourOtherRegionLambdaFunctionARN \
    --assume-role-arn YourAssumeRoleARN \
    --assume-role-external-id YourExternalID
Error: error updating worker deployment version compute config: entry aws-us-east-1: only one scaling group in region aws-us-east-1 can have no task types defined

Composition: remove the aws-us-west-2 scaling group, so the default fallback serves that region

$ temporal worker deployment version compute-config remove \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID \
    --scaling-group aws-us-west-2
Successfully removed worker deployment version compute config

$ temporal worker deployment version compute-config describe \
    --deployment-name YourDeploymentName \
    --build-id YourBuildID
Compute Config Scaling Groups:
  ScalingGroup  aws-us-east-1
  RegionIds     aws-us-east-1
  Provider      aws-lambda
  Scaler        no-sync (scale_up_cooloff_ms 500)

  ScalingGroup    aws-us-east-1-wf
  TaskQueueTypes  workflow
  RegionIds       aws-us-east-1
  Provider        aws-lambda
  Scaler          no-sync

  ScalingGroup  default
  Provider      aws-lambda
  Scaler        no-sync

  ScalingGroup    multi
  TaskQueueTypes  activity
  RegionIds       aws-us-east-1
  Provider        aws-lambda
  Scaler          no-sync

@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch from dce9828 to 704c430 Compare October 20, 2026 21:30
@mani-j9
mani-j9 marked this pull request as ready for review October 20, 2026 21:43
@mani-j9
mani-j9 requested a review from a team as a code owner October 20, 2026 21:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-23T00:14:07.555944Z 11f685d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@harish-narayanappa-10
harish-narayanappa-10 added this pull request to stack #1241 October 20, 2026 23:00
@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch from 704c430 to 1a35604 Compare October 21, 2026 00:44
@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch from 0a3bb91 to cd70d5e Compare October 22, 2026 21:36
@mani-j9
mani-j9 requested a review from seanbollin October 22, 2026 21:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd70d5e6bb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +246 to +247
if r == "" {
return nil, fmt.Errorf("--region-id cannot be empty")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow clearing a scaling group's region IDs

When an existing regional scaling group needs to become a region-agnostic fallback, the update must send the region_ids mask with an empty list. Omitting --region-id deliberately preserves the current list, while passing the only representable empty list (--region-id "") is rejected here, so the CLI cannot perform that transition without deleting and recreating the scaling group. Provide an explicit clearing form or interpret an empty occurrence as an empty replacement.

Useful? React with 👍 / 👎.

@mani-j9
mani-j9 force-pushed the mani/cli-region-id branch from cd70d5e to 11f685d Compare October 23, 2026 00:13
ScalingGroup string
RegionId string
FlagSet *pflag.FlagSet
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this allowing multiple region-id to be set for a scaling group (as the examples show?) Also, I am not seeing anything related to task-queue-type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants