1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. container
  5. getRegistryRepository
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.container.getRegistryRepository

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    This data source fetches the project name, and provides the appropriate URLs to use for container registry for this project.

    The URLs are computed entirely offline - as long as the project exists, they will be valid, but this data source does not contact Google Container Registry (GCR) at any point.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const foo = gcp.container.getRegistryRepository({});
    export const gcrLocation = foo.then(foo => foo.repositoryUrl);
    
    import pulumi
    import pulumi_gcp as gcp
    
    foo = gcp.container.get_registry_repository()
    pulumi.export("gcrLocation", foo.repository_url)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/container"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := container.GetRegistryRepository(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("gcrLocation", foo.RepositoryUrl)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Gcp.Container.GetRegistryRepository.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["gcrLocation"] = foo.Apply(getRegistryRepositoryResult => getRegistryRepositoryResult.RepositoryUrl),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.container.ContainerFunctions;
    import com.pulumi.gcp.container.inputs.GetRegistryRepositoryArgs;
    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 foo = ContainerFunctions.getRegistryRepository();
    
            ctx.export("gcrLocation", foo.applyValue(getRegistryRepositoryResult -> getRegistryRepositoryResult.repositoryUrl()));
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: gcp:container:getRegistryRepository
          Arguments: {}
    outputs:
      gcrLocation: ${foo.repositoryUrl}
    

    Using getRegistryRepository

    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 getRegistryRepository(args: GetRegistryRepositoryArgs, opts?: InvokeOptions): Promise<GetRegistryRepositoryResult>
    function getRegistryRepositoryOutput(args: GetRegistryRepositoryOutputArgs, opts?: InvokeOptions): Output<GetRegistryRepositoryResult>
    def get_registry_repository(project: Optional[str] = None,
                                region: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetRegistryRepositoryResult
    def get_registry_repository_output(project: Optional[pulumi.Input[str]] = None,
                                region: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetRegistryRepositoryResult]
    func GetRegistryRepository(ctx *Context, args *GetRegistryRepositoryArgs, opts ...InvokeOption) (*GetRegistryRepositoryResult, error)
    func GetRegistryRepositoryOutput(ctx *Context, args *GetRegistryRepositoryOutputArgs, opts ...InvokeOption) GetRegistryRepositoryResultOutput

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

    public static class GetRegistryRepository 
    {
        public static Task<GetRegistryRepositoryResult> InvokeAsync(GetRegistryRepositoryArgs args, InvokeOptions? opts = null)
        public static Output<GetRegistryRepositoryResult> Invoke(GetRegistryRepositoryInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegistryRepositoryResult> getRegistryRepository(GetRegistryRepositoryArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:container/getRegistryRepository:getRegistryRepository
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Project string
    The project ID that this repository is attached to. If not provided, provider project will be used instead.
    Region string
    The GCR region to use. As of this writing, one of asia, eu, and us. See the documentation for additional information.
    Project string
    The project ID that this repository is attached to. If not provided, provider project will be used instead.
    Region string
    The GCR region to use. As of this writing, one of asia, eu, and us. See the documentation for additional information.
    project String
    The project ID that this repository is attached to. If not provided, provider project will be used instead.
    region String
    The GCR region to use. As of this writing, one of asia, eu, and us. See the documentation for additional information.
    project string
    The project ID that this repository is attached to. If not provided, provider project will be used instead.
    region string
    The GCR region to use. As of this writing, one of asia, eu, and us. See the documentation for additional information.
    project str
    The project ID that this repository is attached to. If not provided, provider project will be used instead.
    region str
    The GCR region to use. As of this writing, one of asia, eu, and us. See the documentation for additional information.
    project String
    The project ID that this repository is attached to. If not provided, provider project will be used instead.
    region String
    The GCR region to use. As of this writing, one of asia, eu, and us. See the documentation for additional information.

    getRegistryRepository Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Project string
    RepositoryUrl string
    The URL at which the repository can be accessed.
    Region string
    Id string
    The provider-assigned unique ID for this managed resource.
    Project string
    RepositoryUrl string
    The URL at which the repository can be accessed.
    Region string
    id String
    The provider-assigned unique ID for this managed resource.
    project String
    repositoryUrl String
    The URL at which the repository can be accessed.
    region String
    id string
    The provider-assigned unique ID for this managed resource.
    project string
    repositoryUrl string
    The URL at which the repository can be accessed.
    region string
    id str
    The provider-assigned unique ID for this managed resource.
    project str
    repository_url str
    The URL at which the repository can be accessed.
    region str
    id String
    The provider-assigned unique ID for this managed resource.
    project String
    repositoryUrl String
    The URL at which the repository can be accessed.
    region 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.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi