1. Packages
  2. Nexus Provider
  3. API Docs
  4. RepositoryNpmGroup
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

nexus.RepositoryNpmGroup

Explore with Pulumi AI

Use this resource to create a group npm repository.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as nexus from "@pulumi/nexus";

const internal = new nexus.RepositoryNpmHosted("internal", {
    online: true,
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: true,
        writePolicy: "ALLOW",
    },
});
const group = new nexus.RepositoryNpmGroup("group", {
    online: true,
    group: {
        memberNames: [internal.name],
    },
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: true,
    },
});
Copy
import pulumi
import pulumi_nexus as nexus

internal = nexus.RepositoryNpmHosted("internal",
    online=True,
    storage={
        "blob_store_name": "default",
        "strict_content_type_validation": True,
        "write_policy": "ALLOW",
    })
group = nexus.RepositoryNpmGroup("group",
    online=True,
    group={
        "member_names": [internal.name],
    },
    storage={
        "blob_store_name": "default",
        "strict_content_type_validation": True,
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nexus/v2/nexus"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		internal, err := nexus.NewRepositoryNpmHosted(ctx, "internal", &nexus.RepositoryNpmHostedArgs{
			Online: pulumi.Bool(true),
			Storage: &nexus.RepositoryNpmHostedStorageArgs{
				BlobStoreName:               pulumi.String("default"),
				StrictContentTypeValidation: pulumi.Bool(true),
				WritePolicy:                 pulumi.String("ALLOW"),
			},
		})
		if err != nil {
			return err
		}
		_, err = nexus.NewRepositoryNpmGroup(ctx, "group", &nexus.RepositoryNpmGroupArgs{
			Online: pulumi.Bool(true),
			Group: &nexus.RepositoryNpmGroupGroupArgs{
				MemberNames: pulumi.StringArray{
					internal.Name,
				},
			},
			Storage: &nexus.RepositoryNpmGroupStorageArgs{
				BlobStoreName:               pulumi.String("default"),
				StrictContentTypeValidation: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nexus = Pulumi.Nexus;

return await Deployment.RunAsync(() => 
{
    var @internal = new Nexus.RepositoryNpmHosted("internal", new()
    {
        Online = true,
        Storage = new Nexus.Inputs.RepositoryNpmHostedStorageArgs
        {
            BlobStoreName = "default",
            StrictContentTypeValidation = true,
            WritePolicy = "ALLOW",
        },
    });

    var @group = new Nexus.RepositoryNpmGroup("group", new()
    {
        Online = true,
        Group = new Nexus.Inputs.RepositoryNpmGroupGroupArgs
        {
            MemberNames = new[]
            {
                @internal.Name,
            },
        },
        Storage = new Nexus.Inputs.RepositoryNpmGroupStorageArgs
        {
            BlobStoreName = "default",
            StrictContentTypeValidation = true,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nexus.RepositoryNpmHosted;
import com.pulumi.nexus.RepositoryNpmHostedArgs;
import com.pulumi.nexus.inputs.RepositoryNpmHostedStorageArgs;
import com.pulumi.nexus.RepositoryNpmGroup;
import com.pulumi.nexus.RepositoryNpmGroupArgs;
import com.pulumi.nexus.inputs.RepositoryNpmGroupGroupArgs;
import com.pulumi.nexus.inputs.RepositoryNpmGroupStorageArgs;
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 internal = new RepositoryNpmHosted("internal", RepositoryNpmHostedArgs.builder()
            .online(true)
            .storage(RepositoryNpmHostedStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(true)
                .writePolicy("ALLOW")
                .build())
            .build());

        var group = new RepositoryNpmGroup("group", RepositoryNpmGroupArgs.builder()
            .online(true)
            .group(RepositoryNpmGroupGroupArgs.builder()
                .memberNames(internal.name())
                .build())
            .storage(RepositoryNpmGroupStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(true)
                .build())
            .build());

    }
}
Copy
resources:
  internal:
    type: nexus:RepositoryNpmHosted
    properties:
      online: true
      storage:
        blobStoreName: default
        strictContentTypeValidation: true
        writePolicy: ALLOW
  group:
    type: nexus:RepositoryNpmGroup
    properties:
      online: true
      group:
        memberNames:
          - ${internal.name}
      storage:
        blobStoreName: default
        strictContentTypeValidation: true
Copy

Create RepositoryNpmGroup Resource

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

Constructor syntax

new RepositoryNpmGroup(name: string, args: RepositoryNpmGroupArgs, opts?: CustomResourceOptions);
@overload
def RepositoryNpmGroup(resource_name: str,
                       args: RepositoryNpmGroupArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def RepositoryNpmGroup(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       group: Optional[RepositoryNpmGroupGroupArgs] = None,
                       storage: Optional[RepositoryNpmGroupStorageArgs] = None,
                       name: Optional[str] = None,
                       online: Optional[bool] = None)
func NewRepositoryNpmGroup(ctx *Context, name string, args RepositoryNpmGroupArgs, opts ...ResourceOption) (*RepositoryNpmGroup, error)
public RepositoryNpmGroup(string name, RepositoryNpmGroupArgs args, CustomResourceOptions? opts = null)
public RepositoryNpmGroup(String name, RepositoryNpmGroupArgs args)
public RepositoryNpmGroup(String name, RepositoryNpmGroupArgs args, CustomResourceOptions options)
type: nexus:RepositoryNpmGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RepositoryNpmGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RepositoryNpmGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryNpmGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryNpmGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RepositoryNpmGroupArgs
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 repositoryNpmGroupResource = new Nexus.RepositoryNpmGroup("repositoryNpmGroupResource", new()
{
    Group = new Nexus.Inputs.RepositoryNpmGroupGroupArgs
    {
        MemberNames = new[]
        {
            "string",
        },
        WritableMember = "string",
    },
    Storage = new Nexus.Inputs.RepositoryNpmGroupStorageArgs
    {
        BlobStoreName = "string",
        StrictContentTypeValidation = false,
    },
    Name = "string",
    Online = false,
});
Copy
example, err := nexus.NewRepositoryNpmGroup(ctx, "repositoryNpmGroupResource", &nexus.RepositoryNpmGroupArgs{
Group: &.RepositoryNpmGroupGroupArgs{
MemberNames: pulumi.StringArray{
pulumi.String("string"),
},
WritableMember: pulumi.String("string"),
},
Storage: &.RepositoryNpmGroupStorageArgs{
BlobStoreName: pulumi.String("string"),
StrictContentTypeValidation: pulumi.Bool(false),
},
Name: pulumi.String("string"),
Online: pulumi.Bool(false),
})
Copy
var repositoryNpmGroupResource = new RepositoryNpmGroup("repositoryNpmGroupResource", RepositoryNpmGroupArgs.builder()
    .group(RepositoryNpmGroupGroupArgs.builder()
        .memberNames("string")
        .writableMember("string")
        .build())
    .storage(RepositoryNpmGroupStorageArgs.builder()
        .blobStoreName("string")
        .strictContentTypeValidation(false)
        .build())
    .name("string")
    .online(false)
    .build());
Copy
repository_npm_group_resource = nexus.RepositoryNpmGroup("repositoryNpmGroupResource",
    group={
        "member_names": ["string"],
        "writable_member": "string",
    },
    storage={
        "blob_store_name": "string",
        "strict_content_type_validation": False,
    },
    name="string",
    online=False)
Copy
const repositoryNpmGroupResource = new nexus.RepositoryNpmGroup("repositoryNpmGroupResource", {
    group: {
        memberNames: ["string"],
        writableMember: "string",
    },
    storage: {
        blobStoreName: "string",
        strictContentTypeValidation: false,
    },
    name: "string",
    online: false,
});
Copy
type: nexus:RepositoryNpmGroup
properties:
    group:
        memberNames:
            - string
        writableMember: string
    name: string
    online: false
    storage:
        blobStoreName: string
        strictContentTypeValidation: false
Copy

RepositoryNpmGroup 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 RepositoryNpmGroup resource accepts the following input properties:

Group This property is required. RepositoryNpmGroupGroup
Configuration for repository group
Storage This property is required. RepositoryNpmGroupStorage
The storage configuration of the repository
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Group This property is required. RepositoryNpmGroupGroupArgs
Configuration for repository group
Storage This property is required. RepositoryNpmGroupStorageArgs
The storage configuration of the repository
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
group This property is required. RepositoryNpmGroupGroup
Configuration for repository group
storage This property is required. RepositoryNpmGroupStorage
The storage configuration of the repository
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
group This property is required. RepositoryNpmGroupGroup
Configuration for repository group
storage This property is required. RepositoryNpmGroupStorage
The storage configuration of the repository
name string
A unique identifier for this repository
online boolean
Whether this repository accepts incoming requests
group This property is required. RepositoryNpmGroupGroupArgs
Configuration for repository group
storage This property is required. RepositoryNpmGroupStorageArgs
The storage configuration of the repository
name str
A unique identifier for this repository
online bool
Whether this repository accepts incoming requests
group This property is required. Property Map
Configuration for repository group
storage This property is required. Property Map
The storage configuration of the repository
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests

Outputs

All input properties are implicitly available as output properties. Additionally, the RepositoryNpmGroup 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 RepositoryNpmGroup Resource

Get an existing RepositoryNpmGroup 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?: RepositoryNpmGroupState, opts?: CustomResourceOptions): RepositoryNpmGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        group: Optional[RepositoryNpmGroupGroupArgs] = None,
        name: Optional[str] = None,
        online: Optional[bool] = None,
        storage: Optional[RepositoryNpmGroupStorageArgs] = None) -> RepositoryNpmGroup
func GetRepositoryNpmGroup(ctx *Context, name string, id IDInput, state *RepositoryNpmGroupState, opts ...ResourceOption) (*RepositoryNpmGroup, error)
public static RepositoryNpmGroup Get(string name, Input<string> id, RepositoryNpmGroupState? state, CustomResourceOptions? opts = null)
public static RepositoryNpmGroup get(String name, Output<String> id, RepositoryNpmGroupState state, CustomResourceOptions options)
resources:  _:    type: nexus:RepositoryNpmGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Group RepositoryNpmGroupGroup
Configuration for repository group
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Storage RepositoryNpmGroupStorage
The storage configuration of the repository
Group RepositoryNpmGroupGroupArgs
Configuration for repository group
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Storage RepositoryNpmGroupStorageArgs
The storage configuration of the repository
group RepositoryNpmGroupGroup
Configuration for repository group
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
storage RepositoryNpmGroupStorage
The storage configuration of the repository
group RepositoryNpmGroupGroup
Configuration for repository group
name string
A unique identifier for this repository
online boolean
Whether this repository accepts incoming requests
storage RepositoryNpmGroupStorage
The storage configuration of the repository
group RepositoryNpmGroupGroupArgs
Configuration for repository group
name str
A unique identifier for this repository
online bool
Whether this repository accepts incoming requests
storage RepositoryNpmGroupStorageArgs
The storage configuration of the repository
group Property Map
Configuration for repository group
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
storage Property Map
The storage configuration of the repository

Supporting Types

RepositoryNpmGroupGroup
, RepositoryNpmGroupGroupArgs

MemberNames This property is required. List<string>
Member repositories names
WritableMember string
Pro-only: This field is for the Group Deployment feature available in NXRM Pro.
MemberNames This property is required. []string
Member repositories names
WritableMember string
Pro-only: This field is for the Group Deployment feature available in NXRM Pro.
memberNames This property is required. List<String>
Member repositories names
writableMember String
Pro-only: This field is for the Group Deployment feature available in NXRM Pro.
memberNames This property is required. string[]
Member repositories names
writableMember string
Pro-only: This field is for the Group Deployment feature available in NXRM Pro.
member_names This property is required. Sequence[str]
Member repositories names
writable_member str
Pro-only: This field is for the Group Deployment feature available in NXRM Pro.
memberNames This property is required. List<String>
Member repositories names
writableMember String
Pro-only: This field is for the Group Deployment feature available in NXRM Pro.

RepositoryNpmGroupStorage
, RepositoryNpmGroupStorageArgs

BlobStoreName This property is required. string
Blob store used to store repository contents
StrictContentTypeValidation bool
Whether to validate uploaded content's MIME type appropriate for the repository format
BlobStoreName This property is required. string
Blob store used to store repository contents
StrictContentTypeValidation bool
Whether to validate uploaded content's MIME type appropriate for the repository format
blobStoreName This property is required. String
Blob store used to store repository contents
strictContentTypeValidation Boolean
Whether to validate uploaded content's MIME type appropriate for the repository format
blobStoreName This property is required. string
Blob store used to store repository contents
strictContentTypeValidation boolean
Whether to validate uploaded content's MIME type appropriate for the repository format
blob_store_name This property is required. str
Blob store used to store repository contents
strict_content_type_validation bool
Whether to validate uploaded content's MIME type appropriate for the repository format
blobStoreName This property is required. String
Blob store used to store repository contents
strictContentTypeValidation Boolean
Whether to validate uploaded content's MIME type appropriate for the repository format

Import

import using the name of repository

$ pulumi import nexus:index/repositoryNpmGroup:RepositoryNpmGroup group npm-group
Copy

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

Package Details

Repository
nexus datadrivers/terraform-provider-nexus
License
Notes
This Pulumi package is based on the nexus Terraform Provider.