com.pulumi.cloudflare.kotlin.WorkerSecretArgs.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.WorkerSecretArgs.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 Cloudflare Worker secret resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const mySecret = new cloudflare.WorkerSecret("my_secret", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "MY_EXAMPLE_SECRET_TEXT",
* scriptName: "script_1",
* secretText: "my_secret_value",
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* my_secret = cloudflare.WorkerSecret("my_secret",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="MY_EXAMPLE_SECRET_TEXT",
* script_name="script_1",
* secret_text="my_secret_value")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var mySecret = new Cloudflare.WorkerSecret("my_secret", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "MY_EXAMPLE_SECRET_TEXT",
* ScriptName = "script_1",
* SecretText = "my_secret_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 {
* _, err := cloudflare.NewWorkerSecret(ctx, "my_secret", &cloudflare.WorkerSecretArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("MY_EXAMPLE_SECRET_TEXT"),
* ScriptName: pulumi.String("script_1"),
* SecretText: pulumi.String("my_secret_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.WorkerSecret;
* import com.pulumi.cloudflare.WorkerSecretArgs;
* 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 mySecret = new WorkerSecret("mySecret", WorkerSecretArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("MY_EXAMPLE_SECRET_TEXT")
* .scriptName("script_1")
* .secretText("my_secret_value")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* mySecret:
* type: cloudflare:WorkerSecret
* name: my_secret
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: MY_EXAMPLE_SECRET_TEXT
* scriptName: script_1
* secretText: my_secret_value
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/workerSecret:WorkerSecret example //
* ```
* @property accountId The account identifier to target for the resource.
* @property name The name of the Worker secret. **Modifying this attribute will force creation of a new resource.**
* @property scriptName The name of the Worker script to associate the secret with. **Modifying this attribute will force creation of a new resource.**
* @property secretText The text of the Worker secret. **Modifying this attribute will force creation of a new resource.**
*/
public data class WorkerSecretArgs(
public val accountId: Output? = null,
public val name: Output? = null,
public val scriptName: Output? = null,
public val secretText: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.WorkerSecretArgs =
com.pulumi.cloudflare.WorkerSecretArgs.builder()
.accountId(accountId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.scriptName(scriptName?.applyValue({ args0 -> args0 }))
.secretText(secretText?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkerSecretArgs].
*/
@PulumiTagMarker
public class WorkerSecretArgsBuilder internal constructor() {
private var accountId: Output? = null
private var name: Output? = null
private var scriptName: Output? = null
private var secretText: Output? = null
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("fnuwhdqvhttnoyxq")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value The name of the Worker secret. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("gatjckodcddfqklk")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The name of the Worker script to associate the secret with. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("taaaiouquvscfhpq")
public suspend fun scriptName(`value`: Output) {
this.scriptName = value
}
/**
* @param value The text of the Worker secret. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("nvmscdrqqaxctmlg")
public suspend fun secretText(`value`: Output) {
this.secretText = value
}
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("tadwsbbhfsivqsyk")
public suspend fun accountId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accountId = mapped
}
/**
* @param value The name of the Worker secret. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("ikvflataujcrfeqs")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The name of the Worker script to associate the secret with. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("msivufxtbelktfue")
public suspend fun scriptName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.scriptName = mapped
}
/**
* @param value The text of the Worker secret. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("yheogrlfpqurbrds")
public suspend fun secretText(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.secretText = mapped
}
internal fun build(): WorkerSecretArgs = WorkerSecretArgs(
accountId = accountId,
name = name,
scriptName = scriptName,
secretText = secretText,
)
}