com.pulumi.cloudflare.kotlin.ZeroTrustDexTest.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.kotlin.outputs.ZeroTrustDexTestData
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustDexTestData.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [ZeroTrustDexTest].
*/
@PulumiTagMarker
public class ZeroTrustDexTestResourceBuilder internal constructor() {
public var name: String? = null
public var args: ZeroTrustDexTestArgs = ZeroTrustDexTestArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend ZeroTrustDexTestArgsBuilder.() -> Unit) {
val builder = ZeroTrustDexTestArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): ZeroTrustDexTest {
val builtJavaResource = com.pulumi.cloudflare.ZeroTrustDexTest(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ZeroTrustDexTest(builtJavaResource)
}
}
/**
* Provides a Cloudflare Device Dex Test resource. Device Dex Tests allow for building location-aware device settings policies.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const example = new cloudflare.ZeroTrustDexTest("example", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "GET homepage",
* description: "Send a HTTP GET request to the home endpoint every half hour.",
* interval: "0h30m0s",
* enabled: true,
* data: {
* host: "https://example.com/home",
* kind: "http",
* method: "GET",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* example = cloudflare.ZeroTrustDexTest("example",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="GET homepage",
* description="Send a HTTP GET request to the home endpoint every half hour.",
* interval="0h30m0s",
* enabled=True,
* data={
* "host": "https://example.com/home",
* "kind": "http",
* "method": "GET",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var example = new Cloudflare.ZeroTrustDexTest("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "GET homepage",
* Description = "Send a HTTP GET request to the home endpoint every half hour.",
* Interval = "0h30m0s",
* Enabled = true,
* Data = new Cloudflare.Inputs.ZeroTrustDexTestDataArgs
* {
* Host = "https://example.com/home",
* Kind = "http",
* Method = "GET",
* },
* });
* });
* ```
* ```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.NewZeroTrustDexTest(ctx, "example", &cloudflare.ZeroTrustDexTestArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("GET homepage"),
* Description: pulumi.String("Send a HTTP GET request to the home endpoint every half hour."),
* Interval: pulumi.String("0h30m0s"),
* Enabled: pulumi.Bool(true),
* Data: &cloudflare.ZeroTrustDexTestDataArgs{
* Host: pulumi.String("https://example.com/home"),
* Kind: pulumi.String("http"),
* Method: pulumi.String("GET"),
* },
* })
* 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.ZeroTrustDexTest;
* import com.pulumi.cloudflare.ZeroTrustDexTestArgs;
* import com.pulumi.cloudflare.inputs.ZeroTrustDexTestDataArgs;
* 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 ZeroTrustDexTest("example", ZeroTrustDexTestArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("GET homepage")
* .description("Send a HTTP GET request to the home endpoint every half hour.")
* .interval("0h30m0s")
* .enabled(true)
* .data(ZeroTrustDexTestDataArgs.builder()
* .host("https://example.com/home")
* .kind("http")
* .method("GET")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:ZeroTrustDexTest
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: GET homepage
* description: Send a HTTP GET request to the home endpoint every half hour.
* interval: 0h30m0s
* enabled: true
* data:
* host: https://example.com/home
* kind: http
* method: GET
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/zeroTrustDexTest:ZeroTrustDexTest example /
* ```
*/
public class ZeroTrustDexTest internal constructor(
override val javaResource: com.pulumi.cloudflare.ZeroTrustDexTest,
) : KotlinCustomResource(javaResource, ZeroTrustDexTestMapper) {
/**
* The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
public val accountId: Output
get() = javaResource.accountId().applyValue({ args0 -> args0 })
/**
* Timestamp of when the Dex Test was created.
*/
public val created: Output
get() = javaResource.created().applyValue({ args0 -> args0 })
/**
* The configuration object which contains the details for the WARP client to conduct the test.
*/
public val `data`: Output
get() = javaResource.`data`().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
/**
* Additional details about the test.
*/
public val description: Output
get() = javaResource.description().applyValue({ args0 -> args0 })
/**
* Determines whether or not the test is active.
*/
public val enabled: Output
get() = javaResource.enabled().applyValue({ args0 -> args0 })
/**
* How often the test will run.
*/
public val interval: Output
get() = javaResource.interval().applyValue({ args0 -> args0 })
/**
* The name of the Device Dex Test. Must be unique.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Timestamp of when the Dex Test was last updated.
*/
public val updated: Output
get() = javaResource.updated().applyValue({ args0 -> args0 })
}
public object ZeroTrustDexTestMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.ZeroTrustDexTest::class == javaResource::class
override fun map(javaResource: Resource): ZeroTrustDexTest = ZeroTrustDexTest(
javaResource as
com.pulumi.cloudflare.ZeroTrustDexTest,
)
}
/**
* @see [ZeroTrustDexTest].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ZeroTrustDexTest].
*/
public suspend fun zeroTrustDexTest(
name: String,
block: suspend ZeroTrustDexTestResourceBuilder.() -> Unit,
): ZeroTrustDexTest {
val builder = ZeroTrustDexTestResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ZeroTrustDexTest].
* @param name The _unique_ name of the resulting resource.
*/
public fun zeroTrustDexTest(name: String): ZeroTrustDexTest {
val builder = ZeroTrustDexTestResourceBuilder()
builder.name(name)
return builder.build()
}