@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
117 lines • 4.33 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.Repository = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A repository (or repo) is a Git repository storing versioned source content.
*
* To get more information about Repository, see:
*
* * [API documentation](https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/source-repositories/)
*
* ## Example Usage
*
* ### Sourcerepo Repository Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const my_repo = new gcp.sourcerepo.Repository("my-repo", {name: "my/repository"});
* ```
* ### Sourcerepo Repository Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const testAccount = new gcp.serviceaccount.Account("test_account", {
* accountId: "my-account",
* displayName: "Test Service Account",
* });
* const topic = new gcp.pubsub.Topic("topic", {name: "my-topic"});
* const my_repo = new gcp.sourcerepo.Repository("my-repo", {
* name: "my-repository",
* pubsubConfigs: [{
* topic: topic.id,
* messageFormat: "JSON",
* serviceAccountEmail: testAccount.email,
* }],
* });
* ```
*
* ## Import
*
* Repository can be imported using any of these accepted formats:
*
* * `projects/{{project}}/repos/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, Repository can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:sourcerepo/repository:Repository default projects/{{project}}/repos/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:sourcerepo/repository:Repository default {{name}}
* ```
*/
class Repository extends pulumi.CustomResource {
/**
* Get an existing Repository 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 Repository(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Repository. 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'] === Repository.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createIgnoreAlreadyExists"] = state?.createIgnoreAlreadyExists;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["pubsubConfigs"] = state?.pubsubConfigs;
resourceInputs["size"] = state?.size;
resourceInputs["url"] = state?.url;
}
else {
const args = argsOrState;
resourceInputs["createIgnoreAlreadyExists"] = args?.createIgnoreAlreadyExists;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["pubsubConfigs"] = args?.pubsubConfigs;
resourceInputs["size"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Repository.__pulumiType, name, resourceInputs, opts);
}
}
exports.Repository = Repository;
/** @internal */
Repository.__pulumiType = 'gcp:sourcerepo/repository:Repository';
//# sourceMappingURL=repository.js.map
;