Skip to content

feat: show the setup plan and ask before setup changes AWS - #907

Closed
cchu-ld wants to merge 1 commit into
cchu/aws-devops-4-statusfrom
cchu/aws-devops-5-plan
Closed

cchu-ld wants to merge 1 commit into
cchu/aws-devops-4-statusfrom
cchu/aws-devops-5-plan

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 5 of a stack of 7 PRs for ldcli aws-devops-agent. It goes on PR 4 of the stack. Review and merge the PRs in order.

  1. feat: ask which existing agent space to connect LaunchDarkly to #903 Agent space choice
  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 (this PR)
  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

  • setup shows a plan before the first write to AWS. The plan names the account, region, profile, IAM roles, agent space, operator app, and MCP server, and what setup will do to each.
  • In a terminal, setup asks Continue? [y/N]. Only y or yes continues. The new --yes flag skips the question.
  • The plan, the space list, the prompts, and the progress go to stderr. Stdout has only the result, so a json run shows the plan and keeps valid JSON on stdout.
  • Progress lines show names and IDs, not ARNs. The JSON result keeps the ARNs.
  • All prompts read from one stdin. Each prompt reads only its own line, so a pasted answer stays for the next prompt.
  • --agent-space-id and --new-agent-space are mutually exclusive. With --auth-flow, --agent-space-id runs the full setup on that space. IdC flags need --auth-flow=idc, and IdP flags need --auth-flow=idp.

In this PR, setup shows the plan and then runs the same steps as before. The next PR makes setup run the plan that it showed.

Describe alternatives you've considered

None.

Additional context

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

🤖 Generated with Claude Code


Note

Overview
aws-devops-agent setup now prints a setup plan on stderr (account, region, profile, IAM roles, agent space, operator app, MCP server) before any AWS writes. In an interactive plaintext terminal it prompts Continue? [y/N] and aborts unless the answer is y or yes; --yes skips the prompt. JSON and non-interactive runs still show the plan but do not ask; stdout stays limited to the final result so --output json remains valid.

I/O and prompts: Plan, space-selection prompts, SSO login offers, progress logs, and the optional MCP token prompt move to stderr; a shared stdin reader keeps multi-step prompts from eating each other’s input. SSO login is suppressed when output is JSON.

Flags and behavior: --agent-space-id and --new-agent-space are mutually exclusive. --agent-space-id alone only connects the MCP server; passing --auth-flow (explicitly changed) triggers full provisioning on that space. IdC/IdP-related flags are validated against the matching --auth-flow. Setup progress messages use role names and IDs instead of ARNs.

Internals: Adds read-only PlanSetup / SetupPlan for dry-run planning. Token validation reuses resources.APIVersion. status labels unnamed services as Service. README documents the new flow.

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

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7e558d1. Configure here.

Comment thread internal/awsdevops/setup.go Resolved
@cchu-ld
cchu-ld added this pull request to stack #910 October 20, 2026 16:53
Setup shows a plan before the first write to AWS. The plan names the
account, region, profile, IAM roles, agent space, operator app, and MCP
server. In a terminal, setup asks "Continue? [y/N]". The new --yes flag
skips the question.

The plan, the space list, the prompts, and the progress go to stderr.
Stdout has only the result, so a json run shows the plan and keeps
valid JSON on stdout. Progress lines show names, not ARNs.

All prompts read from one stdin. Each prompt reads only its own line,
so a pasted answer stays for the next prompt.

--agent-space-id and --new-agent-space are mutually exclusive. With
--auth-flow, --agent-space-id runs the full setup on that space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cchu-ld
cchu-ld force-pushed the cchu/aws-devops-5-plan branch from 7e558d1 to 424e1e9 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