Google Cloud v9.3.0 published on Tuesday, Oct 7, 2025 by Pulumi
gcp.artifactregistry.getNpmPackages
Get information about Artifact Registry Npm packages. See the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const myPackages = gcp.artifactregistry.getNpmPackages({
location: "us-central1",
repositoryId: "example-repo",
});
import pulumi
import pulumi_gcp as gcp
my_packages = gcp.artifactregistry.get_npm_packages(location="us-central1",
repository_id="example-repo")
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.GetNpmPackages(ctx, &artifactregistry.GetNpmPackagesArgs{
Location: "us-central1",
RepositoryId: "example-repo",
}, 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 myPackages = Gcp.ArtifactRegistry.GetNpmPackages.Invoke(new()
{
Location = "us-central1",
RepositoryId = "example-repo",
});
});
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.GetNpmPackagesArgs;
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 myPackages = ArtifactregistryFunctions.getNpmPackages(GetNpmPackagesArgs.builder()
.location("us-central1")
.repositoryId("example-repo")
.build());
}
}
variables:
myPackages:
fn::invoke:
function: gcp:artifactregistry:getNpmPackages
arguments:
location: us-central1
repositoryId: example-repo
Using getNpmPackages
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 getNpmPackages(args: GetNpmPackagesArgs, opts?: InvokeOptions): Promise<GetNpmPackagesResult>
function getNpmPackagesOutput(args: GetNpmPackagesOutputArgs, opts?: InvokeOptions): Output<GetNpmPackagesResult>
def get_npm_packages(location: Optional[str] = None,
project: Optional[str] = None,
repository_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNpmPackagesResult
def get_npm_packages_output(location: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
repository_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNpmPackagesResult]
func GetNpmPackages(ctx *Context, args *GetNpmPackagesArgs, opts ...InvokeOption) (*GetNpmPackagesResult, error)
func GetNpmPackagesOutput(ctx *Context, args *GetNpmPackagesOutputArgs, opts ...InvokeOption) GetNpmPackagesResultOutput
> Note: This function is named GetNpmPackages
in the Go SDK.
public static class GetNpmPackages
{
public static Task<GetNpmPackagesResult> InvokeAsync(GetNpmPackagesArgs args, InvokeOptions? opts = null)
public static Output<GetNpmPackagesResult> Invoke(GetNpmPackagesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNpmPackagesResult> getNpmPackages(GetNpmPackagesArgs args, InvokeOptions options)
public static Output<GetNpmPackagesResult> getNpmPackages(GetNpmPackagesArgs args, InvokeOptions options)
fn::invoke:
function: gcp:artifactregistry/getNpmPackages:getNpmPackages
arguments:
# arguments dictionary
The following arguments are supported:
- Location string
- The location of the Artifact Registry repository.
- Repository
Id 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 repository.
- Repository
Id 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 repository.
- repository
Id 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 repository.
- repository
Id 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 repository.
- 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 repository.
- repository
Id 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.
getNpmPackages Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Npm
Packages List<GetNpm Packages Npm Package> - A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
- Repository
Id string - Project string
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Npm
Packages []GetNpm Packages Npm Package - A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
- Repository
Id string - Project string
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- npm
Packages List<GetNpm Packages Npm Package> - A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
- repository
Id String - project String
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- npm
Packages GetNpm Packages Npm Package[] - A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
- repository
Id string - project string
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- npm_
packages Sequence[GetNpm Packages Npm Package] - A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
- repository_
id str - project str
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- npm
Packages List<Property Map> - A list of all retrieved Artifact Registry Npm packages. Structure is defined below.
- repository
Id String - project String
Supporting Types
GetNpmPackagesNpmPackage
- Create
Time string - The time, as a RFC 3339 string, this package was created.
- Name string
- The fully qualified name of the fetched package. This name has the form:
projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}
. For example,projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
- Package
Name string - Extracted short name of the package (last part of
name
, without version). For example, from.../my-test-package:0.0.1
→my-test-package
. - List<string>
- The tags associated with the Npm package.
- Update
Time string - The time, as a RFC 3339 string, this package was updated.
- Version string
- Version of this package.
- Create
Time string - The time, as a RFC 3339 string, this package was created.
- Name string
- The fully qualified name of the fetched package. This name has the form:
projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}
. For example,projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
- Package
Name string - Extracted short name of the package (last part of
name
, without version). For example, from.../my-test-package:0.0.1
→my-test-package
. - []string
- The tags associated with the Npm package.
- Update
Time string - The time, as a RFC 3339 string, this package was updated.
- Version string
- Version of this package.
- create
Time String - The time, as a RFC 3339 string, this package was created.
- name String
- The fully qualified name of the fetched package. This name has the form:
projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}
. For example,projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
- package
Name String - Extracted short name of the package (last part of
name
, without version). For example, from.../my-test-package:0.0.1
→my-test-package
. - List<String>
- The tags associated with the Npm package.
- update
Time String - The time, as a RFC 3339 string, this package was updated.
- version String
- Version of this package.
- create
Time string - The time, as a RFC 3339 string, this package was created.
- name string
- The fully qualified name of the fetched package. This name has the form:
projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}
. For example,projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
- package
Name string - Extracted short name of the package (last part of
name
, without version). For example, from.../my-test-package:0.0.1
→my-test-package
. - string[]
- The tags associated with the Npm package.
- update
Time string - The time, as a RFC 3339 string, this package was updated.
- version string
- Version of this package.
- create_
time str - The time, as a RFC 3339 string, this package was created.
- name str
- The fully qualified name of the fetched package. This name has the form:
projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}
. For example,projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
- package_
name str - Extracted short name of the package (last part of
name
, without version). For example, from.../my-test-package:0.0.1
→my-test-package
. - Sequence[str]
- The tags associated with the Npm package.
- update_
time str - The time, as a RFC 3339 string, this package was updated.
- version str
- Version of this package.
- create
Time String - The time, as a RFC 3339 string, this package was created.
- name String
- The fully qualified name of the fetched package. This name has the form:
projects/{{project}}/locations/{{location}}/repository/{{repository_id}}/npmPackages/{{npmPackage}}
. For example,projects/example-project/locations/us-central1/repository/example-repo/npmPackages/my-test-package:0.0.1
- package
Name String - Extracted short name of the package (last part of
name
, without version). For example, from.../my-test-package:0.0.1
→my-test-package
. - List<String>
- The tags associated with the Npm package.
- update
Time String - The time, as a RFC 3339 string, this package was updated.
- version String
- Version of this package.
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.