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

KeyPrefix

Import

consul_key_prefix can be imported. This is useful when the path already and you know all keys in path must be removed.

 $ pulumi import consul:index/keyPrefix:KeyPrefix myapp_config myapp/config/

Create a KeyPrefix Resource

new KeyPrefix(name: string, args: KeyPrefixArgs, opts?: CustomResourceOptions);
def KeyPrefix(resource_name: str, opts: Optional[ResourceOptions] = None, datacenter: Optional[str] = None, namespace: Optional[str] = None, path_prefix: Optional[str] = None, subkey_collection: Optional[Sequence[KeyPrefixSubkeyCollectionArgs]] = None, subkeys: Optional[Mapping[str, str]] = None, token: Optional[str] = None)
func NewKeyPrefix(ctx *Context, name string, args KeyPrefixArgs, opts ...ResourceOption) (*KeyPrefix, error)
public KeyPrefix(string name, KeyPrefixArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args KeyPrefixArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args KeyPrefixArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args KeyPrefixArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

KeyPrefix Resource Properties

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

Inputs

The KeyPrefix resource accepts the following input properties:

PathPrefix string

Specifies the common prefix shared by all keys that will be managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

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<KeyPrefixSubkeyCollectionArgs>

A subkey to add. Supported values documented below. Multiple blocks supported.

Subkeys Dictionary<string, string>

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

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 managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

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 []KeyPrefixSubkeyCollection

A subkey to add. Supported values documented below. Multiple blocks supported.

Subkeys map[string]string

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

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 managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

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 KeyPrefixSubkeyCollection[]

A subkey to add. Supported values documented below. Multiple blocks supported.

subkeys {[key: string]: string}

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

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 managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

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[KeyPrefixSubkeyCollectionArgs]

A subkey to add. Supported values documented below. Multiple blocks supported.

subkeys Mapping[str, str]

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

token str

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

Outputs

All input properties are implicitly available as output properties. Additionally, the KeyPrefix 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing KeyPrefix Resource

Get an existing KeyPrefix 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?: KeyPrefixState, opts?: CustomResourceOptions): KeyPrefix
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, datacenter: Optional[str] = None, namespace: Optional[str] = None, path_prefix: Optional[str] = None, subkey_collection: Optional[Sequence[KeyPrefixSubkeyCollectionArgs]] = None, subkeys: Optional[Mapping[str, str]] = None, token: Optional[str] = None) -> KeyPrefix
func GetKeyPrefix(ctx *Context, name string, id IDInput, state *KeyPrefixState, opts ...ResourceOption) (*KeyPrefix, error)
public static KeyPrefix Get(string name, Input<string> id, KeyPrefixState? 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:

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.

PathPrefix string

Specifies the common prefix shared by all keys that will be managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

SubkeyCollection List<KeyPrefixSubkeyCollectionArgs>

A subkey to add. Supported values documented below. Multiple blocks supported.

Subkeys Dictionary<string, string>

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

Token string

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

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.

PathPrefix string

Specifies the common prefix shared by all keys that will be managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

SubkeyCollection []KeyPrefixSubkeyCollection

A subkey to add. Supported values documented below. Multiple blocks supported.

Subkeys map[string]string

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

Token string

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

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.

pathPrefix string

Specifies the common prefix shared by all keys that will be managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

subkeyCollection KeyPrefixSubkeyCollection[]

A subkey to add. Supported values documented below. Multiple blocks supported.

subkeys {[key: string]: string}

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

token string

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

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.

path_prefix str

Specifies the common prefix shared by all keys that will be managed by this resource instance. In most cases this will end with a slash, to manage a “folder” of keys.

subkey_collection Sequence[KeyPrefixSubkeyCollectionArgs]

A subkey to add. Supported values documented below. Multiple blocks supported.

subkeys Mapping[str, str]

A mapping from subkey name (which will be appended to the given path_prefix) to the value that should be stored at that key. Use slashes, as shown in the above example, to create “sub-folders” under the given path prefix.

token str

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

Supporting Types

KeyPrefixSubkeyCollection

Path string

This is the path (which will be appended to the given path_prefix) in Consul that should be written to.

Value string

The value to write to the given path.

Flags int

An unsigned integer value to attach to the key (defaults to 0).

Path string

This is the path (which will be appended to the given path_prefix) in Consul that should be written to.

Value string

The value to write to the given path.

Flags int

An unsigned integer value to attach to the key (defaults to 0).

path string

This is the path (which will be appended to the given path_prefix) in Consul that should be written to.

value string

The value to write to the given path.

flags number

An unsigned integer value to attach to the key (defaults to 0).

path str

This is the path (which will be appended to the given path_prefix) in Consul that should be written to.

value str

The value to write to the given path.

flags int

An unsigned integer value to attach to the key (defaults to 0).

Package Details

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