UNPKG

@azure/arm-security

Version:
46 lines 2.29 kB
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { __awaiter } from "tslib"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { SecurityCenter } from "@azure/arm-security"; import { DefaultAzureCredential } from "@azure/identity"; /** * This sample demonstrates how to Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated. * * @summary Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated. * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json */ function createOrUpdateASecurityConnector() { return __awaiter(this, void 0, void 0, function* () { const subscriptionId = "a5caac9c-5c04-49af-b3d0-e204f40345d5"; const resourceGroupName = "exampleResourceGroup"; const securityConnectorName = "exampleSecurityConnectorName"; const securityConnector = { cloudName: "AWS", etag: "etag value (must be supplied for update)", hierarchyIdentifier: "exampleHierarchyId", location: "Central US", offerings: [ { nativeCloudConnection: { cloudRoleArn: "arn:aws:iam::00000000:role/ASCMonitor" }, offeringType: "CspmMonitorAws" } ], tags: {} }; const credential = new DefaultAzureCredential(); const client = new SecurityCenter(credential, subscriptionId); const result = yield client.securityConnectors.createOrUpdate(resourceGroupName, securityConnectorName, securityConnector); console.log(result); }); } createOrUpdateASecurityConnector().catch(console.error); //# sourceMappingURL=securityConnectorsCreateOrUpdateSample.js.map