@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
104 lines • 4.95 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.AccessPackageCatalogRoleAssignment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a single catalog role assignment 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: `EntitlementManagement.ReadWrite.All` or `Directory.ReadWrite.All`
*
* When authenticated with a user principal, this resource requires one of the following directory roles: `Identity Governance administrator` or `Global Administrator`
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuread from "@pulumi/azuread";
*
* const example = azuread.getUser({
* userPrincipalName: "jdoe@example.com",
* });
* const exampleGetAccessPackageCatalogRole = azuread.getAccessPackageCatalogRole({
* displayName: "Catalog owner",
* });
* const exampleAccessPackageCatalog = new azuread.AccessPackageCatalog("example", {
* displayName: "example-access-package-catalog",
* description: "Example access package catalog",
* });
* const exampleAccessPackageCatalogRoleAssignment = new azuread.AccessPackageCatalogRoleAssignment("example", {
* roleId: exampleGetAccessPackageCatalogRole.then(exampleGetAccessPackageCatalogRole => exampleGetAccessPackageCatalogRole.objectId),
* principalObjectId: example.then(example => example.objectId),
* catalogId: exampleAccessPackageCatalog.id,
* });
* ```
*
* ## Import
*
* Catalog role assignments can be imported using the ID of the assignment, e.g.
*
* ```sh
* $ pulumi import azuread:index/accessPackageCatalogRoleAssignment:AccessPackageCatalogRoleAssignment example 00000000-0000-0000-0000-000000000000
* ```
*/
class AccessPackageCatalogRoleAssignment extends pulumi.CustomResource {
/**
* Get an existing AccessPackageCatalogRoleAssignment 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 AccessPackageCatalogRoleAssignment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AccessPackageCatalogRoleAssignment. 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'] === AccessPackageCatalogRoleAssignment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["catalogId"] = state ? state.catalogId : undefined;
resourceInputs["principalObjectId"] = state ? state.principalObjectId : undefined;
resourceInputs["roleId"] = state ? state.roleId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.catalogId === undefined) && !opts.urn) {
throw new Error("Missing required property 'catalogId'");
}
if ((!args || args.principalObjectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'principalObjectId'");
}
if ((!args || args.roleId === undefined) && !opts.urn) {
throw new Error("Missing required property 'roleId'");
}
resourceInputs["catalogId"] = args ? args.catalogId : undefined;
resourceInputs["principalObjectId"] = args ? args.principalObjectId : undefined;
resourceInputs["roleId"] = args ? args.roleId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AccessPackageCatalogRoleAssignment.__pulumiType, name, resourceInputs, opts);
}
}
exports.AccessPackageCatalogRoleAssignment = AccessPackageCatalogRoleAssignment;
/** @internal */
AccessPackageCatalogRoleAssignment.__pulumiType = 'azuread:index/accessPackageCatalogRoleAssignment:AccessPackageCatalogRoleAssignment';
//# sourceMappingURL=accessPackageCatalogRoleAssignment.js.map