Google Cloud (GCP) Classic

v6.38.0 published on Thursday, Sep 22, 2022 by Pulumi

getRegistryRepository

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

using System.Collections.Generic;
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 main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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
	})
}
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()));
    }
}
import pulumi
import pulumi_gcp as gcp

foo = gcp.container.get_registry_repository()
pulumi.export("gcrLocation", foo.repository_url)
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);
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
Region string
Project string
Region string
project String
region String
project string
region string
project String
region String

getRegistryRepository Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Project string
RepositoryUrl string
Region string
Id string

The provider-assigned unique ID for this managed resource.

Project string
RepositoryUrl string
Region string
id String

The provider-assigned unique ID for this managed resource.

project String
repositoryUrl String
region String
id string

The provider-assigned unique ID for this managed resource.

project string
repositoryUrl string
region string
id str

The provider-assigned unique ID for this managed resource.

project str
repository_url str
region str
id String

The provider-assigned unique ID for this managed resource.

project String
repositoryUrl String
region String

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.