jetstream.KvEntry
Explore with Pulumi AI
jetstream.KvEntry Resource
The jetstream.KvEntry
Resource manages entries in JetStream Based Key-Value buckets and supports editing entries in place.
Example
Using a string value:
import * as pulumi from "@pulumi/pulumi";
import * as jetstream from "@pulumi/jetstream";
const myserviceCfg = new jetstream.KvEntry("myserviceCfg", {
bucket: "CFG",
key: "config.myservice.timeout",
value: "10",
});
import pulumi
import pulumi_jetstream as jetstream
myservice_cfg = jetstream.KvEntry("myserviceCfg",
bucket="CFG",
key="config.myservice.timeout",
value="10")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/jetstream/jetstream"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := jetstream.NewKvEntry(ctx, "myserviceCfg", &jetstream.KvEntryArgs{
Bucket: pulumi.String("CFG"),
Key: pulumi.String("config.myservice.timeout"),
Value: pulumi.String("10"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Jetstream = Pulumi.Jetstream;
return await Deployment.RunAsync(() =>
{
var myserviceCfg = new Jetstream.KvEntry("myserviceCfg", new()
{
Bucket = "CFG",
Key = "config.myservice.timeout",
Value = "10",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.jetstream.KvEntry;
import com.pulumi.jetstream.KvEntryArgs;
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 myserviceCfg = new KvEntry("myserviceCfg", KvEntryArgs.builder()
.bucket("CFG")
.key("config.myservice.timeout")
.value("10")
.build());
}
}
resources:
myserviceCfg:
type: jetstream:KvEntry
properties:
bucket: CFG
key: config.myservice.timeout
value: '10'
Using json:
import * as pulumi from "@pulumi/pulumi";
import * as jetstream from "@pulumi/jetstream";
const myserviceCfg = new jetstream.KvEntry("myserviceCfg", {
bucket: "CFG",
key: "config.myservice",
value: JSON.stringify({
timeout: 10,
retries: 3,
}),
});
import pulumi
import json
import pulumi_jetstream as jetstream
myservice_cfg = jetstream.KvEntry("myserviceCfg",
bucket="CFG",
key="config.myservice",
value=json.dumps({
"timeout": 10,
"retries": 3,
}))
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/jetstream/jetstream"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"timeout": 10,
"retries": 3,
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = jetstream.NewKvEntry(ctx, "myserviceCfg", &jetstream.KvEntryArgs{
Bucket: pulumi.String("CFG"),
Key: pulumi.String("config.myservice"),
Value: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Jetstream = Pulumi.Jetstream;
return await Deployment.RunAsync(() =>
{
var myserviceCfg = new Jetstream.KvEntry("myserviceCfg", new()
{
Bucket = "CFG",
Key = "config.myservice",
Value = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["timeout"] = 10,
["retries"] = 3,
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.jetstream.KvEntry;
import com.pulumi.jetstream.KvEntryArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 myserviceCfg = new KvEntry("myserviceCfg", KvEntryArgs.builder()
.bucket("CFG")
.key("config.myservice")
.value(serializeJson(
jsonObject(
jsonProperty("timeout", 10),
jsonProperty("retries", 3)
)))
.build());
}
}
resources:
myserviceCfg:
type: jetstream:KvEntry
properties:
bucket: CFG
key: config.myservice
value:
fn::toJSON:
timeout: 10
retries: 3
Attribute Reference
bucket
- (required) The name of the KV bucketkey
- (required) The entry keyvalue
- (required) The entry value
Create KvEntry Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KvEntry(name: string, args: KvEntryArgs, opts?: CustomResourceOptions);
@overload
def KvEntry(resource_name: str,
args: KvEntryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KvEntry(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
key: Optional[str] = None,
value: Optional[str] = None,
kv_entry_id: Optional[str] = None)
func NewKvEntry(ctx *Context, name string, args KvEntryArgs, opts ...ResourceOption) (*KvEntry, error)
public KvEntry(string name, KvEntryArgs args, CustomResourceOptions? opts = null)
public KvEntry(String name, KvEntryArgs args)
public KvEntry(String name, KvEntryArgs args, CustomResourceOptions options)
type: jetstream:KvEntry
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args KvEntryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args KvEntryArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KvEntryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KvEntryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KvEntryArgs
- 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 kvEntryResource = new Jetstream.KvEntry("kvEntryResource", new()
{
Bucket = "string",
Key = "string",
Value = "string",
KvEntryId = "string",
});
example, err := jetstream.NewKvEntry(ctx, "kvEntryResource", &jetstream.KvEntryArgs{
Bucket: pulumi.String("string"),
Key: pulumi.String("string"),
Value: pulumi.String("string"),
KvEntryId: pulumi.String("string"),
})
var kvEntryResource = new KvEntry("kvEntryResource", KvEntryArgs.builder()
.bucket("string")
.key("string")
.value("string")
.kvEntryId("string")
.build());
kv_entry_resource = jetstream.KvEntry("kvEntryResource",
bucket="string",
key="string",
value="string",
kv_entry_id="string")
const kvEntryResource = new jetstream.KvEntry("kvEntryResource", {
bucket: "string",
key: "string",
value: "string",
kvEntryId: "string",
});
type: jetstream:KvEntry
properties:
bucket: string
key: string
kvEntryId: string
value: string
KvEntry 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 KvEntry resource accepts the following input properties:
- bucket str
- The name of the bucket
- key str
- The key of the entry
- value str
- The value of the entry
- kv_
entry_ strid
Outputs
All input properties are implicitly available as output properties. Additionally, the KvEntry resource produces the following output properties:
Look up Existing KvEntry Resource
Get an existing KvEntry 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?: KvEntryState, opts?: CustomResourceOptions): KvEntry
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket: Optional[str] = None,
key: Optional[str] = None,
kv_entry_id: Optional[str] = None,
revision: Optional[float] = None,
value: Optional[str] = None) -> KvEntry
func GetKvEntry(ctx *Context, name string, id IDInput, state *KvEntryState, opts ...ResourceOption) (*KvEntry, error)
public static KvEntry Get(string name, Input<string> id, KvEntryState? state, CustomResourceOptions? opts = null)
public static KvEntry get(String name, Output<String> id, KvEntryState state, CustomResourceOptions options)
resources: _: type: jetstream:KvEntry get: id: ${id}
- 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.
- 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.
- bucket str
- The name of the bucket
- key str
- The key of the entry
- kv_
entry_ strid - revision float
- The revision of the entry
- value str
- The value of the entry
Package Details
- Repository
- jetstream nats-io/terraform-provider-jetstream
- License
- Notes
- This Pulumi package is based on the
jetstream
Terraform Provider.