com.pulumi.cloudflare.kotlin.WorkersKvArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.WorkersKvArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a resource to manage a Cloudflare Workers KV Pair.
* ## Example Usage
*
* ```typescript
* 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",
* });
* ```
* ```python
* 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")
* ```
* ```csharp
* 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",
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```sh
* $ pulumi import cloudflare:index/workersKv:WorkersKv example //
* ```
* @property accountId The account identifier to target for the resource.
* @property key Name of the KV pair. **Modifying this attribute will force creation of a new resource.**
* @property namespaceId 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.**
* @property value Value of the KV pair.
*/
public data class WorkersKvArgs(
public val accountId: Output? = null,
public val key: Output? = null,
public val namespaceId: Output? = null,
public val `value`: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.WorkersKvArgs =
com.pulumi.cloudflare.WorkersKvArgs.builder()
.accountId(accountId?.applyValue({ args0 -> args0 }))
.key(key?.applyValue({ args0 -> args0 }))
.namespaceId(namespaceId?.applyValue({ args0 -> args0 }))
.`value`(`value`?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkersKvArgs].
*/
@PulumiTagMarker
public class WorkersKvArgsBuilder internal constructor() {
private var accountId: Output? = null
private var key: Output? = null
private var namespaceId: Output? = null
private var `value`: Output? = null
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("jogvddcapkwusdsd")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value Name of the KV pair. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("dvtxssmrthlkhdfu")
public suspend fun key(`value`: Output) {
this.key = value
}
/**
* @param value 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.**
*/
@JvmName("ywaveqtnehfsmyam")
public suspend fun namespaceId(`value`: Output) {
this.namespaceId = value
}
/**
* @param value Value of the KV pair.
*/
@JvmName("hwlowmpvpaemffhv")
public suspend fun `value`(`value`: Output) {
this.`value` = value
}
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("fbnoumbrtqfwmhmi")
public suspend fun accountId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accountId = mapped
}
/**
* @param value Name of the KV pair. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("hicgkhtijrclfbcx")
public suspend fun key(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.key = mapped
}
/**
* @param value 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.**
*/
@JvmName("fbjhjyvqgkucgnja")
public suspend fun namespaceId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespaceId = mapped
}
/**
* @param value Value of the KV pair.
*/
@JvmName("ygbrxewypiavycol")
public suspend fun `value`(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.`value` = mapped
}
internal fun build(): WorkersKvArgs = WorkersKvArgs(
accountId = accountId,
key = key,
namespaceId = namespaceId,
`value` = `value`,
)
}