![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.vpclattice.kotlin.Rule.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.vpclattice.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.vpclattice.kotlin.outputs.RuleAction
import com.pulumi.awsnative.vpclattice.kotlin.outputs.RuleMatch
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.outputs.RuleAction.Companion.toKotlin as ruleActionToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.outputs.RuleMatch.Companion.toKotlin as ruleMatchToKotlin
/**
* Builder for [Rule].
*/
@PulumiTagMarker
public class RuleResourceBuilder internal constructor() {
public var name: String? = null
public var args: RuleArgs = RuleArgs()
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 RuleArgsBuilder.() -> Unit) {
val builder = RuleArgsBuilder()
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(): Rule {
val builtJavaResource = com.pulumi.awsnative.vpclattice.Rule(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Rule(builtJavaResource)
}
}
/**
* Creates a listener rule. Each listener has a default rule for checking connection requests, but you can define additional rules. Each rule consists of a priority, one or more actions, and one or more conditions.
*/
public class Rule internal constructor(
override val javaResource: com.pulumi.awsnative.vpclattice.Rule,
) : KotlinCustomResource(javaResource, RuleMapper) {
/**
* Describes the action for a rule.
*/
public val action: Output
get() = javaResource.action().applyValue({ args0 ->
args0.let({ args0 ->
ruleActionToKotlin(args0)
})
})
/**
* The Amazon Resource Name (ARN) of the rule.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The ID of the listener.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The ID or Amazon Resource Name (ARN) of the listener.
*/
public val listenerIdentifier: Output?
get() = javaResource.listenerIdentifier().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The rule match.
*/
public val match: Output
get() = javaResource.match().applyValue({ args0 ->
args0.let({ args0 ->
ruleMatchToKotlin(args0)
})
})
/**
* The name of the rule. The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
* If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.
*/
public val name: Output?
get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
*/
public val priority: Output
get() = javaResource.priority().applyValue({ args0 -> args0 })
/**
* The ID or Amazon Resource Name (ARN) of the service.
*/
public val serviceIdentifier: Output?
get() = javaResource.serviceIdentifier().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The tags for the rule.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object RuleMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.vpclattice.Rule::class == javaResource::class
override fun map(javaResource: Resource): Rule = Rule(
javaResource as
com.pulumi.awsnative.vpclattice.Rule,
)
}
/**
* @see [Rule].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Rule].
*/
public suspend fun rule(name: String, block: suspend RuleResourceBuilder.() -> Unit): Rule {
val builder = RuleResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Rule].
* @param name The _unique_ name of the resulting resource.
*/
public fun rule(name: String): Rule {
val builder = RuleResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy