sparse-intern-71089
01/18/2021, 7:42 PMtall-librarian-49374
01/18/2021, 9:18 PMthen
, does it stop showing the diff?prehistoric-nail-50687
01/19/2021, 7:56 AMtall-librarian-49374
01/19/2021, 8:42 AMprehistoric-nail-50687
01/19/2021, 9:30 AMnextgen
prehistoric-nail-50687
01/19/2021, 9:32 AMimport * as insights from "@pulumi/azure-nextgen/insights/v20150501";
import * as operationalinsights from "@pulumi/azure-nextgen/operationalinsights/v20200801";
tall-librarian-49374
01/19/2021, 9:46 AMmonitoring
?prehistoric-nail-50687
01/19/2021, 10:14 AMimport * as monitoring from "@pulumi/azure/monitoring";
tall-librarian-49374
01/19/2021, 10:31 AMprehistoric-nail-50687
01/19/2021, 10:42 AMgetWorkspace
function.
An other option to ensure this, would be to do both (build it my self and also call getWorkspace
) and compare the two myself. I tried this:
export function getLogWorkspaceId(resourceGroupName: string, workspaceName: string): Promise<pulumi.Output<string>> {
// The workspaceId returned by the `operationalinsights.getWorkspace()`-call is allways lower case.
// Altough azure has no problem when using this one as a reference, the reference stored on the target
// obejct gets converted to CamelCase and ends up in the pulumi state, causing the resource (e.g. DiagnosticSetting)
// to be recreated on every run.
const subscriptionId = authorization.getClientConfig().then((c) => c.subscriptionId);
const predictedWorkspaceId = pulumi.interpolate`/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/${workspaceName}`;
return operationalinsights
.getWorkspace({
resourceGroupName: resourceGroupName,
workspaceName: workspaceName,
})
.then((w) => w.id)
.then((id) => {
const workSpaceId = predictedWorkspaceId.apply((cid) => {
var areEqual = id.toUpperCase() === cid.toUpperCase();
if (areEqual === false) {
throw new Error("workspace id not as expected!");
}
return id;
});
return workSpaceId;
});
}
But now I end up with a Promise<pulumi.Output<string>>
and don’t know how to get it converted to a pulumi.Input<string>
tall-librarian-49374
01/19/2021, 10:52 AM.then((w) => w.id);
so that it matches the expectationtall-librarian-49374
01/19/2021, 11:25 AMprehistoric-nail-50687
01/19/2021, 11:44 AMprehistoric-nail-50687
01/19/2021, 12:07 PMLogSettings
(LogSettings) seems not to be exported or at least I’m not able to define a proper import for it. Also I have an other “dumb” question about the versioning: DiagnosticSetting is only available in a preview version (v20170501preview
), does the version indicate it is in preview since May 2017? is this something I should be worried about?tall-librarian-49374
01/19/2021, 12:15 PMtall-librarian-49374
01/19/2021, 12:18 PMprehistoric-nail-50687
01/19/2021, 12:21 PMLogSettings
e.g.
function newDiagnosticSettingCategory(category: string, enabled: boolean, retentionInDays: number): LogSettings {
return {
category: category,
enabled: enabled,
retentionPolicy: {
enabled: enabled,
days: retentionInDays,
},
};
}
but I can’t find LogSettings
to define the proper TS importtall-librarian-49374
01/19/2021, 12:38 PMprehistoric-nail-50687
01/19/2021, 12:42 PMimport { LogSettings } from "@pulumi/azure-nextgen/types/input/insights/v20170501preview/LogSettings";
does not work
I get:
$ npx tsc
src/application/webApplication.ts:6:29 - error TS2307: Cannot find module '@pulumi/azure-nextgen/types/input/insights/v20170501preview/LogSettings' or its corresponding type declarations.
6 import { LogSettings } from "@pulumi/azure-nextgen/types/input/insights/v20170501preview/LogSettings";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.