@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
104 lines • 4.93 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.ServicePrincipalPassword = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* *Basic example*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuread from "@pulumi/azuread";
*
* const example = new azuread.Application("example", {displayName: "example"});
* const exampleServicePrincipal = new azuread.ServicePrincipal("example", {clientId: example.clientId});
* const exampleServicePrincipalPassword = new azuread.ServicePrincipalPassword("example", {servicePrincipalId: exampleServicePrincipal.id});
* ```
*
* *Time-based rotation*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuread from "@pulumi/azuread";
* import * as time from "@pulumiverse/time";
*
* const example = new azuread.Application("example", {displayName: "example"});
* const exampleServicePrincipal = new azuread.ServicePrincipal("example", {clientId: example.clientId});
* const exampleRotating = new time.Rotating("example", {rotationDays: 7});
* const exampleServicePrincipalPassword = new azuread.ServicePrincipalPassword("example", {
* servicePrincipalId: exampleServicePrincipal.id,
* rotateWhenChanged: {
* rotation: exampleRotating.id,
* },
* });
* ```
*
* ## Import
*
* This resource does not support importing.
*/
class ServicePrincipalPassword extends pulumi.CustomResource {
/**
* Get an existing ServicePrincipalPassword 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 ServicePrincipalPassword(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServicePrincipalPassword. 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'] === ServicePrincipalPassword.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["endDate"] = state ? state.endDate : undefined;
resourceInputs["endDateRelative"] = state ? state.endDateRelative : undefined;
resourceInputs["keyId"] = state ? state.keyId : undefined;
resourceInputs["rotateWhenChanged"] = state ? state.rotateWhenChanged : undefined;
resourceInputs["servicePrincipalId"] = state ? state.servicePrincipalId : undefined;
resourceInputs["startDate"] = state ? state.startDate : undefined;
resourceInputs["value"] = state ? state.value : undefined;
}
else {
const args = argsOrState;
if ((!args || args.servicePrincipalId === undefined) && !opts.urn) {
throw new Error("Missing required property 'servicePrincipalId'");
}
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["endDate"] = args ? args.endDate : undefined;
resourceInputs["endDateRelative"] = args ? args.endDateRelative : undefined;
resourceInputs["rotateWhenChanged"] = args ? args.rotateWhenChanged : undefined;
resourceInputs["servicePrincipalId"] = args ? args.servicePrincipalId : undefined;
resourceInputs["startDate"] = args ? args.startDate : undefined;
resourceInputs["keyId"] = undefined /*out*/;
resourceInputs["value"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["value"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServicePrincipalPassword.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServicePrincipalPassword = ServicePrincipalPassword;
/** @internal */
ServicePrincipalPassword.__pulumiType = 'azuread:index/servicePrincipalPassword:ServicePrincipalPassword';
//# sourceMappingURL=servicePrincipalPassword.js.map