[AWS Onboarding] Add Connect Account step UI#271195
Conversation
…nagement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Prompt Changes DetectedChanges have been detected to one or more prompt files in the Elastic Assistant plugin. Please remember to update the integrations repository with your prompt changes to ensure consistency across all deployments. Next Steps:
This is an automated reminder to help maintain prompt consistency across repositories. |
1a3128e to
2a36df2
Compare
|
Pinging @elastic/fleet (Team:Fleet) |
|
@Omolola-Akinleye all changes are in |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the AWS “Connect Account” step to the Ingest Hub onboarding flow by integrating Fleet’s new AwsConnectSetup UI and persisting user selections across navigation.
Changes:
- Wire Ingest Hub onboarding “Connect” step to Fleet’s
LazyAwsConnectSetup, including step-to-step navigation (onNext) - Add session-backed onboarding flow context to preserve connector selection / entered keys across back navigation
- Extend Fleet with AWS connect setup UI + create-cloud-connector hook and update cloud connector secret-reference handling + tests
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| x-pack/platform/plugins/shared/ingest_hub/kibana.jsonc | Declares Fleet as a required plugin for the new Connect step integration |
| x-pack/platform/plugins/shared/ingest_hub/public/onboarding/onboarding_app.tsx | Adds React Query + onboarding flow provider around the onboarding router |
| x-pack/platform/plugins/shared/ingest_hub/public/onboarding/step_components/connect_step.tsx | Replaces placeholder “Connect” UI with Fleet’s lazy AWS connect setup component |
| x-pack/platform/plugins/shared/ingest_hub/public/onboarding/onboarding_flow_context.tsx | Introduces sessionStorage-backed state for the Connect step |
| x-pack/platform/plugins/shared/ingest_hub/public/onboarding/onboarding_shell.tsx | Threads onNext into step components and advances the flow when pressed |
| x-pack/platform/plugins/shared/ingest_hub/test/scout/ui/tests/onboarding_connect_step.spec.ts | Adds Scout UI coverage for the Connect step behaviors |
| x-pack/platform/plugins/shared/fleet/public/components/cloud_connector/aws_connect_setup/* | Implements the AWS auth-type selector + sub-forms + identity federation creation flow |
| x-pack/platform/plugins/shared/fleet/public/components/cloud_connector/hooks/use_create_cloud_connector.ts | Adds a React Query mutation wrapper for creating cloud connectors |
| x-pack/platform/plugins/shared/fleet/common/types/models/cloud_connector.ts | Adds a secret-reference type guard and broadens AWS external_id typing |
| x-pack/platform/plugins/shared/fleet/server/services/cloud_connector.ts | Uses the new type guard when extracting/validating secret references |
| packages/kbn-optimizer/limits.yml | Updates optimizer budgets for Fleet and Ingest Hub bundles |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } else { | ||
| setSelectedTabId(cloudConnectors.length > 0 ? TABS.EXISTING_CONNECTION : TABS.NEW_CONNECTION); | ||
| } | ||
| }, [cloudConnectors.length, isEditPage]); |
There was a problem hiding this comment.
A review with Claude flagged that this useEffect might create issues and suggested to run only on initial load, since it changes the selected tab every time cloudConnectors.length changes
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
- Accept onNext prop from OnboardingShell (introduced by PR elastic#271195) - Import useOnboardingFlow to read connectorId and derive authType - Wire onClick={onNext} on the Continue button - Remove duplicate @kbn/fleet-plugin from tsconfig kbn_references - Keep selectedServices/serviceVars/isNewConnection as TODO stubs until the Services step PR extends OnboardingFlowContext Co-authored-by: Cursor <cursoragent@cursor.com>
rStelmach
left a comment
There was a problem hiding this comment.
obs-onboarding changes LGTM
- Accept onNext prop from OnboardingShell (introduced by PR elastic#271195) - Import useOnboardingFlow to read connectorId and derive authType - Wire onClick={onNext} on the Continue button - Remove duplicate @kbn/fleet-plugin from tsconfig kbn_references - Keep selectedServices/serviceVars/isNewConnection as TODO stubs until the Services step PR extends OnboardingFlowContext Co-authored-by: Cursor <cursoragent@cursor.com>
- Accept onNext prop from OnboardingShell (introduced by PR elastic#271195) - Import useOnboardingFlow to read connectorId and derive authType - Wire onClick={onNext} on the Continue button - Remove duplicate @kbn/fleet-plugin from tsconfig kbn_references - Keep selectedServices/serviceVars/isNewConnection as TODO stubs until the Services step PR extends OnboardingFlowContext Co-authored-by: Cursor <cursoragent@cursor.com>
…urity-apps to cloud-services (#271728) ## Summary - Reassigns `@elastic/contextual-security-apps` co-ownership of Fleet's `cloud_connector` code to `@elastic/cloud-services`. - Adds explicit co-ownership for the server-side `cloud_connector` route and services dirs (previously only inherited from the parent `fleet` rule). - Context: [kibana#271195 (comment)](#271195 (comment)). ## Paths affected | Path | Before | After | | --- | --- | --- | | `x-pack/platform/plugins/shared/fleet/public/components/cloud_connector` | `@elastic/fleet @elastic/contextual-security-apps` | `@elastic/fleet @elastic/cloud-services` | | `x-pack/platform/plugins/shared/fleet/common/services/cloud_connectors` | `@elastic/fleet @elastic/contextual-security-apps` | `@elastic/fleet @elastic/cloud-services` | | `x-pack/platform/plugins/shared/fleet/server/routes/cloud_connector` | (inherited `@elastic/fleet`) | `@elastic/fleet @elastic/cloud-services` *(new)* | | `x-pack/platform/plugins/shared/fleet/server/services/cloud_connectors` | (inherited `@elastic/fleet`) | `@elastic/fleet @elastic/cloud-services` *(new)* | Other `cloud_security_posture` / `cloud_posture_third_party_support_callout` lines in the same block are intentionally left as-is. ## Test plan - [ ] CI CODEOWNERS validation passes. - [ ] Confirm a follow-up PR touching `fleet/public/components/cloud_connector/**` auto-requests review from `@elastic/cloud-services` (and not `@elastic/contextual-security-apps`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary Implements the **Connect Account** step of the AWS onboarding flow (issue [elastic#7620](https://github.com/elastic/ingest-dev/issues/7620)), letting users choose how Elastic authenticates to their AWS account before proceeding to subsequent steps. Plan to move the Account step later in the flow, to start with Services and show the Account step based on selected services: FI only if supported by selected services, ECF/Firehose doesn't need Account setup. ### What's added **Fleet plugin — `AwsConnectSetup` component** (exported as `LazyAwsConnectSetup`): - `AwsAuthTypeSelector`: select between **Identity Federation** (cloud connector), **Static keys** and ** Temporary keys** - `AwsIdentityFederationSetup`: tabbed UI with an **Existing Identity** selector (reuses `CloudConnectorSelector`) and a **New Identity** form (Role ARN + External ID + connector name + CloudFormation launcher). The "Create Identity" button calls the cloud connector API and auto-selects the new connector on success. - `AwsStaticKeysForm`: fields for Access Key ID, Secret Access Key - `AwsTemporaryKeysForm`: fields for Access Key ID, Secret Access Key, and Session Token - `useCreateCloudConnector`: `react-query` mutation hook wrapping `POST /api/fleet/cloud_connectors` **Ingest Hub plugin — onboarding flow wiring**: - `onNext` callback threaded from `OnboardingShell` → step components → `AwsConnectSetup`; clicking Next marks the step complete and advances to the next step - `OnboardingFlowProvider` / `useOnboardingFlow`: React context backed by `sessionStorage` (`onboarding.aws.connectStep`) holding the selected `connectorId`, entered `staticKeys` or `temporaryKeys` as a single object - Connector selection and static/temporary key fields are **preserved when navigating back** to the Connect step: initial values are passed into the sub-forms on remount, and auth type is restored from stored state - Added Scout UI tests ## Test plan - Enable feature flag: ``` feature_flags.overrides: ingestHub.onboardingEnabled: true ``` - [ ] Select **Identity Federation**, create a new identity via CloudFormation → connector appears in Existing tab and is auto-selected → Next button becomes active - [ ] Select an existing identity from the dropdown → Next button becomes active - [ ] Switch to **Static keys**, enter Access Key ID + Secret → Next button becomes active - [ ] Switch to **Temporary keys**, enter form fields → Next button becomes active - [ ] Click Next on Connect step → moves to Services step; click back → previously selected connector / entered keys are still shown - [ ] Refresh page while on Connect step → session storage restores prior selections 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Screenshots <img width="1203" height="668" alt="image" src="https://github.com/user-attachments/assets/3a70815a-a3f8-46af-aada-68c3cb3d8c15" /> <img width="1207" height="954" alt="image" src="https://github.com/user-attachments/assets/09ee3644-856e-4595-801d-80109a87260a" /> <img width="1208" height="694" alt="image" src="https://github.com/user-attachments/assets/0ef3a47a-cb4d-4c23-8dc7-080f727ce6ce" /> <img width="1200" height="685" alt="image" src="https://github.com/user-attachments/assets/ab9e3908-d41d-44f3-8400-7eab4eb5872a" /> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…urity-apps to cloud-services (elastic#271728) ## Summary - Reassigns `@elastic/contextual-security-apps` co-ownership of Fleet's `cloud_connector` code to `@elastic/cloud-services`. - Adds explicit co-ownership for the server-side `cloud_connector` route and services dirs (previously only inherited from the parent `fleet` rule). - Context: [kibana#271195 (comment)](elastic#271195 (comment)). ## Paths affected | Path | Before | After | | --- | --- | --- | | `x-pack/platform/plugins/shared/fleet/public/components/cloud_connector` | `@elastic/fleet @elastic/contextual-security-apps` | `@elastic/fleet @elastic/cloud-services` | | `x-pack/platform/plugins/shared/fleet/common/services/cloud_connectors` | `@elastic/fleet @elastic/contextual-security-apps` | `@elastic/fleet @elastic/cloud-services` | | `x-pack/platform/plugins/shared/fleet/server/routes/cloud_connector` | (inherited `@elastic/fleet`) | `@elastic/fleet @elastic/cloud-services` *(new)* | | `x-pack/platform/plugins/shared/fleet/server/services/cloud_connectors` | (inherited `@elastic/fleet`) | `@elastic/fleet @elastic/cloud-services` *(new)* | Other `cloud_security_posture` / `cloud_posture_third_party_support_callout` lines in the same block are intentionally left as-is. ## Test plan - [ ] CI CODEOWNERS validation passes. - [ ] Confirm a follow-up PR touching `fleet/public/components/cloud_connector/**` auto-requests review from `@elastic/cloud-services` (and not `@elastic/contextual-security-apps`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Accept onNext prop from OnboardingShell (introduced by PR elastic#271195) - Import useOnboardingFlow to read connectorId and derive authType - Wire onClick={onNext} on the Continue button - Remove duplicate @kbn/fleet-plugin from tsconfig kbn_references - Keep selectedServices/serviceVars/isNewConnection as TODO stubs until the Services step PR extends OnboardingFlowContext Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Implements the Connect Account step of the AWS onboarding flow (issue #7620), letting users choose how Elastic authenticates to their AWS account before proceeding to subsequent steps.
Plan to move the Account step later in the flow, to start with Services and show the Account step based on selected services: FI only if supported by selected services, ECF/Firehose doesn't need Account setup.
What's added
Fleet plugin —
AwsConnectSetupcomponent (exported asLazyAwsConnectSetup):AwsAuthTypeSelector: select between Identity Federation (cloud connector), Static keys and ** Temporary keys**AwsIdentityFederationSetup: tabbed UI with an Existing Identity selector (reusesCloudConnectorSelector) and a New Identity form (Role ARN + External ID + connector name + CloudFormation launcher). The "Create Identity" button calls the cloud connector API and auto-selects the new connector on success.AwsStaticKeysForm: fields for Access Key ID, Secret Access KeyAwsTemporaryKeysForm: fields for Access Key ID, Secret Access Key, and Session TokenuseCreateCloudConnector:react-querymutation hook wrappingPOST /api/fleet/cloud_connectorsIngest Hub plugin — onboarding flow wiring:
onNextcallback threaded fromOnboardingShell→ step components →AwsConnectSetup; clicking Next marks the step complete and advances to the next stepOnboardingFlowProvider/useOnboardingFlow: React context backed bysessionStorage(onboarding.aws.connectStep) holding the selectedconnectorId, enteredstaticKeysortemporaryKeysas a single objectTest plan
🤖 Generated with Claude Code
Screenshots