WorkersKvArgs

data class WorkersKvArgs(val accountId: Output<String>? = null, val key: Output<String>? = null, val namespaceId: Output<String>? = null, val value: Output<String>? = null) : ConvertibleToJava<WorkersKvArgs>

Provides a resource to manage a Cloudflare Workers KV Pair.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleNs = new cloudflare.WorkersKvNamespace("example_ns", {
accountId: "f037e56e89293a057740de681ac9abbe",
title: "test-namespace",
});
const example = new cloudflare.WorkersKv("example", {
accountId: "f037e56e89293a057740de681ac9abbe",
namespaceId: exampleNs.id,
key: "test-key",
value: "test value",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_ns = cloudflare.WorkersKvNamespace("example_ns",
account_id="f037e56e89293a057740de681ac9abbe",
title="test-namespace")
example = cloudflare.WorkersKv("example",
account_id="f037e56e89293a057740de681ac9abbe",
namespace_id=example_ns.id,
key="test-key",
value="test value")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleNs = new Cloudflare.WorkersKvNamespace("example_ns", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
Title = "test-namespace",
});
var example = new Cloudflare.WorkersKv("example", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
NamespaceId = exampleNs.Id,
Key = "test-key",
Value = "test value",
});
});
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleNs, err := cloudflare.NewWorkersKvNamespace(ctx, "example_ns", &cloudflare.WorkersKvNamespaceArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Title: pulumi.String("test-namespace"),
})
if err != nil {
return err
}
_, err = cloudflare.NewWorkersKv(ctx, "example", &cloudflare.WorkersKvArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
NamespaceId: exampleNs.ID(),
Key: pulumi.String("test-key"),
Value: pulumi.String("test value"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.WorkersKvNamespace;
import com.pulumi.cloudflare.WorkersKvNamespaceArgs;
import com.pulumi.cloudflare.WorkersKv;
import com.pulumi.cloudflare.WorkersKvArgs;
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 exampleNs = new WorkersKvNamespace("exampleNs", WorkersKvNamespaceArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.title("test-namespace")
.build());
var example = new WorkersKv("example", WorkersKvArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.namespaceId(exampleNs.id())
.key("test-key")
.value("test value")
.build());
}
}
resources:
exampleNs:
type: cloudflare:WorkersKvNamespace
name: example_ns
properties:
accountId: f037e56e89293a057740de681ac9abbe
title: test-namespace
example:
type: cloudflare:WorkersKv
properties:
accountId: f037e56e89293a057740de681ac9abbe
namespaceId: ${exampleNs.id}
key: test-key
value: test value

Import

$ pulumi import cloudflare:index/workersKv:WorkersKv example <account_id>/<namespace_id>/<key_name>

Constructors

Link copied to clipboard
constructor(accountId: Output<String>? = null, key: Output<String>? = null, namespaceId: Output<String>? = null, value: Output<String>? = null)

Properties

Link copied to clipboard
val accountId: Output<String>? = null

The account identifier to target for the resource.

Link copied to clipboard
val key: Output<String>? = null

Name of the KV pair. Modifying this attribute will force creation of a new resource.

Link copied to clipboard
val namespaceId: Output<String>? = null

The ID of the Workers KV namespace in which you want to create the KV pair. Modifying this attribute will force creation of a new resource.

Link copied to clipboard
val value: Output<String>? = null

Value of the KV pair.

Functions

Link copied to clipboard
open override fun toJava(): WorkersKvArgs