aws / aws/agentcore-cli

Deploying the same agent in different target regions for the same account fails

Open
#1,263 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
283
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
183

Description

### Description

I have setup an agent harness and added a second target region for the same account. Deployment to the first region succeeds. When deploying to the second region the deployment fails.
When running the CLI in TUI mode, error message is not returned in the UI (but is present in the log).

```
[09:10:36] Error: CDK deploy failed: ❌ AgentCore-HarnessTest-eu failed: DeploymentError: The stack named AgentCore-HarnessTest-eu failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "Resource of type 'AWS::IAM::Role' with identifier 'HarnessTest_MyHarness' already exists." (RequestToken: a67da7f0-e57d-39b6-cd35-f086e9018be4, HandlerErrorCode: AlreadyExists)
[09:10:36] Status: FAILED
```

### Steps to Reproduce

1. Create a new agent harness
2. ensure you have two targets in `agentcore/aws-targets.json` for same account different regions
3. deploy the agent in one target
4. deploy the agent in another target

### Expected Behavior

Deployment succeeds

### Actual Behavior

Deployment fails because IAM role already exists

### CLI Version

_No response_

### Operating System

macOS

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.