Skip to content

feat: ask which existing agent space to connect LaunchDarkly to - #903

Closed
cchu-ld wants to merge 1 commit into
mainfrom
cchu/aws-devops-1-space-choice
Closed

cchu-ld wants to merge 1 commit into
mainfrom
cchu/aws-devops-1-space-choice

Conversation

@cchu-ld

@cchu-ld cchu-ld commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

This PR is part 1 of a stack of 7 PRs for ldcli aws-devops-agent. It goes on main. Review and merge the PRs in order.

  1. feat: ask which existing agent space to connect LaunchDarkly to #903 Agent space choice (this PR)
  2. feat: add AWS regions, send the API version, and shorten credential errors #904 Regions, API version, credential error
  3. feat: offer to run aws sso login when SSO credentials expire #905 aws sso login offer
  4. feat: show names and states in the plaintext status output #906 Readable status output
  5. feat: show the setup plan and ask before setup changes AWS #907 Setup plan and confirmation
  6. feat: run the setup plan that setup showed #908 Run the shown plan
  7. feat: choose the setup steps by who made the agent space #909 Ownership rule and existing spaces

Describe the solution you've provided

  • If the region already has agent spaces, setup lists them and asks which one to use. The list also has a choice to provision a new space.
  • On an existing space, setup only registers the LaunchDarkly MCP server and associates it with that space. It does not change the IAM roles, the account association, or the operator app of that space.
  • Without a terminal, setup reuses the space that matches --agent-space-name. If no space matches, it stops and asks for --agent-space-id or --new-agent-space.

Behavior change from main: --agent-space-id now only connects the MCP server. On main, it ran the full setup on that space. No release has the command yet.

Describe alternatives you've considered

None.

Additional context

Testing: go test ./... and golangci-lint pass on this branch.

🤖 Generated with Claude Code


Note

Overview
ldcli aws-devops-agent setup now handles accounts that already have DevOps Agent spaces instead of always running full provisioning.

In an interactive terminal, it lists existing agent spaces (plus an option to provision a new one), then either runs full Setup or ConnectExisting. ConnectExisting only registers and associates the LaunchDarkly MCP server on the chosen space—it does not create IAM roles, AWS account associations, or re-enable the operator app (avoiding overwriting sign-in config).

--agent-space-id is reframed to connect LaunchDarkly to that space (MCP-only path). --new-agent-space skips the prompt and provisions another space. Non-interactive runs (CI / JSON output) reuse a space whose name matches --agent-space-name for idempotent re-runs, or error with guidance to pass --agent-space-id or --new-agent-space when only unrelated spaces exist.

Adds AgentSpaces listing in internal/awsdevops, interactive selection helpers, tests, and README updates for the new behavior.

Reviewed by Cursor Bugbot for commit 4b6b341. Bugbot is set up for automated code reviews on this repo. Configure here.

If the region already has agent spaces, setup lists them and asks which
one to use. On an existing space, setup only registers the LaunchDarkly
MCP server and associates it with that space. It does not change the
roles, the account association, or the operator app of that space.

--agent-space-id picks a space without the list, and it now only
connects the MCP server. --new-agent-space provisions another space.
Without a terminal, setup reuses the space that matches
--agent-space-name, or stops if no space matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cchu-ld
cchu-ld force-pushed the cchu/aws-devops-1-space-choice branch from e469ef6 to 4b6b341 Compare October 20, 2026 16:55
@cchu-ld cchu-ld closed this Oct 20, 2026
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.

1 participant