get Registry Image
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 debian = gcp.container.getRegistryImage({
name: "debian",
});
export const gcrLocation = debian.then(debian => debian.imageUrl);
import pulumi
import pulumi_gcp as gcp
debian = gcp.container.get_registry_image(name="debian")
pulumi.export("gcrLocation", debian.image_url)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var debian = Gcp.Container.GetRegistryImage.Invoke(new()
{
Name = "debian",
});
return new Dictionary<string, object?>
{
["gcrLocation"] = debian.Apply(getRegistryImageResult => getRegistryImageResult.ImageUrl),
};
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
debian, err := container.GetRegistryImage(ctx, &container.GetRegistryImageArgs{
Name: "debian",
}, nil)
if err != nil {
return err
}
ctx.Export("gcrLocation", debian.ImageUrl)
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.GetRegistryImageArgs;
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 debian = ContainerFunctions.getRegistryImage(GetRegistryImageArgs.builder()
.name("debian")
.build());
ctx.export("gcrLocation", debian.applyValue(getRegistryImageResult -> getRegistryImageResult.imageUrl()));
}
}
variables:
debian:
fn::invoke:
Function: gcp:container:getRegistryImage
Arguments:
name: debian
outputs:
gcrLocation: ${debian.imageUrl}
Return
A collection of values returned by getRegistryImage.
Parameters
A collection of arguments for invoking getRegistryImage.
Return
A collection of values returned by getRegistryImage.
Parameters
The image digest to fetch, if any.
The image name.
The project ID that this image is attached to. If not provider, provider project will be used instead.
The GCR region to use. As of this writing, one of asia
, eu
, and us
. See the documentation for additional information.
The tag to fetch, if any.
See also
Return
A collection of values returned by getRegistryImage.
Parameters
Builder for com.pulumi.gcp.container.kotlin.inputs.GetRegistryImagePlainArgs.