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

nexus.RepositoryPypiGroup

Explore with Pulumi AI

Use this resource to create a group pypi repository.

Example Usage

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

const internal = new nexus.RepositoryPypiHosted("internal", {
    online: true,
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: true,
        writePolicy: "ALLOW",
    },
});
const pypiOrg = new nexus.RepositoryPypiProxy("pypiOrg", {
    online: true,
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: true,
    },
    proxy: {
        remoteUrl: "https://pypi.org",
        contentMaxAge: 1440,
        metadataMaxAge: 1440,
    },
    negativeCache: {
        enabled: true,
        ttl: 1440,
    },
    httpClient: {
        blocked: false,
        autoBlock: true,
    },
});
const group = new nexus.RepositoryPypiGroup("group", {
    online: true,
    group: {
        memberNames: [
            internal.name,
            pypiOrg.name,
        ],
    },
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: true,
    },
});
Copy
import pulumi
import pulumi_nexus as nexus

internal = nexus.RepositoryPypiHosted("internal",
    online=True,
    storage={
        "blob_store_name": "default",
        "strict_content_type_validation": True,
        "write_policy": "ALLOW",
    })
pypi_org = nexus.RepositoryPypiProxy("pypiOrg",
    online=True,
    storage={
        "blob_store_name": "default",
        "strict_content_type_validation": True,
    },
    proxy={
        "remote_url": "https://pypi.org",
        "content_max_age": 1440,
        "metadata_max_age": 1440,
    },
    negative_cache={
        "enabled": True,
        "ttl": 1440,
    },
    http_client={
        "blocked": False,
        "auto_block": True,
    })
group = nexus.RepositoryPypiGroup("group",
    online=True,
    group={
        "member_names": [
            internal.name,
            pypi_org.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.NewRepositoryPypiHosted(ctx, "internal", &nexus.RepositoryPypiHostedArgs{
			Online: pulumi.Bool(true),
			Storage: &nexus.RepositoryPypiHostedStorageArgs{
				BlobStoreName:               pulumi.String("default"),
				StrictContentTypeValidation: pulumi.Bool(true),
				WritePolicy:                 pulumi.String("ALLOW"),
			},
		})
		if err != nil {
			return err
		}
		pypiOrg, err := nexus.NewRepositoryPypiProxy(ctx, "pypiOrg", &nexus.RepositoryPypiProxyArgs{
			Online: pulumi.Bool(true),
			Storage: &nexus.RepositoryPypiProxyStorageArgs{
				BlobStoreName:               pulumi.String("default"),
				StrictContentTypeValidation: pulumi.Bool(true),
			},
			Proxy: &nexus.RepositoryPypiProxyProxyArgs{
				RemoteUrl:      pulumi.String("https://pypi.org"),
				ContentMaxAge:  pulumi.Float64(1440),
				MetadataMaxAge: pulumi.Float64(1440),
			},
			NegativeCache: &nexus.RepositoryPypiProxyNegativeCacheArgs{
				Enabled: pulumi.Bool(true),
				Ttl:     pulumi.Float64(1440),
			},
			HttpClient: &nexus.RepositoryPypiProxyHttpClientArgs{
				Blocked:   pulumi.Bool(false),
				AutoBlock: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		_, err = nexus.NewRepositoryPypiGroup(ctx, "group", &nexus.RepositoryPypiGroupArgs{
			Online: pulumi.Bool(true),
			Group: &nexus.RepositoryPypiGroupGroupArgs{
				MemberNames: pulumi.StringArray{
					internal.Name,
					pypiOrg.Name,
				},
			},
			Storage: &nexus.RepositoryPypiGroupStorageArgs{
				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.RepositoryPypiHosted("internal", new()
    {
        Online = true,
        Storage = new Nexus.Inputs.RepositoryPypiHostedStorageArgs
        {
            BlobStoreName = "default",
            StrictContentTypeValidation = true,
            WritePolicy = "ALLOW",
        },
    });

    var pypiOrg = new Nexus.RepositoryPypiProxy("pypiOrg", new()
    {
        Online = true,
        Storage = new Nexus.Inputs.RepositoryPypiProxyStorageArgs
        {
            BlobStoreName = "default",
            StrictContentTypeValidation = true,
        },
        Proxy = new Nexus.Inputs.RepositoryPypiProxyProxyArgs
        {
            RemoteUrl = "https://pypi.org",
            ContentMaxAge = 1440,
            MetadataMaxAge = 1440,
        },
        NegativeCache = new Nexus.Inputs.RepositoryPypiProxyNegativeCacheArgs
        {
            Enabled = true,
            Ttl = 1440,
        },
        HttpClient = new Nexus.Inputs.RepositoryPypiProxyHttpClientArgs
        {
            Blocked = false,
            AutoBlock = true,
        },
    });

    var @group = new Nexus.RepositoryPypiGroup("group", new()
    {
        Online = true,
        Group = new Nexus.Inputs.RepositoryPypiGroupGroupArgs
        {
            MemberNames = new[]
            {
                @internal.Name,
                pypiOrg.Name,
            },
        },
        Storage = new Nexus.Inputs.RepositoryPypiGroupStorageArgs
        {
            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.RepositoryPypiHosted;
import com.pulumi.nexus.RepositoryPypiHostedArgs;
import com.pulumi.nexus.inputs.RepositoryPypiHostedStorageArgs;
import com.pulumi.nexus.RepositoryPypiProxy;
import com.pulumi.nexus.RepositoryPypiProxyArgs;
import com.pulumi.nexus.inputs.RepositoryPypiProxyStorageArgs;
import com.pulumi.nexus.inputs.RepositoryPypiProxyProxyArgs;
import com.pulumi.nexus.inputs.RepositoryPypiProxyNegativeCacheArgs;
import com.pulumi.nexus.inputs.RepositoryPypiProxyHttpClientArgs;
import com.pulumi.nexus.RepositoryPypiGroup;
import com.pulumi.nexus.RepositoryPypiGroupArgs;
import com.pulumi.nexus.inputs.RepositoryPypiGroupGroupArgs;
import com.pulumi.nexus.inputs.RepositoryPypiGroupStorageArgs;
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 RepositoryPypiHosted("internal", RepositoryPypiHostedArgs.builder()
            .online(true)
            .storage(RepositoryPypiHostedStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(true)
                .writePolicy("ALLOW")
                .build())
            .build());

        var pypiOrg = new RepositoryPypiProxy("pypiOrg", RepositoryPypiProxyArgs.builder()
            .online(true)
            .storage(RepositoryPypiProxyStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(true)
                .build())
            .proxy(RepositoryPypiProxyProxyArgs.builder()
                .remoteUrl("https://pypi.org")
                .contentMaxAge(1440)
                .metadataMaxAge(1440)
                .build())
            .negativeCache(RepositoryPypiProxyNegativeCacheArgs.builder()
                .enabled(true)
                .ttl(1440)
                .build())
            .httpClient(RepositoryPypiProxyHttpClientArgs.builder()
                .blocked(false)
                .autoBlock(true)
                .build())
            .build());

        var group = new RepositoryPypiGroup("group", RepositoryPypiGroupArgs.builder()
            .online(true)
            .group(RepositoryPypiGroupGroupArgs.builder()
                .memberNames(                
                    internal.name(),
                    pypiOrg.name())
                .build())
            .storage(RepositoryPypiGroupStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(true)
                .build())
            .build());

    }
}
Copy
resources:
  internal:
    type: nexus:RepositoryPypiHosted
    properties:
      online: true
      storage:
        blobStoreName: default
        strictContentTypeValidation: true
        writePolicy: ALLOW
  pypiOrg:
    type: nexus:RepositoryPypiProxy
    properties:
      online: true
      storage:
        blobStoreName: default
        strictContentTypeValidation: true
      proxy:
        remoteUrl: https://pypi.org
        contentMaxAge: 1440
        metadataMaxAge: 1440
      negativeCache:
        enabled: true
        ttl: 1440
      httpClient:
        blocked: false
        autoBlock: true
  group:
    type: nexus:RepositoryPypiGroup
    properties:
      online: true
      group:
        memberNames:
          - ${internal.name}
          - ${pypiOrg.name}
      storage:
        blobStoreName: default
        strictContentTypeValidation: true
Copy

Create RepositoryPypiGroup Resource

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

Constructor syntax

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

@overload
def RepositoryPypiGroup(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        group: Optional[RepositoryPypiGroupGroupArgs] = None,
                        storage: Optional[RepositoryPypiGroupStorageArgs] = None,
                        name: Optional[str] = None,
                        online: Optional[bool] = None)
func NewRepositoryPypiGroup(ctx *Context, name string, args RepositoryPypiGroupArgs, opts ...ResourceOption) (*RepositoryPypiGroup, error)
public RepositoryPypiGroup(string name, RepositoryPypiGroupArgs args, CustomResourceOptions? opts = null)
public RepositoryPypiGroup(String name, RepositoryPypiGroupArgs args)
public RepositoryPypiGroup(String name, RepositoryPypiGroupArgs args, CustomResourceOptions options)
type: nexus:RepositoryPypiGroup
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. RepositoryPypiGroupArgs
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. RepositoryPypiGroupArgs
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. RepositoryPypiGroupArgs
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. RepositoryPypiGroupArgs
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. RepositoryPypiGroupArgs
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 repositoryPypiGroupResource = new Nexus.RepositoryPypiGroup("repositoryPypiGroupResource", new()
{
    Group = new Nexus.Inputs.RepositoryPypiGroupGroupArgs
    {
        MemberNames = new[]
        {
            "string",
        },
    },
    Storage = new Nexus.Inputs.RepositoryPypiGroupStorageArgs
    {
        BlobStoreName = "string",
        StrictContentTypeValidation = false,
    },
    Name = "string",
    Online = false,
});
Copy
example, err := nexus.NewRepositoryPypiGroup(ctx, "repositoryPypiGroupResource", &nexus.RepositoryPypiGroupArgs{
Group: &.RepositoryPypiGroupGroupArgs{
MemberNames: pulumi.StringArray{
pulumi.String("string"),
},
},
Storage: &.RepositoryPypiGroupStorageArgs{
BlobStoreName: pulumi.String("string"),
StrictContentTypeValidation: pulumi.Bool(false),
},
Name: pulumi.String("string"),
Online: pulumi.Bool(false),
})
Copy
var repositoryPypiGroupResource = new RepositoryPypiGroup("repositoryPypiGroupResource", RepositoryPypiGroupArgs.builder()
    .group(RepositoryPypiGroupGroupArgs.builder()
        .memberNames("string")
        .build())
    .storage(RepositoryPypiGroupStorageArgs.builder()
        .blobStoreName("string")
        .strictContentTypeValidation(false)
        .build())
    .name("string")
    .online(false)
    .build());
Copy
repository_pypi_group_resource = nexus.RepositoryPypiGroup("repositoryPypiGroupResource",
    group={
        "member_names": ["string"],
    },
    storage={
        "blob_store_name": "string",
        "strict_content_type_validation": False,
    },
    name="string",
    online=False)
Copy
const repositoryPypiGroupResource = new nexus.RepositoryPypiGroup("repositoryPypiGroupResource", {
    group: {
        memberNames: ["string"],
    },
    storage: {
        blobStoreName: "string",
        strictContentTypeValidation: false,
    },
    name: "string",
    online: false,
});
Copy
type: nexus:RepositoryPypiGroup
properties:
    group:
        memberNames:
            - string
    name: string
    online: false
    storage:
        blobStoreName: string
        strictContentTypeValidation: false
Copy

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

Group This property is required. RepositoryPypiGroupGroup
Configuration for repository group
Storage This property is required. RepositoryPypiGroupStorage
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. RepositoryPypiGroupGroupArgs
Configuration for repository group
Storage This property is required. RepositoryPypiGroupStorageArgs
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. RepositoryPypiGroupGroup
Configuration for repository group
storage This property is required. RepositoryPypiGroupStorage
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. RepositoryPypiGroupGroup
Configuration for repository group
storage This property is required. RepositoryPypiGroupStorage
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. RepositoryPypiGroupGroupArgs
Configuration for repository group
storage This property is required. RepositoryPypiGroupStorageArgs
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 RepositoryPypiGroup 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 RepositoryPypiGroup Resource

Get an existing RepositoryPypiGroup 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?: RepositoryPypiGroupState, opts?: CustomResourceOptions): RepositoryPypiGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        group: Optional[RepositoryPypiGroupGroupArgs] = None,
        name: Optional[str] = None,
        online: Optional[bool] = None,
        storage: Optional[RepositoryPypiGroupStorageArgs] = None) -> RepositoryPypiGroup
func GetRepositoryPypiGroup(ctx *Context, name string, id IDInput, state *RepositoryPypiGroupState, opts ...ResourceOption) (*RepositoryPypiGroup, error)
public static RepositoryPypiGroup Get(string name, Input<string> id, RepositoryPypiGroupState? state, CustomResourceOptions? opts = null)
public static RepositoryPypiGroup get(String name, Output<String> id, RepositoryPypiGroupState state, CustomResourceOptions options)
resources:  _:    type: nexus:RepositoryPypiGroup    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 RepositoryPypiGroupGroup
Configuration for repository group
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Storage RepositoryPypiGroupStorage
The storage configuration of the repository
Group RepositoryPypiGroupGroupArgs
Configuration for repository group
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Storage RepositoryPypiGroupStorageArgs
The storage configuration of the repository
group RepositoryPypiGroupGroup
Configuration for repository group
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
storage RepositoryPypiGroupStorage
The storage configuration of the repository
group RepositoryPypiGroupGroup
Configuration for repository group
name string
A unique identifier for this repository
online boolean
Whether this repository accepts incoming requests
storage RepositoryPypiGroupStorage
The storage configuration of the repository
group RepositoryPypiGroupGroupArgs
Configuration for repository group
name str
A unique identifier for this repository
online bool
Whether this repository accepts incoming requests
storage RepositoryPypiGroupStorageArgs
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

RepositoryPypiGroupGroup
, RepositoryPypiGroupGroupArgs

MemberNames This property is required. List<string>
Member repositories names
MemberNames This property is required. []string
Member repositories names
memberNames This property is required. List<String>
Member repositories names
memberNames This property is required. string[]
Member repositories names
member_names This property is required. Sequence[str]
Member repositories names
memberNames This property is required. List<String>
Member repositories names

RepositoryPypiGroupStorage
, RepositoryPypiGroupStorageArgs

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/repositoryPypiGroup:RepositoryPypiGroup group pypi-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.