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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.networkfirewall.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.networkfirewall.kotlin.outputs.FirewallSubnetMapping
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.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.networkfirewall.kotlin.outputs.FirewallSubnetMapping.Companion.toKotlin as firewallSubnetMappingToKotlin

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

    public var args: FirewallArgs = FirewallArgs()

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

/**
 * Resource type definition for AWS::NetworkFirewall::Firewall
 */
public class Firewall internal constructor(
    override val javaResource: com.pulumi.awsnative.networkfirewall.Firewall,
) : KotlinCustomResource(javaResource, FirewallMapper) {
    /**
     * A flag indicating whether it is possible to delete the firewall. A setting of `TRUE` indicates that the firewall is protected against deletion. Use this setting to protect against accidentally deleting a firewall that is in use. When you create a firewall, the operation initializes this flag to `TRUE` .
     */
    public val deleteProtection: Output?
        get() = javaResource.deleteProtection().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The unique IDs of the firewall endpoints for all of the subnets that you attached to the firewall. The subnets are not listed in any particular order. For example: `["us-west-2c:vpce-111122223333", "us-west-2a:vpce-987654321098", "us-west-2b:vpce-012345678901"]` .
     */
    public val endpointIds: Output>
        get() = javaResource.endpointIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

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

    /**
     * The name of the `Firewall` resource.
     */
    public val firewallId: Output
        get() = javaResource.firewallId().applyValue({ args0 -> args0 })

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

    /**
     * The Amazon Resource Name (ARN) of the firewall policy.
     * The relationship of firewall to firewall policy is many to one. Each firewall requires one firewall policy association, and you can use the same firewall policy for multiple firewalls.
     */
    public val firewallPolicyArn: Output
        get() = javaResource.firewallPolicyArn().applyValue({ args0 -> args0 })

    /**
     * A setting indicating whether the firewall is protected against a change to the firewall policy association. Use this setting to protect against accidentally modifying the firewall policy for a firewall that is in use. When you create a firewall, the operation initializes this setting to `TRUE` .
     */
    public val firewallPolicyChangeProtection: Output?
        get() = javaResource.firewallPolicyChangeProtection().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A setting indicating whether the firewall is protected against changes to the subnet associations. Use this setting to protect against accidentally modifying the subnet associations for a firewall that is in use. When you create a firewall, the operation initializes this setting to `TRUE` .
     */
    public val subnetChangeProtection: Output?
        get() = javaResource.subnetChangeProtection().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The public subnets that Network Firewall is using for the firewall. Each subnet must belong to a different Availability Zone.
     */
    public val subnetMappings: Output>
        get() = javaResource.subnetMappings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> firewallSubnetMappingToKotlin(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)
        })

    /**
     * The unique identifier of the VPC where the firewall is in use. You can't change the VPC of a firewall after you create the firewall.
     */
    public val vpcId: Output
        get() = javaResource.vpcId().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy