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

nexus.PrivilegeScript

Explore with Pulumi AI

nexus logo
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

    Use this resource to manage a privilege for a Script

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nexus from "@pulumi/nexus";
    
    const exampleScript = new nexus.Script("exampleScript", {content: "log.info('Hello, World!')"});
    const examplePrivilegeScript = new nexus.PrivilegeScript("examplePrivilegeScript", {
        description: "description",
        actions: [
            "ADD",
            "READ",
            "DELETE",
            "RUN",
            "BROWSE",
            "EDIT",
        ],
        scriptName: resource.nexus_script.example.name,
    });
    
    import pulumi
    import pulumi_nexus as nexus
    
    example_script = nexus.Script("exampleScript", content="log.info('Hello, World!')")
    example_privilege_script = nexus.PrivilegeScript("examplePrivilegeScript",
        description="description",
        actions=[
            "ADD",
            "READ",
            "DELETE",
            "RUN",
            "BROWSE",
            "EDIT",
        ],
        script_name=resource["nexus_script"]["example"]["name"])
    
    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.NewScript(ctx, "exampleScript", &nexus.ScriptArgs{
    			Content: pulumi.String("log.info('Hello, World!')"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = nexus.NewPrivilegeScript(ctx, "examplePrivilegeScript", &nexus.PrivilegeScriptArgs{
    			Description: pulumi.String("description"),
    			Actions: pulumi.StringArray{
    				pulumi.String("ADD"),
    				pulumi.String("READ"),
    				pulumi.String("DELETE"),
    				pulumi.String("RUN"),
    				pulumi.String("BROWSE"),
    				pulumi.String("EDIT"),
    			},
    			ScriptName: pulumi.Any(resource.Nexus_script.Example.Name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nexus = Pulumi.Nexus;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleScript = new Nexus.Script("exampleScript", new()
        {
            Content = "log.info('Hello, World!')",
        });
    
        var examplePrivilegeScript = new Nexus.PrivilegeScript("examplePrivilegeScript", new()
        {
            Description = "description",
            Actions = new[]
            {
                "ADD",
                "READ",
                "DELETE",
                "RUN",
                "BROWSE",
                "EDIT",
            },
            ScriptName = resource.Nexus_script.Example.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nexus.Script;
    import com.pulumi.nexus.ScriptArgs;
    import com.pulumi.nexus.PrivilegeScript;
    import com.pulumi.nexus.PrivilegeScriptArgs;
    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 exampleScript = new Script("exampleScript", ScriptArgs.builder()
                .content("log.info('Hello, World!')")
                .build());
    
            var examplePrivilegeScript = new PrivilegeScript("examplePrivilegeScript", PrivilegeScriptArgs.builder()
                .description("description")
                .actions(            
                    "ADD",
                    "READ",
                    "DELETE",
                    "RUN",
                    "BROWSE",
                    "EDIT")
                .scriptName(resource.nexus_script().example().name())
                .build());
    
        }
    }
    
    resources:
      exampleScript:
        type: nexus:Script
        properties:
          content: log.info('Hello, World!')
      examplePrivilegeScript:
        type: nexus:PrivilegeScript
        properties:
          description: description
          actions:
            - ADD
            - READ
            - DELETE
            - RUN
            - BROWSE
            - EDIT
          scriptName: ${resource.nexus_script.example.name}
    

    Create PrivilegeScript Resource

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

    Constructor syntax

    new PrivilegeScript(name: string, args: PrivilegeScriptArgs, opts?: CustomResourceOptions);
    @overload
    def PrivilegeScript(resource_name: str,
                        args: PrivilegeScriptArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def PrivilegeScript(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        actions: Optional[Sequence[str]] = None,
                        script_name: Optional[str] = None,
                        description: Optional[str] = None,
                        name: Optional[str] = None)
    func NewPrivilegeScript(ctx *Context, name string, args PrivilegeScriptArgs, opts ...ResourceOption) (*PrivilegeScript, error)
    public PrivilegeScript(string name, PrivilegeScriptArgs args, CustomResourceOptions? opts = null)
    public PrivilegeScript(String name, PrivilegeScriptArgs args)
    public PrivilegeScript(String name, PrivilegeScriptArgs args, CustomResourceOptions options)
    
    type: nexus:PrivilegeScript
    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 PrivilegeScriptArgs
    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 PrivilegeScriptArgs
    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 PrivilegeScriptArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PrivilegeScriptArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PrivilegeScriptArgs
    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 privilegeScriptResource = new Nexus.PrivilegeScript("privilegeScriptResource", new()
    {
        Actions = new[]
        {
            "string",
        },
        ScriptName = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := nexus.NewPrivilegeScript(ctx, "privilegeScriptResource", &nexus.PrivilegeScriptArgs{
    	Actions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ScriptName:  pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var privilegeScriptResource = new PrivilegeScript("privilegeScriptResource", PrivilegeScriptArgs.builder()
        .actions("string")
        .scriptName("string")
        .description("string")
        .name("string")
        .build());
    
    privilege_script_resource = nexus.PrivilegeScript("privilegeScriptResource",
        actions=["string"],
        script_name="string",
        description="string",
        name="string")
    
    const privilegeScriptResource = new nexus.PrivilegeScript("privilegeScriptResource", {
        actions: ["string"],
        scriptName: "string",
        description: "string",
        name: "string",
    });
    
    type: nexus:PrivilegeScript
    properties:
        actions:
            - string
        description: string
        name: string
        scriptName: string
    

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

    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
    ScriptName string
    The script Name
    Description string
    A description
    Name string
    The name of the privilege. This value cannot be changed.
    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
    ScriptName string
    The script Name
    Description string
    A description
    Name string
    The name of the privilege. This value cannot be changed.
    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
    scriptName String
    The script Name
    description String
    A description
    name String
    The name of the privilege. This value cannot be changed.
    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
    scriptName string
    The script Name
    description string
    A description
    name string
    The name of the privilege. This value cannot be changed.
    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
    script_name str
    The script Name
    description str
    A description
    name str
    The name of the privilege. This value cannot be changed.
    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
    scriptName String
    The script Name
    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 PrivilegeScript 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 PrivilegeScript Resource

    Get an existing PrivilegeScript 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?: PrivilegeScriptState, opts?: CustomResourceOptions): PrivilegeScript
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            actions: Optional[Sequence[str]] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            script_name: Optional[str] = None) -> PrivilegeScript
    func GetPrivilegeScript(ctx *Context, name string, id IDInput, state *PrivilegeScriptState, opts ...ResourceOption) (*PrivilegeScript, error)
    public static PrivilegeScript Get(string name, Input<string> id, PrivilegeScriptState? state, CustomResourceOptions? opts = null)
    public static PrivilegeScript get(String name, Output<String> id, PrivilegeScriptState state, CustomResourceOptions options)
    resources:  _:    type: nexus:PrivilegeScript    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:
    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
    Description string
    A description
    Name string
    The name of the privilege. This value cannot be changed.
    ScriptName string
    The script Name
    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
    Description string
    A description
    Name string
    The name of the privilege. This value cannot be changed.
    ScriptName string
    The script Name
    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
    description String
    A description
    name String
    The name of the privilege. This value cannot be changed.
    scriptName String
    The script Name
    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
    description string
    A description
    name string
    The name of the privilege. This value cannot be changed.
    scriptName string
    The script Name
    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
    description str
    A description
    name str
    The name of the privilege. This value cannot be changed.
    script_name str
    The script Name
    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
    description String
    A description
    name String
    The name of the privilege. This value cannot be changed.
    scriptName String
    The script Name

    Import

    import using the name of the privilege

    $ pulumi import nexus:index/privilegeScript:PrivilegeScript example name
    

    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.
    nexus logo
    nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers