HashiCorp Vault v6.4.0 published on Wednesday, Nov 20, 2024 by Pulumi
vault.getNamespaces
Explore with Pulumi AI
Example Usage
Child namespaces
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const children = vault.getNamespaces({});
import pulumi
import pulumi_vault as vault
children = vault.get_namespaces()
package main
import (
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vault.GetNamespaces(ctx, &vault.GetNamespacesArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var children = Vault.GetNamespaces.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.VaultFunctions;
import com.pulumi.vault.inputs.GetNamespacesArgs;
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) {
final var children = VaultFunctions.getNamespaces();
}
}
variables:
children:
fn::invoke:
Function: vault:getNamespaces
Arguments: {}
Nested namespace
To fetch the details of nested namespaces:
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const children = vault.getNamespaces({
namespace: "parent",
});
const child = .reduce((__obj, [, ]) => ({ ...__obj, [__key]: vault.getNamespace({
namespace: _arg0_.namespace,
path: __key,
}) }));
import pulumi
import pulumi_vault as vault
children = vault.get_namespaces(namespace="parent")
child = {__key: vault.get_namespace(namespace=children.namespace,
path=__key) for __key, __value in children.paths}
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var children = Vault.GetNamespaces.Invoke(new()
{
Namespace = "parent",
});
var child = .ToDictionary(item => {
var __key = item.Key;
return __key;
}, item => {
var __key = item.Key;
return Vault.GetNamespace.Invoke(new()
{
Namespace = _arg0_.Namespace,
Path = __key,
});
});
});
Coming soon!
Coming soon!
Using getNamespaces
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNamespaces(args: GetNamespacesArgs, opts?: InvokeOptions): Promise<GetNamespacesResult>
function getNamespacesOutput(args: GetNamespacesOutputArgs, opts?: InvokeOptions): Output<GetNamespacesResult>
def get_namespaces(namespace: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNamespacesResult
def get_namespaces_output(namespace: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNamespacesResult]
func GetNamespaces(ctx *Context, args *GetNamespacesArgs, opts ...InvokeOption) (*GetNamespacesResult, error)
func GetNamespacesOutput(ctx *Context, args *GetNamespacesOutputArgs, opts ...InvokeOption) GetNamespacesResultOutput
> Note: This function is named GetNamespaces
in the Go SDK.
public static class GetNamespaces
{
public static Task<GetNamespacesResult> InvokeAsync(GetNamespacesArgs args, InvokeOptions? opts = null)
public static Output<GetNamespacesResult> Invoke(GetNamespacesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNamespacesResult> getNamespaces(GetNamespacesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: vault:index/getNamespaces:getNamespaces
arguments:
# arguments dictionary
The following arguments are supported:
getNamespaces Result
The following output properties are available:
Package Details
- Repository
- Vault pulumi/pulumi-vault
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vault
Terraform Provider.