com.pulumi.cloudflare.kotlin.WorkersForPlatformsNamespaceArgs.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.WorkersForPlatformsNamespaceArgs.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
/**
* The [Workers for Platforms](https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/) resource allows you
* to manage Cloudflare Workers for Platforms namespaces.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* import * as std from "@pulumi/std";
* const example = new cloudflare.WorkersForPlatformsNamespace("example", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "example-namespace",
* });
* const customerWorker1 = new cloudflare.WorkersScript("customer_worker_1", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "customer-worker-1",
* content: std.file({
* input: "script.js",
* }).then(invoke => invoke.result),
* dispatchNamespace: example.name,
* tags: ["free"],
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* import pulumi_std as std
* example = cloudflare.WorkersForPlatformsNamespace("example",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="example-namespace")
* customer_worker1 = cloudflare.WorkersScript("customer_worker_1",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="customer-worker-1",
* content=std.file(input="script.js").result,
* dispatch_namespace=example.name,
* tags=["free"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var example = new Cloudflare.WorkersForPlatformsNamespace("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "example-namespace",
* });
* var customerWorker1 = new Cloudflare.WorkersScript("customer_worker_1", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "customer-worker-1",
* Content = Std.File.Invoke(new()
* {
* Input = "script.js",
* }).Apply(invoke => invoke.Result),
* DispatchNamespace = example.Name,
* Tags = new[]
* {
* "free",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := cloudflare.NewWorkersForPlatformsNamespace(ctx, "example", &cloudflare.WorkersForPlatformsNamespaceArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("example-namespace"),
* })
* if err != nil {
* return err
* }
* invokeFile, err := std.File(ctx, &std.FileArgs{
* Input: "script.js",
* }, nil)
* if err != nil {
* return err
* }
* _, err = cloudflare.NewWorkersScript(ctx, "customer_worker_1", &cloudflare.WorkersScriptArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("customer-worker-1"),
* Content: pulumi.String(invokeFile.Result),
* DispatchNamespace: example.Name,
* Tags: pulumi.StringArray{
* pulumi.String("free"),
* },
* })
* 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.WorkersForPlatformsNamespace;
* import com.pulumi.cloudflare.WorkersForPlatformsNamespaceArgs;
* import com.pulumi.cloudflare.WorkersScript;
* import com.pulumi.cloudflare.WorkersScriptArgs;
* 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 example = new WorkersForPlatformsNamespace("example", WorkersForPlatformsNamespaceArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("example-namespace")
* .build());
* var customerWorker1 = new WorkersScript("customerWorker1", WorkersScriptArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("customer-worker-1")
* .content(StdFunctions.file(FileArgs.builder()
* .input("script.js")
* .build()).result())
* .dispatchNamespace(example.name())
* .tags("free")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:WorkersForPlatformsNamespace
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: example-namespace
* customerWorker1:
* type: cloudflare:WorkersScript
* name: customer_worker_1
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: customer-worker-1
* content:
* fn::invoke:
* Function: std:file
* Arguments:
* input: script.js
* Return: result
* dispatchNamespace: ${example.name}
* tags:
* - free
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/workersForPlatformsNamespace:WorkersForPlatformsNamespace example /
* ```
* @property accountId The account identifier to target for the resource.
* @property name The name of the Workers for Platforms namespace.
*/
public data class WorkersForPlatformsNamespaceArgs(
public val accountId: Output? = null,
public val name: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.WorkersForPlatformsNamespaceArgs =
com.pulumi.cloudflare.WorkersForPlatformsNamespaceArgs.builder()
.accountId(accountId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkersForPlatformsNamespaceArgs].
*/
@PulumiTagMarker
public class WorkersForPlatformsNamespaceArgsBuilder internal constructor() {
private var accountId: Output? = null
private var name: Output? = null
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("rurlrqvrlhjswmek")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value The name of the Workers for Platforms namespace.
*/
@JvmName("amgcpjdrcwrrgmrs")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("nnyuwdsnegalomkd")
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 Workers for Platforms namespace.
*/
@JvmName("pfsrfpstphvyyomv")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
internal fun build(): WorkersForPlatformsNamespaceArgs = WorkersForPlatformsNamespaceArgs(
accountId = accountId,
name = name,
)
}