1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. artifactregistry
  5. getVersions
Google Cloud v9.10.0 published on Friday, Jan 16, 2026 by Pulumi
gcp logo
Google Cloud v9.10.0 published on Friday, Jan 16, 2026 by Pulumi

    Get information about Artifact Registry versions. See the official documentation and API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const myVersions = gcp.artifactregistry.getVersions({
        location: "us-central1",
        repositoryId: "example-repo",
        packageName: "example-package",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_versions = gcp.artifactregistry.get_versions(location="us-central1",
        repository_id="example-repo",
        package_name="example-package")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/artifactregistry"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := artifactregistry.GetVersions(ctx, &artifactregistry.GetVersionsArgs{
    			Location:     "us-central1",
    			RepositoryId: "example-repo",
    			PackageName:  "example-package",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var myVersions = Gcp.ArtifactRegistry.GetVersions.Invoke(new()
        {
            Location = "us-central1",
            RepositoryId = "example-repo",
            PackageName = "example-package",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.artifactregistry.ArtifactregistryFunctions;
    import com.pulumi.gcp.artifactregistry.inputs.GetVersionsArgs;
    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 myVersions = ArtifactregistryFunctions.getVersions(GetVersionsArgs.builder()
                .location("us-central1")
                .repositoryId("example-repo")
                .packageName("example-package")
                .build());
    
        }
    }
    
    variables:
      myVersions:
        fn::invoke:
          function: gcp:artifactregistry:getVersions
          arguments:
            location: us-central1
            repositoryId: example-repo
            packageName: example-package
    

    Using getVersions

    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 getVersions(args: GetVersionsArgs, opts?: InvokeOptions): Promise<GetVersionsResult>
    function getVersionsOutput(args: GetVersionsOutputArgs, opts?: InvokeOptions): Output<GetVersionsResult>
    def get_versions(filter: Optional[str] = None,
                     location: Optional[str] = None,
                     package_name: Optional[str] = None,
                     project: Optional[str] = None,
                     repository_id: Optional[str] = None,
                     view: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetVersionsResult
    def get_versions_output(filter: Optional[pulumi.Input[str]] = None,
                     location: Optional[pulumi.Input[str]] = None,
                     package_name: Optional[pulumi.Input[str]] = None,
                     project: Optional[pulumi.Input[str]] = None,
                     repository_id: Optional[pulumi.Input[str]] = None,
                     view: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetVersionsResult]
    func GetVersions(ctx *Context, args *GetVersionsArgs, opts ...InvokeOption) (*GetVersionsResult, error)
    func GetVersionsOutput(ctx *Context, args *GetVersionsOutputArgs, opts ...InvokeOption) GetVersionsResultOutput

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

    public static class GetVersions 
    {
        public static Task<GetVersionsResult> InvokeAsync(GetVersionsArgs args, InvokeOptions? opts = null)
        public static Output<GetVersionsResult> Invoke(GetVersionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVersionsResult> getVersions(GetVersionsArgs args, InvokeOptions options)
    public static Output<GetVersionsResult> getVersions(GetVersionsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:artifactregistry/getVersions:getVersions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location of the artifact registry.
    PackageName string
    The name of the package.
    RepositoryId string
    The last part of the repository name to fetch from.
    Filter string
    An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are name and version. Further information can be found in the REST API.
    Project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    View string
    The view, which determines what version information is returned in a response. Possible values are "BASIC" and "FULL". Defaults to "BASIC".
    Location string
    The location of the artifact registry.
    PackageName string
    The name of the package.
    RepositoryId string
    The last part of the repository name to fetch from.
    Filter string
    An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are name and version. Further information can be found in the REST API.
    Project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    View string
    The view, which determines what version information is returned in a response. Possible values are "BASIC" and "FULL". Defaults to "BASIC".
    location String
    The location of the artifact registry.
    packageName String
    The name of the package.
    repositoryId String
    The last part of the repository name to fetch from.
    filter String
    An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are name and version. Further information can be found in the REST API.
    project String
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    view String
    The view, which determines what version information is returned in a response. Possible values are "BASIC" and "FULL". Defaults to "BASIC".
    location string
    The location of the artifact registry.
    packageName string
    The name of the package.
    repositoryId string
    The last part of the repository name to fetch from.
    filter string
    An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are name and version. Further information can be found in the REST API.
    project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    view string
    The view, which determines what version information is returned in a response. Possible values are "BASIC" and "FULL". Defaults to "BASIC".
    location str
    The location of the artifact registry.
    package_name str
    The name of the package.
    repository_id str
    The last part of the repository name to fetch from.
    filter str
    An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are name and version. Further information can be found in the REST API.
    project str
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    view str
    The view, which determines what version information is returned in a response. Possible values are "BASIC" and "FULL". Defaults to "BASIC".
    location String
    The location of the artifact registry.
    packageName String
    The name of the package.
    repositoryId String
    The last part of the repository name to fetch from.
    filter String
    An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are name and version. Further information can be found in the REST API.
    project String
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    view String
    The view, which determines what version information is returned in a response. Possible values are "BASIC" and "FULL". Defaults to "BASIC".

    getVersions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    PackageName string
    RepositoryId string
    Versions List<GetVersionsVersion>
    A list of all retrieved Artifact Registry versions. Structure is defined below.
    Filter string
    Project string
    View string
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    PackageName string
    RepositoryId string
    Versions []GetVersionsVersion
    A list of all retrieved Artifact Registry versions. Structure is defined below.
    Filter string
    Project string
    View string
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    packageName String
    repositoryId String
    versions List<GetVersionsVersion>
    A list of all retrieved Artifact Registry versions. Structure is defined below.
    filter String
    project String
    view String
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    packageName string
    repositoryId string
    versions GetVersionsVersion[]
    A list of all retrieved Artifact Registry versions. Structure is defined below.
    filter string
    project string
    view string
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    package_name str
    repository_id str
    versions Sequence[GetVersionsVersion]
    A list of all retrieved Artifact Registry versions. Structure is defined below.
    filter str
    project str
    view str
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    packageName String
    repositoryId String
    versions List<Property Map>
    A list of all retrieved Artifact Registry versions. Structure is defined below.
    filter String
    project String
    view String

    Supporting Types

    GetVersionsVersion

    Annotations Dictionary<string, string>
    Client specified annotations.
    CreateTime string
    The time, as a RFC 3339 string, this package was created.
    Description string
    Description of the version, as specified in its metadata.
    Name string
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    RelatedTags List<GetVersionsVersionRelatedTag>
    A list of related tags. Will contain up to 100 tags that reference this version.
    UpdateTime string
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    Annotations map[string]string
    Client specified annotations.
    CreateTime string
    The time, as a RFC 3339 string, this package was created.
    Description string
    Description of the version, as specified in its metadata.
    Name string
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    RelatedTags []GetVersionsVersionRelatedTag
    A list of related tags. Will contain up to 100 tags that reference this version.
    UpdateTime string
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    annotations Map<String,String>
    Client specified annotations.
    createTime String
    The time, as a RFC 3339 string, this package was created.
    description String
    Description of the version, as specified in its metadata.
    name String
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    relatedTags List<GetVersionsVersionRelatedTag>
    A list of related tags. Will contain up to 100 tags that reference this version.
    updateTime String
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    annotations {[key: string]: string}
    Client specified annotations.
    createTime string
    The time, as a RFC 3339 string, this package was created.
    description string
    Description of the version, as specified in its metadata.
    name string
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    relatedTags GetVersionsVersionRelatedTag[]
    A list of related tags. Will contain up to 100 tags that reference this version.
    updateTime string
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    annotations Mapping[str, str]
    Client specified annotations.
    create_time str
    The time, as a RFC 3339 string, this package was created.
    description str
    Description of the version, as specified in its metadata.
    name str
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    related_tags Sequence[GetVersionsVersionRelatedTag]
    A list of related tags. Will contain up to 100 tags that reference this version.
    update_time str
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    annotations Map<String>
    Client specified annotations.
    createTime String
    The time, as a RFC 3339 string, this package was created.
    description String
    Description of the version, as specified in its metadata.
    name String
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    relatedTags List<Property Map>
    A list of related tags. Will contain up to 100 tags that reference this version.
    updateTime String
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.

    GetVersionsVersionRelatedTag

    Name string
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    Version string
    Name string
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    Version string
    name String
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    version String
    name string
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    version string
    name str
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    version str
    name String
    The name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/version1. If the package part contains slashes, the slashes are escaped.
    version 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 v9.10.0 published on Friday, Jan 16, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate