@rulebricks/cli 2.1.6 → 2.3.1

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.
Files changed (114) hide show
  1. package/README.md +75 -14
  2. package/cluster-setup/aws/README.md +123 -0
  3. package/cluster-setup/aws/check-aws-access.sh +242 -0
  4. package/cluster-setup/aws/parameters.json +13 -0
  5. package/cluster-setup/aws/rulebricks-cluster.cfn.yaml +355 -0
  6. package/cluster-setup/azure/README.md +141 -0
  7. package/cluster-setup/azure/check-aks-prereqs.sh +276 -0
  8. package/cluster-setup/azure/parameters.json +30 -0
  9. package/cluster-setup/azure/rulebricks-cluster.bicep +546 -0
  10. package/cluster-setup/gcp/README.md +189 -0
  11. package/cluster-setup/gcp/check-gke-prereqs.sh +260 -0
  12. package/dist/commands/backup.d.ts +5 -0
  13. package/dist/commands/backup.js +104 -0
  14. package/dist/commands/deploy.d.ts +3 -1
  15. package/dist/commands/deploy.js +226 -326
  16. package/dist/commands/destroy.d.ts +1 -1
  17. package/dist/commands/destroy.js +73 -123
  18. package/dist/commands/init.d.ts +5 -1
  19. package/dist/commands/init.js +78 -47
  20. package/dist/commands/list.d.ts +1 -0
  21. package/dist/commands/list.js +74 -0
  22. package/dist/commands/open.d.ts +1 -1
  23. package/dist/commands/open.js +4 -12
  24. package/dist/commands/redeploy.d.ts +6 -0
  25. package/dist/commands/redeploy.js +310 -0
  26. package/dist/commands/restore.d.ts +5 -0
  27. package/dist/commands/restore.js +338 -0
  28. package/dist/commands/status.js +62 -49
  29. package/dist/commands/upgrade.js +74 -51
  30. package/dist/components/DNSWaitScreen.d.ts +5 -1
  31. package/dist/components/DNSWaitScreen.js +47 -41
  32. package/dist/components/Wizard/WizardContext.d.ts +174 -29
  33. package/dist/components/Wizard/WizardContext.js +896 -91
  34. package/dist/components/Wizard/steps/CloudProviderStep.js +192 -102
  35. package/dist/components/Wizard/steps/DomainStep.js +5 -24
  36. package/dist/components/Wizard/steps/ExternalServicesStep.d.ts +6 -0
  37. package/dist/components/Wizard/steps/ExternalServicesStep.js +645 -0
  38. package/dist/components/Wizard/steps/FeatureConfigStep.d.ts +2 -1
  39. package/dist/components/Wizard/steps/FeatureConfigStep.js +959 -248
  40. package/dist/components/Wizard/steps/FeaturesStep.js +31 -35
  41. package/dist/components/Wizard/steps/ObservabilityStep.d.ts +6 -0
  42. package/dist/components/Wizard/steps/ObservabilityStep.js +137 -0
  43. package/dist/components/Wizard/steps/ReviewStep.d.ts +2 -1
  44. package/dist/components/Wizard/steps/ReviewStep.js +56 -7
  45. package/dist/components/Wizard/steps/StorageStep.d.ts +9 -0
  46. package/dist/components/Wizard/steps/StorageStep.js +592 -0
  47. package/dist/components/Wizard/steps/SupabaseCredentialsStep.js +20 -21
  48. package/dist/components/Wizard/steps/VersionStep.js +45 -23
  49. package/dist/components/Wizard/steps/index.d.ts +3 -3
  50. package/dist/components/Wizard/steps/index.js +3 -3
  51. package/dist/components/common/CommandApproval.d.ts +12 -0
  52. package/dist/components/common/CommandApproval.js +91 -0
  53. package/dist/components/common/DeploymentPicker.d.ts +14 -0
  54. package/dist/components/common/DeploymentPicker.js +16 -0
  55. package/dist/components/common/index.d.ts +2 -0
  56. package/dist/components/common/index.js +2 -0
  57. package/dist/index.js +94 -62
  58. package/dist/lib/cloudCli.d.ts +134 -63
  59. package/dist/lib/cloudCli.js +512 -220
  60. package/dist/lib/clusterSetupDefaults.d.ts +30 -0
  61. package/dist/lib/clusterSetupDefaults.js +64 -0
  62. package/dist/lib/commandApproval.d.ts +26 -0
  63. package/dist/lib/commandApproval.js +114 -0
  64. package/dist/lib/config.d.ts +12 -10
  65. package/dist/lib/config.js +91 -33
  66. package/dist/lib/configFixtures.d.ts +5 -0
  67. package/dist/lib/configFixtures.js +513 -0
  68. package/dist/lib/deploymentHealth.d.ts +32 -0
  69. package/dist/lib/deploymentHealth.js +157 -0
  70. package/dist/lib/dns.d.ts +1 -1
  71. package/dist/lib/dns.js +19 -1
  72. package/dist/lib/dns.test.d.ts +1 -0
  73. package/dist/lib/dns.test.js +27 -0
  74. package/dist/lib/dockerHub.d.ts +12 -1
  75. package/dist/lib/dockerHub.js +18 -8
  76. package/dist/lib/helm.d.ts +4 -0
  77. package/dist/lib/helm.js +16 -0
  78. package/dist/lib/helmValues.d.ts +25 -0
  79. package/dist/lib/helmValues.js +1937 -259
  80. package/dist/lib/helmValues.test.d.ts +1 -0
  81. package/dist/lib/helmValues.test.js +966 -0
  82. package/dist/lib/htpasswd.d.ts +1 -0
  83. package/dist/lib/htpasswd.js +15 -0
  84. package/dist/lib/kubernetes.d.ts +126 -13
  85. package/dist/lib/kubernetes.js +624 -134
  86. package/dist/lib/secrets.d.ts +23 -0
  87. package/dist/lib/secrets.js +158 -0
  88. package/dist/lib/validateValues.d.ts +31 -0
  89. package/dist/lib/validateValues.js +253 -0
  90. package/dist/lib/versions.d.ts +82 -11
  91. package/dist/lib/versions.js +131 -31
  92. package/dist/lib/versions.test.d.ts +1 -0
  93. package/dist/lib/versions.test.js +81 -0
  94. package/dist/lib/wizardSteps.d.ts +14 -0
  95. package/dist/lib/wizardSteps.js +23 -0
  96. package/dist/lib/workloadIdentity.d.ts +26 -0
  97. package/dist/lib/workloadIdentity.js +323 -0
  98. package/dist/lib/workloadIdentity.test.d.ts +1 -0
  99. package/dist/lib/workloadIdentity.test.js +57 -0
  100. package/dist/types/index.d.ts +2152 -95
  101. package/dist/types/index.js +554 -286
  102. package/package.json +10 -4
  103. package/schema/values.schema.json +1934 -0
  104. package/dist/components/Wizard/steps/CredentialsStep.d.ts +0 -6
  105. package/dist/components/Wizard/steps/CredentialsStep.js +0 -22
  106. package/dist/components/Wizard/steps/DeploymentModeStep.d.ts +0 -5
  107. package/dist/components/Wizard/steps/DeploymentModeStep.js +0 -26
  108. package/dist/components/Wizard/steps/TierStep.d.ts +0 -6
  109. package/dist/components/Wizard/steps/TierStep.js +0 -29
  110. package/dist/lib/terraform.d.ts +0 -66
  111. package/dist/lib/terraform.js +0 -754
  112. package/terraform/aws/main.tf +0 -355
  113. package/terraform/azure/main.tf +0 -371
  114. package/terraform/gcp/main.tf +0 -407
@@ -1,6 +0,0 @@
1
- interface CredentialsStepProps {
2
- onComplete: () => void;
3
- onBack: () => void;
4
- }
5
- export declare function CredentialsStep({ onComplete, onBack }: CredentialsStepProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Box, Text, useInput } from 'ink';
4
- import TextInput from 'ink-text-input';
5
- import { useWizard } from '../WizardContext.js';
6
- import { BorderBox } from '../../common/index.js';
7
- export function CredentialsStep({ onComplete, onBack }) {
8
- const { state, dispatch } = useWizard();
9
- const [licenseKey, setLicenseKey] = useState(state.licenseKey || '');
10
- useInput((input, key) => {
11
- if (key.escape) {
12
- onBack();
13
- }
14
- });
15
- const handleSubmit = () => {
16
- if (!licenseKey)
17
- return;
18
- dispatch({ type: 'SET_LICENSE_KEY', key: licenseKey });
19
- onComplete();
20
- };
21
- return (_jsxs(BorderBox, { title: "Credentials", children: [_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { children: "Enter your Rulebricks license key:" }), _jsx(Text, { color: "gray", dimColor: true, children: "This is required to pull the Rulebricks Docker images" }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: "cyan", children: "\u276F " }), _jsx(TextInput, { value: licenseKey, onChange: setLicenseKey, onSubmit: handleSubmit, placeholder: "Enter your license key", mask: "*" })] })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", dimColor: true, children: "Esc to go back \u2022 Enter to continue" }) })] }));
22
- }
@@ -1,5 +0,0 @@
1
- interface DeploymentModeStepProps {
2
- onComplete: () => void;
3
- }
4
- export declare function DeploymentModeStep({ onComplete }: DeploymentModeStepProps): import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import SelectInput from 'ink-select-input';
4
- import { useWizard } from '../WizardContext.js';
5
- import { BorderBox, useTheme } from '../../common/index.js';
6
- export function DeploymentModeStep({ onComplete }) {
7
- const { dispatch } = useWizard();
8
- const { colors } = useTheme();
9
- const items = [
10
- {
11
- label: 'Use existing Kubernetes cluster',
12
- value: 'existing',
13
- description: 'I already have a cluster configured'
14
- },
15
- {
16
- label: 'Provision new infrastructure',
17
- value: 'provision',
18
- description: 'Create a new cluster on AWS, GCP, or Azure'
19
- }
20
- ];
21
- const handleSelect = (item) => {
22
- dispatch({ type: 'SET_INFRA_MODE', mode: item.value });
23
- onComplete();
24
- };
25
- return (_jsxs(BorderBox, { title: "Deployment Mode", children: [_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { children: "How would you like to deploy Rulebricks?" }), _jsx(Text, { color: "gray", dimColor: true, children: "Select whether to use an existing cluster or provision new infrastructure" })] }), _jsx(Box, { marginY: 1, children: _jsx(SelectInput, { items: items, onSelect: handleSelect, itemComponent: ({ isSelected, label }) => (_jsx(Box, { children: _jsx(Text, { color: isSelected ? colors.accent : undefined, children: label }) })) }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", dimColor: true, children: "\u2191/\u2193 to navigate \u2022 Enter to select" }) })] }));
26
- }
@@ -1,6 +0,0 @@
1
- interface TierStepProps {
2
- onComplete: () => void;
3
- onBack: () => void;
4
- }
5
- export declare function TierStep({ onComplete, onBack }: TierStepProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text, useInput } from 'ink';
3
- import SelectInput from 'ink-select-input';
4
- import { useWizard } from '../WizardContext.js';
5
- import { BorderBox, useTheme } from '../../common/index.js';
6
- import { TIER_CONFIGS } from '../../../types/index.js';
7
- export function TierStep({ onComplete, onBack }) {
8
- const { dispatch } = useWizard();
9
- const { colors } = useTheme();
10
- useInput((input, key) => {
11
- if (key.escape) {
12
- onBack();
13
- }
14
- });
15
- const items = Object.entries(TIER_CONFIGS).map(([tier, config]) => ({
16
- label: tier.charAt(0).toUpperCase() + tier.slice(1),
17
- value: tier,
18
- config
19
- }));
20
- const handleSelect = (item) => {
21
- dispatch({ type: 'SET_TIER', tier: item.value });
22
- onComplete();
23
- };
24
- return (_jsxs(BorderBox, { title: "Performance Tier", children: [_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsx(Text, { children: "Select your deployment size:" }), _jsx(Text, { color: "gray", dimColor: true, children: "This determines the cluster resources and scaling limits" })] }), _jsx(SelectInput, { items: items, onSelect: handleSelect, indicatorComponent: () => null, itemComponent: ({ isSelected, label }) => {
25
- const currentItem = items.find(i => i.label === label) || items[0];
26
- const config = currentItem.config;
27
- return (_jsxs(Box, { flexDirection: "column", marginY: isSelected ? 1 : 0, children: [_jsxs(Text, { color: isSelected ? colors.accent : undefined, bold: isSelected, children: [isSelected ? '❯ ' : ' ', currentItem.label, _jsxs(Text, { color: "gray", children: [" - ", config.description] })] }), isSelected && (_jsxs(Box, { flexDirection: "column", marginLeft: 4, children: [_jsxs(Text, { color: "gray", children: ["Throughput: ", config.throughput] }), _jsxs(Text, { color: "gray", children: ["Nodes: ", config.nodes.min, "-", config.nodes.max, " \u2022 ", config.resources] }), _jsxs(Text, { color: "gray", children: ["HPS Workers: ", config.hpsWorkerReplicas.min, "-", config.hpsWorkerReplicas.max] })] }))] }));
28
- } }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", dimColor: true, children: "Esc to go back \u2022 Enter to select" }) })] }));
29
- }
@@ -1,66 +0,0 @@
1
- import { CloudProvider, DeploymentConfig } from '../types/index.js';
2
- /**
3
- * Checks if Terraform is installed
4
- */
5
- export declare function isTerraformInstalled(): Promise<boolean>;
6
- /**
7
- * Gets the installed Terraform version
8
- */
9
- export declare function getTerraformVersion(): Promise<string>;
10
- /**
11
- * Copies terraform templates to the deployment directory
12
- */
13
- export declare function setupTerraformWorkspace(deploymentName: string, provider: CloudProvider): Promise<string>;
14
- /**
15
- * Initializes Terraform in the deployment directory
16
- */
17
- export declare function terraformInit(deploymentName: string): Promise<void>;
18
- /**
19
- * Plans Terraform changes
20
- */
21
- export declare function terraformPlan(deploymentName: string): Promise<void>;
22
- /**
23
- * Applies Terraform changes
24
- */
25
- export declare function terraformApply(deploymentName: string): Promise<void>;
26
- /**
27
- * Lightweight pre-deploy cleanup for the CloudWatch log group that the EKS module
28
- * no longer manages (create_cloudwatch_log_group = false). Safe to call before
29
- * terraform apply since it targets a resource outside terraform's control.
30
- */
31
- export declare function cleanupOrphanedResources(provider: CloudProvider, clusterName: string, region: string): Promise<void>;
32
- /**
33
- * Destroys Terraform infrastructure, then sweeps remaining cloud resources.
34
- *
35
- * Flow:
36
- * 1. terraform destroy (single attempt)
37
- * 2. Cloud-native cleanup ALWAYS runs (terraform can report success while
38
- * resources still exist)
39
- * 3. If terraform reported failure, try once more now that blockers are gone
40
- */
41
- export declare function terraformDestroy(deploymentName: string, cloudContext?: {
42
- provider: CloudProvider;
43
- clusterName: string;
44
- region: string;
45
- }): Promise<void>;
46
- /**
47
- * Gets Terraform outputs
48
- */
49
- export declare function getTerraformOutputs(deploymentName: string): Promise<Record<string, string>>;
50
- /**
51
- * Checks if Terraform files/state exist for a deployment.
52
- * Returns true if the terraform directory contains any terraform files,
53
- * not just the state file. This allows destroy to work on partial infrastructure.
54
- */
55
- export declare function hasTerraformState(deploymentName: string): Promise<boolean>;
56
- /**
57
- * Generates Terraform variables from deployment configuration
58
- */
59
- export declare function generateTerraformVars(config: DeploymentConfig): Record<string, unknown>;
60
- /**
61
- * Updates kubeconfig for the provisioned cluster
62
- */
63
- export declare function updateKubeconfig(provider: CloudProvider, clusterName: string, region: string, options?: {
64
- gcpProjectId?: string;
65
- azureResourceGroup?: string;
66
- }): Promise<void>;