@oneuptime/common 14.0.93 → 14.0.94
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/Models/DatabaseModels/Alert.d.mts +2 -0
- package/Models/DatabaseModels/Alert.d.ts +2 -0
- package/Models/DatabaseModels/Alert.js +54 -0
- package/Models/DatabaseModels/CloudAccount.d.mts +29 -0
- package/Models/DatabaseModels/CloudAccount.d.ts +29 -0
- package/Models/DatabaseModels/CloudAccount.js +546 -0
- package/Models/DatabaseModels/CloudAccount.mjs +2 -0
- package/Models/DatabaseModels/CloudResource.d.mts +8 -0
- package/Models/DatabaseModels/CloudResource.d.ts +8 -0
- package/Models/DatabaseModels/CloudResource.js +169 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +1 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +1 -0
- package/Models/DatabaseModels/CloudResourceLabelRule.js +40 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +1 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +1 -0
- package/Models/DatabaseModels/CloudResourceOwnerRule.js +40 -0
- package/Models/DatabaseModels/Incident.d.mts +2 -0
- package/Models/DatabaseModels/Incident.d.ts +2 -0
- package/Models/DatabaseModels/Incident.js +54 -0
- package/Models/DatabaseModels/Index.js +2 -0
- package/Models/DatabaseModels/Monitor.d.mts +2 -0
- package/Models/DatabaseModels/Monitor.d.ts +2 -0
- package/Models/DatabaseModels/Monitor.js +54 -0
- package/Models/DatabaseModels/OpenSourceDeployment.d.mts +1 -0
- package/Models/DatabaseModels/OpenSourceDeployment.d.ts +1 -0
- package/Models/DatabaseModels/OpenSourceDeployment.js +25 -6
- package/Models/DatabaseModels/ScheduledMaintenance.d.mts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenance.d.ts +1 -0
- package/Models/DatabaseModels/ScheduledMaintenance.js +50 -0
- package/Types/AI/AiAffectedResources.d.mts +40 -0
- package/Types/AI/AiAffectedResources.d.ts +40 -0
- package/Types/AI/AiAffectedResources.js +292 -0
- package/Types/AI/AiAffectedResources.mjs +10 -0
- package/Types/Cloud/CloudAccountSummary.d.mts +25 -0
- package/Types/Cloud/CloudAccountSummary.d.ts +25 -0
- package/Types/Cloud/CloudAccountSummary.js +114 -0
- package/Types/Cloud/CloudAccountSummary.mjs +5 -0
- package/Types/Cloud/CloudEndpointMatch.d.mts +26 -0
- package/Types/Cloud/CloudEndpointMatch.d.ts +26 -0
- package/Types/Cloud/CloudEndpointMatch.js +134 -0
- package/Types/Cloud/CloudEndpointMatch.mjs +5 -0
- package/Types/Cloud/CloudInventory.d.mts +34 -0
- package/Types/Cloud/CloudInventory.d.ts +34 -0
- package/Types/Cloud/CloudInventory.js +362 -0
- package/Types/Cloud/CloudInventory.mjs +22 -0
- package/Types/Cloud/CloudResourceCatalog.d.mts +2 -0
- package/Types/Cloud/CloudResourceCatalog.d.ts +2 -0
- package/Types/Cloud/CloudResourceCatalog.js +29 -1
- package/Types/Cloud/CloudResourceCatalog.mjs +2 -0
- package/Types/Cloud/CloudResourceIndex.d.mts +44 -0
- package/Types/Cloud/CloudResourceIndex.d.ts +44 -0
- package/Types/Cloud/CloudResourceIndex.js +191 -0
- package/Types/Cloud/CloudResourceIndex.mjs +4 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.mts +3 -0
- package/Types/CloudConnection/CloudConnectionCatalog.d.ts +3 -0
- package/Types/CloudConnection/CloudConnectionCatalog.js +70 -12
- package/Types/CloudConnection/CloudConnectionCatalog.mjs +2 -0
- package/Types/CloudConnection/CloudConnectionPaste.js +7 -1
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +43 -3
- package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +43 -3
- package/Types/CloudConnection/CloudConnectionSetupCommands.js +280 -30
- package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +14 -0
- package/Types/CloudConnection/CloudConnectionTest.d.mts +1 -0
- package/Types/CloudConnection/CloudConnectionTest.d.ts +1 -0
- package/Types/CloudConnection/CloudConnectionTest.js +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.mts +19 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.d.ts +19 -0
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.js +27 -1
- package/Types/Dashboard/DashboardComponents/DashboardTableComponent.mjs +3 -0
- package/Types/Date.d.mts +1 -0
- package/Types/Date.d.ts +1 -0
- package/Types/Date.js +32 -6
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +67 -12
- package/Types/DateLanguage.mjs +2 -0
- package/Types/Domain.d.mts +2 -0
- package/Types/Domain.d.ts +2 -0
- package/Types/Domain.js +27 -0
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +1 -0
- package/Types/Email.d.mts +1 -0
- package/Types/Email.d.ts +1 -0
- package/Types/Email.js +16 -0
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.mts +4 -0
- package/Types/Monitor/ExternalStatusPageMonitor/ExternalStatusPageMonitorResponse.d.ts +4 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.mts +3 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.d.ts +3 -0
- package/Types/Monitor/MonitorStepExternalStatusPageMonitor.js +35 -0
- package/Types/Monitor/MonitorTemplateSyncField.js +6 -1
- package/Types/Monitor/UptimeBarTooltipMaintenance.d.mts +15 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.d.ts +15 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.js +2 -0
- package/Types/Monitor/UptimeBarTooltipMaintenance.mjs +1 -0
- package/Types/Monitor/UptimeHistoryLabels.d.mts +5 -0
- package/Types/Monitor/UptimeHistoryLabels.d.ts +5 -0
- package/Types/Monitor/UptimeHistoryLabels.js +5 -0
- package/Types/ReadingDirection.d.mts +10 -0
- package/Types/ReadingDirection.d.ts +10 -0
- package/Types/ReadingDirection.js +171 -0
- package/Types/ReadingDirection.mjs +10 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.js +2 -0
- package/Types/Runbook/HttpStepVariables.d.mts +8 -0
- package/Types/Runbook/HttpStepVariables.d.ts +8 -0
- package/Types/Runbook/HttpStepVariables.js +109 -0
- package/Types/Runbook/HttpStepVariables.mjs +5 -0
- package/Types/Runbook/RunbookStep.d.mts +1 -0
- package/Types/Runbook/RunbookStep.d.ts +1 -0
- package/Types/Runbook/RunnerFeatures.d.mts +1 -0
- package/Types/Runbook/RunnerFeatures.d.ts +1 -0
- package/Types/Runbook/RunnerFeatures.js +15 -3
- package/Types/Runbook/RunnerFeatures.mjs +1 -0
- package/Types/Runbook/SshHostKey.d.mts +22 -0
- package/Types/Runbook/SshHostKey.d.ts +22 -0
- package/Types/Runbook/SshHostKey.js +201 -0
- package/Types/Runbook/SshHostKey.mjs +10 -0
- package/Types/Runner/CodeRepositoryRunner.js +2 -3
- package/Types/Runner/GlobalAIAgentsGone.d.mts +1 -0
- package/Types/Runner/GlobalAIAgentsGone.d.ts +1 -0
- package/Types/Runner/GlobalAIAgentsGone.js +19 -0
- package/Types/Runner/GlobalAIAgentsGone.mjs +2 -0
- package/Types/Runner/GlobalRunnerWork.d.mts +1 -0
- package/Types/Runner/GlobalRunnerWork.d.ts +1 -0
- package/Types/Runner/GlobalRunnerWork.js +21 -1
- package/Types/Runner/GlobalRunnerWork.mjs +1 -0
- package/Types/SSO/SignInMethods.d.mts +31 -0
- package/Types/SSO/SignInMethods.d.ts +31 -0
- package/Types/SSO/SignInMethods.js +160 -0
- package/Types/SSO/SignInMethods.mjs +8 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.mts +24 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.d.ts +24 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.js +159 -0
- package/Types/ScheduledMaintenance/ScheduledMaintenancePublication.mjs +8 -0
- package/Types/StatusPage/StatusPageLanguage.d.mts +6 -0
- package/Types/StatusPage/StatusPageLanguage.d.ts +6 -0
- package/Types/StatusPage/StatusPageLanguage.js +17 -1
- package/Types/StatusPage/StatusPageLanguage.mjs +1 -0
- package/Types/Workflow/WorkflowPlan.d.mts +7 -0
- package/Types/Workflow/WorkflowPlan.d.ts +7 -0
- package/Types/Workflow/WorkflowPlan.js +39 -0
- package/Types/Workflow/WorkflowPlan.mjs +3 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.mts +11 -0
- package/Types/Workspace/WorkspaceMessagePayload.d.ts +11 -0
- package/Utils/Dashboard/TableThresholds.d.mts +44 -0
- package/Utils/Dashboard/TableThresholds.d.ts +44 -0
- package/Utils/Dashboard/TableThresholds.js +288 -0
- package/Utils/Dashboard/TableThresholds.mjs +17 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.mts +6 -0
- package/Utils/Dashboard/ValueWidgetSeries.d.ts +6 -0
- package/Utils/Dashboard/ValueWidgetSeries.js +70 -1
- package/Utils/Dashboard/ValueWidgetSeries.mjs +2 -0
- package/Utils/DeveloperDocs/ResourceProfiles.js +16 -0
- package/Utils/DeveloperDocs/TerraformSchema.d.mts +1 -0
- package/Utils/DeveloperDocs/TerraformSchema.d.ts +1 -0
- package/Utils/DeveloperDocs/TerraformSchema.js +17 -0
- package/Utils/DeveloperDocs/TerraformSchema.mjs +1 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.d.mts +17 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.d.ts +17 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.js +274 -0
- package/Utils/Monitor/ExternalStatusPageComponentNames.mjs +6 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.mts +35 -0
- package/Utils/Monitor/ExternalStatusPageReading.d.ts +35 -0
- package/Utils/Monitor/ExternalStatusPageReading.js +380 -0
- package/Utils/Monitor/ExternalStatusPageReading.mjs +6 -0
- package/Utils/Monitor/ExternalStatusPageScope.d.mts +43 -0
- package/Utils/Monitor/ExternalStatusPageScope.d.ts +43 -0
- package/Utils/Monitor/ExternalStatusPageScope.js +213 -0
- package/Utils/Monitor/ExternalStatusPageScope.mjs +4 -0
- package/Utils/Runbook/SshHostKeyFingerprint.d.mts +8 -0
- package/Utils/Runbook/SshHostKeyFingerprint.d.ts +8 -0
- package/Utils/Runbook/SshHostKeyFingerprint.js +83 -0
- package/Utils/Runbook/SshHostKeyFingerprint.mjs +5 -0
- package/Utils/ScheduledMaintenanceStart.d.mts +6 -0
- package/Utils/ScheduledMaintenanceStart.d.ts +6 -0
- package/Utils/ScheduledMaintenanceStart.js +15 -0
- package/Utils/StatusPage/HistoryChartBarColors.d.mts +2 -0
- package/Utils/StatusPage/HistoryChartBarColors.d.ts +2 -0
- package/Utils/StatusPage/HistoryChartBarColors.js +12 -1
- package/Utils/StatusPage/HistoryChartBarColors.mjs +2 -0
- package/Utils/Telemetry/ChangeEventFields.d.mts +19 -1
- package/Utils/Telemetry/ChangeEventFields.d.ts +19 -1
- package/Utils/Telemetry/ChangeEventFields.js +52 -1
- package/Utils/Uptime/DayUptimeGraphUtil.d.mts +6 -0
- package/Utils/Uptime/DayUptimeGraphUtil.d.ts +6 -0
- package/Utils/Uptime/DayUptimeGraphUtil.js +37 -6
- package/Utils/Uptime/UptimeMaintenanceUtil.d.mts +60 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.d.ts +60 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.js +295 -0
- package/Utils/Uptime/UptimeMaintenanceUtil.mjs +3 -0
- package/package.json +1 -1
|
@@ -2,12 +2,41 @@ import { CloudProvider } from "../Cloud/CloudPlatform";
|
|
|
2
2
|
import { CloudConnectionAuthMethod } from "./CloudConnectionCatalog";
|
|
3
3
|
export declare const CLOUD_CONNECTION_READ_ONLY_NAME: string;
|
|
4
4
|
export declare const GCP_SERVICE_ACCOUNT_ID: string;
|
|
5
|
+
export declare enum CloudConnectionSetupScope {
|
|
6
|
+
Account = "account",
|
|
7
|
+
Organization = "organization"
|
|
8
|
+
}
|
|
9
|
+
export interface AwsReadOnlyActionGroup {
|
|
10
|
+
purpose: string;
|
|
11
|
+
actions: Array<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare const AWS_READ_ONLY_ACTION_GROUPS: Array<AwsReadOnlyActionGroup>;
|
|
14
|
+
export declare const AWS_ORGANIZATION_ACTION_GROUP: AwsReadOnlyActionGroup;
|
|
5
15
|
export declare const AWS_READ_ONLY_ACTIONS: Array<string>;
|
|
16
|
+
export declare const AWS_SCOPED_READ_RESOURCES: Record<string, Array<string>>;
|
|
6
17
|
export declare const AZURE_READ_ONLY_ROLE: string;
|
|
7
18
|
export declare const GCP_READ_ONLY_ROLE: string;
|
|
19
|
+
export declare const GCP_INVENTORY_ROLE: string;
|
|
20
|
+
export declare const GCP_AUDIT_LOG_ROLE: string;
|
|
21
|
+
export declare const GCP_SERVICE_HEALTH_ROLE: string;
|
|
22
|
+
export declare const GCP_READ_ONLY_ROLES: Array<string>;
|
|
23
|
+
export declare const GCP_SERVICES: Array<string>;
|
|
8
24
|
export declare function getAwsExternalIdForProject(projectId: string): string;
|
|
9
25
|
export declare function getAwsRoleNameForExternalId(externalId: string): string;
|
|
10
|
-
export declare function
|
|
26
|
+
export declare function getAwsOrganizationStackSetName(externalId: string): string;
|
|
27
|
+
export declare function getAwsReadOnlyPolicy(options?: {
|
|
28
|
+
organization?: boolean | undefined;
|
|
29
|
+
}): {
|
|
30
|
+
Version: string;
|
|
31
|
+
Statement: Array<{
|
|
32
|
+
Effect: string;
|
|
33
|
+
Action: Array<string>;
|
|
34
|
+
Resource: string | Array<string>;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
export declare function getAwsReadOnlyPolicyDocument(options?: {
|
|
38
|
+
organization?: boolean | undefined;
|
|
39
|
+
}): string;
|
|
11
40
|
export declare function getAwsTrustPolicyDocument(data: {
|
|
12
41
|
trustedPrincipalArn: string;
|
|
13
42
|
externalId: string;
|
|
@@ -15,15 +44,26 @@ export declare function getAwsTrustPolicyDocument(data: {
|
|
|
15
44
|
export declare function getAwsRoleSetupCommand(data: {
|
|
16
45
|
trustedPrincipalArn: string;
|
|
17
46
|
externalId: string;
|
|
47
|
+
organization?: boolean | undefined;
|
|
48
|
+
}): string;
|
|
49
|
+
export declare function getAwsReadOnlyRoleTemplate(data: {
|
|
50
|
+
trustedPrincipalArn: string;
|
|
51
|
+
externalId: string;
|
|
52
|
+
}): string;
|
|
53
|
+
export declare function getAwsOrganizationSetupCommand(data: {
|
|
54
|
+
trustedPrincipalArn: string;
|
|
55
|
+
externalId: string;
|
|
18
56
|
}): string;
|
|
19
57
|
export declare function getAwsAccessKeySetupCommand(): string;
|
|
20
|
-
export declare function getAzureSetupCommand(): string;
|
|
21
|
-
export declare function getGcpSetupCommand(): string;
|
|
58
|
+
export declare function getAzureSetupCommand(scope?: CloudConnectionSetupScope): string;
|
|
59
|
+
export declare function getGcpSetupCommand(scope?: CloudConnectionSetupScope): string;
|
|
22
60
|
export interface CloudConnectionCommandContext {
|
|
23
61
|
trustedPrincipalArn?: string | undefined;
|
|
24
62
|
externalId?: string | undefined;
|
|
63
|
+
scope?: CloudConnectionSetupScope | undefined;
|
|
25
64
|
}
|
|
26
65
|
export declare function getCloudConnectionSetupCommand(provider: CloudProvider, method: CloudConnectionAuthMethod, context?: CloudConnectionCommandContext): string | undefined;
|
|
66
|
+
export declare function canSetUpOrganization(provider: CloudProvider, method: CloudConnectionAuthMethod): boolean;
|
|
27
67
|
export interface CloudConnectionAwsRoleSetup {
|
|
28
68
|
isAvailable: boolean;
|
|
29
69
|
trustedPrincipalArn?: string | undefined;
|
|
@@ -3,16 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GCP_READ_ONLY_ROLE = exports.AZURE_READ_ONLY_ROLE = exports.AWS_READ_ONLY_ACTIONS = exports.GCP_SERVICE_ACCOUNT_ID = exports.CLOUD_CONNECTION_READ_ONLY_NAME = void 0;
|
|
6
|
+
exports.GCP_SERVICES = exports.GCP_READ_ONLY_ROLES = exports.GCP_SERVICE_HEALTH_ROLE = exports.GCP_AUDIT_LOG_ROLE = exports.GCP_INVENTORY_ROLE = exports.GCP_READ_ONLY_ROLE = exports.AZURE_READ_ONLY_ROLE = exports.AWS_SCOPED_READ_RESOURCES = exports.AWS_READ_ONLY_ACTIONS = exports.AWS_ORGANIZATION_ACTION_GROUP = exports.AWS_READ_ONLY_ACTION_GROUPS = exports.CloudConnectionSetupScope = exports.GCP_SERVICE_ACCOUNT_ID = exports.CLOUD_CONNECTION_READ_ONLY_NAME = void 0;
|
|
7
7
|
exports.getAwsExternalIdForProject = getAwsExternalIdForProject;
|
|
8
8
|
exports.getAwsRoleNameForExternalId = getAwsRoleNameForExternalId;
|
|
9
|
+
exports.getAwsOrganizationStackSetName = getAwsOrganizationStackSetName;
|
|
10
|
+
exports.getAwsReadOnlyPolicy = getAwsReadOnlyPolicy;
|
|
9
11
|
exports.getAwsReadOnlyPolicyDocument = getAwsReadOnlyPolicyDocument;
|
|
10
12
|
exports.getAwsTrustPolicyDocument = getAwsTrustPolicyDocument;
|
|
11
13
|
exports.getAwsRoleSetupCommand = getAwsRoleSetupCommand;
|
|
14
|
+
exports.getAwsReadOnlyRoleTemplate = getAwsReadOnlyRoleTemplate;
|
|
15
|
+
exports.getAwsOrganizationSetupCommand = getAwsOrganizationSetupCommand;
|
|
12
16
|
exports.getAwsAccessKeySetupCommand = getAwsAccessKeySetupCommand;
|
|
13
17
|
exports.getAzureSetupCommand = getAzureSetupCommand;
|
|
14
18
|
exports.getGcpSetupCommand = getGcpSetupCommand;
|
|
15
19
|
exports.getCloudConnectionSetupCommand = getCloudConnectionSetupCommand;
|
|
20
|
+
exports.canSetUpOrganization = canSetUpOrganization;
|
|
16
21
|
const Crypto_1 = __importDefault(require("../../Utils/Crypto"));
|
|
17
22
|
const CloudPlatform_1 = require("../Cloud/CloudPlatform");
|
|
18
23
|
const CloudConnectionCatalog_1 = require("./CloudConnectionCatalog");
|
|
@@ -22,18 +27,27 @@ const CloudConnectionCatalog_1 = require("./CloudConnectionCatalog");
|
|
|
22
27
|
* Connecting a cloud takes one paste: the customer opens their cloud's own
|
|
23
28
|
* browser terminal (AWS CloudShell, Azure Cloud Shell, Google Cloud Shell),
|
|
24
29
|
* runs the command shown, and pastes back what it printed. Each command
|
|
25
|
-
* creates access that can only read, and
|
|
30
|
+
* creates access that can only read - metrics, the resources and how they
|
|
31
|
+
* are configured, what changed and the provider's health events, never
|
|
32
|
+
* data or secrets - and nothing more than a connection uses:
|
|
26
33
|
*
|
|
27
34
|
* - AWS, IAM role: a role trusting this OneUptime's AWS account with an
|
|
28
35
|
* external id only this project's connections use, with an inline
|
|
29
|
-
* policy
|
|
36
|
+
* read-only policy (AWS_READ_ONLY_ACTION_GROUPS). Prints the role's ARN.
|
|
37
|
+
* For a whole organization, the same role in every account through a
|
|
38
|
+
* CloudFormation StackSet of this project's own, and in the management
|
|
39
|
+
* account itself - the one role that may also list the organization's
|
|
40
|
+
* accounts (AWS_ORGANIZATION_ACTION_GROUP).
|
|
30
41
|
* - AWS, access key: a user with the same policy, and an access key.
|
|
31
42
|
* Prints the key.
|
|
32
43
|
* - Azure: an app registration (service principal) with the built-in
|
|
33
|
-
* Monitoring Reader role on the current subscription
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
44
|
+
* Monitoring Reader role on the current subscription - or on the
|
|
45
|
+
* tenant's root management group, for every subscription. Prints its
|
|
46
|
+
* app id, password, tenant and when the password expires.
|
|
47
|
+
* - Google Cloud: a service account with the built-in Monitoring Viewer,
|
|
48
|
+
* Cloud Asset Viewer, Logs Viewer and Service Health Viewer roles on the
|
|
49
|
+
* current project - or on its organization, for every project - and a
|
|
50
|
+
* JSON key. Prints the key.
|
|
37
51
|
*
|
|
38
52
|
* Each can be run again: a role, a user or a service account that is
|
|
39
53
|
* already there is updated, not duplicated.
|
|
@@ -46,18 +60,127 @@ const CloudConnectionCatalog_1 = require("./CloudConnectionCatalog");
|
|
|
46
60
|
exports.CLOUD_CONNECTION_READ_ONLY_NAME = "OneUptimeReadOnly";
|
|
47
61
|
exports.GCP_SERVICE_ACCOUNT_ID = "oneuptime-read-only";
|
|
48
62
|
/*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
63
|
+
* Whom one command gives access: the account the shell is in, or every
|
|
64
|
+
* account of its organization (an AWS Organization, an Azure tenant, a
|
|
65
|
+
* Google Cloud organization).
|
|
52
66
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
67
|
+
var CloudConnectionSetupScope;
|
|
68
|
+
(function (CloudConnectionSetupScope) {
|
|
69
|
+
CloudConnectionSetupScope["Account"] = "account";
|
|
70
|
+
CloudConnectionSetupScope["Organization"] = "organization";
|
|
71
|
+
})(CloudConnectionSetupScope || (exports.CloudConnectionSetupScope = CloudConnectionSetupScope = {}));
|
|
72
|
+
/*
|
|
73
|
+
* Every AWS action a connection uses, by what it is for. Each reads; none
|
|
74
|
+
* reads data (an object, a row, a message) or a secret, and none writes.
|
|
75
|
+
* Listing a resource type through Cloud Control calls that service's own
|
|
76
|
+
* List or Describe action as the role, which is why those are here.
|
|
77
|
+
*/
|
|
78
|
+
exports.AWS_READ_ONLY_ACTION_GROUPS = [
|
|
79
|
+
{
|
|
80
|
+
purpose: "Find the resources that report metrics, and read their metrics",
|
|
81
|
+
actions: ["cloudwatch:GetMetricData", "cloudwatch:ListMetrics"],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
purpose: "Name each resource and read its tags",
|
|
85
|
+
actions: ["tag:GetResources", "iam:ListAccountAliases"],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
purpose: "List every resource and how it is configured, through Cloud Control",
|
|
89
|
+
actions: [
|
|
90
|
+
"cloudformation:ListResources",
|
|
91
|
+
"ec2:DescribeInstances",
|
|
92
|
+
"ec2:DescribeVolumes",
|
|
93
|
+
"ec2:DescribeVpcs",
|
|
94
|
+
"ec2:DescribeNatGateways",
|
|
95
|
+
"autoscaling:DescribeAutoScalingGroups",
|
|
96
|
+
"elasticloadbalancing:DescribeLoadBalancers",
|
|
97
|
+
"elasticloadbalancing:DescribeLoadBalancerAttributes",
|
|
98
|
+
"elasticloadbalancing:DescribeTargetGroups",
|
|
99
|
+
"elasticloadbalancing:DescribeTargetGroupAttributes",
|
|
100
|
+
"elasticloadbalancing:DescribeTargetHealth",
|
|
101
|
+
"elasticloadbalancing:DescribeTags",
|
|
102
|
+
"ecs:ListClusters",
|
|
103
|
+
"ecs:DescribeClusters",
|
|
104
|
+
"ecs:ListServices",
|
|
105
|
+
"ecs:DescribeServices",
|
|
106
|
+
"lambda:ListFunctions",
|
|
107
|
+
"rds:DescribeDBInstances",
|
|
108
|
+
"rds:DescribeDBClusters",
|
|
109
|
+
"elasticache:DescribeReplicationGroups",
|
|
110
|
+
"sqs:ListQueues",
|
|
111
|
+
"sqs:GetQueueAttributes",
|
|
112
|
+
"sns:ListTopics",
|
|
113
|
+
"sns:GetTopicAttributes",
|
|
114
|
+
"sns:ListSubscriptionsByTopic",
|
|
115
|
+
"dynamodb:ListTables",
|
|
116
|
+
"dynamodb:DescribeTable",
|
|
117
|
+
"kinesis:ListStreams",
|
|
118
|
+
"kinesis:DescribeStreamSummary",
|
|
119
|
+
"states:ListStateMachines",
|
|
120
|
+
"states:DescribeStateMachine",
|
|
121
|
+
"cloudfront:ListDistributions",
|
|
122
|
+
"elasticfilesystem:DescribeFileSystems",
|
|
123
|
+
"es:ListDomainNames",
|
|
124
|
+
"es:DescribeDomains",
|
|
125
|
+
"apprunner:ListServices",
|
|
126
|
+
"apprunner:DescribeService",
|
|
127
|
+
"apigateway:GET",
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
purpose: "Read what changed: the account's management events",
|
|
132
|
+
actions: ["cloudtrail:LookupEvents"],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
purpose: "Read AWS's own health events for the account",
|
|
136
|
+
actions: ["health:DescribeEvents", "health:DescribeEventDetails"],
|
|
137
|
+
},
|
|
57
138
|
];
|
|
139
|
+
/*
|
|
140
|
+
* What only the organization's management account's role may do besides:
|
|
141
|
+
* list the accounts the other roles are in. Never in an account's own
|
|
142
|
+
* role, nor in the roles the StackSet puts in every member account.
|
|
143
|
+
*/
|
|
144
|
+
exports.AWS_ORGANIZATION_ACTION_GROUP = {
|
|
145
|
+
purpose: "List the organization's accounts, from its management account",
|
|
146
|
+
actions: ["organizations:ListAccounts"],
|
|
147
|
+
};
|
|
148
|
+
exports.AWS_READ_ONLY_ACTIONS = exports.AWS_READ_ONLY_ACTION_GROUPS.flatMap((group) => {
|
|
149
|
+
return group.actions;
|
|
150
|
+
});
|
|
151
|
+
/*
|
|
152
|
+
* Actions allowed only on some resources. API Gateway's reads are one
|
|
153
|
+
* action for every path, so it is allowed on the APIs' own definitions
|
|
154
|
+
* only - never on /apikeys, which can return a key's value.
|
|
155
|
+
*/
|
|
156
|
+
exports.AWS_SCOPED_READ_RESOURCES = {
|
|
157
|
+
"apigateway:GET": [
|
|
158
|
+
"arn:aws:apigateway:*::/restapis",
|
|
159
|
+
"arn:aws:apigateway:*::/restapis/*",
|
|
160
|
+
"arn:aws:apigateway:*::/apis",
|
|
161
|
+
"arn:aws:apigateway:*::/apis/*",
|
|
162
|
+
],
|
|
163
|
+
};
|
|
58
164
|
// The built-in roles Azure and Google Cloud connections are given.
|
|
59
165
|
exports.AZURE_READ_ONLY_ROLE = "Monitoring Reader";
|
|
60
166
|
exports.GCP_READ_ONLY_ROLE = "roles/monitoring.viewer";
|
|
167
|
+
exports.GCP_INVENTORY_ROLE = "roles/cloudasset.viewer";
|
|
168
|
+
exports.GCP_AUDIT_LOG_ROLE = "roles/logging.viewer";
|
|
169
|
+
exports.GCP_SERVICE_HEALTH_ROLE = "roles/servicehealth.viewer";
|
|
170
|
+
exports.GCP_READ_ONLY_ROLES = [
|
|
171
|
+
exports.GCP_READ_ONLY_ROLE,
|
|
172
|
+
exports.GCP_INVENTORY_ROLE,
|
|
173
|
+
exports.GCP_AUDIT_LOG_ROLE,
|
|
174
|
+
exports.GCP_SERVICE_HEALTH_ROLE,
|
|
175
|
+
];
|
|
176
|
+
// The Google Cloud APIs a connection calls, turned on by the command.
|
|
177
|
+
exports.GCP_SERVICES = [
|
|
178
|
+
"monitoring.googleapis.com",
|
|
179
|
+
"cloudasset.googleapis.com",
|
|
180
|
+
"logging.googleapis.com",
|
|
181
|
+
"cloudresourcemanager.googleapis.com",
|
|
182
|
+
"servicehealth.googleapis.com",
|
|
183
|
+
];
|
|
61
184
|
const EXTERNAL_ID_PREFIX = "oneuptime-";
|
|
62
185
|
/*
|
|
63
186
|
* The external id an AWS role trusts OneUptime with, for one project.
|
|
@@ -84,17 +207,49 @@ function getAwsRoleNameForExternalId(externalId) {
|
|
|
84
207
|
: externalId.slice(0, 8);
|
|
85
208
|
return `${exports.CLOUD_CONNECTION_READ_ONLY_NAME}-${suffix}`;
|
|
86
209
|
}
|
|
87
|
-
|
|
88
|
-
|
|
210
|
+
/*
|
|
211
|
+
* The StackSet that puts the role in every account of an AWS Organization:
|
|
212
|
+
* one per project, named like the project's role, so a second project that
|
|
213
|
+
* connects the same organization adds its own roles instead of replacing
|
|
214
|
+
* the first project's.
|
|
215
|
+
*/
|
|
216
|
+
function getAwsOrganizationStackSetName(externalId) {
|
|
217
|
+
return getAwsRoleNameForExternalId(externalId);
|
|
218
|
+
}
|
|
219
|
+
/*
|
|
220
|
+
* The read-only policy as an object, for the commands and the template.
|
|
221
|
+
* An organization's management account's role (organization: true) may
|
|
222
|
+
* also list the organization's accounts.
|
|
223
|
+
*/
|
|
224
|
+
function getAwsReadOnlyPolicy(options = {}) {
|
|
225
|
+
const scoped = Object.keys(exports.AWS_SCOPED_READ_RESOURCES);
|
|
226
|
+
return {
|
|
89
227
|
Version: "2012-10-17",
|
|
90
228
|
Statement: [
|
|
91
229
|
{
|
|
92
230
|
Effect: "Allow",
|
|
93
|
-
Action:
|
|
231
|
+
Action: [
|
|
232
|
+
...exports.AWS_READ_ONLY_ACTIONS.filter((action) => {
|
|
233
|
+
return !scoped.includes(action);
|
|
234
|
+
}),
|
|
235
|
+
...(options.organization
|
|
236
|
+
? exports.AWS_ORGANIZATION_ACTION_GROUP.actions
|
|
237
|
+
: []),
|
|
238
|
+
],
|
|
94
239
|
Resource: "*",
|
|
95
240
|
},
|
|
241
|
+
...scoped.map((action) => {
|
|
242
|
+
return {
|
|
243
|
+
Effect: "Allow",
|
|
244
|
+
Action: [action],
|
|
245
|
+
Resource: exports.AWS_SCOPED_READ_RESOURCES[action],
|
|
246
|
+
};
|
|
247
|
+
}),
|
|
96
248
|
],
|
|
97
|
-
}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function getAwsReadOnlyPolicyDocument(options = {}) {
|
|
252
|
+
return JSON.stringify(getAwsReadOnlyPolicy(options));
|
|
98
253
|
}
|
|
99
254
|
function getAwsTrustPolicyDocument(data) {
|
|
100
255
|
return JSON.stringify({
|
|
@@ -122,10 +277,61 @@ function getAwsRoleSetupCommand(data) {
|
|
|
122
277
|
`ROLE=${role}`,
|
|
123
278
|
`TRUST='${trust}'`,
|
|
124
279
|
`aws iam create-role --role-name "$ROLE" --assume-role-policy-document "$TRUST" > /dev/null 2>&1 || aws iam update-assume-role-policy --role-name "$ROLE" --policy-document "$TRUST"`,
|
|
125
|
-
`aws iam put-role-policy --role-name "$ROLE" --policy-name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --policy-document '${getAwsReadOnlyPolicyDocument()}'`,
|
|
280
|
+
`aws iam put-role-policy --role-name "$ROLE" --policy-name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --policy-document '${getAwsReadOnlyPolicyDocument({ organization: data.organization })}'`,
|
|
126
281
|
`aws iam get-role --role-name "$ROLE" --query Role.Arn --output text`,
|
|
127
282
|
].join("\n");
|
|
128
283
|
}
|
|
284
|
+
/*
|
|
285
|
+
* The CloudFormation template of the role: what a StackSet puts in every
|
|
286
|
+
* account of an organization, and what a team that keeps its IAM in
|
|
287
|
+
* CloudFormation deploys itself.
|
|
288
|
+
*/
|
|
289
|
+
function getAwsReadOnlyRoleTemplate(data) {
|
|
290
|
+
return JSON.stringify({
|
|
291
|
+
AWSTemplateFormatVersion: "2010-09-09",
|
|
292
|
+
Description: "OneUptime: a role that can only read this account's metrics, resources, changes and health events.",
|
|
293
|
+
Resources: {
|
|
294
|
+
OneUptimeReadOnlyRole: {
|
|
295
|
+
Type: "AWS::IAM::Role",
|
|
296
|
+
Properties: {
|
|
297
|
+
RoleName: getAwsRoleNameForExternalId(data.externalId),
|
|
298
|
+
AssumeRolePolicyDocument: JSON.parse(getAwsTrustPolicyDocument(data)),
|
|
299
|
+
Policies: [
|
|
300
|
+
{
|
|
301
|
+
PolicyName: exports.CLOUD_CONNECTION_READ_ONLY_NAME,
|
|
302
|
+
PolicyDocument: getAwsReadOnlyPolicy(),
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
Outputs: {
|
|
309
|
+
RoleArn: {
|
|
310
|
+
Value: { "Fn::GetAtt": ["OneUptimeReadOnlyRole", "Arn"] },
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/*
|
|
316
|
+
* A whole AWS Organization, from its management account: StackSets'
|
|
317
|
+
* trusted access to the organization turned on (nothing happens when it
|
|
318
|
+
* is on already), the role in every member account (a service-managed
|
|
319
|
+
* StackSet of this project's own that also reaches accounts added later),
|
|
320
|
+
* then in the management account itself, whose ARN it prints. IAM is
|
|
321
|
+
* global, so the StackSet deploys to one Region.
|
|
322
|
+
*/
|
|
323
|
+
function getAwsOrganizationSetupCommand(data) {
|
|
324
|
+
const stackSet = getAwsOrganizationStackSetName(data.externalId);
|
|
325
|
+
return [
|
|
326
|
+
`cat > oneuptime-read-only.json <<'TEMPLATE'`,
|
|
327
|
+
getAwsReadOnlyRoleTemplate(data),
|
|
328
|
+
"TEMPLATE",
|
|
329
|
+
`aws cloudformation activate-organizations-access > /dev/null 2>&1 || true`,
|
|
330
|
+
`aws cloudformation create-stack-set --stack-set-name ${stackSet} --template-body file://oneuptime-read-only.json --capabilities CAPABILITY_NAMED_IAM --permission-model SERVICE_MANAGED --auto-deployment Enabled=true,RetainStacksOnAccountRemoval=false > /dev/null 2>&1 || aws cloudformation update-stack-set --stack-set-name ${stackSet} --template-body file://oneuptime-read-only.json --capabilities CAPABILITY_NAMED_IAM > /dev/null`,
|
|
331
|
+
`aws cloudformation create-stack-instances --stack-set-name ${stackSet} --deployment-targets OrganizationalUnitIds=$(aws organizations list-roots --query "Roots[0].Id" --output text) --regions us-east-1 > /dev/null 2>&1 || true`,
|
|
332
|
+
getAwsRoleSetupCommand(Object.assign(Object.assign({}, data), { organization: true })),
|
|
333
|
+
].join("\n");
|
|
334
|
+
}
|
|
129
335
|
function getAwsAccessKeySetupCommand() {
|
|
130
336
|
const user = exports.CLOUD_CONNECTION_READ_ONLY_NAME;
|
|
131
337
|
return [
|
|
@@ -134,16 +340,45 @@ function getAwsAccessKeySetupCommand() {
|
|
|
134
340
|
`aws iam create-access-key --user-name ${user}`,
|
|
135
341
|
].join("\n");
|
|
136
342
|
}
|
|
137
|
-
|
|
138
|
-
|
|
343
|
+
/*
|
|
344
|
+
* Azure: the app, its role on the scope, and what it printed with the
|
|
345
|
+
* password's expiry added, so OneUptime can say before the password stops
|
|
346
|
+
* working. The tenant's root management group is named after the tenant.
|
|
347
|
+
*/
|
|
348
|
+
function getAzureSetupCommand(scope = CloudConnectionSetupScope.Account) {
|
|
349
|
+
const scopeLine = scope === CloudConnectionSetupScope.Organization
|
|
350
|
+
? `SCOPE="/providers/Microsoft.Management/managementGroups/$(az account show --query tenantId --output tsv)"`
|
|
351
|
+
: `SCOPE="/subscriptions/$(az account show --query id --output tsv)"`;
|
|
352
|
+
return [
|
|
353
|
+
scopeLine,
|
|
354
|
+
`OUT=$(az ad sp create-for-rbac --name ${exports.CLOUD_CONNECTION_READ_ONLY_NAME} --role "${exports.AZURE_READ_ONLY_ROLE}" --scopes "$SCOPE")`,
|
|
355
|
+
`APP=$(echo "$OUT" | jq -r .appId)`,
|
|
356
|
+
`END=$(az ad app credential list --id "$APP" --query "max([].endDateTime)" --output tsv)`,
|
|
357
|
+
`echo "$OUT" | jq --arg end "$END" '. + {endDateTime: $end}'`,
|
|
358
|
+
].join("\n");
|
|
139
359
|
}
|
|
140
|
-
|
|
360
|
+
/*
|
|
361
|
+
* Google Cloud: the APIs a connection calls, the service account, its
|
|
362
|
+
* roles on the project - or on the project's organization, for every
|
|
363
|
+
* project - and a key it prints and then deletes from the shell.
|
|
364
|
+
*/
|
|
365
|
+
function getGcpSetupCommand(scope = CloudConnectionSetupScope.Account) {
|
|
141
366
|
const member = `${exports.GCP_SERVICE_ACCOUNT_ID}@$PROJECT_ID.iam.gserviceaccount.com`;
|
|
367
|
+
const bind = (role) => {
|
|
368
|
+
return scope === CloudConnectionSetupScope.Organization
|
|
369
|
+
? `gcloud organizations add-iam-policy-binding "$ORG_ID" --member "serviceAccount:${member}" --role ${role} --condition=None > /dev/null`
|
|
370
|
+
: `gcloud projects add-iam-policy-binding "$PROJECT_ID" --member "serviceAccount:${member}" --role ${role} --condition=None > /dev/null`;
|
|
371
|
+
};
|
|
142
372
|
return [
|
|
143
373
|
"PROJECT_ID=$(gcloud config get-value project)",
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
374
|
+
...(scope === CloudConnectionSetupScope.Organization
|
|
375
|
+
? [
|
|
376
|
+
`ORG_ID=$(gcloud projects get-ancestors "$PROJECT_ID" --format="value(id)" | tail -1)`,
|
|
377
|
+
]
|
|
378
|
+
: []),
|
|
379
|
+
`gcloud services enable ${exports.GCP_SERVICES.join(" ")}`,
|
|
380
|
+
`gcloud iam service-accounts create ${exports.GCP_SERVICE_ACCOUNT_ID} --display-name "OneUptime (read only)" > /dev/null 2>&1 || true`,
|
|
381
|
+
...exports.GCP_READ_ONLY_ROLES.map(bind),
|
|
147
382
|
`gcloud iam service-accounts keys create oneuptime-key.json --iam-account "${member}"`,
|
|
148
383
|
"cat oneuptime-key.json && rm oneuptime-key.json",
|
|
149
384
|
].join("\n");
|
|
@@ -151,23 +386,38 @@ function getGcpSetupCommand() {
|
|
|
151
386
|
/*
|
|
152
387
|
* The command for a cloud and sign-in method, or undefined when it cannot
|
|
153
388
|
* be written yet (an AWS role before this OneUptime's AWS identity is
|
|
154
|
-
* known).
|
|
389
|
+
* known). An AWS organization is read through roles only: an access key's
|
|
390
|
+
* user cannot sign in to the member accounts' roles.
|
|
155
391
|
*/
|
|
156
392
|
function getCloudConnectionSetupCommand(provider, method, context = {}) {
|
|
393
|
+
const scope = context.scope || CloudConnectionSetupScope.Account;
|
|
157
394
|
if (provider === CloudPlatform_1.CloudProvider.AWS) {
|
|
158
395
|
if (method === CloudConnectionCatalog_1.CloudConnectionAuthMethod.AwsRole) {
|
|
159
396
|
if (!context.trustedPrincipalArn || !context.externalId) {
|
|
160
397
|
return undefined;
|
|
161
398
|
}
|
|
162
|
-
|
|
399
|
+
const role = {
|
|
163
400
|
trustedPrincipalArn: context.trustedPrincipalArn,
|
|
164
401
|
externalId: context.externalId,
|
|
165
|
-
}
|
|
402
|
+
};
|
|
403
|
+
return scope === CloudConnectionSetupScope.Organization
|
|
404
|
+
? getAwsOrganizationSetupCommand(role)
|
|
405
|
+
: getAwsRoleSetupCommand(role);
|
|
166
406
|
}
|
|
167
407
|
return getAwsAccessKeySetupCommand();
|
|
168
408
|
}
|
|
169
409
|
if (provider === CloudPlatform_1.CloudProvider.Azure) {
|
|
170
|
-
return getAzureSetupCommand();
|
|
410
|
+
return getAzureSetupCommand(scope);
|
|
411
|
+
}
|
|
412
|
+
return getGcpSetupCommand(scope);
|
|
413
|
+
}
|
|
414
|
+
/*
|
|
415
|
+
* Whether a cloud and sign-in method can be set up for a whole
|
|
416
|
+
* organization: Azure and Google Cloud always, AWS through a role.
|
|
417
|
+
*/
|
|
418
|
+
function canSetUpOrganization(provider, method) {
|
|
419
|
+
if (provider === CloudPlatform_1.CloudProvider.AWS) {
|
|
420
|
+
return method === CloudConnectionCatalog_1.CloudConnectionAuthMethod.AwsRole;
|
|
171
421
|
}
|
|
172
|
-
return
|
|
422
|
+
return true;
|
|
173
423
|
}
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import commonJsModule from "./CloudConnectionSetupCommands.js";
|
|
2
|
+
export const AWS_ORGANIZATION_ACTION_GROUP = commonJsModule.AWS_ORGANIZATION_ACTION_GROUP;
|
|
2
3
|
export const AWS_READ_ONLY_ACTIONS = commonJsModule.AWS_READ_ONLY_ACTIONS;
|
|
4
|
+
export const AWS_READ_ONLY_ACTION_GROUPS = commonJsModule.AWS_READ_ONLY_ACTION_GROUPS;
|
|
5
|
+
export const AWS_SCOPED_READ_RESOURCES = commonJsModule.AWS_SCOPED_READ_RESOURCES;
|
|
3
6
|
export const AZURE_READ_ONLY_ROLE = commonJsModule.AZURE_READ_ONLY_ROLE;
|
|
4
7
|
export const CLOUD_CONNECTION_READ_ONLY_NAME = commonJsModule.CLOUD_CONNECTION_READ_ONLY_NAME;
|
|
8
|
+
export const CloudConnectionSetupScope = commonJsModule.CloudConnectionSetupScope;
|
|
9
|
+
export const GCP_AUDIT_LOG_ROLE = commonJsModule.GCP_AUDIT_LOG_ROLE;
|
|
10
|
+
export const GCP_INVENTORY_ROLE = commonJsModule.GCP_INVENTORY_ROLE;
|
|
5
11
|
export const GCP_READ_ONLY_ROLE = commonJsModule.GCP_READ_ONLY_ROLE;
|
|
12
|
+
export const GCP_READ_ONLY_ROLES = commonJsModule.GCP_READ_ONLY_ROLES;
|
|
13
|
+
export const GCP_SERVICES = commonJsModule.GCP_SERVICES;
|
|
6
14
|
export const GCP_SERVICE_ACCOUNT_ID = commonJsModule.GCP_SERVICE_ACCOUNT_ID;
|
|
15
|
+
export const GCP_SERVICE_HEALTH_ROLE = commonJsModule.GCP_SERVICE_HEALTH_ROLE;
|
|
16
|
+
export const canSetUpOrganization = commonJsModule.canSetUpOrganization;
|
|
7
17
|
export const getAwsAccessKeySetupCommand = commonJsModule.getAwsAccessKeySetupCommand;
|
|
8
18
|
export const getAwsExternalIdForProject = commonJsModule.getAwsExternalIdForProject;
|
|
19
|
+
export const getAwsOrganizationSetupCommand = commonJsModule.getAwsOrganizationSetupCommand;
|
|
20
|
+
export const getAwsOrganizationStackSetName = commonJsModule.getAwsOrganizationStackSetName;
|
|
21
|
+
export const getAwsReadOnlyPolicy = commonJsModule.getAwsReadOnlyPolicy;
|
|
9
22
|
export const getAwsReadOnlyPolicyDocument = commonJsModule.getAwsReadOnlyPolicyDocument;
|
|
23
|
+
export const getAwsReadOnlyRoleTemplate = commonJsModule.getAwsReadOnlyRoleTemplate;
|
|
10
24
|
export const getAwsRoleNameForExternalId = commonJsModule.getAwsRoleNameForExternalId;
|
|
11
25
|
export const getAwsRoleSetupCommand = commonJsModule.getAwsRoleSetupCommand;
|
|
12
26
|
export const getAwsTrustPolicyDocument = commonJsModule.getAwsTrustPolicyDocument;
|
|
@@ -33,6 +33,7 @@ export interface CloudConnectionReadSummary {
|
|
|
33
33
|
newResources: number;
|
|
34
34
|
archivedResources: number;
|
|
35
35
|
pointsWritten: number;
|
|
36
|
+
changesRecorded: number;
|
|
36
37
|
requestCount: number;
|
|
37
38
|
warnings: Array<string>;
|
|
38
39
|
failureKind?: CloudConnectionFailureKind | undefined;
|
|
@@ -33,6 +33,7 @@ export interface CloudConnectionReadSummary {
|
|
|
33
33
|
newResources: number;
|
|
34
34
|
archivedResources: number;
|
|
35
35
|
pointsWritten: number;
|
|
36
|
+
changesRecorded: number;
|
|
36
37
|
requestCount: number;
|
|
37
38
|
warnings: Array<string>;
|
|
38
39
|
failureKind?: CloudConnectionFailureKind | undefined;
|
|
@@ -70,6 +70,7 @@ function readCloudConnectionReadSummary(value) {
|
|
|
70
70
|
newResources: readNumber(value["newResources"]),
|
|
71
71
|
archivedResources: readNumber(value["archivedResources"]),
|
|
72
72
|
pointsWritten: readNumber(value["pointsWritten"]),
|
|
73
|
+
changesRecorded: readNumber(value["changesRecorded"]),
|
|
73
74
|
requestCount: readNumber(value["requestCount"]),
|
|
74
75
|
warnings: readStrings(value["warnings"]),
|
|
75
76
|
failureKind: typeof failureKind === "string" &&
|
|
@@ -17,6 +17,23 @@ export declare enum TableColumnKind {
|
|
|
17
17
|
Metric = "Metric",
|
|
18
18
|
Formula = "Formula"
|
|
19
19
|
}
|
|
20
|
+
export declare enum TableThresholdDirection {
|
|
21
|
+
HigherIsWorse = "HigherIsWorse",
|
|
22
|
+
LowerIsWorse = "LowerIsWorse"
|
|
23
|
+
}
|
|
24
|
+
export declare enum TableThresholdStyle {
|
|
25
|
+
Text = "Text",
|
|
26
|
+
Background = "Background"
|
|
27
|
+
}
|
|
28
|
+
export declare enum TableThresholdLevel {
|
|
29
|
+
Warning = "Warning",
|
|
30
|
+
Critical = "Critical"
|
|
31
|
+
}
|
|
32
|
+
export interface TableColumnThresholds {
|
|
33
|
+
warning?: number | undefined;
|
|
34
|
+
critical?: number | undefined;
|
|
35
|
+
direction?: TableThresholdDirection | undefined;
|
|
36
|
+
}
|
|
20
37
|
export interface TableColumn {
|
|
21
38
|
id: string;
|
|
22
39
|
variable: string;
|
|
@@ -28,6 +45,7 @@ export interface TableColumn {
|
|
|
28
45
|
formula?: string | undefined;
|
|
29
46
|
decimals?: number | undefined;
|
|
30
47
|
unit?: string | undefined;
|
|
48
|
+
thresholds?: TableColumnThresholds | undefined;
|
|
31
49
|
}
|
|
32
50
|
export interface TableGroupByAttribute {
|
|
33
51
|
key: string;
|
|
@@ -45,6 +63,7 @@ export default interface DashboardTableComponent extends BaseComponent {
|
|
|
45
63
|
maxRows?: number | undefined;
|
|
46
64
|
reduce?: TableReduce | undefined;
|
|
47
65
|
decimals?: number | undefined;
|
|
66
|
+
thresholdStyle?: TableThresholdStyle | undefined;
|
|
48
67
|
attributeFilters?: Dictionary<DictionaryEntryValue> | undefined;
|
|
49
68
|
metricQueryConfig?: MetricQueryConfigData | undefined;
|
|
50
69
|
metricQueryConfigs?: Array<MetricQueryConfigData> | undefined;
|
|
@@ -17,6 +17,23 @@ export declare enum TableColumnKind {
|
|
|
17
17
|
Metric = "Metric",
|
|
18
18
|
Formula = "Formula"
|
|
19
19
|
}
|
|
20
|
+
export declare enum TableThresholdDirection {
|
|
21
|
+
HigherIsWorse = "HigherIsWorse",
|
|
22
|
+
LowerIsWorse = "LowerIsWorse"
|
|
23
|
+
}
|
|
24
|
+
export declare enum TableThresholdStyle {
|
|
25
|
+
Text = "Text",
|
|
26
|
+
Background = "Background"
|
|
27
|
+
}
|
|
28
|
+
export declare enum TableThresholdLevel {
|
|
29
|
+
Warning = "Warning",
|
|
30
|
+
Critical = "Critical"
|
|
31
|
+
}
|
|
32
|
+
export interface TableColumnThresholds {
|
|
33
|
+
warning?: number | undefined;
|
|
34
|
+
critical?: number | undefined;
|
|
35
|
+
direction?: TableThresholdDirection | undefined;
|
|
36
|
+
}
|
|
20
37
|
export interface TableColumn {
|
|
21
38
|
id: string;
|
|
22
39
|
variable: string;
|
|
@@ -28,6 +45,7 @@ export interface TableColumn {
|
|
|
28
45
|
formula?: string | undefined;
|
|
29
46
|
decimals?: number | undefined;
|
|
30
47
|
unit?: string | undefined;
|
|
48
|
+
thresholds?: TableColumnThresholds | undefined;
|
|
31
49
|
}
|
|
32
50
|
export interface TableGroupByAttribute {
|
|
33
51
|
key: string;
|
|
@@ -45,6 +63,7 @@ export default interface DashboardTableComponent extends BaseComponent {
|
|
|
45
63
|
maxRows?: number | undefined;
|
|
46
64
|
reduce?: TableReduce | undefined;
|
|
47
65
|
decimals?: number | undefined;
|
|
66
|
+
thresholdStyle?: TableThresholdStyle | undefined;
|
|
48
67
|
attributeFilters?: Dictionary<DictionaryEntryValue> | undefined;
|
|
49
68
|
metricQueryConfig?: MetricQueryConfigData | undefined;
|
|
50
69
|
metricQueryConfigs?: Array<MetricQueryConfigData> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableColumnKind = exports.TableReduce = void 0;
|
|
3
|
+
exports.TableThresholdLevel = exports.TableThresholdStyle = exports.TableThresholdDirection = exports.TableColumnKind = exports.TableReduce = void 0;
|
|
4
4
|
var TableReduce;
|
|
5
5
|
(function (TableReduce) {
|
|
6
6
|
TableReduce["Last"] = "Last";
|
|
@@ -14,3 +14,29 @@ var TableColumnKind;
|
|
|
14
14
|
TableColumnKind["Metric"] = "Metric";
|
|
15
15
|
TableColumnKind["Formula"] = "Formula";
|
|
16
16
|
})(TableColumnKind || (exports.TableColumnKind = TableColumnKind = {}));
|
|
17
|
+
/*
|
|
18
|
+
* Which way a column's values go bad (issue #5231). Higher is worse - CPU,
|
|
19
|
+
* memory or disk in use, errors, latency - reaches a threshold at or above
|
|
20
|
+
* it; lower is worse - free space, availability, throughput - at or below
|
|
21
|
+
* it.
|
|
22
|
+
*/
|
|
23
|
+
var TableThresholdDirection;
|
|
24
|
+
(function (TableThresholdDirection) {
|
|
25
|
+
TableThresholdDirection["HigherIsWorse"] = "HigherIsWorse";
|
|
26
|
+
TableThresholdDirection["LowerIsWorse"] = "LowerIsWorse";
|
|
27
|
+
})(TableThresholdDirection || (exports.TableThresholdDirection = TableThresholdDirection = {}));
|
|
28
|
+
/*
|
|
29
|
+
* How a value past a threshold is colored, for the whole table: the number
|
|
30
|
+
* itself (the default), or the whole cell behind it.
|
|
31
|
+
*/
|
|
32
|
+
var TableThresholdStyle;
|
|
33
|
+
(function (TableThresholdStyle) {
|
|
34
|
+
TableThresholdStyle["Text"] = "Text";
|
|
35
|
+
TableThresholdStyle["Background"] = "Background";
|
|
36
|
+
})(TableThresholdStyle || (exports.TableThresholdStyle = TableThresholdStyle = {}));
|
|
37
|
+
// The level a value has reached, worst last.
|
|
38
|
+
var TableThresholdLevel;
|
|
39
|
+
(function (TableThresholdLevel) {
|
|
40
|
+
TableThresholdLevel["Warning"] = "Warning";
|
|
41
|
+
TableThresholdLevel["Critical"] = "Critical";
|
|
42
|
+
})(TableThresholdLevel || (exports.TableThresholdLevel = TableThresholdLevel = {}));
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import commonJsModule from "./DashboardTableComponent.js";
|
|
2
2
|
export const TableColumnKind = commonJsModule.TableColumnKind;
|
|
3
3
|
export const TableReduce = commonJsModule.TableReduce;
|
|
4
|
+
export const TableThresholdDirection = commonJsModule.TableThresholdDirection;
|
|
5
|
+
export const TableThresholdLevel = commonJsModule.TableThresholdLevel;
|
|
6
|
+
export const TableThresholdStyle = commonJsModule.TableThresholdStyle;
|