HashiCorp Vault

v5.1.0 published on Thursday, Dec 30, 2021 by Pulumi

Namespace

Provides a resource to manage Namespaces.

Note this feature is available only with Vault Enterprise.

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var ns1 = new Vault.Namespace("ns1", new Vault.NamespaceArgs
        {
            Path = "ns1",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vault.NewNamespace(ctx, "ns1", &vault.NamespaceArgs{
			Path: pulumi.String("ns1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

ns1 = vault.Namespace("ns1", path="ns1")
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const ns1 = new vault.Namespace("ns1", {
    path: "ns1",
});

Create a Namespace Resource

new Namespace(name: string, args: NamespaceArgs, opts?: CustomResourceOptions);
@overload
def Namespace(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              path: Optional[str] = None)
@overload
def Namespace(resource_name: str,
              args: NamespaceArgs,
              opts: Optional[ResourceOptions] = None)
func NewNamespace(ctx *Context, name string, args NamespaceArgs, opts ...ResourceOption) (*Namespace, error)
public Namespace(string name, NamespaceArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NamespaceArgs
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 NamespaceArgs
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 NamespaceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NamespaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Namespace Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Namespace resource accepts the following input properties:

Path string
The path of the namespace. Must not have a trailing /
Path string
The path of the namespace. Must not have a trailing /
path string
The path of the namespace. Must not have a trailing /
path str
The path of the namespace. Must not have a trailing /

Outputs

All input properties are implicitly available as output properties. Additionally, the Namespace resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
NamespaceId string
ID of the namepsace.
Id string
The provider-assigned unique ID for this managed resource.
NamespaceId string
ID of the namepsace.
id string
The provider-assigned unique ID for this managed resource.
namespaceId string
ID of the namepsace.
id str
The provider-assigned unique ID for this managed resource.
namespace_id str
ID of the namepsace.

Look up an Existing Namespace Resource

Get an existing Namespace 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?: NamespaceState, opts?: CustomResourceOptions): Namespace
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        namespace_id: Optional[str] = None,
        path: Optional[str] = None) -> Namespace
func GetNamespace(ctx *Context, name string, id IDInput, state *NamespaceState, opts ...ResourceOption) (*Namespace, error)
public static Namespace Get(string name, Input<string> id, NamespaceState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

NamespaceId string
ID of the namepsace.
Path string
The path of the namespace. Must not have a trailing /
NamespaceId string
ID of the namepsace.
Path string
The path of the namespace. Must not have a trailing /
namespaceId string
ID of the namepsace.
path string
The path of the namespace. Must not have a trailing /
namespace_id str
ID of the namepsace.
path str
The path of the namespace. Must not have a trailing /

Import

Namespaces can be imported using its name as accessor id

 $ pulumi import vault:index/namespace:Namespace example <name>

If the declared resource is imported and intends to support namespaces using a provider alias, then the name is relative to the namespace path. provider “vault” {

Configuration options

namespace = “example”

alias

= “example” } resource vault_namespace “example2” {

provider = vault.example }

 $ pulumi import vault:index/namespace:Namespace example2 example2

$ terraform state show vault_namespace.example2 # vault_namespace.example2 resource “vault_namespace” “example2” {

id

= “example/example2/”

namespace_id =

path

= “example2” }

Package Details

Repository
https://github.com/pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.