@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
118 lines • 5.29 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SynchronizationJob = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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 00000000-0000-0000-0000-000000000000/job/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 `{servicePrincipalId}/job/{jobId}`.
*/
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, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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 ? state.enabled : undefined;
resourceInputs["schedules"] = state ? state.schedules : undefined;
resourceInputs["servicePrincipalId"] = state ? state.servicePrincipalId : undefined;
resourceInputs["templateId"] = state ? state.templateId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.servicePrincipalId === undefined) && !opts.urn) {
throw new Error("Missing required property 'servicePrincipalId'");
}
if ((!args || args.templateId === undefined) && !opts.urn) {
throw new Error("Missing required property 'templateId'");
}
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["servicePrincipalId"] = args ? args.servicePrincipalId : undefined;
resourceInputs["templateId"] = args ? args.templateId : undefined;
resourceInputs["schedules"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SynchronizationJob.__pulumiType, name, resourceInputs, opts);
}
}
exports.SynchronizationJob = SynchronizationJob;
/** @internal */
SynchronizationJob.__pulumiType = 'azuread:index/synchronizationJob:SynchronizationJob';
//# sourceMappingURL=synchronizationJob.js.map