Package com.pulumi.gcp.sourcerepo
Class Repository
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.sourcerepo.Repository
-
public class Repository extends com.pulumi.resources.CustomResource
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 ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.sourcerepo.Repository; 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) { var my_repo = new Repository("my-repo"); } } ``` ### Sourcerepo Repository Full ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.serviceaccount.Account; import com.pulumi.gcp.serviceaccount.AccountArgs; import com.pulumi.gcp.pubsub.Topic; import com.pulumi.gcp.sourcerepo.Repository; import com.pulumi.gcp.sourcerepo.RepositoryArgs; import com.pulumi.gcp.sourcerepo.inputs.RepositoryPubsubConfigArgs; 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) { var testAccount = new Account("testAccount", AccountArgs.builder() .accountId("my-account") .displayName("Test Service Account") .build()); var topic = new Topic("topic"); var my_repo = new Repository("my-repo", RepositoryArgs.builder() .pubsubConfigs(RepositoryPubsubConfigArgs.builder() .topic(topic.id()) .messageFormat("JSON") .serviceAccountEmail(testAccount.email()) .build()) .build()); } } ``` ## Import Repository can be imported using any of these accepted formats* `projects/{{project}}/repos/{{name}}` * `{{name}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Repository using one of the formats above. For exampletf import { id = "projects/{{project}}/repos/{{name}}" to = google_sourcerepo_repository.default } ```sh $ pulumi import gcp:sourcerepo/repository:Repository When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} ```
-
-
Constructor Summary
Constructors Constructor Description Repository(java.lang.String name)
Repository(java.lang.String name, RepositoryArgs args)
Repository(java.lang.String name, RepositoryArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Repository
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RepositoryState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<java.util.Optional<java.util.List<RepositoryPubsubConfig>>>
pubsubConfigs()
com.pulumi.core.Output<java.lang.Integer>
size()
com.pulumi.core.Output<java.lang.String>
url()
-
-
-
Constructor Detail
-
Repository
public Repository(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Repository
public Repository(java.lang.String name, @Nullable RepositoryArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Repository
public Repository(java.lang.String name, @Nullable RepositoryArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Resource name of the repository, of the form `{{repo}}`. The repo name may contain slashes. eg, `name/with/slash` ***
-
project
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
-
pubsubConfigs
public com.pulumi.core.Output<java.util.Optional<java.util.List<RepositoryPubsubConfig>>> pubsubConfigs()
- Returns:
- How this repository publishes a change in the repository through Cloud Pub/Sub. Keyed by the topic names. Structure is documented below.
-
size
public com.pulumi.core.Output<java.lang.Integer> size()
- Returns:
- The disk usage of the repo, in bytes.
-
url
public com.pulumi.core.Output<java.lang.String> url()
- Returns:
- URL to clone the repository from Google Cloud Source Repositories.
-
get
public static Repository get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable RepositoryState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-