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

nexus.PrivilegeRepositoryContentSelector

Explore with Pulumi AI

Use this resource to manage a privilege for a repository content selector

Example Usage

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

const exampleRepositoryHelmHosted = new nexus.RepositoryHelmHosted("exampleRepositoryHelmHosted", {
    online: true,
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: false,
        writePolicy: "ALLOW",
    },
});
const exampleSecurityContentSelector = new nexus.SecurityContentSelector("exampleSecurityContentSelector", {
    description: "A content selector matching public docker images.",
    expression: "path =^ \"/v2/public/\"",
});
const examplePrivilegeRepositoryContentSelector = new nexus.PrivilegeRepositoryContentSelector("examplePrivilegeRepositoryContentSelector", {
    description: "description",
    actions: [
        "ADD",
        "READ",
        "DELETE",
        "BROWSE",
        "EDIT",
    ],
    repository: resource.nexus_repository_helm_hosted.example.name,
    format: "helm",
    contentSelector: resource.nexus_security_content_selector.example.name,
});
Copy
import pulumi
import pulumi_nexus as nexus

example_repository_helm_hosted = nexus.RepositoryHelmHosted("exampleRepositoryHelmHosted",
    online=True,
    storage={
        "blob_store_name": "default",
        "strict_content_type_validation": False,
        "write_policy": "ALLOW",
    })
example_security_content_selector = nexus.SecurityContentSelector("exampleSecurityContentSelector",
    description="A content selector matching public docker images.",
    expression="path =^ \"/v2/public/\"")
example_privilege_repository_content_selector = nexus.PrivilegeRepositoryContentSelector("examplePrivilegeRepositoryContentSelector",
    description="description",
    actions=[
        "ADD",
        "READ",
        "DELETE",
        "BROWSE",
        "EDIT",
    ],
    repository=resource["nexus_repository_helm_hosted"]["example"]["name"],
    format="helm",
    content_selector=resource["nexus_security_content_selector"]["example"]["name"])
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 {
		_, err := nexus.NewRepositoryHelmHosted(ctx, "exampleRepositoryHelmHosted", &nexus.RepositoryHelmHostedArgs{
			Online: pulumi.Bool(true),
			Storage: &nexus.RepositoryHelmHostedStorageArgs{
				BlobStoreName:               pulumi.String("default"),
				StrictContentTypeValidation: pulumi.Bool(false),
				WritePolicy:                 pulumi.String("ALLOW"),
			},
		})
		if err != nil {
			return err
		}
		_, err = nexus.NewSecurityContentSelector(ctx, "exampleSecurityContentSelector", &nexus.SecurityContentSelectorArgs{
			Description: pulumi.String("A content selector matching public docker images."),
			Expression:  pulumi.String("path =^ \"/v2/public/\""),
		})
		if err != nil {
			return err
		}
		_, err = nexus.NewPrivilegeRepositoryContentSelector(ctx, "examplePrivilegeRepositoryContentSelector", &nexus.PrivilegeRepositoryContentSelectorArgs{
			Description: pulumi.String("description"),
			Actions: pulumi.StringArray{
				pulumi.String("ADD"),
				pulumi.String("READ"),
				pulumi.String("DELETE"),
				pulumi.String("BROWSE"),
				pulumi.String("EDIT"),
			},
			Repository:      pulumi.Any(resource.Nexus_repository_helm_hosted.Example.Name),
			Format:          pulumi.String("helm"),
			ContentSelector: pulumi.Any(resource.Nexus_security_content_selector.Example.Name),
		})
		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 exampleRepositoryHelmHosted = new Nexus.RepositoryHelmHosted("exampleRepositoryHelmHosted", new()
    {
        Online = true,
        Storage = new Nexus.Inputs.RepositoryHelmHostedStorageArgs
        {
            BlobStoreName = "default",
            StrictContentTypeValidation = false,
            WritePolicy = "ALLOW",
        },
    });

    var exampleSecurityContentSelector = new Nexus.SecurityContentSelector("exampleSecurityContentSelector", new()
    {
        Description = "A content selector matching public docker images.",
        Expression = "path =^ \"/v2/public/\"",
    });

    var examplePrivilegeRepositoryContentSelector = new Nexus.PrivilegeRepositoryContentSelector("examplePrivilegeRepositoryContentSelector", new()
    {
        Description = "description",
        Actions = new[]
        {
            "ADD",
            "READ",
            "DELETE",
            "BROWSE",
            "EDIT",
        },
        Repository = resource.Nexus_repository_helm_hosted.Example.Name,
        Format = "helm",
        ContentSelector = resource.Nexus_security_content_selector.Example.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nexus.RepositoryHelmHosted;
import com.pulumi.nexus.RepositoryHelmHostedArgs;
import com.pulumi.nexus.inputs.RepositoryHelmHostedStorageArgs;
import com.pulumi.nexus.SecurityContentSelector;
import com.pulumi.nexus.SecurityContentSelectorArgs;
import com.pulumi.nexus.PrivilegeRepositoryContentSelector;
import com.pulumi.nexus.PrivilegeRepositoryContentSelectorArgs;
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 exampleRepositoryHelmHosted = new RepositoryHelmHosted("exampleRepositoryHelmHosted", RepositoryHelmHostedArgs.builder()
            .online(true)
            .storage(RepositoryHelmHostedStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(false)
                .writePolicy("ALLOW")
                .build())
            .build());

        var exampleSecurityContentSelector = new SecurityContentSelector("exampleSecurityContentSelector", SecurityContentSelectorArgs.builder()
            .description("A content selector matching public docker images.")
            .expression("path =^ \"/v2/public/\"")
            .build());

        var examplePrivilegeRepositoryContentSelector = new PrivilegeRepositoryContentSelector("examplePrivilegeRepositoryContentSelector", PrivilegeRepositoryContentSelectorArgs.builder()
            .description("description")
            .actions(            
                "ADD",
                "READ",
                "DELETE",
                "BROWSE",
                "EDIT")
            .repository(resource.nexus_repository_helm_hosted().example().name())
            .format("helm")
            .contentSelector(resource.nexus_security_content_selector().example().name())
            .build());

    }
}
Copy
resources:
  exampleRepositoryHelmHosted:
    type: nexus:RepositoryHelmHosted
    properties:
      online: true
      storage:
        blobStoreName: default
        strictContentTypeValidation: false
        writePolicy: ALLOW
  exampleSecurityContentSelector:
    type: nexus:SecurityContentSelector
    properties:
      description: A content selector matching public docker images.
      expression: path =^ "/v2/public/"
  examplePrivilegeRepositoryContentSelector:
    type: nexus:PrivilegeRepositoryContentSelector
    properties:
      description: description
      actions:
        - ADD
        - READ
        - DELETE
        - BROWSE
        - EDIT
      repository: ${resource.nexus_repository_helm_hosted.example.name}
      format: helm
      contentSelector: ${resource.nexus_security_content_selector.example.name}
Copy

Create PrivilegeRepositoryContentSelector Resource

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

Constructor syntax

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

@overload
def PrivilegeRepositoryContentSelector(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       actions: Optional[Sequence[str]] = None,
                                       content_selector: Optional[str] = None,
                                       format: Optional[str] = None,
                                       repository: Optional[str] = None,
                                       description: Optional[str] = None,
                                       name: Optional[str] = None)
func NewPrivilegeRepositoryContentSelector(ctx *Context, name string, args PrivilegeRepositoryContentSelectorArgs, opts ...ResourceOption) (*PrivilegeRepositoryContentSelector, error)
public PrivilegeRepositoryContentSelector(string name, PrivilegeRepositoryContentSelectorArgs args, CustomResourceOptions? opts = null)
public PrivilegeRepositoryContentSelector(String name, PrivilegeRepositoryContentSelectorArgs args)
public PrivilegeRepositoryContentSelector(String name, PrivilegeRepositoryContentSelectorArgs args, CustomResourceOptions options)
type: nexus:PrivilegeRepositoryContentSelector
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. PrivilegeRepositoryContentSelectorArgs
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. PrivilegeRepositoryContentSelectorArgs
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. PrivilegeRepositoryContentSelectorArgs
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. PrivilegeRepositoryContentSelectorArgs
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. PrivilegeRepositoryContentSelectorArgs
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 privilegeRepositoryContentSelectorResource = new Nexus.PrivilegeRepositoryContentSelector("privilegeRepositoryContentSelectorResource", new()
{
    Actions = new[]
    {
        "string",
    },
    ContentSelector = "string",
    Format = "string",
    Repository = "string",
    Description = "string",
    Name = "string",
});
Copy
example, err := nexus.NewPrivilegeRepositoryContentSelector(ctx, "privilegeRepositoryContentSelectorResource", &nexus.PrivilegeRepositoryContentSelectorArgs{
Actions: pulumi.StringArray{
pulumi.String("string"),
},
ContentSelector: pulumi.String("string"),
Format: pulumi.String("string"),
Repository: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
Copy
var privilegeRepositoryContentSelectorResource = new PrivilegeRepositoryContentSelector("privilegeRepositoryContentSelectorResource", PrivilegeRepositoryContentSelectorArgs.builder()
    .actions("string")
    .contentSelector("string")
    .format("string")
    .repository("string")
    .description("string")
    .name("string")
    .build());
Copy
privilege_repository_content_selector_resource = nexus.PrivilegeRepositoryContentSelector("privilegeRepositoryContentSelectorResource",
    actions=["string"],
    content_selector="string",
    format="string",
    repository="string",
    description="string",
    name="string")
Copy
const privilegeRepositoryContentSelectorResource = new nexus.PrivilegeRepositoryContentSelector("privilegeRepositoryContentSelectorResource", {
    actions: ["string"],
    contentSelector: "string",
    format: "string",
    repository: "string",
    description: "string",
    name: "string",
});
Copy
type: nexus:PrivilegeRepositoryContentSelector
properties:
    actions:
        - string
    contentSelector: string
    description: string
    format: string
    name: string
    repository: string
Copy

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

Actions This property is required. List<string>
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
ContentSelector This property is required. string
The content selector
Format This property is required. string
The format of the referenced Repository
Repository This property is required. string
Name of the repository the privilege applies to
Description string
A description
Name string
The name of the privilege. This value cannot be changed.
Actions This property is required. []string
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
ContentSelector This property is required. string
The content selector
Format This property is required. string
The format of the referenced Repository
Repository This property is required. string
Name of the repository the privilege applies to
Description string
A description
Name string
The name of the privilege. This value cannot be changed.
actions This property is required. List<String>
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
contentSelector This property is required. String
The content selector
format This property is required. String
The format of the referenced Repository
repository This property is required. String
Name of the repository the privilege applies to
description String
A description
name String
The name of the privilege. This value cannot be changed.
actions This property is required. string[]
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
contentSelector This property is required. string
The content selector
format This property is required. string
The format of the referenced Repository
repository This property is required. string
Name of the repository the privilege applies to
description string
A description
name string
The name of the privilege. This value cannot be changed.
actions This property is required. Sequence[str]
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
content_selector This property is required. str
The content selector
format This property is required. str
The format of the referenced Repository
repository This property is required. str
Name of the repository the privilege applies to
description str
A description
name str
The name of the privilege. This value cannot be changed.
actions This property is required. List<String>
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
contentSelector This property is required. String
The content selector
format This property is required. String
The format of the referenced Repository
repository This property is required. String
Name of the repository the privilege applies to
description String
A description
name String
The name of the privilege. This value cannot be changed.

Outputs

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

Get an existing PrivilegeRepositoryContentSelector 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?: PrivilegeRepositoryContentSelectorState, opts?: CustomResourceOptions): PrivilegeRepositoryContentSelector
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[Sequence[str]] = None,
        content_selector: Optional[str] = None,
        description: Optional[str] = None,
        format: Optional[str] = None,
        name: Optional[str] = None,
        repository: Optional[str] = None) -> PrivilegeRepositoryContentSelector
func GetPrivilegeRepositoryContentSelector(ctx *Context, name string, id IDInput, state *PrivilegeRepositoryContentSelectorState, opts ...ResourceOption) (*PrivilegeRepositoryContentSelector, error)
public static PrivilegeRepositoryContentSelector Get(string name, Input<string> id, PrivilegeRepositoryContentSelectorState? state, CustomResourceOptions? opts = null)
public static PrivilegeRepositoryContentSelector get(String name, Output<String> id, PrivilegeRepositoryContentSelectorState state, CustomResourceOptions options)
resources:  _:    type: nexus:PrivilegeRepositoryContentSelector    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:
Actions List<string>
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
ContentSelector string
The content selector
Description string
A description
Format string
The format of the referenced Repository
Name string
The name of the privilege. This value cannot be changed.
Repository string
Name of the repository the privilege applies to
Actions []string
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
ContentSelector string
The content selector
Description string
A description
Format string
The format of the referenced Repository
Name string
The name of the privilege. This value cannot be changed.
Repository string
Name of the repository the privilege applies to
actions List<String>
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
contentSelector String
The content selector
description String
A description
format String
The format of the referenced Repository
name String
The name of the privilege. This value cannot be changed.
repository String
Name of the repository the privilege applies to
actions string[]
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
contentSelector string
The content selector
description string
A description
format string
The format of the referenced Repository
name string
The name of the privilege. This value cannot be changed.
repository string
Name of the repository the privilege applies to
actions Sequence[str]
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
content_selector str
The content selector
description str
A description
format str
The format of the referenced Repository
name str
The name of the privilege. This value cannot be changed.
repository str
Name of the repository the privilege applies to
actions List<String>
A list of allowed actions. For a list of applicable values see https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/privileges#Privileges-PrivilegeTypes
contentSelector String
The content selector
description String
A description
format String
The format of the referenced Repository
name String
The name of the privilege. This value cannot be changed.
repository String
Name of the repository the privilege applies to

Import

import using the name of the privilege

$ pulumi import nexus:index/privilegeRepositoryContentSelector:PrivilegeRepositoryContentSelector example name
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.