com.pulumi.cloudflare.kotlin.ZeroTrustDnsLocation.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.kotlin.outputs.ZeroTrustDnsLocationNetwork
import com.pulumi.cloudflare.kotlin.outputs.ZeroTrustDnsLocationNetwork.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
import kotlin.collections.List
/**
* Builder for [ZeroTrustDnsLocation].
*/
@PulumiTagMarker
public class ZeroTrustDnsLocationResourceBuilder internal constructor() {
public var name: String? = null
public var args: ZeroTrustDnsLocationArgs = ZeroTrustDnsLocationArgs()
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 ZeroTrustDnsLocationArgsBuilder.() -> Unit) {
val builder = ZeroTrustDnsLocationArgsBuilder()
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(): ZeroTrustDnsLocation {
val builtJavaResource = com.pulumi.cloudflare.ZeroTrustDnsLocation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ZeroTrustDnsLocation(builtJavaResource)
}
}
/**
* Provides a Cloudflare Teams Location resource. Teams Locations are
* referenced when creating secure web gateway policies.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const example = new cloudflare.ZeroTrustDnsLocation("example", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "office",
* clientDefault: true,
* ecsSupport: false,
* networks: [
* {
* network: "203.0.113.1/32",
* },
* {
* network: "203.0.113.2/32",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* example = cloudflare.ZeroTrustDnsLocation("example",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="office",
* client_default=True,
* ecs_support=False,
* networks=[
* {
* "network": "203.0.113.1/32",
* },
* {
* "network": "203.0.113.2/32",
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var example = new Cloudflare.ZeroTrustDnsLocation("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "office",
* ClientDefault = true,
* EcsSupport = false,
* Networks = new[]
* {
* new Cloudflare.Inputs.ZeroTrustDnsLocationNetworkArgs
* {
* Network = "203.0.113.1/32",
* },
* new Cloudflare.Inputs.ZeroTrustDnsLocationNetworkArgs
* {
* Network = "203.0.113.2/32",
* },
* },
* });
* });
* ```
* ```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.NewZeroTrustDnsLocation(ctx, "example", &cloudflare.ZeroTrustDnsLocationArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("office"),
* ClientDefault: pulumi.Bool(true),
* EcsSupport: pulumi.Bool(false),
* Networks: cloudflare.ZeroTrustDnsLocationNetworkArray{
* &cloudflare.ZeroTrustDnsLocationNetworkArgs{
* Network: pulumi.String("203.0.113.1/32"),
* },
* &cloudflare.ZeroTrustDnsLocationNetworkArgs{
* Network: pulumi.String("203.0.113.2/32"),
* },
* },
* })
* 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.ZeroTrustDnsLocation;
* import com.pulumi.cloudflare.ZeroTrustDnsLocationArgs;
* import com.pulumi.cloudflare.inputs.ZeroTrustDnsLocationNetworkArgs;
* 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 ZeroTrustDnsLocation("example", ZeroTrustDnsLocationArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("office")
* .clientDefault(true)
* .ecsSupport(false)
* .networks(
* ZeroTrustDnsLocationNetworkArgs.builder()
* .network("203.0.113.1/32")
* .build(),
* ZeroTrustDnsLocationNetworkArgs.builder()
* .network("203.0.113.2/32")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:ZeroTrustDnsLocation
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: office
* clientDefault: true
* ecsSupport: false
* networks:
* - network: 203.0.113.1/32
* - network: 203.0.113.2/32
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/zeroTrustDnsLocation:ZeroTrustDnsLocation example /
* ```
*/
public class ZeroTrustDnsLocation internal constructor(
override val javaResource: com.pulumi.cloudflare.ZeroTrustDnsLocation,
) : KotlinCustomResource(javaResource, ZeroTrustDnsLocationMapper) {
/**
* The account identifier to target for the resource.
*/
public val accountId: Output
get() = javaResource.accountId().applyValue({ args0 -> args0 })
/**
* Indicator that anonymized logs are enabled.
*/
public val anonymizedLogsEnabled: Output
get() = javaResource.anonymizedLogsEnabled().applyValue({ args0 -> args0 })
/**
* Indicator that this is the default location.
*/
public val clientDefault: Output?
get() = javaResource.clientDefault().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The FQDN that DoH clients should be pointed at.
*/
public val dohSubdomain: Output
get() = javaResource.dohSubdomain().applyValue({ args0 -> args0 })
/**
* Indicator that this location needs to resolve EDNS queries.
*/
public val ecsSupport: Output?
get() = javaResource.ecsSupport().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Client IP address.
*/
public val ip: Output
get() = javaResource.ip().applyValue({ args0 -> args0 })
/**
* IP to direct all IPv4 DNS queries to.
*/
public val ipv4Destination: Output
get() = javaResource.ipv4Destination().applyValue({ args0 -> args0 })
/**
* Name of the teams location.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The networks CIDRs that comprise the location.
*/
public val networks: Output>?
get() = javaResource.networks().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
public val policyIds: Output>
get() = javaResource.policyIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}
public object ZeroTrustDnsLocationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.ZeroTrustDnsLocation::class == javaResource::class
override fun map(javaResource: Resource): ZeroTrustDnsLocation = ZeroTrustDnsLocation(
javaResource
as com.pulumi.cloudflare.ZeroTrustDnsLocation,
)
}
/**
* @see [ZeroTrustDnsLocation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ZeroTrustDnsLocation].
*/
public suspend fun zeroTrustDnsLocation(
name: String,
block: suspend ZeroTrustDnsLocationResourceBuilder.() -> Unit,
): ZeroTrustDnsLocation {
val builder = ZeroTrustDnsLocationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ZeroTrustDnsLocation].
* @param name The _unique_ name of the resulting resource.
*/
public fun zeroTrustDnsLocation(name: String): ZeroTrustDnsLocation {
val builder = ZeroTrustDnsLocationResourceBuilder()
builder.name(name)
return builder.build()
}