@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
95 lines • 4.23 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.AppInstallationRepository = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > **Note**: This resource is not compatible with the GitHub App Installation authentication method.
*
* This resource manages relationships between app installations and repositories
* in your GitHub organization.
*
* Creating this resource installs a particular app on a particular repository.
*
* The app installation and the repository must both belong to the same
* organization on GitHub. Note: you can review your organization's installations
* by the following the instructions at this
* [link](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-your-organizations-installed-integrations).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* // Create a repository.
* const someRepo = new github.Repository("some_repo", {name: "some-repo"});
* const someAppRepo = new github.AppInstallationRepository("some_app_repo", {
* installationId: "1234567",
* repository: someRepo.name,
* });
* ```
*
* ## Import
*
* GitHub App Installation Repository can be imported
* using an ID made up of `installation_id:repository`, e.g.
*
* ```sh
* $ pulumi import github:index/appInstallationRepository:AppInstallationRepository terraform_repo 1234567:terraform
* ```
*/
class AppInstallationRepository extends pulumi.CustomResource {
/**
* Get an existing AppInstallationRepository 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 AppInstallationRepository(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AppInstallationRepository. 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'] === AppInstallationRepository.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["installationId"] = state ? state.installationId : undefined;
resourceInputs["repoId"] = state ? state.repoId : undefined;
resourceInputs["repository"] = state ? state.repository : undefined;
}
else {
const args = argsOrState;
if ((!args || args.installationId === undefined) && !opts.urn) {
throw new Error("Missing required property 'installationId'");
}
if ((!args || args.repository === undefined) && !opts.urn) {
throw new Error("Missing required property 'repository'");
}
resourceInputs["installationId"] = args ? args.installationId : undefined;
resourceInputs["repository"] = args ? args.repository : undefined;
resourceInputs["repoId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AppInstallationRepository.__pulumiType, name, resourceInputs, opts);
}
}
exports.AppInstallationRepository = AppInstallationRepository;
/** @internal */
AppInstallationRepository.__pulumiType = 'github:index/appInstallationRepository:AppInstallationRepository';
//# sourceMappingURL=appInstallationRepository.js.map
;