UNPKG

@pulumi/azuread

Version:

A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.

107 lines 5.36 kB
"use strict"; // *** 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.ApplicationFromTemplate = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates an application registration and associated service principal from a gallery template. * * > The azuread.Application resource can also be used to instantiate a gallery application, however unlike the `azuread.Application` resource, this resource does not attempt to manage any properties of the resulting application. * * ## 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.OwnedBy` or `Application.ReadWrite.All` * * When authenticated with a user principal, this resource may require one of the following directory roles: `Application Administrator` or `Global Administrator` * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getApplicationTemplate({ * displayName: "Marketo", * }); * const exampleApplicationFromTemplate = new azuread.ApplicationFromTemplate("example", { * displayName: "Example Application", * templateId: example.then(example => example.templateId), * }); * const exampleGetApplication = azuread.getApplicationOutput({ * objectId: exampleApplicationFromTemplate.applicationObjectId, * }); * const exampleGetServicePrincipal = azuread.getServicePrincipalOutput({ * objectId: exampleApplicationFromTemplate.servicePrincipalObjectId, * }); * ``` * * ## Import * * Templated Applications can be imported using the template ID, the object ID of the application, and the object ID of the service principal, in the following format. * * ```sh * $ pulumi import azuread:index/applicationFromTemplate:ApplicationFromTemplate example /applicationTemplates/00000000-0000-0000-0000-000000000000/instantiate/11111111-1111-1111-1111-111111111111/22222222-2222-2222-2222-222222222222 * ``` */ class ApplicationFromTemplate extends pulumi.CustomResource { /** * Get an existing ApplicationFromTemplate 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 ApplicationFromTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ApplicationFromTemplate. 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'] === ApplicationFromTemplate.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationId"] = state ? state.applicationId : undefined; resourceInputs["applicationObjectId"] = state ? state.applicationObjectId : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["servicePrincipalId"] = state ? state.servicePrincipalId : undefined; resourceInputs["servicePrincipalObjectId"] = state ? state.servicePrincipalObjectId : undefined; resourceInputs["templateId"] = state ? state.templateId : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.templateId === undefined) && !opts.urn) { throw new Error("Missing required property 'templateId'"); } resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["templateId"] = args ? args.templateId : undefined; resourceInputs["applicationId"] = undefined /*out*/; resourceInputs["applicationObjectId"] = undefined /*out*/; resourceInputs["servicePrincipalId"] = undefined /*out*/; resourceInputs["servicePrincipalObjectId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ApplicationFromTemplate.__pulumiType, name, resourceInputs, opts); } } exports.ApplicationFromTemplate = ApplicationFromTemplate; /** @internal */ ApplicationFromTemplate.__pulumiType = 'azuread:index/applicationFromTemplate:ApplicationFromTemplate'; //# sourceMappingURL=applicationFromTemplate.js.map