@veltrixsecops/app-sdk 3.2.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/byol/index.cjs +3802 -0
- package/dist/byol/index.cjs.map +1 -0
- package/dist/byol/index.d.cts +578 -0
- package/dist/byol/index.d.ts +578 -0
- package/dist/byol/index.js +2587 -0
- package/dist/byol/index.js.map +1 -0
- package/dist/chunk-3WK4EVQ3.js +842 -0
- package/dist/chunk-3WK4EVQ3.js.map +1 -0
- package/dist/{chunk-EOOEHZGC.js → chunk-HIL6RIDG.js} +107 -3
- package/dist/chunk-HIL6RIDG.js.map +1 -0
- package/dist/{chunk-VWFTOFTI.js → chunk-Y6XBNZGR.js} +8 -2
- package/dist/chunk-Y6XBNZGR.js.map +1 -0
- package/dist/client/index.cjs +112 -2
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +118 -6
- package/dist/client/index.d.ts +118 -6
- package/dist/client/index.js +13 -1
- package/dist/connections/index.cjs +1787 -0
- package/dist/connections/index.cjs.map +1 -0
- package/dist/connections/index.d.cts +78 -0
- package/dist/connections/index.d.ts +78 -0
- package/dist/connections/index.js +754 -0
- package/dist/connections/index.js.map +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/opentofu/index.cjs +138 -0
- package/dist/opentofu/index.cjs.map +1 -0
- package/dist/opentofu/index.d.cts +131 -0
- package/dist/opentofu/index.d.ts +131 -0
- package/dist/opentofu/index.js +109 -0
- package/dist/opentofu/index.js.map +1 -0
- package/dist/pipeline/index.cjs +7 -0
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +9 -2
- package/dist/pipeline/index.d.ts +9 -2
- package/dist/pipeline/index.js +3 -1
- package/dist/pipeline-beeT8dje.d.cts +408 -0
- package/dist/pipeline-beeT8dje.d.ts +408 -0
- package/dist/ui/index.cjs +136 -0
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +109 -1
- package/dist/ui/index.d.ts +109 -1
- package/dist/ui/index.js +35 -677
- package/dist/ui/index.js.map +1 -1
- package/dist/{use-app-context-OQlcmq7t.d.cts → use-app-context-Byv_fam0.d.cts} +206 -4
- package/dist/{use-app-context-OQlcmq7t.d.ts → use-app-context-Byv_fam0.d.ts} +206 -4
- package/opentofu/README.md +114 -0
- package/opentofu/modules/aws/main.tf +1008 -0
- package/opentofu/modules/aws/outputs.tf +90 -0
- package/opentofu/modules/aws/variables.tf +437 -0
- package/opentofu/modules/aws/versions.tf +23 -0
- package/opentofu/modules/azure/main.tf +920 -0
- package/opentofu/modules/azure/outputs.tf +72 -0
- package/opentofu/modules/azure/variables.tf +498 -0
- package/opentofu/modules/azure/versions.tf +27 -0
- package/opentofu/modules/gcp/main.tf +645 -0
- package/opentofu/modules/gcp/outputs.tf +73 -0
- package/opentofu/modules/gcp/variables.tf +428 -0
- package/opentofu/modules/gcp/versions.tf +27 -0
- package/opentofu/modules/hetzner/main.tf +432 -0
- package/opentofu/modules/hetzner/outputs.tf +72 -0
- package/opentofu/modules/hetzner/variables.tf +423 -0
- package/opentofu/modules/hetzner/versions.tf +26 -0
- package/package.json +33 -1
- package/dist/chunk-EOOEHZGC.js.map +0 -1
- package/dist/chunk-VWFTOFTI.js.map +0 -1
- package/dist/pipeline-A-gSsPRR.d.cts +0 -189
- package/dist/pipeline-A-gSsPRR.d.ts +0 -189
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { BadgeVariant } from '../ui/index.js';
|
|
3
|
+
|
|
4
|
+
/** A region association satellite row (indexer / search-head placement). */
|
|
5
|
+
interface ByolRegion {
|
|
6
|
+
id: string;
|
|
7
|
+
region: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Control-plane consolidation layout. Trades HA/isolation for cost by combining
|
|
11
|
+
* management roles onto fewer instances:
|
|
12
|
+
* - `dedicated` — 5 instances, one role each (LM, CM, SH-deployer, DS, MC).
|
|
13
|
+
* - `consolidated`— ~3 instances; CM and SH-deployer stay isolated, the rest combine.
|
|
14
|
+
* - `single` — 1 manager node running every management role (small / non-HA).
|
|
15
|
+
* Applies to distributed deployments; single-instance deployments ignore it.
|
|
16
|
+
*/
|
|
17
|
+
type ControlPlaneLayout = 'dedicated' | 'consolidated' | 'single';
|
|
18
|
+
/** How a cluster's sites are addressed: availability zones (same region) or regions. */
|
|
19
|
+
type PlacementGranularity = 'az' | 'region';
|
|
20
|
+
/** One placement target with its share of the cluster's nodes. */
|
|
21
|
+
interface PlacementSite {
|
|
22
|
+
/** AZ id (e.g. `us-east-1a`) when granularity is `az`, or a region code (e.g. `us-west-2`) when `region`. */
|
|
23
|
+
site: string;
|
|
24
|
+
/** Percent of the cluster's nodes placed on this site. Percents across a cluster's sites sum to 100. */
|
|
25
|
+
percent: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Placement of a single cluster tier. `single` keeps every node in the standard
|
|
29
|
+
* main region/zone; `multi-site` spreads nodes across `sites` by percent.
|
|
30
|
+
* ONLY the indexer and search-head tiers accept multi-site placement — every
|
|
31
|
+
* other tier is always single-site in the main region.
|
|
32
|
+
*/
|
|
33
|
+
interface ClusterPlacement {
|
|
34
|
+
mode: 'single' | 'multi-site';
|
|
35
|
+
granularity?: PlacementGranularity;
|
|
36
|
+
sites?: PlacementSite[];
|
|
37
|
+
}
|
|
38
|
+
/** Default single-site placement (all nodes in the main region). */
|
|
39
|
+
declare const SINGLE_SITE_PLACEMENT: ClusterPlacement;
|
|
40
|
+
/** Minimum heavy forwarders in a distributed ingest tier. */
|
|
41
|
+
declare const MIN_HEAVY_FORWARDERS = 1;
|
|
42
|
+
interface ByolInfrastructure {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
deploymentType?: string;
|
|
46
|
+
environmentType?: string;
|
|
47
|
+
indexerCount?: number;
|
|
48
|
+
searchHeadCount?: number;
|
|
49
|
+
status?: string;
|
|
50
|
+
hosting_type?: string;
|
|
51
|
+
cloudProviderId?: string | null;
|
|
52
|
+
region?: string | null;
|
|
53
|
+
indexerRegions?: ByolRegion[];
|
|
54
|
+
searchHeadRegions?: ByolRegion[];
|
|
55
|
+
/** Deployment target: platform-hosted network, or a customer-owned VPC. Defaults to 'shared'. */
|
|
56
|
+
networkMode?: 'shared' | 'dedicated' | 'existing' | string;
|
|
57
|
+
/** DNS strategy for the deployment. Defaults to 'managed'. */
|
|
58
|
+
dnsMode?: 'managed' | 'delegated' | 'private-only' | string;
|
|
59
|
+
/** Platform cloud account connection backing a BYOC (dedicated/existing) deployment. */
|
|
60
|
+
cloudAccountConnectionId?: string | null;
|
|
61
|
+
/** Control-plane consolidation layout (distributed only). Defaults to 'dedicated'. */
|
|
62
|
+
controlPlaneLayout?: ControlPlaneLayout;
|
|
63
|
+
/** Heavy forwarder count in the ingest tier (distributed only). Defaults to 1. */
|
|
64
|
+
heavyForwarderCount?: number;
|
|
65
|
+
/** Compute size override for every node (e.g. AWS `t2.medium`); empty = cloud default. */
|
|
66
|
+
instanceType?: string | null;
|
|
67
|
+
/** Placement of the indexer cluster — single-site or multi-site by percent. */
|
|
68
|
+
indexerPlacement?: ClusterPlacement;
|
|
69
|
+
/** Placement of the search-head cluster — single-site or multi-site by percent. */
|
|
70
|
+
searchHeadPlacement?: ClusterPlacement;
|
|
71
|
+
/** Selected software version (app catalog entry id) to install on every node. */
|
|
72
|
+
versionId?: string;
|
|
73
|
+
updatedAt?: string;
|
|
74
|
+
createdAt?: string;
|
|
75
|
+
}
|
|
76
|
+
/** A persisted resource row (from GET /byol/:id/resources). */
|
|
77
|
+
interface ByolResource {
|
|
78
|
+
id: string;
|
|
79
|
+
infrastructureId: string;
|
|
80
|
+
tier: string;
|
|
81
|
+
kind: string;
|
|
82
|
+
name: string;
|
|
83
|
+
role: string | null;
|
|
84
|
+
region: string | null;
|
|
85
|
+
/** Availability zone within `region` for a multi-AZ-placed node; null otherwise. */
|
|
86
|
+
zone?: string | null;
|
|
87
|
+
/** Management roles a consolidated control-plane instance runs; null otherwise. */
|
|
88
|
+
roles?: string[] | null;
|
|
89
|
+
status: string;
|
|
90
|
+
externalRef: string | null;
|
|
91
|
+
message: string | null;
|
|
92
|
+
planKey: string;
|
|
93
|
+
sortOrder: number;
|
|
94
|
+
}
|
|
95
|
+
/** A deployment step (from GET /byol/:id/deployments → steps). */
|
|
96
|
+
interface ByolDeploymentStep {
|
|
97
|
+
id: string;
|
|
98
|
+
deploymentId: string;
|
|
99
|
+
stepOrder: number;
|
|
100
|
+
key: string;
|
|
101
|
+
title: string;
|
|
102
|
+
status: string;
|
|
103
|
+
detail: string | null;
|
|
104
|
+
logs: string | null;
|
|
105
|
+
startedAt: string | null;
|
|
106
|
+
completedAt: string | null;
|
|
107
|
+
}
|
|
108
|
+
/** A deployment run (from GET /byol/:id/deployments). */
|
|
109
|
+
interface ByolDeployment {
|
|
110
|
+
id: string;
|
|
111
|
+
infrastructureId: string;
|
|
112
|
+
action: string;
|
|
113
|
+
status: string;
|
|
114
|
+
message: string | null;
|
|
115
|
+
startedAt: string;
|
|
116
|
+
completedAt: string | null;
|
|
117
|
+
steps: ByolDeploymentStep[];
|
|
118
|
+
}
|
|
119
|
+
/** Platform tag — the customer's environment tags feed the Environment picker. */
|
|
120
|
+
interface Tag {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
}
|
|
124
|
+
/** Platform cloud provider — feeds the "Provider" picker (plus Self-Hosted). */
|
|
125
|
+
interface CloudProvider {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
code?: string;
|
|
129
|
+
isActive?: boolean;
|
|
130
|
+
}
|
|
131
|
+
interface CloudRegion {
|
|
132
|
+
id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
code: string;
|
|
135
|
+
isActive?: boolean;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Platform cloud account connection — feeds the "Cloud account" picker shown
|
|
139
|
+
* for BYOC (dedicated/existing network) deployment targets. Sourced from
|
|
140
|
+
* `GET /api/cloud-accounts`. Only `VERIFIED` accounts matching the selected
|
|
141
|
+
* cloud provider are offered.
|
|
142
|
+
*/
|
|
143
|
+
interface CloudAccount {
|
|
144
|
+
id: string;
|
|
145
|
+
provider: 'aws' | 'azure' | 'gcp' | 'hetzner' | string;
|
|
146
|
+
name: string;
|
|
147
|
+
status: 'UNVERIFIED' | 'VERIFIED' | 'ERROR' | string;
|
|
148
|
+
authMethod?: string;
|
|
149
|
+
/**
|
|
150
|
+
* 'customer' — the tenant's own account (BYOC / dedicated / existing).
|
|
151
|
+
* 'platform' — a Veltrix-managed account a hosted (shared) deployment provisions
|
|
152
|
+
* through. The form offers platform accounts for hosted, customer accounts for BYOC.
|
|
153
|
+
*/
|
|
154
|
+
scope?: 'customer' | 'platform' | string;
|
|
155
|
+
}
|
|
156
|
+
interface FormState {
|
|
157
|
+
name: string;
|
|
158
|
+
deploymentType: string;
|
|
159
|
+
environmentType: string;
|
|
160
|
+
/** A cloud provider id, or the SELF_HOSTED sentinel. */
|
|
161
|
+
providerId: string;
|
|
162
|
+
region: string;
|
|
163
|
+
indexerCount: string;
|
|
164
|
+
searchHeadCount: string;
|
|
165
|
+
/** Deployment target: 'shared' (Veltrix-hosted), 'dedicated', or 'existing' (BYOC). */
|
|
166
|
+
networkMode: string;
|
|
167
|
+
/** DNS strategy: 'managed', 'delegated', or 'private-only'. */
|
|
168
|
+
dnsMode: string;
|
|
169
|
+
/** Platform cloud account connection id, required when networkMode is BYOC. */
|
|
170
|
+
cloudAccountConnectionId: string;
|
|
171
|
+
/** Control-plane consolidation layout (distributed only). */
|
|
172
|
+
controlPlaneLayout: ControlPlaneLayout;
|
|
173
|
+
/** Heavy forwarder count as a form string (distributed only, min 1). */
|
|
174
|
+
heavyForwarderCount: string;
|
|
175
|
+
/** Compute size override for every node; empty = cloud default (t2.medium-class). */
|
|
176
|
+
instanceType: string;
|
|
177
|
+
/** Placement of the indexer cluster. */
|
|
178
|
+
indexerPlacement: ClusterPlacement;
|
|
179
|
+
/** Placement of the search-head cluster. */
|
|
180
|
+
searchHeadPlacement: ClusterPlacement;
|
|
181
|
+
/** Selected software version (app catalog entry id); empty = app-default. */
|
|
182
|
+
versionId: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* A link surfaced in the detail view's Configuration section. The app supplies
|
|
186
|
+
* these (the SDK stays app-agnostic). When `configTypeId` + `configBase` are
|
|
187
|
+
* present the link resolves to `<configBase>/<configTypeId>`; otherwise `href`
|
|
188
|
+
* is used verbatim.
|
|
189
|
+
*/
|
|
190
|
+
interface ByolConfigLink {
|
|
191
|
+
key: string;
|
|
192
|
+
title: string;
|
|
193
|
+
description: string;
|
|
194
|
+
configTypeId?: string;
|
|
195
|
+
href?: string;
|
|
196
|
+
}
|
|
197
|
+
interface ByolInfrastructureManagerProps {
|
|
198
|
+
/** Base URL of the app's BYOL routes, e.g. `/api/apps/splunk-enterprise/byol`. */
|
|
199
|
+
apiBase: string;
|
|
200
|
+
/** Card title. Defaults to "BYOL Infrastructure". */
|
|
201
|
+
title?: string;
|
|
202
|
+
/** Deployment topology options. Defaults to Single instance + Distributed. */
|
|
203
|
+
deploymentTypes?: Array<{
|
|
204
|
+
value: string;
|
|
205
|
+
label: string;
|
|
206
|
+
}>;
|
|
207
|
+
/**
|
|
208
|
+
* Optional base path to this app's configuration canvases, e.g.
|
|
209
|
+
* `/apps/splunk-enterprise/config`. Combined with each link's `configTypeId`
|
|
210
|
+
* to deep-link the detail view's Configuration section.
|
|
211
|
+
*/
|
|
212
|
+
configBase?: string;
|
|
213
|
+
/** Configuration links to surface in the detail view (app-supplied). */
|
|
214
|
+
configLinks?: ByolConfigLink[];
|
|
215
|
+
/**
|
|
216
|
+
* Software version options for the "Splunk version" form picker (app-supplied —
|
|
217
|
+
* the SDK has no notion of Splunk). Omit or pass an empty array to hide the
|
|
218
|
+
* picker entirely (e.g. an app with no version catalog).
|
|
219
|
+
*/
|
|
220
|
+
versionOptions?: Array<{
|
|
221
|
+
value: string;
|
|
222
|
+
label: string;
|
|
223
|
+
}>;
|
|
224
|
+
/**
|
|
225
|
+
* Version id a NEW infrastructure's form should default to (typically the
|
|
226
|
+
* catalog's "latest" entry). Ignored when `versionOptions` is empty. Existing
|
|
227
|
+
* rows always reflect their own stored `versionId`, never this default.
|
|
228
|
+
*/
|
|
229
|
+
defaultVersionId?: string;
|
|
230
|
+
}
|
|
231
|
+
/** Control-plane consolidation options for the "Control plane" form section. */
|
|
232
|
+
declare const CONTROL_PLANE_LAYOUT_OPTIONS: Array<{
|
|
233
|
+
value: ControlPlaneLayout;
|
|
234
|
+
label: string;
|
|
235
|
+
description: string;
|
|
236
|
+
}>;
|
|
237
|
+
/** Placement granularity options for a cluster's "Placement" form section. */
|
|
238
|
+
declare const PLACEMENT_GRANULARITY_OPTIONS: Array<{
|
|
239
|
+
value: PlacementGranularity;
|
|
240
|
+
label: string;
|
|
241
|
+
}>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Reusable BYOL infrastructure manager: a searchable/filterable list whose rows
|
|
245
|
+
* open a full deployment console (the detail view), a Provider picker (platform
|
|
246
|
+
* cloud providers plus Self-Hosted), an Environment picker fed by the customer's
|
|
247
|
+
* tags, and a cloud region picker shown only for a distributed cloud deployment.
|
|
248
|
+
* The app owns the data (its own DB table + routes); this component owns the UI.
|
|
249
|
+
*/
|
|
250
|
+
declare const ByolInfrastructureManager: React__default.FC<ByolInfrastructureManagerProps>;
|
|
251
|
+
|
|
252
|
+
interface ByolInfrastructureDetailProps {
|
|
253
|
+
apiBase: string;
|
|
254
|
+
/** The row the user clicked — rendered instantly, then refreshed from the API. */
|
|
255
|
+
initialInfra: ByolInfrastructure;
|
|
256
|
+
configBase?: string;
|
|
257
|
+
configLinks?: ByolConfigLink[];
|
|
258
|
+
onBack: () => void;
|
|
259
|
+
onEdit: (infra: ByolInfrastructure) => void;
|
|
260
|
+
onDeleted: () => void;
|
|
261
|
+
/** Called after any mutation so the parent list can refresh statuses. */
|
|
262
|
+
onChanged: () => void;
|
|
263
|
+
/** Bumped by the parent (e.g. after an edit via the shared form) to force a reload. */
|
|
264
|
+
reloadSignal?: number;
|
|
265
|
+
}
|
|
266
|
+
declare const ByolInfrastructureDetail: React__default.FC<ByolInfrastructureDetailProps>;
|
|
267
|
+
|
|
268
|
+
/** Context a BYOL tag set is derived from — everything the app already holds. */
|
|
269
|
+
interface ByolTagInput {
|
|
270
|
+
/** Tenant id — cost attribution + tenant isolation. */
|
|
271
|
+
customerId: string;
|
|
272
|
+
/**
|
|
273
|
+
* Human-readable, unique tenant shortname (set in Settings → Organization).
|
|
274
|
+
* Used as the `Veltrix:Customer` value so cloud tags are legible; falls back
|
|
275
|
+
* to `customerId` when the tenant has not set one.
|
|
276
|
+
*/
|
|
277
|
+
customerShortName?: string | null;
|
|
278
|
+
/** Unique environment id (the infrastructure record id). */
|
|
279
|
+
infrastructureId: string;
|
|
280
|
+
/** Human environment name. */
|
|
281
|
+
name: string;
|
|
282
|
+
/** Environment class, e.g. prod / staging / dev. */
|
|
283
|
+
environmentType: string;
|
|
284
|
+
/** Owning app, e.g. `splunk-enterprise`. */
|
|
285
|
+
appId: string;
|
|
286
|
+
/** Billing account / cost center; falls back to `customerId`. */
|
|
287
|
+
costCenter?: string | null;
|
|
288
|
+
/** Initiating user / owner; falls back to `customerId`. */
|
|
289
|
+
owner?: string | null;
|
|
290
|
+
}
|
|
291
|
+
/** An ordered tag map. Insertion order IS the canonical display order. */
|
|
292
|
+
type ByolTags = Record<string, string>;
|
|
293
|
+
/**
|
|
294
|
+
* The canonical tag keys, in the order they are emitted. Exported so callers +
|
|
295
|
+
* tests can assert against the contract without re-deriving it.
|
|
296
|
+
*/
|
|
297
|
+
declare const BYOL_TAG_KEYS: readonly ["Veltrix:Customer", "Veltrix:Environment", "Veltrix:EnvName", "Veltrix:EnvType", "Veltrix:App", "Veltrix:ManagedBy", "CostCenter", "Owner"];
|
|
298
|
+
/** The constant value stamped on `Veltrix:ManagedBy` (drives tag-scoped IAM). */
|
|
299
|
+
declare const MANAGED_BY = "Veltrix";
|
|
300
|
+
/**
|
|
301
|
+
* Build the canonical cost-allocation / tenant-isolation tag set for a BYOL
|
|
302
|
+
* environment. Pure: the same input always yields the same ordered map.
|
|
303
|
+
*
|
|
304
|
+
* Veltrix:Customer = customerShortName ?? customerId
|
|
305
|
+
* Veltrix:Environment = infrastructureId (unique env id)
|
|
306
|
+
* Veltrix:EnvName = name
|
|
307
|
+
* Veltrix:EnvType = environmentType (prod / staging / …)
|
|
308
|
+
* Veltrix:App = appId (splunk-enterprise, …)
|
|
309
|
+
* Veltrix:ManagedBy = Veltrix (constant; tag-scoped IAM)
|
|
310
|
+
* CostCenter = costCenter ?? the customer label
|
|
311
|
+
* Owner = owner ?? the customer label
|
|
312
|
+
*/
|
|
313
|
+
declare function buildByolTags(input: ByolTagInput): ByolTags;
|
|
314
|
+
|
|
315
|
+
/** A single resource's disposition in a plan. */
|
|
316
|
+
type PlanAction = 'add' | 'change' | 'destroy' | 'noop';
|
|
317
|
+
/** The minimal shape of a CURRENT persisted resource row diffPlan compares. */
|
|
318
|
+
interface PlanDiffCurrent {
|
|
319
|
+
planKey: string;
|
|
320
|
+
tier: string;
|
|
321
|
+
kind: string;
|
|
322
|
+
name: string;
|
|
323
|
+
role: string | null;
|
|
324
|
+
region: string | null;
|
|
325
|
+
/** A `failed`/`attention` row is always re-planned as a change. */
|
|
326
|
+
status?: string;
|
|
327
|
+
}
|
|
328
|
+
/** The minimal shape of a DESIRED topology plan item diffPlan compares. */
|
|
329
|
+
interface PlanDiffDesired {
|
|
330
|
+
planKey: string;
|
|
331
|
+
tier: string;
|
|
332
|
+
kind: string;
|
|
333
|
+
name: string;
|
|
334
|
+
role: string | null;
|
|
335
|
+
region: string | null;
|
|
336
|
+
sortOrder?: number;
|
|
337
|
+
}
|
|
338
|
+
/** The four buckets of a diff, keyed by `planKey`. add/change/noop hold the
|
|
339
|
+
* desired item (the target state); destroy holds the current row being removed. */
|
|
340
|
+
interface PlanDiff {
|
|
341
|
+
add: PlanDiffDesired[];
|
|
342
|
+
change: PlanDiffDesired[];
|
|
343
|
+
destroy: PlanDiffCurrent[];
|
|
344
|
+
noop: PlanDiffDesired[];
|
|
345
|
+
}
|
|
346
|
+
/** Count of each action — the header summary of the Plan modal. */
|
|
347
|
+
interface ByolPlanSummary {
|
|
348
|
+
add: number;
|
|
349
|
+
change: number;
|
|
350
|
+
destroy: number;
|
|
351
|
+
noop: number;
|
|
352
|
+
}
|
|
353
|
+
/** One resource line in the plan, tagged with its action for the modal. */
|
|
354
|
+
interface ByolPlanItem {
|
|
355
|
+
planKey: string;
|
|
356
|
+
action: PlanAction;
|
|
357
|
+
name: string;
|
|
358
|
+
role: string | null;
|
|
359
|
+
region: string | null;
|
|
360
|
+
kind: string;
|
|
361
|
+
}
|
|
362
|
+
/** Plan lines grouped by tier, in provisioning order. */
|
|
363
|
+
interface ByolPlanGroup {
|
|
364
|
+
tier: string;
|
|
365
|
+
items: ByolPlanItem[];
|
|
366
|
+
}
|
|
367
|
+
/** The subnet the platform network allocator previewed / reserved for a stack. */
|
|
368
|
+
interface ByolPlanNetwork {
|
|
369
|
+
/** Opaque handle to the shared per-(provider,region) Network (VPC/VNet/…). */
|
|
370
|
+
networkRef: string;
|
|
371
|
+
/** The /24 subnet CIDR carved for this stack, e.g. `10.20.4.0/24`. */
|
|
372
|
+
subnetCidr: string;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* The full `GET /byol/:id/plan` response contract.
|
|
376
|
+
*
|
|
377
|
+
* The core diff (`summary` + `groups`) is computed by `buildByolPlan`; the app
|
|
378
|
+
* server ENRICHES the response with `network` (a dry-run subnet peek) + `tags`
|
|
379
|
+
* (the canonical tenant/cost tag set). Both are optional so the modal degrades
|
|
380
|
+
* gracefully: `networkUnavailable` flags that the allocator was unreachable, and
|
|
381
|
+
* `network` is simply absent for a self-hosted stack where it does not apply.
|
|
382
|
+
*/
|
|
383
|
+
interface ByolPlan {
|
|
384
|
+
summary: ByolPlanSummary;
|
|
385
|
+
groups: ByolPlanGroup[];
|
|
386
|
+
/** Subnet the allocator would carve for this stack (peek), when applicable. */
|
|
387
|
+
network?: ByolPlanNetwork;
|
|
388
|
+
/** Canonical tenant / cost-allocation tags every resource will carry. */
|
|
389
|
+
tags?: ByolTags;
|
|
390
|
+
/** Soft flag: the network allocator was unreachable, so `network` is absent. */
|
|
391
|
+
networkUnavailable?: boolean;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Diff the desired topology plan against the current persisted rows.
|
|
395
|
+
*
|
|
396
|
+
* • add — desired keys with no current row
|
|
397
|
+
* • change — desired keys whose current row differs (tier/kind/name/role/
|
|
398
|
+
* region) or is failed/attention
|
|
399
|
+
* • destroy — current rows whose key is no longer desired
|
|
400
|
+
* • noop — desired keys whose current row already matches
|
|
401
|
+
*
|
|
402
|
+
* Pure and non-mutating: it never touches its inputs.
|
|
403
|
+
*/
|
|
404
|
+
declare function diffPlan(current: PlanDiffCurrent[], desired: PlanDiffDesired[]): PlanDiff;
|
|
405
|
+
/**
|
|
406
|
+
* Compute the full plan response from current + desired: the action counts plus
|
|
407
|
+
* every resource line grouped by tier in provisioning order. Destroyed rows are
|
|
408
|
+
* appended within their tier (they retain their tier but not a desired order).
|
|
409
|
+
*/
|
|
410
|
+
declare function buildByolPlan(current: PlanDiffCurrent[], desired: PlanDiffDesired[]): ByolPlan;
|
|
411
|
+
/** Whether a plan has any actionable change (drives the modal's Apply gate). */
|
|
412
|
+
declare function planHasChanges(summary: ByolPlanSummary): boolean;
|
|
413
|
+
|
|
414
|
+
interface ByolPlanModalProps {
|
|
415
|
+
isOpen: boolean;
|
|
416
|
+
onClose: () => void;
|
|
417
|
+
/** The computed plan, or null while it is still loading. */
|
|
418
|
+
plan: ByolPlan | null;
|
|
419
|
+
/** True while the plan is being fetched. */
|
|
420
|
+
loading?: boolean;
|
|
421
|
+
/** A plan-fetch or apply error to surface inline. */
|
|
422
|
+
error?: string | null;
|
|
423
|
+
/** True while Apply is in flight. */
|
|
424
|
+
applying?: boolean;
|
|
425
|
+
/** Invoked by the primary Apply button. */
|
|
426
|
+
onApply: () => void;
|
|
427
|
+
/** Optional environment name, shown in the subtitle. */
|
|
428
|
+
infraName?: string;
|
|
429
|
+
/**
|
|
430
|
+
* Allow Apply even when the plan has no add/change/destroy — for a redeployable
|
|
431
|
+
* environment (a failed or never-deployed infra) where the user is RE-running
|
|
432
|
+
* the same plan rather than making a change.
|
|
433
|
+
*/
|
|
434
|
+
allowApplyWithoutChanges?: boolean;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* The Plan modal. Fetch the plan into `plan` (showing `loading` first), then let
|
|
438
|
+
* the user Apply. Apply is disabled while loading, while applying, and when the
|
|
439
|
+
* plan has no add/change/destroy.
|
|
440
|
+
*/
|
|
441
|
+
declare const ByolPlanModal: React__default.FC<ByolPlanModalProps>;
|
|
442
|
+
|
|
443
|
+
interface DestroyPlanModalProps {
|
|
444
|
+
isOpen: boolean;
|
|
445
|
+
onClose: () => void;
|
|
446
|
+
/** The current persisted resources this destroy will tear down; null while (re)loading. */
|
|
447
|
+
resources: ByolResource[] | null;
|
|
448
|
+
/** True while the resource inventory is being (re)loaded. */
|
|
449
|
+
loading?: boolean;
|
|
450
|
+
/** A destroy-action error (from the `/destroy` call itself) to surface inline. */
|
|
451
|
+
error?: string | null;
|
|
452
|
+
/** True while the destroy request is in flight. */
|
|
453
|
+
destroying?: boolean;
|
|
454
|
+
/** Invoked by the primary (danger) Destroy button. */
|
|
455
|
+
onConfirm: () => void;
|
|
456
|
+
/** Optional environment name, shown in the subtitle. */
|
|
457
|
+
infraName?: string;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* The Destroy modal. Shows every resource in `resources` as a destroy line
|
|
461
|
+
* grouped by tier. Destroy stays enabled even when the inventory hasn't
|
|
462
|
+
* loaded or is empty — the underlying `/destroy` action doesn't depend on this
|
|
463
|
+
* preview, so an unavailable/empty list must never block the user from tearing
|
|
464
|
+
* an environment down, only inform them the resource list itself was unavailable.
|
|
465
|
+
*/
|
|
466
|
+
declare const DestroyPlanModal: React__default.FC<DestroyPlanModalProps>;
|
|
467
|
+
|
|
468
|
+
interface SiteAllocation {
|
|
469
|
+
site: string;
|
|
470
|
+
count: number;
|
|
471
|
+
/** The requested percent for this site (echoed for display / audit). */
|
|
472
|
+
percent: number;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Allocate `totalNodes` across a cluster's sites by percent.
|
|
476
|
+
*
|
|
477
|
+
* Rules:
|
|
478
|
+
* - Every listed site receives at least one node (a site in the plan must be real).
|
|
479
|
+
* - The remaining nodes are distributed by percent using the largest-remainder
|
|
480
|
+
* method, so the counts sum to exactly `totalNodes`.
|
|
481
|
+
* - Deterministic: ties in the remainder are broken by site order (no RNG).
|
|
482
|
+
*
|
|
483
|
+
* Callers must ensure `sites.length <= totalNodes` (see {@link validatePlacement});
|
|
484
|
+
* when that does not hold this still returns one node per site until it runs out,
|
|
485
|
+
* so it never returns a negative count.
|
|
486
|
+
*/
|
|
487
|
+
declare function allocateNodesBySite(totalNodes: number, sites: PlacementSite[]): SiteAllocation[];
|
|
488
|
+
/**
|
|
489
|
+
* Validate a cluster placement against a node count. Returns a human-readable
|
|
490
|
+
* error string, or `null` when the placement is deployable.
|
|
491
|
+
*/
|
|
492
|
+
declare function validatePlacement(placement: ClusterPlacement | undefined, totalNodes: number): string | null;
|
|
493
|
+
/**
|
|
494
|
+
* Resolve the placement actually used for a tier: multi-site placement is only
|
|
495
|
+
* honored for eligible (indexer / search-head) tiers; everything else collapses
|
|
496
|
+
* to single-site so callers can treat the result uniformly.
|
|
497
|
+
*/
|
|
498
|
+
declare function effectivePlacement(placement: ClusterPlacement | undefined, eligible: boolean): ClusterPlacement;
|
|
499
|
+
|
|
500
|
+
/** Badge variant for an infrastructure status (falls back to neutral). */
|
|
501
|
+
declare function statusVariant(status?: string): BadgeVariant;
|
|
502
|
+
/** Human label for an infrastructure status (Title-Cases anything unknown). */
|
|
503
|
+
declare function statusLabel(status?: string): string;
|
|
504
|
+
/** Whether the environment is actively running (running/active). */
|
|
505
|
+
declare function isRunning(status?: string): boolean;
|
|
506
|
+
/** Whether a deploy has never been requested yet. */
|
|
507
|
+
declare function isNotStarted(status?: string): boolean;
|
|
508
|
+
declare function resourceStatusVariant(status?: string): BadgeVariant;
|
|
509
|
+
declare function resourceStatusLabel(status?: string): string;
|
|
510
|
+
declare function stepStatusVariant(status?: string): BadgeVariant;
|
|
511
|
+
|
|
512
|
+
/** Coarse grouping used to lay the plan out by tier in the UI and DB. */
|
|
513
|
+
type ByolResourceTier = 'foundation' | 'control-plane' | 'data' | 'search' | 'ingest';
|
|
514
|
+
/** A stable machine kind for a resource, used for icons + worker correlation. */
|
|
515
|
+
type ByolResourceKind = 'network' | 'load-balancer' | 'dns' | 'tls' | 'storage' | 'secrets' | 'license-file' | 'license-manager' | 'cluster-manager' | 'sh-deployer' | 'deployment-server' | 'monitoring-console' | 'indexer' | 'search-head' | 'hec' | 'heavy-forwarder' | 'standalone' | 'management-node';
|
|
516
|
+
/** One resource in the plan. `planKey` is a stable identity for idempotent seeding. */
|
|
517
|
+
interface ByolResourcePlanItem {
|
|
518
|
+
planKey: string;
|
|
519
|
+
tier: ByolResourceTier;
|
|
520
|
+
kind: ByolResourceKind;
|
|
521
|
+
name: string;
|
|
522
|
+
role: string;
|
|
523
|
+
region: string | null;
|
|
524
|
+
/** Availability zone within `region` (multi-AZ placement); null otherwise. */
|
|
525
|
+
zone?: string | null;
|
|
526
|
+
/** Machine-readable roles this instance runs — drives control-plane bring-up. */
|
|
527
|
+
roles?: string[];
|
|
528
|
+
}
|
|
529
|
+
interface ByolTopologyInput {
|
|
530
|
+
deploymentType?: string;
|
|
531
|
+
indexerCount?: number;
|
|
532
|
+
searchHeadCount?: number;
|
|
533
|
+
/** Display provider name, e.g. "AWS" or "Self-Hosted". */
|
|
534
|
+
hostingType?: string;
|
|
535
|
+
/** Whether the deployment targets a cloud provider (vs Self-Hosted). */
|
|
536
|
+
isCloud?: boolean;
|
|
537
|
+
/** Primary region + any per-node regions, in preference order. */
|
|
538
|
+
region?: string | null;
|
|
539
|
+
indexerRegions?: string[];
|
|
540
|
+
searchHeadRegions?: string[];
|
|
541
|
+
/** Control-plane consolidation layout (distributed only). Defaults to 'dedicated'. */
|
|
542
|
+
controlPlaneLayout?: ControlPlaneLayout;
|
|
543
|
+
/** Heavy forwarder count (distributed only). Defaults to 1. */
|
|
544
|
+
heavyForwarderCount?: number;
|
|
545
|
+
/** Multi-site placement of the indexer cluster (indexer/search tiers only). */
|
|
546
|
+
indexerPlacement?: ClusterPlacement | null;
|
|
547
|
+
/** Multi-site placement of the search-head cluster. */
|
|
548
|
+
searchHeadPlacement?: ClusterPlacement | null;
|
|
549
|
+
}
|
|
550
|
+
declare const TIER_LABELS: Record<ByolResourceTier, string>;
|
|
551
|
+
/** Provisioning order the tiers deploy in (also the display order). */
|
|
552
|
+
declare const TIER_ORDER: ByolResourceTier[];
|
|
553
|
+
/**
|
|
554
|
+
* Build the ordered resource plan for a BYOL infrastructure.
|
|
555
|
+
*
|
|
556
|
+
* A single-instance deployment collapses to an all-in-one Splunk node plus the
|
|
557
|
+
* foundation. A distributed deployment expands to the full topology: control
|
|
558
|
+
* plane (license/cluster managers, deployment server, monitoring console, SH
|
|
559
|
+
* deployer), an N-peer indexer cluster, an M-member search-head cluster, and the
|
|
560
|
+
* ingest path (HEC + heavy forwarders).
|
|
561
|
+
*/
|
|
562
|
+
declare function buildByolResourcePlan(input: ByolTopologyInput): ByolResourcePlanItemWithOrder[];
|
|
563
|
+
/** Attach the plan's stable sort order (kept separate so callers can persist it). */
|
|
564
|
+
declare function stampOrder(item: ByolResourcePlanItem, index: number): ByolResourcePlanItem & {
|
|
565
|
+
sortOrder: number;
|
|
566
|
+
};
|
|
567
|
+
type ByolResourcePlanItemWithOrder = ReturnType<typeof stampOrder>;
|
|
568
|
+
/**
|
|
569
|
+
* The ordered high-level steps a deployment run advances through. Mirrors the
|
|
570
|
+
* tier order plus the post-deploy phases. Workers report progress against these.
|
|
571
|
+
*/
|
|
572
|
+
declare const DEPLOYMENT_STEPS: Array<{
|
|
573
|
+
key: string;
|
|
574
|
+
title: string;
|
|
575
|
+
detail: string;
|
|
576
|
+
}>;
|
|
577
|
+
|
|
578
|
+
export { BYOL_TAG_KEYS, type ByolConfigLink, type ByolDeployment, type ByolDeploymentStep, type ByolInfrastructure, ByolInfrastructureDetail, ByolInfrastructureManager, type ByolInfrastructureManagerProps, type ByolPlan, type ByolPlanGroup, type ByolPlanItem, ByolPlanModal, type ByolPlanModalProps, type ByolPlanNetwork, type ByolPlanSummary, type ByolRegion, type ByolResource, type ByolResourceKind, type ByolResourcePlanItem, type ByolResourcePlanItemWithOrder, type ByolResourceTier, type ByolTagInput, type ByolTags, type ByolTopologyInput, CONTROL_PLANE_LAYOUT_OPTIONS, type CloudAccount, type CloudProvider, type CloudRegion, type ClusterPlacement, type ControlPlaneLayout, DEPLOYMENT_STEPS, DestroyPlanModal, type DestroyPlanModalProps, type FormState, MANAGED_BY, MIN_HEAVY_FORWARDERS, PLACEMENT_GRANULARITY_OPTIONS, type PlacementGranularity, type PlacementSite, type PlanAction, type PlanDiff, type PlanDiffCurrent, type PlanDiffDesired, SINGLE_SITE_PLACEMENT, type SiteAllocation, TIER_LABELS, TIER_ORDER, type Tag, allocateNodesBySite, buildByolPlan, buildByolResourcePlan, buildByolTags, ByolInfrastructureManager as default, diffPlan, effectivePlacement, isNotStarted, isRunning, planHasChanges, resourceStatusLabel, resourceStatusVariant, statusLabel, statusVariant, stepStatusVariant, validatePlacement };
|