@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
238 lines • 8.89 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Usergroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating a Harness User Group. Linking SSO providers with User Groups:
*
* The following fields need to be populated for LDAP SSO Providers:
*
* - linkedSsoId
*
* - linkedSsoDisplayName
*
* - ssoGroupId
*
* - ssoGroupName
*
* - linkedSsoType
*
* - ssoLinked
*
* The following fields need to be populated for SAML SSO Providers:
*
* - linkedSsoId
*
* - linkedSsoDisplayName
*
* - ssoGroupName
*
* - ssoGroupId // same as ssoGroupName
*
* - linkedSsoType
*
* - ssoLinked
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const ssoTypeSaml = new harness.platform.Usergroup("ssoTypeSaml", {
* externallyManaged: false,
* identifier: "identifier",
* linkedSsoDisplayName: "linked_sso_display_name",
* linkedSsoId: "linked_sso_id",
* linkedSsoType: "SAML",
* notificationConfigs: [
* {
* slackWebhookUrl: "https://google.com",
* type: "SLACK",
* },
* {
* groupEmail: "email@email.com",
* sendEmailToAllUsers: true,
* type: "EMAIL",
* },
* {
* microsoftTeamsWebhookUrl: "https://google.com",
* type: "MSTEAMS",
* },
* {
* pagerDutyKey: "pagerDutyKey",
* type: "PAGERDUTY",
* },
* ],
* orgId: "org_id",
* projectId: "project_id",
* ssoGroupId: "sso_group_name",
* ssoGroupName: "sso_group_name",
* ssoLinked: true,
* users: ["user_id"],
* });
* const ssoTypeLdap = new harness.platform.Usergroup("ssoTypeLdap", {
* externallyManaged: false,
* identifier: "identifier",
* linkedSsoDisplayName: "linked_sso_display_name",
* linkedSsoId: "linked_sso_id",
* linkedSsoType: "LDAP",
* notificationConfigs: [
* {
* slackWebhookUrl: "https://google.com",
* type: "SLACK",
* },
* {
* groupEmail: "email@email.com",
* sendEmailToAllUsers: true,
* type: "EMAIL",
* },
* {
* microsoftTeamsWebhookUrl: "https://google.com",
* type: "MSTEAMS",
* },
* {
* pagerDutyKey: "pagerDutyKey",
* type: "PAGERDUTY",
* },
* ],
* orgId: "org_id",
* projectId: "project_id",
* ssoGroupId: "sso_group_id",
* ssoGroupName: "sso_group_name",
* ssoLinked: true,
* users: ["user_id"],
* });
* // Create user group by adding user emails
* const example = new harness.platform.Usergroup("example", {
* externallyManaged: false,
* identifier: "identifier",
* linkedSsoDisplayName: "linked_sso_display_name",
* linkedSsoId: "linked_sso_id",
* linkedSsoType: "SAML",
* notificationConfigs: [
* {
* slackWebhookUrl: "https://google.com",
* type: "SLACK",
* },
* {
* groupEmail: "email@email.com",
* sendEmailToAllUsers: true,
* type: "EMAIL",
* },
* {
* microsoftTeamsWebhookUrl: "https://google.com",
* type: "MSTEAMS",
* },
* {
* pagerDutyKey: "pagerDutyKey",
* type: "PAGERDUTY",
* },
* ],
* orgId: "org_id",
* projectId: "project_id",
* ssoGroupId: "sso_group_name",
* ssoGroupName: "sso_group_name",
* ssoLinked: true,
* userEmails: ["user@email.com"],
* });
* ```
*
* ## Import
*
* Import account level user group
*
* ```sh
* $ pulumi import harness:platform/usergroup:Usergroup example <usergroup_id>
* ```
*
* Import org level user group
*
* ```sh
* $ pulumi import harness:platform/usergroup:Usergroup example <ord_id>/<usergroup_id>
* ```
*
* Import project level user group
*
* ```sh
* $ pulumi import harness:platform/usergroup:Usergroup example <org_id>/<project_id>/<usergroup_id>
* ```
*/
class Usergroup extends pulumi.CustomResource {
/**
* Get an existing Usergroup 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 Usergroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Usergroup. 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'] === Usergroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["externallyManaged"] = state ? state.externallyManaged : undefined;
resourceInputs["identifier"] = state ? state.identifier : undefined;
resourceInputs["linkedSsoDisplayName"] = state ? state.linkedSsoDisplayName : undefined;
resourceInputs["linkedSsoId"] = state ? state.linkedSsoId : undefined;
resourceInputs["linkedSsoType"] = state ? state.linkedSsoType : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["notificationConfigs"] = state ? state.notificationConfigs : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["ssoGroupId"] = state ? state.ssoGroupId : undefined;
resourceInputs["ssoGroupName"] = state ? state.ssoGroupName : undefined;
resourceInputs["ssoLinked"] = state ? state.ssoLinked : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["userEmails"] = state ? state.userEmails : undefined;
resourceInputs["users"] = state ? state.users : undefined;
}
else {
const args = argsOrState;
if ((!args || args.identifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["externallyManaged"] = args ? args.externallyManaged : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["linkedSsoDisplayName"] = args ? args.linkedSsoDisplayName : undefined;
resourceInputs["linkedSsoId"] = args ? args.linkedSsoId : undefined;
resourceInputs["linkedSsoType"] = args ? args.linkedSsoType : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["notificationConfigs"] = args ? args.notificationConfigs : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["ssoGroupId"] = args ? args.ssoGroupId : undefined;
resourceInputs["ssoGroupName"] = args ? args.ssoGroupName : undefined;
resourceInputs["ssoLinked"] = args ? args.ssoLinked : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["userEmails"] = args ? args.userEmails : undefined;
resourceInputs["users"] = args ? args.users : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Usergroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.Usergroup = Usergroup;
/** @internal */
Usergroup.__pulumiType = 'harness:platform/usergroup:Usergroup';
//# sourceMappingURL=usergroup.js.map