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

nexus.SecurityRealms

Explore with Pulumi AI

Use this resource to activate and order the Nexus Security realms.

!> This resource can only be used once for a nexus

Example Usage

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

const example = new nexus.SecurityRealms("example", {actives: [
    "NexusAuthenticatingRealm",
    "DockerToken",
]});
Copy
import pulumi
import pulumi_nexus as nexus

example = nexus.SecurityRealms("example", actives=[
    "NexusAuthenticatingRealm",
    "DockerToken",
])
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.NewSecurityRealms(ctx, "example", &nexus.SecurityRealmsArgs{
			Actives: pulumi.StringArray{
				pulumi.String("NexusAuthenticatingRealm"),
				pulumi.String("DockerToken"),
			},
		})
		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 example = new Nexus.SecurityRealms("example", new()
    {
        Actives = new[]
        {
            "NexusAuthenticatingRealm",
            "DockerToken",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nexus.SecurityRealms;
import com.pulumi.nexus.SecurityRealmsArgs;
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 example = new SecurityRealms("example", SecurityRealmsArgs.builder()
            .actives(            
                "NexusAuthenticatingRealm",
                "DockerToken")
            .build());

    }
}
Copy
resources:
  example:
    type: nexus:SecurityRealms
    properties:
      actives:
        - NexusAuthenticatingRealm
        - DockerToken
Copy

Create SecurityRealms Resource

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

Constructor syntax

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

@overload
def SecurityRealms(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   actives: Optional[Sequence[str]] = None)
func NewSecurityRealms(ctx *Context, name string, args SecurityRealmsArgs, opts ...ResourceOption) (*SecurityRealms, error)
public SecurityRealms(string name, SecurityRealmsArgs args, CustomResourceOptions? opts = null)
public SecurityRealms(String name, SecurityRealmsArgs args)
public SecurityRealms(String name, SecurityRealmsArgs args, CustomResourceOptions options)
type: nexus:SecurityRealms
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. SecurityRealmsArgs
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. SecurityRealmsArgs
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. SecurityRealmsArgs
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. SecurityRealmsArgs
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. SecurityRealmsArgs
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 securityRealmsResource = new Nexus.SecurityRealms("securityRealmsResource", new()
{
    Actives = new[]
    {
        "string",
    },
});
Copy
example, err := nexus.NewSecurityRealms(ctx, "securityRealmsResource", &nexus.SecurityRealmsArgs{
	Actives: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var securityRealmsResource = new SecurityRealms("securityRealmsResource", SecurityRealmsArgs.builder()
    .actives("string")
    .build());
Copy
security_realms_resource = nexus.SecurityRealms("securityRealmsResource", actives=["string"])
Copy
const securityRealmsResource = new nexus.SecurityRealms("securityRealmsResource", {actives: ["string"]});
Copy
type: nexus:SecurityRealms
properties:
    actives:
        - string
Copy

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

Actives This property is required. List<string>
Set the active security realms in the order they should be used.
Actives This property is required. []string
Set the active security realms in the order they should be used.
actives This property is required. List<String>
Set the active security realms in the order they should be used.
actives This property is required. string[]
Set the active security realms in the order they should be used.
actives This property is required. Sequence[str]
Set the active security realms in the order they should be used.
actives This property is required. List<String>
Set the active security realms in the order they should be used.

Outputs

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

Get an existing SecurityRealms 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?: SecurityRealmsState, opts?: CustomResourceOptions): SecurityRealms
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actives: Optional[Sequence[str]] = None) -> SecurityRealms
func GetSecurityRealms(ctx *Context, name string, id IDInput, state *SecurityRealmsState, opts ...ResourceOption) (*SecurityRealms, error)
public static SecurityRealms Get(string name, Input<string> id, SecurityRealmsState? state, CustomResourceOptions? opts = null)
public static SecurityRealms get(String name, Output<String> id, SecurityRealmsState state, CustomResourceOptions options)
resources:  _:    type: nexus:SecurityRealms    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:
Actives List<string>
Set the active security realms in the order they should be used.
Actives []string
Set the active security realms in the order they should be used.
actives List<String>
Set the active security realms in the order they should be used.
actives string[]
Set the active security realms in the order they should be used.
actives Sequence[str]
Set the active security realms in the order they should be used.
actives List<String>
Set the active security realms in the order they should be used.

Import

import of active security realms

$ pulumi import nexus:index/securityRealms:SecurityRealms example active
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.