All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.networkfirewall.kotlin.RuleGroup.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.networkfirewall.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.networkfirewall.kotlin.enums.RuleGroupTypeEnum
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.networkfirewall.kotlin.enums.RuleGroupTypeEnum.Companion.toKotlin as ruleGroupTypeEnumToKotlin
import com.pulumi.awsnative.networkfirewall.kotlin.outputs.RuleGroup.Companion.toKotlin as ruleGroupToKotlin

/**
 * Builder for [RuleGroup].
 */
@PulumiTagMarker
public class RuleGroupResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: RuleGroupArgs = RuleGroupArgs()

    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 RuleGroupArgsBuilder.() -> Unit) {
        val builder = RuleGroupArgsBuilder()
        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(): RuleGroup {
        val builtJavaResource = com.pulumi.awsnative.networkfirewall.RuleGroup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return RuleGroup(builtJavaResource)
    }
}

/**
 * Resource type definition for AWS::NetworkFirewall::RuleGroup
 */
public class RuleGroup internal constructor(
    override val javaResource: com.pulumi.awsnative.networkfirewall.RuleGroup,
) : KotlinCustomResource(javaResource, RuleGroupMapper) {
    /**
     * The maximum operating resources that this rule group can use. You can't change a rule group's capacity setting after you create the rule group. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.
     */
    public val capacity: Output
        get() = javaResource.capacity().applyValue({ args0 -> args0 })

    /**
     * A description of the rule group.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * An object that defines the rule group rules.
     */
    public val ruleGroup: Output?
        get() = javaResource.ruleGroup().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    ruleGroupToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the `RuleGroup` .
     */
    public val ruleGroupArn: Output
        get() = javaResource.ruleGroupArn().applyValue({ args0 -> args0 })

    /**
     * The unique ID of the `RuleGroup` resource.
     */
    public val ruleGroupId: Output
        get() = javaResource.ruleGroupId().applyValue({ args0 -> args0 })

    /**
     * The descriptive name of the rule group. You can't change the name of a rule group after you create it.
     */
    public val ruleGroupName: Output
        get() = javaResource.ruleGroupName().applyValue({ args0 -> args0 })

    /**
     * An array of key-value pairs to apply to this resource.
     * For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains
     * stateless rules. If it is stateful, it contains stateful rules.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 ->
            args0.let({ args0 ->
                ruleGroupTypeEnumToKotlin(args0)
            })
        })
}

public object RuleGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.networkfirewall.RuleGroup::class == javaResource::class

    override fun map(javaResource: Resource): RuleGroup = RuleGroup(
        javaResource as
            com.pulumi.awsnative.networkfirewall.RuleGroup,
    )
}

/**
 * @see [RuleGroup].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [RuleGroup].
 */
public suspend fun ruleGroup(name: String, block: suspend RuleGroupResourceBuilder.() -> Unit): RuleGroup {
    val builder = RuleGroupResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [RuleGroup].
 * @param name The _unique_ name of the resulting resource.
 */
public fun ruleGroup(name: String): RuleGroup {
    val builder = RuleGroupResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy