1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. pkiSecret
  5. getBackendKeys
HashiCorp Vault v6.2.0 published on Friday, Jun 21, 2024 by Pulumi

vault.pkiSecret.getBackendKeys

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.2.0 published on Friday, Jun 21, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const pki = new vault.Mount("pki", {
        path: "pki",
        type: "pki",
        description: "PKI secret engine mount",
    });
    const root = new vault.pkisecret.SecretBackendRootCert("root", {
        backend: pki.path,
        type: "internal",
        commonName: "example",
        ttl: "86400",
        keyName: "example",
    });
    const example = vault.pkiSecret.getBackendKeysOutput({
        backend: root.backend,
    });
    
    import pulumi
    import pulumi_vault as vault
    
    pki = vault.Mount("pki",
        path="pki",
        type="pki",
        description="PKI secret engine mount")
    root = vault.pki_secret.SecretBackendRootCert("root",
        backend=pki.path,
        type="internal",
        common_name="example",
        ttl="86400",
        key_name="example")
    example = vault.pkiSecret.get_backend_keys_output(backend=root.backend)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
    	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/pkiSecret"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pki, err := vault.NewMount(ctx, "pki", &vault.MountArgs{
    			Path:        pulumi.String("pki"),
    			Type:        pulumi.String("pki"),
    			Description: pulumi.String("PKI secret engine mount"),
    		})
    		if err != nil {
    			return err
    		}
    		root, err := pkiSecret.NewSecretBackendRootCert(ctx, "root", &pkiSecret.SecretBackendRootCertArgs{
    			Backend:    pki.Path,
    			Type:       pulumi.String("internal"),
    			CommonName: pulumi.String("example"),
    			Ttl:        pulumi.String("86400"),
    			KeyName:    pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = pkiSecret.GetBackendKeysOutput(ctx, pkisecret.GetBackendKeysOutputArgs{
    			Backend: root.Backend,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var pki = new Vault.Mount("pki", new()
        {
            Path = "pki",
            Type = "pki",
            Description = "PKI secret engine mount",
        });
    
        var root = new Vault.PkiSecret.SecretBackendRootCert("root", new()
        {
            Backend = pki.Path,
            Type = "internal",
            CommonName = "example",
            Ttl = "86400",
            KeyName = "example",
        });
    
        var example = Vault.PkiSecret.GetBackendKeys.Invoke(new()
        {
            Backend = root.Backend,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.Mount;
    import com.pulumi.vault.MountArgs;
    import com.pulumi.vault.pkiSecret.SecretBackendRootCert;
    import com.pulumi.vault.pkiSecret.SecretBackendRootCertArgs;
    import com.pulumi.vault.pkiSecret.PkiSecretFunctions;
    import com.pulumi.vault.pkiSecret.inputs.GetBackendKeysArgs;
    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 pki = new Mount("pki", MountArgs.builder()
                .path("pki")
                .type("pki")
                .description("PKI secret engine mount")
                .build());
    
            var root = new SecretBackendRootCert("root", SecretBackendRootCertArgs.builder()
                .backend(pki.path())
                .type("internal")
                .commonName("example")
                .ttl("86400")
                .keyName("example")
                .build());
    
            final var example = PkiSecretFunctions.getBackendKeys(GetBackendKeysArgs.builder()
                .backend(root.backend())
                .build());
    
        }
    }
    
    resources:
      pki:
        type: vault:Mount
        properties:
          path: pki
          type: pki
          description: PKI secret engine mount
      root:
        type: vault:pkiSecret:SecretBackendRootCert
        properties:
          backend: ${pki.path}
          type: internal
          commonName: example
          ttl: '86400'
          keyName: example
    variables:
      example:
        fn::invoke:
          Function: vault:pkiSecret:getBackendKeys
          Arguments:
            backend: ${root.backend}
    

    Using getBackendKeys

    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 getBackendKeys(args: GetBackendKeysArgs, opts?: InvokeOptions): Promise<GetBackendKeysResult>
    function getBackendKeysOutput(args: GetBackendKeysOutputArgs, opts?: InvokeOptions): Output<GetBackendKeysResult>
    def get_backend_keys(backend: Optional[str] = None,
                         namespace: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetBackendKeysResult
    def get_backend_keys_output(backend: Optional[pulumi.Input[str]] = None,
                         namespace: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetBackendKeysResult]
    func GetBackendKeys(ctx *Context, args *GetBackendKeysArgs, opts ...InvokeOption) (*GetBackendKeysResult, error)
    func GetBackendKeysOutput(ctx *Context, args *GetBackendKeysOutputArgs, opts ...InvokeOption) GetBackendKeysResultOutput

    > Note: This function is named GetBackendKeys in the Go SDK.

    public static class GetBackendKeys 
    {
        public static Task<GetBackendKeysResult> InvokeAsync(GetBackendKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetBackendKeysResult> Invoke(GetBackendKeysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackendKeysResult> getBackendKeys(GetBackendKeysArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vault:pkiSecret/getBackendKeys:getBackendKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Backend string
    The path to the PKI secret backend to read the keys from, with no leading or trailing /s.
    Namespace string
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    Backend string
    The path to the PKI secret backend to read the keys from, with no leading or trailing /s.
    Namespace string
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    backend String
    The path to the PKI secret backend to read the keys from, with no leading or trailing /s.
    namespace String
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    backend string
    The path to the PKI secret backend to read the keys from, with no leading or trailing /s.
    namespace string
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    backend str
    The path to the PKI secret backend to read the keys from, with no leading or trailing /s.
    namespace str
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    backend String
    The path to the PKI secret backend to read the keys from, with no leading or trailing /s.
    namespace String
    The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

    getBackendKeys Result

    The following output properties are available:

    Backend string
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyInfo Dictionary<string, object>
    Map of key strings read from Vault.
    KeyInfoJson string
    JSON-encoded key data read from Vault.
    Keys List<string>
    Keys used under the backend path.
    Namespace string
    Backend string
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyInfo map[string]interface{}
    Map of key strings read from Vault.
    KeyInfoJson string
    JSON-encoded key data read from Vault.
    Keys []string
    Keys used under the backend path.
    Namespace string
    backend String
    id String
    The provider-assigned unique ID for this managed resource.
    keyInfo Map<String,Object>
    Map of key strings read from Vault.
    keyInfoJson String
    JSON-encoded key data read from Vault.
    keys List<String>
    Keys used under the backend path.
    namespace String
    backend string
    id string
    The provider-assigned unique ID for this managed resource.
    keyInfo {[key: string]: any}
    Map of key strings read from Vault.
    keyInfoJson string
    JSON-encoded key data read from Vault.
    keys string[]
    Keys used under the backend path.
    namespace string
    backend str
    id str
    The provider-assigned unique ID for this managed resource.
    key_info Mapping[str, Any]
    Map of key strings read from Vault.
    key_info_json str
    JSON-encoded key data read from Vault.
    keys Sequence[str]
    Keys used under the backend path.
    namespace str
    backend String
    id String
    The provider-assigned unique ID for this managed resource.
    keyInfo Map<Any>
    Map of key strings read from Vault.
    keyInfoJson String
    JSON-encoded key data read from Vault.
    keys List<String>
    Keys used under the backend path.
    namespace String

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo
    HashiCorp Vault v6.2.0 published on Friday, Jun 21, 2024 by Pulumi