Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getKeyPrefix

Using getKeyPrefix

function getKeyPrefix(args: GetKeyPrefixArgs, opts?: InvokeOptions): Promise<GetKeyPrefixResult>
def get_key_prefix(datacenter: Optional[str] = None, namespace: Optional[str] = None, path_prefix: Optional[str] = None, subkey_collection: Optional[Sequence[GetKeyPrefixSubkeyCollectionArgs]] = None, token: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetKeyPrefixResult
func LookupKeyPrefix(ctx *Context, args *LookupKeyPrefixArgs, opts ...InvokeOption) (*LookupKeyPrefixResult, error)

Note: This function is named LookupKeyPrefix in the Go SDK.

public static class GetKeyPrefix {
    public static Task<GetKeyPrefixResult> InvokeAsync(GetKeyPrefixArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

PathPrefix string

Specifies the common prefix shared by all keys that will be read by this data source instance. In most cases, this will end with a slash to read a “folder” of subkeys.

Datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

Namespace string

The namespace to create the keys within.

SubkeyCollection List<GetKeyPrefixSubkeyCollectionArgs>

Specifies a subkey in Consul to be read. Supported values documented below. Multiple blocks supported.

Token string

The ACL token to use. This overrides the token that the agent provides by default.

PathPrefix string

Specifies the common prefix shared by all keys that will be read by this data source instance. In most cases, this will end with a slash to read a “folder” of subkeys.

Datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

Namespace string

The namespace to create the keys within.

SubkeyCollection []GetKeyPrefixSubkeyCollection

Specifies a subkey in Consul to be read. Supported values documented below. Multiple blocks supported.

Token string

The ACL token to use. This overrides the token that the agent provides by default.

pathPrefix string

Specifies the common prefix shared by all keys that will be read by this data source instance. In most cases, this will end with a slash to read a “folder” of subkeys.

datacenter string

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

namespace string

The namespace to create the keys within.

subkeyCollection GetKeyPrefixSubkeyCollection[]

Specifies a subkey in Consul to be read. Supported values documented below. Multiple blocks supported.

token string

The ACL token to use. This overrides the token that the agent provides by default.

path_prefix str

Specifies the common prefix shared by all keys that will be read by this data source instance. In most cases, this will end with a slash to read a “folder” of subkeys.

datacenter str

The datacenter to use. This overrides the agent’s default datacenter and the datacenter in the provider setup.

namespace str

The namespace to create the keys within.

subkey_collection Sequence[GetKeyPrefixSubkeyCollectionArgs]

Specifies a subkey in Consul to be read. Supported values documented below. Multiple blocks supported.

token str

The ACL token to use. This overrides the token that the agent provides by default.

getKeyPrefix Result

The following output properties are available:

Datacenter string

The datacenter the keys are being read from.

Id string

The provider-assigned unique ID for this managed resource.

PathPrefix string

the common prefix shared by all keys being read. * var.<name> - For each name given, the corresponding attribute has the value of the key.

Subkeys Dictionary<string, string>

A map of the subkeys and values is set if no subkey block is provided.

Var Dictionary<string, string>
Namespace string
SubkeyCollection List<GetKeyPrefixSubkeyCollection>
Token string
Datacenter string

The datacenter the keys are being read from.

Id string

The provider-assigned unique ID for this managed resource.

PathPrefix string

the common prefix shared by all keys being read. * var.<name> - For each name given, the corresponding attribute has the value of the key.

Subkeys map[string]string

A map of the subkeys and values is set if no subkey block is provided.

Var map[string]string
Namespace string
SubkeyCollection []GetKeyPrefixSubkeyCollection
Token string
datacenter string

The datacenter the keys are being read from.

id string

The provider-assigned unique ID for this managed resource.

pathPrefix string

the common prefix shared by all keys being read. * var.<name> - For each name given, the corresponding attribute has the value of the key.

subkeys {[key: string]: string}

A map of the subkeys and values is set if no subkey block is provided.

var {[key: string]: string}
namespace string
subkeyCollection GetKeyPrefixSubkeyCollection[]
token string
datacenter str

The datacenter the keys are being read from.

id str

The provider-assigned unique ID for this managed resource.

path_prefix str

the common prefix shared by all keys being read. * var.<name> - For each name given, the corresponding attribute has the value of the key.

subkeys Mapping[str, str]

A map of the subkeys and values is set if no subkey block is provided.

var Mapping[str, str]
namespace str
subkey_collection Sequence[GetKeyPrefixSubkeyCollection]
token str

Supporting Types

GetKeyPrefixSubkeyCollection

Name string

This is the name of the key. This value of the key is exposed as var.<name>. This is not the path of the subkey in Consul.

Path string

This is the subkey path in Consul (which will be appended to the given path_prefix) to construct the full key that will be used to read the value.

Default string

This is the default value to set for var.<name> if the key does not exist in Consul. Defaults to an empty string.

Name string

This is the name of the key. This value of the key is exposed as var.<name>. This is not the path of the subkey in Consul.

Path string

This is the subkey path in Consul (which will be appended to the given path_prefix) to construct the full key that will be used to read the value.

Default string

This is the default value to set for var.<name> if the key does not exist in Consul. Defaults to an empty string.

name string

This is the name of the key. This value of the key is exposed as var.<name>. This is not the path of the subkey in Consul.

path string

This is the subkey path in Consul (which will be appended to the given path_prefix) to construct the full key that will be used to read the value.

default string

This is the default value to set for var.<name> if the key does not exist in Consul. Defaults to an empty string.

name str

This is the name of the key. This value of the key is exposed as var.<name>. This is not the path of the subkey in Consul.

path str

This is the subkey path in Consul (which will be appended to the given path_prefix) to construct the full key that will be used to read the value.

default str

This is the default value to set for var.<name> if the key does not exist in Consul. Defaults to an empty string.

Package Details

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