com.pulumi.cloudflare.kotlin.TeamsLocation.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.TeamsLocationNetwork
import com.pulumi.cloudflare.kotlin.outputs.TeamsLocationNetwork.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 [TeamsLocation].
*/
@PulumiTagMarker
public class TeamsLocationResourceBuilder internal constructor() {
public var name: String? = null
public var args: TeamsLocationArgs = TeamsLocationArgs()
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 TeamsLocationArgsBuilder.() -> Unit) {
val builder = TeamsLocationArgsBuilder()
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(): TeamsLocation {
val builtJavaResource = com.pulumi.cloudflare.TeamsLocation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return TeamsLocation(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.TeamsLocation("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.TeamsLocation("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.TeamsLocation("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "office",
* ClientDefault = true,
* EcsSupport = false,
* Networks = new[]
* {
* new Cloudflare.Inputs.TeamsLocationNetworkArgs
* {
* Network = "203.0.113.1/32",
* },
* new Cloudflare.Inputs.TeamsLocationNetworkArgs
* {
* 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.NewTeamsLocation(ctx, "example", &cloudflare.TeamsLocationArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("office"),
* ClientDefault: pulumi.Bool(true),
* EcsSupport: pulumi.Bool(false),
* Networks: cloudflare.TeamsLocationNetworkArray{
* &cloudflare.TeamsLocationNetworkArgs{
* Network: pulumi.String("203.0.113.1/32"),
* },
* &cloudflare.TeamsLocationNetworkArgs{
* 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.TeamsLocation;
* import com.pulumi.cloudflare.TeamsLocationArgs;
* import com.pulumi.cloudflare.inputs.TeamsLocationNetworkArgs;
* 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 TeamsLocation("example", TeamsLocationArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("office")
* .clientDefault(true)
* .ecsSupport(false)
* .networks(
* TeamsLocationNetworkArgs.builder()
* .network("203.0.113.1/32")
* .build(),
* TeamsLocationNetworkArgs.builder()
* .network("203.0.113.2/32")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:TeamsLocation
* 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/teamsLocation:TeamsLocation example /
* ```
*/
public class TeamsLocation internal constructor(
override val javaResource: com.pulumi.cloudflare.TeamsLocation,
) : KotlinCustomResource(javaResource, TeamsLocationMapper) {
/**
* 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 TeamsLocationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.TeamsLocation::class == javaResource::class
override fun map(javaResource: Resource): TeamsLocation = TeamsLocation(
javaResource as
com.pulumi.cloudflare.TeamsLocation,
)
}
/**
* @see [TeamsLocation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [TeamsLocation].
*/
public suspend fun teamsLocation(
name: String,
block: suspend TeamsLocationResourceBuilder.() -> Unit,
): TeamsLocation {
val builder = TeamsLocationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [TeamsLocation].
* @param name The _unique_ name of the resulting resource.
*/
public fun teamsLocation(name: String): TeamsLocation {
val builder = TeamsLocationResourceBuilder()
builder.name(name)
return builder.build()
}