import * as pulumi from "@pulumi/pulumi"; /** * A repository associated to a parent connection. * * To get more information about Repository, see: * * * [API documentation](https://cloud.google.com/build/docs/api/reference/rest) * * How-to Guides * * [Official Documentation](https://cloud.google.com/build/docs) * * ## Example Usage * * ### Cloudbuildv2 Repository Ghe Doc * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const private_key_secret = new gcp.secretmanager.Secret("private-key-secret", { * secretId: "ghe-pk-secret", * replication: { * auto: {}, * }, * }); * const private_key_secret_version = new gcp.secretmanager.SecretVersion("private-key-secret-version", { * secret: private_key_secret.id, * secretData: std.file({ * input: "private-key.pem", * }).then(invoke => invoke.result), * }); * const webhook_secret_secret = new gcp.secretmanager.Secret("webhook-secret-secret", { * secretId: "github-token-secret", * replication: { * auto: {}, * }, * }); * const webhook_secret_secret_version = new gcp.secretmanager.SecretVersion("webhook-secret-secret-version", { * secret: webhook_secret_secret.id, * secretData: "", * }); * const p4sa_secretAccessor = gcp.organizations.getIAMPolicy({ * bindings: [{ * role: "roles/secretmanager.secretAccessor", * members: ["serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com"], * }], * }); * const policy_pk = new gcp.secretmanager.SecretIamPolicy("policy-pk", { * secretId: private_key_secret.secretId, * policyData: p4sa_secretAccessor.then(p4sa_secretAccessor => p4sa_secretAccessor.policyData), * }); * const policy_whs = new gcp.secretmanager.SecretIamPolicy("policy-whs", { * secretId: webhook_secret_secret.secretId, * policyData: p4sa_secretAccessor.then(p4sa_secretAccessor => p4sa_secretAccessor.policyData), * }); * const my_connection = new gcp.cloudbuildv2.Connection("my-connection", { * location: "us-central1", * name: "my-terraform-ghe-connection", * githubEnterpriseConfig: { * hostUri: "https://ghe.com", * privateKeySecretVersion: private_key_secret_version.id, * webhookSecretSecretVersion: webhook_secret_secret_version.id, * appId: 200, * appSlug: "gcb-app", * appInstallationId: 300, * }, * }, { * dependsOn: [ * policy_pk, * policy_whs, * ], * }); * const my_repository = new gcp.cloudbuildv2.Repository("my-repository", { * name: "my-terraform-ghe-repo", * location: "us-central1", * parentConnection: my_connection.name, * remoteUri: "https://ghe.com/hashicorp/terraform-provider-google.git", * }); * ``` * ### Cloudbuildv2 Repository Github Doc * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const github_token_secret = new gcp.secretmanager.Secret("github-token-secret", { * secretId: "github-token-secret", * replication: { * auto: {}, * }, * }); * const github_token_secret_version = new gcp.secretmanager.SecretVersion("github-token-secret-version", { * secret: github_token_secret.id, * secretData: std.file({ * input: "my-github-token.txt", * }).then(invoke => invoke.result), * }); * const p4sa_secretAccessor = gcp.organizations.getIAMPolicy({ * bindings: [{ * role: "roles/secretmanager.secretAccessor", * members: ["serviceAccount:service-123456789@gcp-sa-cloudbuild.iam.gserviceaccount.com"], * }], * }); * const policy = new gcp.secretmanager.SecretIamPolicy("policy", { * secretId: github_token_secret.secretId, * policyData: p4sa_secretAccessor.then(p4sa_secretAccessor => p4sa_secretAccessor.policyData), * }); * const my_connection = new gcp.cloudbuildv2.Connection("my-connection", { * location: "us-central1", * name: "my-connection", * githubConfig: { * appInstallationId: 123123, * authorizerCredential: { * oauthTokenSecretVersion: github_token_secret_version.id, * }, * }, * }); * const my_repository = new gcp.cloudbuildv2.Repository("my-repository", { * location: "us-central1", * name: "my-repo", * parentConnection: my_connection.name, * remoteUri: "https://github.com/myuser/myrepo.git", * }); * ``` * * ## Import * * Repository can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/connections/{{parent_connection}}/repositories/{{name}}` * * `{{project}}/{{location}}/{{parent_connection}}/{{name}}` * * `{{location}}/{{parent_connection}}/{{name}}` * * When using the `pulumi import` command, Repository can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudbuildv2/repository:Repository default projects/{{project}}/locations/{{location}}/connections/{{parent_connection}}/repositories/{{name}} * $ pulumi import gcp:cloudbuildv2/repository:Repository default {{project}}/{{location}}/{{parent_connection}}/{{name}} * $ pulumi import gcp:cloudbuildv2/repository:Repository default {{location}}/{{parent_connection}}/{{name}} * ``` */ export declare 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: string, id: pulumi.Input, state?: RepositoryState, opts?: pulumi.CustomResourceOptions): Repository; /** * 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: any): obj is Repository; /** * Allows clients to store small amounts of arbitrary data. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ readonly annotations: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Output only. Server assigned timestamp for when the connection was created. */ readonly createTime: pulumi.Output; /** * All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services. */ readonly effectiveAnnotations: pulumi.Output<{ [key: string]: string; }>; /** * This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. */ readonly etag: pulumi.Output; /** * The location for the resource */ readonly location: pulumi.Output; /** * Name of the repository. */ readonly name: pulumi.Output; /** * The connection for the resource */ readonly parentConnection: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * Required. Git Clone HTTPS URI. */ readonly remoteUri: pulumi.Output; /** * Output only. Server assigned timestamp for when the connection was updated. */ readonly updateTime: pulumi.Output; /** * Create a Repository resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RepositoryArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Repository resources. */ export interface RepositoryState { /** * Allows clients to store small amounts of arbitrary data. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Output only. Server assigned timestamp for when the connection was created. */ createTime?: pulumi.Input; /** * All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services. */ effectiveAnnotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. */ etag?: pulumi.Input; /** * The location for the resource */ location?: pulumi.Input; /** * Name of the repository. */ name?: pulumi.Input; /** * The connection for the resource */ parentConnection?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Required. Git Clone HTTPS URI. */ remoteUri?: pulumi.Input; /** * Output only. Server assigned timestamp for when the connection was updated. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a Repository resource. */ export interface RepositoryArgs { /** * Allows clients to store small amounts of arbitrary data. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The location for the resource */ location?: pulumi.Input; /** * Name of the repository. */ name?: pulumi.Input; /** * The connection for the resource */ parentConnection: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Required. Git Clone HTTPS URI. */ remoteUri: pulumi.Input; }