1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. artifactregistry
  5. getPackage
Google Cloud v8.41.1 published on Monday, Aug 25, 2025 by Pulumi

gcp.artifactregistry.getPackage

Explore with Pulumi AI

gcp logo
Google Cloud v8.41.1 published on Monday, Aug 25, 2025 by Pulumi

    This data source fetches information of a package from a provided Artifact Registry repository.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as google from "@pulumi/google";
    
    const myPackage = new google.index.ArtifactRegistryPackage("my_package", {
        location: "us-west1",
        repositoryId: "my-repository",
    });
    
    import pulumi
    import pulumi_google as google
    
    my_package = google.index.ArtifactRegistryPackage("my_package",
        location=us-west1,
        repository_id=my-repository)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-google/sdk/go/google"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := google.NewArtifactRegistryPackage(ctx, "my_package", &google.ArtifactRegistryPackageArgs{
    			Location:     "us-west1",
    			RepositoryId: "my-repository",
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Google = Pulumi.Google;
    
    return await Deployment.RunAsync(() => 
    {
        var myPackage = new Google.Index.ArtifactRegistryPackage("my_package", new()
        {
            Location = "us-west1",
            RepositoryId = "my-repository",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.google.artifactRegistryPackage;
    import com.pulumi.google.artifactRegistryPackageArgs;
    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 myPackage = new ArtifactRegistryPackage("myPackage", ArtifactRegistryPackageArgs.builder()
                .location("us-west1")
                .repositoryId("my-repository")
                .build());
    
        }
    }
    
    resources:
      myPackage:
        type: google:artifactRegistryPackage
        name: my_package
        properties:
          location: us-west1
          repositoryId: my-repository
    

    Using getPackage

    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 getPackage(args: GetPackageArgs, opts?: InvokeOptions): Promise<GetPackageResult>
    function getPackageOutput(args: GetPackageOutputArgs, opts?: InvokeOptions): Output<GetPackageResult>
    def get_package(location: Optional[str] = None,
                    name: Optional[str] = None,
                    project: Optional[str] = None,
                    repository_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetPackageResult
    def get_package_output(location: Optional[pulumi.Input[str]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    project: Optional[pulumi.Input[str]] = None,
                    repository_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetPackageResult]
    func GetPackage(ctx *Context, args *GetPackageArgs, opts ...InvokeOption) (*GetPackageResult, error)
    func GetPackageOutput(ctx *Context, args *GetPackageOutputArgs, opts ...InvokeOption) GetPackageResultOutput

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

    public static class GetPackage 
    {
        public static Task<GetPackageResult> InvokeAsync(GetPackageArgs args, InvokeOptions? opts = null)
        public static Output<GetPackageResult> Invoke(GetPackageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPackageResult> getPackage(GetPackageArgs args, InvokeOptions options)
    public static Output<GetPackageResult> getPackage(GetPackageArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:artifactregistry/getPackage:getPackage
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location of the artifact registry.
    Name string
    The name of the package.
    RepositoryId string
    The last part of the repository name to fetch from.
    Project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location of the artifact registry.
    Name string
    The name of the package.
    RepositoryId string
    The last part of the repository name to fetch from.
    Project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the artifact registry.
    name String
    The name of the package.
    repositoryId String
    The last part of the repository name to fetch from.
    project String
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location of the artifact registry.
    name string
    The name of the package.
    repositoryId string
    The last part of the repository name to fetch from.
    project string
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location of the artifact registry.
    name str
    The name of the package.
    repository_id str
    The last part of the repository name to fetch from.
    project str
    The project ID in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the artifact registry.
    name String
    The name of the package.
    repositoryId String
    The last part of the repository name to fetch from.
    project String
    The project ID in which the resource belongs. If it is not provided, the provider project is used.

    getPackage Result

    The following output properties are available:

    Annotations Dictionary<string, string>
    Client specified annotations.
    CreateTime string
    The time, as a RFC 3339 string, this package was created.
    DisplayName string
    The display name of the package.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    RepositoryId string
    UpdateTime string
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    Project string
    Annotations map[string]string
    Client specified annotations.
    CreateTime string
    The time, as a RFC 3339 string, this package was created.
    DisplayName string
    The display name of the package.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Name string
    RepositoryId string
    UpdateTime string
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    Project string
    annotations Map<String,String>
    Client specified annotations.
    createTime String
    The time, as a RFC 3339 string, this package was created.
    displayName String
    The display name of the package.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    repositoryId String
    updateTime String
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    project String
    annotations {[key: string]: string}
    Client specified annotations.
    createTime string
    The time, as a RFC 3339 string, this package was created.
    displayName string
    The display name of the package.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    name string
    repositoryId string
    updateTime string
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    project string
    annotations Mapping[str, str]
    Client specified annotations.
    create_time str
    The time, as a RFC 3339 string, this package was created.
    display_name str
    The display name of the package.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    name str
    repository_id str
    update_time str
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    project str
    annotations Map<String>
    Client specified annotations.
    createTime String
    The time, as a RFC 3339 string, this package was created.
    displayName String
    The display name of the package.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    name String
    repositoryId String
    updateTime String
    The time, as a RFC 3339 string, this package was last updated. This includes publishing a new version of the package.
    project 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 v8.41.1 published on Monday, Aug 25, 2025 by Pulumi