Skip to content

Add 'integrations add aws' command (onboarding 3/3) - #7

Draft
droth-plerion wants to merge 3 commits into
plerionhq:mainfrom
droth-plerion:feat/integrations-add-aws-cli
Draft

Add 'integrations add aws' command (onboarding 3/3)#7
droth-plerion wants to merge 3 commits into
plerionhq:mainfrom
droth-plerion:feat/integrations-add-aws-cli

Conversation

@droth-plerion

Copy link
Copy Markdown

3 of 3 in the integrations add aws series (token plumbing → onboarding engine → this). Stacked on the engine PR — review only the last commit. Jira: PL-5466 · APPP-15.

What

plerion integrations add aws --aws-profile prod --aws-region ap-southeast-2

Wires the engine to a new subcommand under integrations (provider-extensible: add azure|gcp can follow). Happy path needs at most the AWS profile and region — the target account is resolved via STS and confirmed interactively; --yes + --expect-account-id for CI. --dry-run prints the fully offline plan (the security-review artifact; AuthToken redacted), --validate-only runs every check without deploying.

Exit codes for scripting: 0 ok · 1 config/API · 2 preflight/aborted · 3 deploy failed · 4 already onboarded (--allow-existing). Implemented via an OnboardError downcast in main.rs; every other command still exits 1.

Testing

5 subprocess tests (tests/cli_onboard_test.rs): offline dry-run incl. redaction assertions, flag validation, exit-code contract, help completeness. Full suite: 326 tests green, clippy clean. Binary exercised manually (dry-run output + help).

Docs: README section here; docs.plerion.com page in plerionhq/docs#151.

🤖 Generated with Claude Code

droth-plerion and others added 3 commits July 23, 2026 13:23
generate_token now takes Option<&str>: Some(id) keeps the existing
integration-scoped behavior (aws generate-token is unchanged), None issues
the bare POST that mints an onboarding token for registering a new AWS
account. New typed envelope models for the three AWS endpoints; the raw
subcommands keep returning serde_json::Value so their output is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 2c1bffa)
Library-only orchestration for end-to-end AWS account onboarding, behind
an AwsApi trait so the state machine is unit-testable without AWS
(aws-sdk-* types are confined to sdk.rs). Covers preflight (STS account
resolution, stack conflicts, duplicate detection via IAM roles AND the
tenant integration list, advisory IAM simulation tolerant of Identity
Center false negatives, template validation), a short-lived registration
token minted last, CreateStack with CAPABILITY_NAMED_IAM, polling with
failure-event reporting, and an offline dry-run plan renderer with the
AuthToken always redacted.

No CLI surface change in this commit — the command lands next.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wires the onboarding engine to a new subcommand under the integrations
group. Happy path needs at most --aws-profile/--aws-region: the account
is resolved via STS and confirmed interactively (--yes plus
--expect-account-id for CI). --dry-run prints a fully offline plan with
the AuthToken redacted; --validate-only runs all checks without
deploying. Exit codes for scripting: 0 ok, 1 config/API, 2 preflight or
aborted, 3 deploy failed, 4 already onboarded (--allow-existing to
override) — scoped to this command via an OnboardError downcast in
main.rs; every other command still exits 1. Removes the temporary
dead_code allowance on the AWS models now that the binary consumes them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@droth-plerion

Copy link
Copy Markdown
Author

Series: #5 (token plumbing) → #6 (onboarding engine, stacked on #5) → #7 (CLI command, stacked on #6). Merge in order; each is independently green (build, tests, clippy). Supersedes #4.

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