com.pulumi.awsnative.iot.kotlin.TopicRule.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.iot.kotlin
import com.pulumi.awsnative.iot.kotlin.outputs.TopicRulePayload
import com.pulumi.awsnative.kotlin.outputs.Tag
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
import com.pulumi.awsnative.iot.kotlin.outputs.TopicRulePayload.Companion.toKotlin as topicRulePayloadToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [TopicRule].
*/
@PulumiTagMarker
public class TopicRuleResourceBuilder internal constructor() {
public var name: String? = null
public var args: TopicRuleArgs = TopicRuleArgs()
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 TopicRuleArgsBuilder.() -> Unit) {
val builder = TopicRuleArgsBuilder()
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(): TopicRule {
val builtJavaResource = com.pulumi.awsnative.iot.TopicRule(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return TopicRule(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::IoT::TopicRule
*/
public class TopicRule internal constructor(
override val javaResource: com.pulumi.awsnative.iot.TopicRule,
) : KotlinCustomResource(javaResource, TopicRuleMapper) {
/**
* The Amazon Resource Name (ARN) of the AWS IoT rule, such as `arn:aws:iot:us-east-2:123456789012:rule/MyIoTRule` .
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The name of the rule.
* *Pattern* : `^[a-zA-Z0-9_]+$`
*/
public val ruleName: Output?
get() = javaResource.ruleName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Metadata which can be used to manage the topic rule.
* > For URI Request parameters use format: ...key1=value1&key2=value2...
* >
* > For the CLI command-line parameter use format: --tags "key1=value1&key2=value2..."
* >
* > For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The rule payload.
*/
public val topicRulePayload: Output
get() = javaResource.topicRulePayload().applyValue({ args0 ->
args0.let({ args0 ->
topicRulePayloadToKotlin(args0)
})
})
}
public object TopicRuleMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.iot.TopicRule::class == javaResource::class
override fun map(javaResource: Resource): TopicRule = TopicRule(
javaResource as
com.pulumi.awsnative.iot.TopicRule,
)
}
/**
* @see [TopicRule].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [TopicRule].
*/
public suspend fun topicRule(name: String, block: suspend TopicRuleResourceBuilder.() -> Unit): TopicRule {
val builder = TopicRuleResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [TopicRule].
* @param name The _unique_ name of the resulting resource.
*/
public fun topicRule(name: String): TopicRule {
val builder = TopicRuleResourceBuilder()
builder.name(name)
return builder.build()
}