Skip to content

feat: add GovCloud multi-partition support#908

Merged
aidandaly24 merged 1 commit intomainfrom
feat/govcloud-partition-support
Apr 23, 2026
Merged

feat: add GovCloud multi-partition support#908
aidandaly24 merged 1 commit intomainfrom
feat/govcloud-partition-support

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

Adds multi-partition support to the AgentCore CLI, enabling deployment to GovCloud (us-gov-west-1) and laying groundwork for China (cn-*) regions.

Core change: New src/cli/aws/partition.ts utility module that maps AWS regions to partition-specific values (ARN prefix, DNS suffix, console domain). All hardcoded arn:aws:, amazonaws.com, and console.aws.amazon.com references in source files have been replaced with dynamic calls to this utility.

Changes

  • New: src/cli/aws/partition.ts — central partition utility with getPartition, arnPrefix, dnsSuffix, serviceEndpoint, consoleDomain
  • New: src/cli/aws/__tests__/partition.test.ts — 15 unit tests covering all 3 partitions × 5 functions
  • ARN construction: 7 source files updated to use arnPrefix(region) instead of hardcoded arn:aws:
  • ARN validation: 3 files updated — regex patterns now use arn:[^:]+: to accept any partition
  • Endpoint URLs: 2 files updated to use serviceEndpoint() instead of hardcoded amazonaws.com
  • Console URLs: trace-url.ts updated to use consoleDomain() for partition-correct CloudWatch deep links
  • Region lists: us-gov-west-1 added to AgentCoreRegionSchema, BEDROCK_REGIONS, LLM compacted types, and tests
  • CDK config: Added aws-us-gov to cdk.json target-partitions
  • Static assets: execution-role-policy.json updated to use arn:*: partition wildcard for cross-partition IAM compatibility
  • Documentation: Added "Multi-Partition Support" section to AGENTS.md with rules and checklists for adding new regions/partitions

Companion PR

Supersedes

  • add govcloud support #776 by @onchrs — this PR is a superset of that work with additional coverage (endpoint URLs, ARN regexes, console URLs, static assets, cdk.json, documentation)

Related Issue

Closes #

Documentation PR

None required — documentation added inline in AGENTS.md

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@aidandaly24 aidandaly24 requested a review from a team April 22, 2026 15:02
@github-actions github-actions Bot added the size/m PR size: M label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.9.1.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-908-tarball/aws-agentcore-0.9.1.tgz

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.03% 7231 / 17202
🔵 Statements 41.44% 7664 / 18491
🔵 Functions 40.11% 1282 / 3196
🔵 Branches 40.5% 4824 / 11911
Generated in workflow #1897 for commit 9dd51f5 by the Vitest Coverage Report Action

@aidandaly24 aidandaly24 force-pushed the feat/govcloud-partition-support branch from 6241e3b to fcbcdc6 Compare April 22, 2026 17:37
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Apr 22, 2026
jariy17
jariy17 previously approved these changes Apr 22, 2026
Copy link
Copy Markdown
Collaborator

@jariy17 jariy17 left a comment

Choose a reason for hiding this comment

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

LGTM, just rebase if you can

@aidandaly24 aidandaly24 force-pushed the feat/govcloud-partition-support branch from fcbcdc6 to 50ed2b8 Compare April 23, 2026 13:50
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Apr 23, 2026
jariy17
jariy17 previously approved these changes Apr 23, 2026
@aidandaly24 aidandaly24 force-pushed the feat/govcloud-partition-support branch from 50ed2b8 to 8fd5408 Compare April 23, 2026 13:55
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Apr 23, 2026
@aidandaly24 aidandaly24 force-pushed the feat/govcloud-partition-support branch from 8fd5408 to 8fc528f Compare April 23, 2026 14:04
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Apr 23, 2026
@aidandaly24 aidandaly24 force-pushed the feat/govcloud-partition-support branch from 8fc528f to 1cba7c1 Compare April 23, 2026 14:08
@github-actions github-actions Bot removed the size/m PR size: M label Apr 23, 2026
Add partition-aware ARN construction, endpoint URL generation, and
console URL generation to support aws-us-gov (and future aws-cn)
partitions.

- Create src/cli/aws/partition.ts with getPartition, arnPrefix,
  dnsSuffix, serviceEndpoint, and consoleDomain utilities
- Replace all hardcoded arn:aws: in ARN template literals with
  arnPrefix(region)
- Update ARN regex patterns to accept any partition (arn:[^:]+:)
- Replace hardcoded amazonaws.com in endpoint URLs with
  serviceEndpoint()
- Replace hardcoded console.aws.amazon.com with consoleDomain()
- Add us-gov-west-1 to AgentCoreRegionSchema, BEDROCK_REGIONS,
  and LLM compacted types
- Add aws-us-gov to cdk.json target-partitions
- Fix execution-role-policy.json to use partition wildcard (arn:*)
- Add 15 unit tests for partition utilities
- Document multi-partition rules and checklists in AGENTS.md
@aidandaly24 aidandaly24 force-pushed the feat/govcloud-partition-support branch from 1cba7c1 to 9dd51f5 Compare April 23, 2026 14:22
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Apr 23, 2026
@aidandaly24 aidandaly24 merged commit 098b104 into main Apr 23, 2026
22 of 23 checks passed
@aidandaly24 aidandaly24 deleted the feat/govcloud-partition-support branch April 23, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants