Add AWS onboarding engine, library-only (onboarding 2/3) - #6
Draft
droth-plerion wants to merge 2 commits into
Draft
Add AWS onboarding engine, library-only (onboarding 2/3)#6droth-plerion wants to merge 2 commits into
droth-plerion wants to merge 2 commits into
Conversation
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>
Author
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2 of 3 in the
integrations add awsseries (token plumbing → this → CLI command). Stacked on the plumbing PR — review only the last commit. Jira: PL-5466 · APPP-15.What
The onboarding engine as a library-only module (
src/onboard/) — no CLI surface change. It orchestrates end-to-end AWS account onboarding:external-id → pinned template (+ opportunistic
serviceAccountIdpickup) → preflight → confirmation seam → short-lived registration token (minted last) → CreateStack (CAPABILITY_NAMED_IAM,OnFailure=ROLLBACK) → poll with failure-event reporting → outputs.Preflight encodes two lessons from a live onboarding run:
iam:SimulatePrincipalPolicyreports false denials for Identity Center admins (reproduced with full AdministratorAccess) → simulation is advisory by default, fatal only with strict mode.*PlerionAccessRole*, any stack name) and the tenant'sintegrations list.Design
AwsApitrait with owned domain types;sdk.rsis the only file importingaws-sdk-*. The state machine is unit-testable without AWS.aws-config+aws-sdk-sts/iam/cloudformation+async-trait. Please run the 5-target cross release build on this branch — aws-lc-rs undercross/musl is the known risk; fallback is pinning a ring-based rustls HTTP client viaSdkConfig::http_client.Testing
17 scenarios in
tests/onboard_test.rswith a scriptedAwsApi+ScriptedUi+ mockito Plerion server: happy path, account-guard mismatch, ROLLBACK_COMPLETE hint, duplicate confirm/deny/allow-existing/non-interactive, advisory vs strict simulation, simulation-unavailable, deploy failure with expired-token hint, timeout, stack-name prefix rule, missing service-account guidance. Zero warnings, clippy clean.🤖 Generated with Claude Code