1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. sourcerepo
  5. getRepository
Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi

gcp.sourcerepo.getRepository

Explore with Pulumi AI

Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi

Get infomation about an existing Google Cloud Source Repository. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const my_repo = gcp.sourcerepo.getRepository({
    name: "my-repository",
});
Copy
import pulumi
import pulumi_gcp as gcp

my_repo = gcp.sourcerepo.get_repository(name="my-repository")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/sourcerepo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sourcerepo.LookupRepository(ctx, &sourcerepo.LookupRepositoryArgs{
			Name: "my-repository",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var my_repo = Gcp.SourceRepo.GetRepository.Invoke(new()
    {
        Name = "my-repository",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.sourcerepo.SourcerepoFunctions;
import com.pulumi.gcp.sourcerepo.inputs.GetRepositoryArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var my-repo = SourcerepoFunctions.getRepository(GetRepositoryArgs.builder()
            .name("my-repository")
            .build());

    }
}
Copy
variables:
  my-repo:
    fn::invoke:
      function: gcp:sourcerepo:getRepository
      arguments:
        name: my-repository
Copy

Using getRepository

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getRepository(args: GetRepositoryArgs, opts?: InvokeOptions): Promise<GetRepositoryResult>
function getRepositoryOutput(args: GetRepositoryOutputArgs, opts?: InvokeOptions): Output<GetRepositoryResult>
Copy
def get_repository(name: Optional[str] = None,
                   project: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetRepositoryResult
def get_repository_output(name: Optional[pulumi.Input[str]] = None,
                   project: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryResult]
Copy
func LookupRepository(ctx *Context, args *LookupRepositoryArgs, opts ...InvokeOption) (*LookupRepositoryResult, error)
func LookupRepositoryOutput(ctx *Context, args *LookupRepositoryOutputArgs, opts ...InvokeOption) LookupRepositoryResultOutput
Copy

> Note: This function is named LookupRepository in the Go SDK.

public static class GetRepository 
{
    public static Task<GetRepositoryResult> InvokeAsync(GetRepositoryArgs args, InvokeOptions? opts = null)
    public static Output<GetRepositoryResult> Invoke(GetRepositoryInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
public static Output<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:sourcerepo/getRepository:getRepository
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Name This property is required. string
Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. String
Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. string
Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. str
Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
name This property is required. String
Resource name of the repository. The repo name may contain slashes. eg, name/with/slash
project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

getRepository Result

The following output properties are available:

CreateIgnoreAlreadyExists bool
Id string
The provider-assigned unique ID for this managed resource.
Name string
PubsubConfigs List<GetRepositoryPubsubConfig>
Size int
Url string
Project string
CreateIgnoreAlreadyExists bool
Id string
The provider-assigned unique ID for this managed resource.
Name string
PubsubConfigs []GetRepositoryPubsubConfig
Size int
Url string
Project string
createIgnoreAlreadyExists Boolean
id String
The provider-assigned unique ID for this managed resource.
name String
pubsubConfigs List<GetRepositoryPubsubConfig>
size Integer
url String
project String
createIgnoreAlreadyExists boolean
id string
The provider-assigned unique ID for this managed resource.
name string
pubsubConfigs GetRepositoryPubsubConfig[]
size number
url string
project string
create_ignore_already_exists bool
id str
The provider-assigned unique ID for this managed resource.
name str
pubsub_configs Sequence[GetRepositoryPubsubConfig]
size int
url str
project str
createIgnoreAlreadyExists Boolean
id String
The provider-assigned unique ID for this managed resource.
name String
pubsubConfigs List<Property Map>
size Number
url String
project String

Supporting Types

GetRepositoryPubsubConfig

MessageFormat This property is required. string
The format of the Cloud Pub/Sub messages.

  • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
  • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
ServiceAccountEmail This property is required. string
Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
Topic This property is required. string
MessageFormat This property is required. string
The format of the Cloud Pub/Sub messages.

  • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
  • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
ServiceAccountEmail This property is required. string
Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
Topic This property is required. string
messageFormat This property is required. String
The format of the Cloud Pub/Sub messages.

  • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
  • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
serviceAccountEmail This property is required. String
Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
topic This property is required. String
messageFormat This property is required. string
The format of the Cloud Pub/Sub messages.

  • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
  • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
serviceAccountEmail This property is required. string
Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
topic This property is required. string
message_format This property is required. str
The format of the Cloud Pub/Sub messages.

  • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
  • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
service_account_email This property is required. str
Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
topic This property is required. str
messageFormat This property is required. String
The format of the Cloud Pub/Sub messages.

  • PROTOBUF: The message payload is a serialized protocol buffer of SourceRepoEvent.
  • JSON: The message payload is a JSON string of SourceRepoEvent. Possible values: ["PROTOBUF", "JSON"]
serviceAccountEmail This property is required. String
Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.
topic This property is required. String

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.25.0 published on Thursday, Apr 3, 2025 by Pulumi