@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
141 lines • 6.25 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SynchronizationJob = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Manages a synchronization job associated with a service principal (enterprise application) within Azure Active Directory.
*
* ## API Permissions
*
* The following API permissions are required in order to use this resource.
*
* When authenticated with a service principal, this resource requires one of the following application roles: `Application.ReadWrite.All` or `Directory.ReadWrite.All`
*
* ## Example Usage
*
* *Basic example*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuread from "@pulumi/azuread";
*
* const example = azuread.getApplicationTemplate({
* displayName: "Azure Databricks SCIM Provisioning Connector",
* });
* const exampleApplicationFromTemplate = new azuread.ApplicationFromTemplate("example", {
* displayName: "example",
* templateId: example.then(example => example.templateId),
* });
* const exampleGetServicePrincipal = azuread.getServicePrincipalOutput({
* objectId: exampleApplicationFromTemplate.servicePrincipalObjectId,
* });
* const exampleSynchronizationSecret = new azuread.SynchronizationSecret("example", {
* servicePrincipalId: exampleGetServicePrincipal.apply(exampleGetServicePrincipal => exampleGetServicePrincipal.id),
* credentials: [
* {
* key: "BaseAddress",
* value: "https://adb-example.azuredatabricks.net/api/2.0/preview/scim",
* },
* {
* key: "SecretToken",
* value: "some-token",
* },
* ],
* });
* const exampleSynchronizationJob = new azuread.SynchronizationJob("example", {
* servicePrincipalId: exampleGetServicePrincipal.apply(exampleGetServicePrincipal => exampleGetServicePrincipal.id),
* templateId: "dataBricks",
* enabled: true,
* });
* ```
*
* ## Import
*
* Synchronization jobs can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import azuread:index/synchronizationJob:SynchronizationJob example /servicePrincipals/00000000-0000-0000-0000-000000000000/synchronization/jobs/dataBricks.f5532fc709734b1a90e8a1fa9fd03a82.8442fd39-2183-419c-8732-74b6ce866bd5
* ```
*
* > This ID format is unique to Terraform and is composed of the Service Principal Object ID and the ID of the Synchronization Job Id in the format `/servicePrincipals/{servicePrincipalId}/synchronization/jobs/{synchronizationJobId}`.
*/
class SynchronizationJob extends pulumi.CustomResource {
/**
* Get an existing SynchronizationJob resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new SynchronizationJob(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'azuread:index/synchronizationJob:SynchronizationJob';
/**
* Returns true if the given object is an instance of SynchronizationJob. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SynchronizationJob.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["schedules"] = state?.schedules;
resourceInputs["servicePrincipalId"] = state?.servicePrincipalId;
resourceInputs["templateId"] = state?.templateId;
}
else {
const args = argsOrState;
if (args?.servicePrincipalId === undefined && !opts.urn) {
throw new Error("Missing required property 'servicePrincipalId'");
}
if (args?.templateId === undefined && !opts.urn) {
throw new Error("Missing required property 'templateId'");
}
resourceInputs["enabled"] = args?.enabled;
resourceInputs["servicePrincipalId"] = args?.servicePrincipalId;
resourceInputs["templateId"] = args?.templateId;
resourceInputs["schedules"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SynchronizationJob.__pulumiType, name, resourceInputs, opts);
}
}
exports.SynchronizationJob = SynchronizationJob;
//# sourceMappingURL=synchronizationJob.js.map