@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
82 lines • 3.7 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.EmuGroupMapping = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource manages mappings between external groups for enterprise managed users and GitHub teams. It wraps the API detailed [here](https://docs.github.com/en/rest/reference/teams#external-groups). Note that this is a distinct resource from `github.TeamSyncGroupMapping`. `github.EmuGroupMapping` is special to the Enterprise Managed User (EMU) external group feature, whereas `github.TeamSyncGroupMapping` is specific to Identity Provider Groups.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* const exampleEmuGroupMapping = new github.EmuGroupMapping("example_emu_group_mapping", {
* teamSlug: "emu-test-team",
* groupId: 28836,
* });
* ```
*
* ## Import
*
* GitHub EMU External Group Mappings can be imported using the external `group_id`, e.g.
*
* ```sh
* $ pulumi import github:index/emuGroupMapping:EmuGroupMapping example_emu_group_mapping 28836
* ```
*/
class EmuGroupMapping extends pulumi.CustomResource {
/**
* Get an existing EmuGroupMapping 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 EmuGroupMapping(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of EmuGroupMapping. 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'] === EmuGroupMapping.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["groupId"] = state ? state.groupId : undefined;
resourceInputs["teamSlug"] = state ? state.teamSlug : undefined;
}
else {
const args = argsOrState;
if ((!args || args.groupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'groupId'");
}
if ((!args || args.teamSlug === undefined) && !opts.urn) {
throw new Error("Missing required property 'teamSlug'");
}
resourceInputs["groupId"] = args ? args.groupId : undefined;
resourceInputs["teamSlug"] = args ? args.teamSlug : undefined;
resourceInputs["etag"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EmuGroupMapping.__pulumiType, name, resourceInputs, opts);
}
}
exports.EmuGroupMapping = EmuGroupMapping;
/** @internal */
EmuGroupMapping.__pulumiType = 'github:index/emuGroupMapping:EmuGroupMapping';
//# sourceMappingURL=emuGroupMapping.js.map
;