1. Packages
  2. Gitlab Provider
  3. API Docs
  4. ProjectPackageDependencyProxy
GitLab v9.8.0 published on Friday, Jan 16, 2026 by Pulumi
gitlab logo
GitLab v9.8.0 published on Friday, Jan 16, 2026 by Pulumi

    The gitlab.ProjectPackageDependencyProxy resource allows managing the project-level package dependency proxy for Maven packages.

    This resource configures the external Maven registry settings for the dependency proxy, allowing packages to be cached and proxied through GitLab.

    This resource requires GitLab Premium or Ultimate and the packages and dependency proxy features to be enabled on the GitLab instance.

    Upstream API: GitLab GraphQL API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    // Configure the project package dependency proxy for Maven packages
    const example = new gitlab.ProjectPackageDependencyProxy("example", {
        project: exampleGitlabProject.id,
        enabled: true,
        mavenExternalRegistryUrl: "https://repo.maven.apache.org/maven2/",
    });
    // With authentication credentials for the external registry
    const authenticated = new gitlab.ProjectPackageDependencyProxy("authenticated", {
        project: exampleGitlabProject.id,
        enabled: true,
        mavenExternalRegistryUrl: "https://private-repo.example.com/maven/",
        mavenExternalRegistryUsername: "maven_user",
        mavenExternalRegistryPassword: mavenRegistryPassword,
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    # Configure the project package dependency proxy for Maven packages
    example = gitlab.ProjectPackageDependencyProxy("example",
        project=example_gitlab_project["id"],
        enabled=True,
        maven_external_registry_url="https://repo.maven.apache.org/maven2/")
    # With authentication credentials for the external registry
    authenticated = gitlab.ProjectPackageDependencyProxy("authenticated",
        project=example_gitlab_project["id"],
        enabled=True,
        maven_external_registry_url="https://private-repo.example.com/maven/",
        maven_external_registry_username="maven_user",
        maven_external_registry_password=maven_registry_password)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Configure the project package dependency proxy for Maven packages
    		_, err := gitlab.NewProjectPackageDependencyProxy(ctx, "example", &gitlab.ProjectPackageDependencyProxyArgs{
    			Project:                  pulumi.Any(exampleGitlabProject.Id),
    			Enabled:                  pulumi.Bool(true),
    			MavenExternalRegistryUrl: pulumi.String("https://repo.maven.apache.org/maven2/"),
    		})
    		if err != nil {
    			return err
    		}
    		// With authentication credentials for the external registry
    		_, err = gitlab.NewProjectPackageDependencyProxy(ctx, "authenticated", &gitlab.ProjectPackageDependencyProxyArgs{
    			Project:                       pulumi.Any(exampleGitlabProject.Id),
    			Enabled:                       pulumi.Bool(true),
    			MavenExternalRegistryUrl:      pulumi.String("https://private-repo.example.com/maven/"),
    			MavenExternalRegistryUsername: pulumi.String("maven_user"),
    			MavenExternalRegistryPassword: pulumi.Any(mavenRegistryPassword),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        // Configure the project package dependency proxy for Maven packages
        var example = new GitLab.ProjectPackageDependencyProxy("example", new()
        {
            Project = exampleGitlabProject.Id,
            Enabled = true,
            MavenExternalRegistryUrl = "https://repo.maven.apache.org/maven2/",
        });
    
        // With authentication credentials for the external registry
        var authenticated = new GitLab.ProjectPackageDependencyProxy("authenticated", new()
        {
            Project = exampleGitlabProject.Id,
            Enabled = true,
            MavenExternalRegistryUrl = "https://private-repo.example.com/maven/",
            MavenExternalRegistryUsername = "maven_user",
            MavenExternalRegistryPassword = mavenRegistryPassword,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.ProjectPackageDependencyProxy;
    import com.pulumi.gitlab.ProjectPackageDependencyProxyArgs;
    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) {
            // Configure the project package dependency proxy for Maven packages
            var example = new ProjectPackageDependencyProxy("example", ProjectPackageDependencyProxyArgs.builder()
                .project(exampleGitlabProject.id())
                .enabled(true)
                .mavenExternalRegistryUrl("https://repo.maven.apache.org/maven2/")
                .build());
    
            // With authentication credentials for the external registry
            var authenticated = new ProjectPackageDependencyProxy("authenticated", ProjectPackageDependencyProxyArgs.builder()
                .project(exampleGitlabProject.id())
                .enabled(true)
                .mavenExternalRegistryUrl("https://private-repo.example.com/maven/")
                .mavenExternalRegistryUsername("maven_user")
                .mavenExternalRegistryPassword(mavenRegistryPassword)
                .build());
    
        }
    }
    
    resources:
      # Configure the project package dependency proxy for Maven packages
      example:
        type: gitlab:ProjectPackageDependencyProxy
        properties:
          project: ${exampleGitlabProject.id}
          enabled: true
          mavenExternalRegistryUrl: https://repo.maven.apache.org/maven2/
      # With authentication credentials for the external registry
      authenticated:
        type: gitlab:ProjectPackageDependencyProxy
        properties:
          project: ${exampleGitlabProject.id}
          enabled: true
          mavenExternalRegistryUrl: https://private-repo.example.com/maven/
          mavenExternalRegistryUsername: maven_user
          mavenExternalRegistryPassword: ${mavenRegistryPassword}
    

    Create ProjectPackageDependencyProxy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ProjectPackageDependencyProxy(name: string, args: ProjectPackageDependencyProxyArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectPackageDependencyProxy(resource_name: str,
                                      args: ProjectPackageDependencyProxyArgs,
                                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectPackageDependencyProxy(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      project: Optional[str] = None,
                                      enabled: Optional[bool] = None,
                                      maven_external_registry_password: Optional[str] = None,
                                      maven_external_registry_url: Optional[str] = None,
                                      maven_external_registry_username: Optional[str] = None)
    func NewProjectPackageDependencyProxy(ctx *Context, name string, args ProjectPackageDependencyProxyArgs, opts ...ResourceOption) (*ProjectPackageDependencyProxy, error)
    public ProjectPackageDependencyProxy(string name, ProjectPackageDependencyProxyArgs args, CustomResourceOptions? opts = null)
    public ProjectPackageDependencyProxy(String name, ProjectPackageDependencyProxyArgs args)
    public ProjectPackageDependencyProxy(String name, ProjectPackageDependencyProxyArgs args, CustomResourceOptions options)
    
    type: gitlab:ProjectPackageDependencyProxy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ProjectPackageDependencyProxyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ProjectPackageDependencyProxyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ProjectPackageDependencyProxyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectPackageDependencyProxyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectPackageDependencyProxyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var projectPackageDependencyProxyResource = new GitLab.ProjectPackageDependencyProxy("projectPackageDependencyProxyResource", new()
    {
        Project = "string",
        Enabled = false,
        MavenExternalRegistryPassword = "string",
        MavenExternalRegistryUrl = "string",
        MavenExternalRegistryUsername = "string",
    });
    
    example, err := gitlab.NewProjectPackageDependencyProxy(ctx, "projectPackageDependencyProxyResource", &gitlab.ProjectPackageDependencyProxyArgs{
    	Project:                       pulumi.String("string"),
    	Enabled:                       pulumi.Bool(false),
    	MavenExternalRegistryPassword: pulumi.String("string"),
    	MavenExternalRegistryUrl:      pulumi.String("string"),
    	MavenExternalRegistryUsername: pulumi.String("string"),
    })
    
    var projectPackageDependencyProxyResource = new ProjectPackageDependencyProxy("projectPackageDependencyProxyResource", ProjectPackageDependencyProxyArgs.builder()
        .project("string")
        .enabled(false)
        .mavenExternalRegistryPassword("string")
        .mavenExternalRegistryUrl("string")
        .mavenExternalRegistryUsername("string")
        .build());
    
    project_package_dependency_proxy_resource = gitlab.ProjectPackageDependencyProxy("projectPackageDependencyProxyResource",
        project="string",
        enabled=False,
        maven_external_registry_password="string",
        maven_external_registry_url="string",
        maven_external_registry_username="string")
    
    const projectPackageDependencyProxyResource = new gitlab.ProjectPackageDependencyProxy("projectPackageDependencyProxyResource", {
        project: "string",
        enabled: false,
        mavenExternalRegistryPassword: "string",
        mavenExternalRegistryUrl: "string",
        mavenExternalRegistryUsername: "string",
    });
    
    type: gitlab:ProjectPackageDependencyProxy
    properties:
        enabled: false
        mavenExternalRegistryPassword: string
        mavenExternalRegistryUrl: string
        mavenExternalRegistryUsername: string
        project: string
    

    ProjectPackageDependencyProxy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ProjectPackageDependencyProxy resource accepts the following input properties:

    Project string
    The ID or URL-encoded path of the project.
    Enabled bool
    Indicates whether the dependency proxy is enabled for packages.
    MavenExternalRegistryPassword string
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    MavenExternalRegistryUrl string
    The URL of the external Maven registry.
    MavenExternalRegistryUsername string
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    Project string
    The ID or URL-encoded path of the project.
    Enabled bool
    Indicates whether the dependency proxy is enabled for packages.
    MavenExternalRegistryPassword string
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    MavenExternalRegistryUrl string
    The URL of the external Maven registry.
    MavenExternalRegistryUsername string
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project String
    The ID or URL-encoded path of the project.
    enabled Boolean
    Indicates whether the dependency proxy is enabled for packages.
    mavenExternalRegistryPassword String
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    mavenExternalRegistryUrl String
    The URL of the external Maven registry.
    mavenExternalRegistryUsername String
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project string
    The ID or URL-encoded path of the project.
    enabled boolean
    Indicates whether the dependency proxy is enabled for packages.
    mavenExternalRegistryPassword string
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    mavenExternalRegistryUrl string
    The URL of the external Maven registry.
    mavenExternalRegistryUsername string
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project str
    The ID or URL-encoded path of the project.
    enabled bool
    Indicates whether the dependency proxy is enabled for packages.
    maven_external_registry_password str
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    maven_external_registry_url str
    The URL of the external Maven registry.
    maven_external_registry_username str
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project String
    The ID or URL-encoded path of the project.
    enabled Boolean
    Indicates whether the dependency proxy is enabled for packages.
    mavenExternalRegistryPassword String
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    mavenExternalRegistryUrl String
    The URL of the external Maven registry.
    mavenExternalRegistryUsername String
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectPackageDependencyProxy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ProjectPackageDependencyProxy Resource

    Get an existing ProjectPackageDependencyProxy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ProjectPackageDependencyProxyState, opts?: CustomResourceOptions): ProjectPackageDependencyProxy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled: Optional[bool] = None,
            maven_external_registry_password: Optional[str] = None,
            maven_external_registry_url: Optional[str] = None,
            maven_external_registry_username: Optional[str] = None,
            project: Optional[str] = None) -> ProjectPackageDependencyProxy
    func GetProjectPackageDependencyProxy(ctx *Context, name string, id IDInput, state *ProjectPackageDependencyProxyState, opts ...ResourceOption) (*ProjectPackageDependencyProxy, error)
    public static ProjectPackageDependencyProxy Get(string name, Input<string> id, ProjectPackageDependencyProxyState? state, CustomResourceOptions? opts = null)
    public static ProjectPackageDependencyProxy get(String name, Output<String> id, ProjectPackageDependencyProxyState state, CustomResourceOptions options)
    resources:  _:    type: gitlab:ProjectPackageDependencyProxy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Enabled bool
    Indicates whether the dependency proxy is enabled for packages.
    MavenExternalRegistryPassword string
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    MavenExternalRegistryUrl string
    The URL of the external Maven registry.
    MavenExternalRegistryUsername string
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    Project string
    The ID or URL-encoded path of the project.
    Enabled bool
    Indicates whether the dependency proxy is enabled for packages.
    MavenExternalRegistryPassword string
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    MavenExternalRegistryUrl string
    The URL of the external Maven registry.
    MavenExternalRegistryUsername string
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    Project string
    The ID or URL-encoded path of the project.
    enabled Boolean
    Indicates whether the dependency proxy is enabled for packages.
    mavenExternalRegistryPassword String
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    mavenExternalRegistryUrl String
    The URL of the external Maven registry.
    mavenExternalRegistryUsername String
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project String
    The ID or URL-encoded path of the project.
    enabled boolean
    Indicates whether the dependency proxy is enabled for packages.
    mavenExternalRegistryPassword string
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    mavenExternalRegistryUrl string
    The URL of the external Maven registry.
    mavenExternalRegistryUsername string
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project string
    The ID or URL-encoded path of the project.
    enabled bool
    Indicates whether the dependency proxy is enabled for packages.
    maven_external_registry_password str
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    maven_external_registry_url str
    The URL of the external Maven registry.
    maven_external_registry_username str
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project str
    The ID or URL-encoded path of the project.
    enabled Boolean
    Indicates whether the dependency proxy is enabled for packages.
    mavenExternalRegistryPassword String
    The password to authenticate with the external Maven registry. Must be set together with maven_external_registry_username. Cannot be imported.
    mavenExternalRegistryUrl String
    The URL of the external Maven registry.
    mavenExternalRegistryUsername String
    The username to authenticate with the external Maven registry. Must be set together with maven_external_registry_password.
    project String
    The ID or URL-encoded path of the project.

    Import

    Starting in Terraform v1.5.0, you can use an import block to import gitlab_project_package_dependency_proxy. For example:

    terraform

    import {

    to = gitlab_project_package_dependency_proxy.example

    id = “see CLI command below for ID”

    }

    Importing using the CLI is supported with the following syntax:

    You can import a project package dependency proxy using the project id. e.g. {project-id}

    “maven_external_registry_password” will not populate when importing, but will still

    be required in the configuration if credentials are used.

    $ pulumi import gitlab:index/projectPackageDependencyProxy:ProjectPackageDependencyProxy example 42
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v9.8.0 published on Friday, Jan 16, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate