fleet

package
v0.16.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOperationalSpaceFromState added in v0.12.2

func GetOperationalSpaceFromState(ctx context.Context, state tfsdk.State) (string, diag.Diagnostics)

GetOperationalSpaceFromState extracts the operational space ID from Terraform state. This helper reads space_ids from state (not plan) to determine which space to use for API operations, preventing errors when space_ids changes (e.g., prepending a new space).

**Why read from STATE not PLAN:** When updating space_ids = ["space-a"] → ["space-b", "space-a"], we need to query the policy in a space where it currently EXISTS (space-a from STATE), not where it WILL exist (space-b from PLAN). Otherwise, the API call fails with 404.

Selection Strategy:

  1. Extract space_ids from state
  2. If empty/null → return "" (uses default space without /s/{spaceId} prefix)
  3. Otherwise → return first space from state (where resource currently exists)

Note: With Sets, there's no inherent ordering, but we can rely on deterministic iteration to get a consistent space for API operations.

func IDValidator added in v0.16.3

func IDValidator(attributeName string) validator.String

IDValidator returns a reusable Fleet ID validator for the given Terraform attribute name.

func SpaceIDFromSet added in v0.15.0

func SpaceIDFromSet(spaceIDs types.Set) string

SpaceIDFromSet extracts the first known, non-empty space ID from a space_ids set attribute. Returns an empty string if the set is null, unknown, empty, or contains only empty/unknown elements (directing API calls to the default space).

func SpaceIDFromSetOrDefault added in v0.16.4

func SpaceIDFromSetOrDefault(spaceIDs types.Set, fallback string) types.String

SpaceIDFromSetOrDefault returns the first known, non-empty space ID from a space_ids set, or fallback wrapped in types.StringValue when none is set. This is the GetSpaceID helper shared by Fleet resource models, which differ only in their fallback value.

Types

This section is empty.

Directories

Path Synopsis
Package fleetschema holds attribute builders shared between Fleet integration package installation resources (integration, customintegration) to keep their descriptions and semantics from drifting apart.
Package fleetschema holds attribute builders shared between Fleet integration package installation resources (integration, customintegration) to keep their descriptions and semantics from drifting apart.
Package globaldatatags provides the shared Terraform model, schema, and map<->API conversion helpers for the `global_data_tags` map attribute used by both internal/fleet/agentpolicy and internal/fleet/managedintegration.
Package globaldatatags provides the shared Terraform model, schema, and map<->API conversion helpers for the `global_data_tags` map attribute used by both internal/fleet/agentpolicy and internal/fleet/managedintegration.
Package managedintegration: model ↔ Kibana managed_integrations API conversion — POST/PUT request bodies (toCreateBody) and state population from KibanaHTTPAPIsManagedIntegration (populateFromManagedIntegration).
Package managedintegration: model ↔ Kibana managed_integrations API conversion — POST/PUT request bodies (toCreateBody) and state population from KibanaHTTPAPIsManagedIntegration (populateFromManagedIntegration).
Package policyshape provides the shared Plugin Framework modeling for Fleet package policy inputs, streams, and vars: the "shape" of a package policy body that is common to every resource that creates or updates one (elasticstack_fleet_integration_policy today; elasticstack_fleet_managed_integration).
Package policyshape provides the shared Plugin Framework modeling for Fleet package policy inputs, streams, and vars: the "shape" of a package policy body that is common to every resource that creates or updates one (elasticstack_fleet_integration_policy today; elasticstack_fleet_managed_integration).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL