Skip to content

Conversation

@seanrathier
Copy link
Contributor

@seanrathier seanrathier commented Jan 14, 2026

What does this PR do?

Add a new var_groups field to the package manifest schema that:

  • Defines mutually exclusive groups of variables
  • Controls variable visibility based on the selected option
  • Stores the selection in the policy for backend processing
  • Uses additionalProperties: true on options to allow feature-specific extensions

Why is it important?

Current Limitation

Fleet's generic UI renders all integration variables in a flat list, regardless of authentication method or configuration context. Users see fields that don't apply to their chosen setup (e.g., showing access_key_id when using Assume Role authentication), creating confusion and a poor user experience.

Specific Use Cases

  1. Cloud Connector Integration: The Cloud Connector feature (for agentless AWS/GCP/Azure data collection) is currently only available in CSPM and Cloud Asset Inventory, which use custom UIs. Scaling this to other integrations (AWS GuardDuty, Security Hub, etc.) requires a manifest-driven approach.
  2. Authentication Method Selection: AWS integrations support 5+ authentication methods (Direct Keys, Temporary Keys, Assume Role, Shared Credentials, Cloud Connector), each with different required variables.
  3. Generic Conditional Groups: Other use cases exist beyond authentication, such as selecting compression methods where each method has different configuration options.

Checklist

Related issues

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new var_groups schema to the package manifest specification, enabling conditional variable groups that control which authentication variables are visible based on user selection. This addresses the limitation where Fleet's generic UI currently displays all integration variables in a flat list regardless of their context.

Changes:

  • Introduces var_groups field with mutually exclusive options for organizing related variables
  • Adds validation rules to ensure var_groups reference valid variables and maintain naming uniqueness
  • Supports deployment mode filtering and input-level option hiding for advanced use cases

Reviewed changes

Copilot reviewed 30 out of 40 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/integration/manifest.spec.yml Adds var_groups schema definition with options, deployment mode filtering, and hide_in_var_group_options for inputs
spec/integration/data_stream/manifest.spec.yml Adds var_groups support at stream level with version patch to remove from pre-3.6.0
spec/changelog.yml Documents the var_groups enhancement for Cloud Connector integration
code/go/internal/validator/spec.go Registers ValidateVarGroups semantic validation rule for format_version >= 3.6.0
code/go/internal/validator/semantic/validate_var_groups.go Implements validation logic for var_groups including duplicate detection and required field checking
code/go/internal/validator/semantic/validate_var_groups_test.go Adds comprehensive test coverage for var_groups validation scenarios
code/go/pkg/validator/validator_test.go Registers test packages for good and bad var_groups validation cases
test/packages/good_var_groups/* Complete test package demonstrating valid var_groups usage with Cloud Connector extensions
test/packages/bad_var_groups_/ Test packages for invalid scenarios (missing vars, duplicate names, required conflicts)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

teresaromero
teresaromero previously approved these changes Jan 22, 2026
Copy link
Contributor

@teresaromero teresaromero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please update branch with conflicts

seanrathier and others added 6 commits January 22, 2026 09:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seanrathier
Copy link
Contributor Author

/test

teresaromero
teresaromero previously approved these changes Jan 23, 2026
link: https://github.com/elastic/package-spec/pull/1053
- description: Add var_groups schema to support conditional variable groups for Cloud Connector integration.
type: enhancement
link: https://github.com/elastic/package-spec/issues/1054
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. Could it be added the kibana issue that adds the support in Kibana as a comment ? As in the other changelog entries. Is this one ? elastic/kibana#249449


// ValidateVarGroups validates var_groups definitions in manifests.
// It checks that:
// - vars referenced in options[].vars exist in the manifest vars array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @seanrathier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Change Proposal] Add var_groups to support Cloud Connector integration with Fleet

5 participants