@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
115 lines • 5.36 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.ApplicationPreAuthorized = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuread from "@pulumi/azuread";
*
* const authorized = new azuread.ApplicationRegistration("authorized", {displayName: "example-authorized-app"});
* const authorizer = new azuread.Application("authorizer", {
* displayName: "example-authorizing-app",
* api: {
* oauth2PermissionScopes: [
* {
* adminConsentDescription: "Administer the application",
* adminConsentDisplayName: "Administer",
* enabled: true,
* id: "00000000-0000-0000-0000-000000000000",
* type: "Admin",
* value: "administer",
* },
* {
* adminConsentDescription: "Access the application",
* adminConsentDisplayName: "Access",
* enabled: true,
* id: "11111111-1111-1111-1111-111111111111",
* type: "User",
* userConsentDescription: "Access the application",
* userConsentDisplayName: "Access",
* value: "user_impersonation",
* },
* ],
* },
* });
* const example = new azuread.ApplicationPreAuthorized("example", {
* applicationId: authorizer.id,
* authorizedClientId: authorized.clientId,
* permissionIds: [
* "00000000-0000-0000-0000-000000000000",
* "11111111-1111-1111-1111-111111111111",
* ],
* });
* ```
*
* ## Import
*
* Pre-authorized applications can be imported using the object ID of the authorizing application and the application ID of the application being authorized, e.g.
*
* ```sh
* $ pulumi import azuread:index/applicationPreAuthorized:ApplicationPreAuthorized example 00000000-0000-0000-0000-000000000000/preAuthorizedApplication/11111111-1111-1111-1111-111111111111
* ```
*
* -> This ID format is unique to Terraform and is composed of the authorizing application's object ID, the string "preAuthorizedApplication" and the authorized application's application ID (client ID) in the format `{ObjectId}/preAuthorizedApplication/{ApplicationId}`.
*/
class ApplicationPreAuthorized extends pulumi.CustomResource {
/**
* Get an existing ApplicationPreAuthorized 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 ApplicationPreAuthorized(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ApplicationPreAuthorized. 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'] === ApplicationPreAuthorized.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applicationId"] = state ? state.applicationId : undefined;
resourceInputs["authorizedClientId"] = state ? state.authorizedClientId : undefined;
resourceInputs["permissionIds"] = state ? state.permissionIds : undefined;
}
else {
const args = argsOrState;
if ((!args || args.applicationId === undefined) && !opts.urn) {
throw new Error("Missing required property 'applicationId'");
}
if ((!args || args.authorizedClientId === undefined) && !opts.urn) {
throw new Error("Missing required property 'authorizedClientId'");
}
if ((!args || args.permissionIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'permissionIds'");
}
resourceInputs["applicationId"] = args ? args.applicationId : undefined;
resourceInputs["authorizedClientId"] = args ? args.authorizedClientId : undefined;
resourceInputs["permissionIds"] = args ? args.permissionIds : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ApplicationPreAuthorized.__pulumiType, name, resourceInputs, opts);
}
}
exports.ApplicationPreAuthorized = ApplicationPreAuthorized;
/** @internal */
ApplicationPreAuthorized.__pulumiType = 'azuread:index/applicationPreAuthorized:ApplicationPreAuthorized';
//# sourceMappingURL=applicationPreAuthorized.js.map