com.pulumi.cloudflare.kotlin.CloudConnectorRules.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.CloudConnectorRulesRule
import com.pulumi.cloudflare.kotlin.outputs.CloudConnectorRulesRule.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 [CloudConnectorRules].
*/
@PulumiTagMarker
public class CloudConnectorRulesResourceBuilder internal constructor() {
public var name: String? = null
public var args: CloudConnectorRulesArgs = CloudConnectorRulesArgs()
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 CloudConnectorRulesArgsBuilder.() -> Unit) {
val builder = CloudConnectorRulesArgsBuilder()
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(): CloudConnectorRules {
val builtJavaResource = com.pulumi.cloudflare.CloudConnectorRules(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return CloudConnectorRules(builtJavaResource)
}
}
/**
* The Cloud Connector Rules resource allows you to create and manage cloud connector rules for a zone.
* ## Example Usage
*
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.cloudflare.CloudConnectorRules;
* import com.pulumi.cloudflare.CloudConnectorRulesArgs;
* import com.pulumi.cloudflare.inputs.CloudConnectorRulesRuleArgs;
* 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 CloudConnectorRules("example", CloudConnectorRulesArgs.builder()
* .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
* .rules(CloudConnectorRulesRuleArgs.builder()
* .description("connect aws bucket")
* .enabled(true)
* .expression("http.uri")
* .provider("aws_s3")
* .parameters(CloudConnectorRulesRuleParametersArgs.builder()
* .host("mystorage.s3.ams.amazonaws.com")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:CloudConnectorRules
* properties:
* zoneId: 0da42c8d2132a9ddaf714f9e7c920711
* rules:
* - description: connect aws bucket
* enabled: true
* expression: http.uri
* provider: aws_s3
* parameters:
* - host: mystorage.s3.ams.amazonaws.com
* ```
*
*/
public class CloudConnectorRules internal constructor(
override val javaResource: com.pulumi.cloudflare.CloudConnectorRules,
) : KotlinCustomResource(javaResource, CloudConnectorRulesMapper) {
/**
* List of Cloud Connector Rules
*/
public val rules: Output>?
get() = javaResource.rules().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The zone identifier to target for the resource.
*/
public val zoneId: Output
get() = javaResource.zoneId().applyValue({ args0 -> args0 })
}
public object CloudConnectorRulesMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.CloudConnectorRules::class == javaResource::class
override fun map(javaResource: Resource): CloudConnectorRules = CloudConnectorRules(
javaResource
as com.pulumi.cloudflare.CloudConnectorRules,
)
}
/**
* @see [CloudConnectorRules].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [CloudConnectorRules].
*/
public suspend fun cloudConnectorRules(
name: String,
block: suspend CloudConnectorRulesResourceBuilder.() -> Unit,
): CloudConnectorRules {
val builder = CloudConnectorRulesResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [CloudConnectorRules].
* @param name The _unique_ name of the resulting resource.
*/
public fun cloudConnectorRules(name: String): CloudConnectorRules {
val builder = CloudConnectorRulesResourceBuilder()
builder.name(name)
return builder.build()
}