1. Packages
  2. Etcd Provider
  3. API Docs
  4. Key
etcd 0.10.0 published on Tuesday, Apr 15, 2025 by ferlab-ste-justine

etcd.Key

Explore with Pulumi AI

Key value for etcd.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as etcd from "@pulumi/etcd";

const helloWorld = new etcd.Key("helloWorld", {
    key: "/hello",
    value: "world",
});
Copy
import pulumi
import pulumi_etcd as etcd

hello_world = etcd.Key("helloWorld",
    key="/hello",
    value="world")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/etcd/etcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := etcd.NewKey(ctx, "helloWorld", &etcd.KeyArgs{
			Key:   pulumi.String("/hello"),
			Value: pulumi.String("world"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Etcd = Pulumi.Etcd;

return await Deployment.RunAsync(() => 
{
    var helloWorld = new Etcd.Key("helloWorld", new()
    {
        Key = "/hello",
        Value = "world",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.etcd.Key;
import com.pulumi.etcd.KeyArgs;
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 helloWorld = new Key("helloWorld", KeyArgs.builder()
            .key("/hello")
            .value("world")
            .build());

    }
}
Copy
resources:
  helloWorld:
    type: etcd:Key
    properties:
      key: /hello
      value: world
Copy

Create Key Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Key(name: string, args: KeyArgs, opts?: CustomResourceOptions);
@overload
def Key(resource_name: str,
        args: KeyArgs,
        opts: Optional[ResourceOptions] = None)

@overload
def Key(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        key: Optional[str] = None,
        value: Optional[str] = None,
        key_id: Optional[str] = None)
func NewKey(ctx *Context, name string, args KeyArgs, opts ...ResourceOption) (*Key, error)
public Key(string name, KeyArgs args, CustomResourceOptions? opts = null)
public Key(String name, KeyArgs args)
public Key(String name, KeyArgs args, CustomResourceOptions options)
type: etcd:Key
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. KeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. KeyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. KeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. KeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. KeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var keyResource = new Etcd.Key("keyResource", new()
{
    Key = "string",
    Value = "string",
    KeyId = "string",
});
Copy
example, err := etcd.NewKey(ctx, "keyResource", &etcd.KeyArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
KeyId: pulumi.String("string"),
})
Copy
var keyResource = new Key("keyResource", KeyArgs.builder()
    .key("string")
    .value("string")
    .keyId("string")
    .build());
Copy
key_resource = etcd.Key("keyResource",
    key="string",
    value="string",
    key_id="string")
Copy
const keyResource = new etcd.Key("keyResource", {
    key: "string",
    value: "string",
    keyId: "string",
});
Copy
type: etcd:Key
properties:
    key: string
    keyId: string
    value: string
Copy

Key Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Key resource accepts the following input properties:

Key This property is required. string
Key to set.
Value This property is required. string
Value to store in the key.
KeyId string
The ID of this resource.
Key This property is required. string
Key to set.
Value This property is required. string
Value to store in the key.
KeyId string
The ID of this resource.
key This property is required. String
Key to set.
value This property is required. String
Value to store in the key.
keyId String
The ID of this resource.
key This property is required. string
Key to set.
value This property is required. string
Value to store in the key.
keyId string
The ID of this resource.
key This property is required. str
Key to set.
value This property is required. str
Value to store in the key.
key_id str
The ID of this resource.
key This property is required. String
Key to set.
value This property is required. String
Value to store in the key.
keyId String
The ID of this resource.

Outputs

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

Look up Existing Key Resource

Get an existing Key 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?: KeyState, opts?: CustomResourceOptions): Key
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        key: Optional[str] = None,
        key_id: Optional[str] = None,
        value: Optional[str] = None) -> Key
func GetKey(ctx *Context, name string, id IDInput, state *KeyState, opts ...ResourceOption) (*Key, error)
public static Key Get(string name, Input<string> id, KeyState? state, CustomResourceOptions? opts = null)
public static Key get(String name, Output<String> id, KeyState state, CustomResourceOptions options)
resources:  _:    type: etcd:Key    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Key string
Key to set.
KeyId string
The ID of this resource.
Value string
Value to store in the key.
Key string
Key to set.
KeyId string
The ID of this resource.
Value string
Value to store in the key.
key String
Key to set.
keyId String
The ID of this resource.
value String
Value to store in the key.
key string
Key to set.
keyId string
The ID of this resource.
value string
Value to store in the key.
key str
Key to set.
key_id str
The ID of this resource.
value str
Value to store in the key.
key String
Key to set.
keyId String
The ID of this resource.
value String
Value to store in the key.

Package Details

Repository
etcd ferlab-ste-justine/terraform-provider-etcd
License
Notes
This Pulumi package is based on the etcd Terraform Provider.