error TS2820: Type '"DynamicThresholdCriterion"' is not assignable to type 'Input<"StaticThresholdCriterion">'. Did you mean '"StaticThresholdCriterion"'? #3667
Unanswered
solarisfire
asked this question in
Q&A
Replies: 1 comment
|
If I set: criterionType: "DynamicThresholdCriterion" as any it works, but then gets stuck on: error TS2353: Object literal may only specify known properties, and 'alertSensitivity' does not exist in type 'Input'. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi guys,
I have this function, and as far as I can tell it should work. The documentation says DynamicThresholdCriterion is a thing. The ARM templates say it should be a thing. But Pulumi is just throwing a TypeScript error.
Am I doing anything obviously stupid?
// Function for creating dynamic threshold alert rules function createDynamicLoadBalancerMetricAlertRules( alertName: string, description: string, metricName: string, metricNamespace: string, timeAggregation: string, evaluationFrequency: string, evaluationWindow: string, severity: number, args: any, dimensions?: Dimension[] ) { return new azure_native.insights.MetricAlert(alertName, { actions: [ { actionGroupId: args.actionGroupId, }, ], autoMitigate: true, criteria: { allOf: [ { criterionType: azure_native.insights.CriterionType.DynamicThresholdCriterion, metricNamespace: metricNamespace, metricName: metricName, timeAggregation: timeAggregation, operator: azure_native.insights.DynamicThresholdOperator.GreaterOrLessThan, // Dynamic operator alertSensitivity: azure_native.insights.DynamicThresholdSensitivity.Low, // Sensitivity level numberOfViolations: 1, // Trigger on 1 violation failingPeriods: { numberOfEvaluationPeriods: 1, // Evaluate over 1 period }, name: alertName.slice(0, 99), ...(dimensions && dimensions.length > 0 && { dimensions: dimensions.map((dimension) => ({ name: dimension.name, operator: dimension.operator, values: dimension.values, })), }), }, ], odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", }, description: description, enabled: alertsEnabled, evaluationFrequency: evaluationFrequency, windowSize: evaluationWindow, location: "Global", resourceGroupName: args.resourceGroup, ruleName: alertName, scopes: [args.ResourceId], severity: severity, tags: { Project: args.ResourceGroupName, Service: serviceTagName, }, targetResourceRegion: args.location, targetResourceType: metricNamespace, }); }All reactions