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

com.pulumi.aws.ec2.kotlin.inputs.SecurityGroupEgressArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.ec2.kotlin.inputs

import com.pulumi.aws.ec2.inputs.SecurityGroupEgressArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property cidrBlocks List of CIDR blocks.
 * @property description Description of this egress rule.
 * @property fromPort Start port (or ICMP type number if protocol is `icmp`)
 * @property ipv6CidrBlocks List of IPv6 CIDR blocks.
 * @property prefixListIds List of Prefix List IDs.
 * @property protocol Protocol. If you select a protocol of `-1` (semantically equivalent to `all`, which is not a valid value here), you must specify a `from_port` and `to_port` equal to 0. The supported values are defined in the `IpProtocol` argument in the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
 * @property securityGroups List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
 * @property self Whether the security group itself will be added as a source to this egress rule.
 * @property toPort End range port (or ICMP code if protocol is `icmp`).
 * The following arguments are optional:
 * > **Note** Although `cidr_blocks`, `ipv6_cidr_blocks`, `prefix_list_ids`, and `security_groups` are all marked as optional, you _must_ provide one of them in order to configure the destination of the traffic.
 */
public data class SecurityGroupEgressArgs(
    public val cidrBlocks: Output>? = null,
    public val description: Output? = null,
    public val fromPort: Output,
    public val ipv6CidrBlocks: Output>? = null,
    public val prefixListIds: Output>? = null,
    public val protocol: Output,
    public val securityGroups: Output>? = null,
    public val self: Output? = null,
    public val toPort: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.ec2.inputs.SecurityGroupEgressArgs =
        com.pulumi.aws.ec2.inputs.SecurityGroupEgressArgs.builder()
            .cidrBlocks(cidrBlocks?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .fromPort(fromPort.applyValue({ args0 -> args0 }))
            .ipv6CidrBlocks(ipv6CidrBlocks?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .prefixListIds(prefixListIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .protocol(protocol.applyValue({ args0 -> args0 }))
            .securityGroups(securityGroups?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .self(self?.applyValue({ args0 -> args0 }))
            .toPort(toPort.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SecurityGroupEgressArgs].
 */
@PulumiTagMarker
public class SecurityGroupEgressArgsBuilder internal constructor() {
    private var cidrBlocks: Output>? = null

    private var description: Output? = null

    private var fromPort: Output? = null

    private var ipv6CidrBlocks: Output>? = null

    private var prefixListIds: Output>? = null

    private var protocol: Output? = null

    private var securityGroups: Output>? = null

    private var self: Output? = null

    private var toPort: Output? = null

    /**
     * @param value List of CIDR blocks.
     */
    @JvmName("eepkbgumrchgecki")
    public suspend fun cidrBlocks(`value`: Output>) {
        this.cidrBlocks = value
    }

    @JvmName("focnawcoyatksocr")
    public suspend fun cidrBlocks(vararg values: Output) {
        this.cidrBlocks = Output.all(values.asList())
    }

    /**
     * @param values List of CIDR blocks.
     */
    @JvmName("cnnlbgwaffpwplpi")
    public suspend fun cidrBlocks(values: List>) {
        this.cidrBlocks = Output.all(values)
    }

    /**
     * @param value Description of this egress rule.
     */
    @JvmName("mmxohubsyipvwpti")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Start port (or ICMP type number if protocol is `icmp`)
     */
    @JvmName("qqnflivtpfmyhuum")
    public suspend fun fromPort(`value`: Output) {
        this.fromPort = value
    }

    /**
     * @param value List of IPv6 CIDR blocks.
     */
    @JvmName("bxpdrsksnyvnjgjl")
    public suspend fun ipv6CidrBlocks(`value`: Output>) {
        this.ipv6CidrBlocks = value
    }

    @JvmName("npixoikqxpsbkkpb")
    public suspend fun ipv6CidrBlocks(vararg values: Output) {
        this.ipv6CidrBlocks = Output.all(values.asList())
    }

    /**
     * @param values List of IPv6 CIDR blocks.
     */
    @JvmName("mcflityvayxtwcjb")
    public suspend fun ipv6CidrBlocks(values: List>) {
        this.ipv6CidrBlocks = Output.all(values)
    }

    /**
     * @param value List of Prefix List IDs.
     */
    @JvmName("oualpmovpdblcrpj")
    public suspend fun prefixListIds(`value`: Output>) {
        this.prefixListIds = value
    }

    @JvmName("rthujkdnncymyhnh")
    public suspend fun prefixListIds(vararg values: Output) {
        this.prefixListIds = Output.all(values.asList())
    }

    /**
     * @param values List of Prefix List IDs.
     */
    @JvmName("dlwtlnnkkneyrmvp")
    public suspend fun prefixListIds(values: List>) {
        this.prefixListIds = Output.all(values)
    }

    /**
     * @param value Protocol. If you select a protocol of `-1` (semantically equivalent to `all`, which is not a valid value here), you must specify a `from_port` and `to_port` equal to 0. The supported values are defined in the `IpProtocol` argument in the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
     */
    @JvmName("ajhlpxdunxvguobc")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
     */
    @JvmName("lbomelqgkelnsvuk")
    public suspend fun securityGroups(`value`: Output>) {
        this.securityGroups = value
    }

    @JvmName("lysmtdkvvcmbstsv")
    public suspend fun securityGroups(vararg values: Output) {
        this.securityGroups = Output.all(values.asList())
    }

    /**
     * @param values List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
     */
    @JvmName("vxxbpcunxhisllft")
    public suspend fun securityGroups(values: List>) {
        this.securityGroups = Output.all(values)
    }

    /**
     * @param value Whether the security group itself will be added as a source to this egress rule.
     */
    @JvmName("uoqrtfdchigradog")
    public suspend fun self(`value`: Output) {
        this.self = value
    }

    /**
     * @param value End range port (or ICMP code if protocol is `icmp`).
     * The following arguments are optional:
     * > **Note** Although `cidr_blocks`, `ipv6_cidr_blocks`, `prefix_list_ids`, and `security_groups` are all marked as optional, you _must_ provide one of them in order to configure the destination of the traffic.
     */
    @JvmName("juaejwjeuxowcgxd")
    public suspend fun toPort(`value`: Output) {
        this.toPort = value
    }

    /**
     * @param value List of CIDR blocks.
     */
    @JvmName("vdfuxifjrfcievrm")
    public suspend fun cidrBlocks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cidrBlocks = mapped
    }

    /**
     * @param values List of CIDR blocks.
     */
    @JvmName("kjclkbaymnrdrfuy")
    public suspend fun cidrBlocks(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.cidrBlocks = mapped
    }

    /**
     * @param value Description of this egress rule.
     */
    @JvmName("vyfbrtymopmttrig")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Start port (or ICMP type number if protocol is `icmp`)
     */
    @JvmName("ulvpflnxyniiaila")
    public suspend fun fromPort(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.fromPort = mapped
    }

    /**
     * @param value List of IPv6 CIDR blocks.
     */
    @JvmName("twwypkjypylrrjxx")
    public suspend fun ipv6CidrBlocks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipv6CidrBlocks = mapped
    }

    /**
     * @param values List of IPv6 CIDR blocks.
     */
    @JvmName("bcyiunullyhmbhjv")
    public suspend fun ipv6CidrBlocks(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ipv6CidrBlocks = mapped
    }

    /**
     * @param value List of Prefix List IDs.
     */
    @JvmName("qmpmyepgmatrmysg")
    public suspend fun prefixListIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.prefixListIds = mapped
    }

    /**
     * @param values List of Prefix List IDs.
     */
    @JvmName("ejgsakkbpeuyosug")
    public suspend fun prefixListIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.prefixListIds = mapped
    }

    /**
     * @param value Protocol. If you select a protocol of `-1` (semantically equivalent to `all`, which is not a valid value here), you must specify a `from_port` and `to_port` equal to 0. The supported values are defined in the `IpProtocol` argument in the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
     */
    @JvmName("dqmrriovjtomaemx")
    public suspend fun protocol(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
     */
    @JvmName("qkpljpvpbfenwlfx")
    public suspend fun securityGroups(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.securityGroups = mapped
    }

    /**
     * @param values List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
     */
    @JvmName("pildqjjcnugjjefo")
    public suspend fun securityGroups(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.securityGroups = mapped
    }

    /**
     * @param value Whether the security group itself will be added as a source to this egress rule.
     */
    @JvmName("wrjybaxigpvbwfku")
    public suspend fun self(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.self = mapped
    }

    /**
     * @param value End range port (or ICMP code if protocol is `icmp`).
     * The following arguments are optional:
     * > **Note** Although `cidr_blocks`, `ipv6_cidr_blocks`, `prefix_list_ids`, and `security_groups` are all marked as optional, you _must_ provide one of them in order to configure the destination of the traffic.
     */
    @JvmName("hyjvhdqqxdfnskcc")
    public suspend fun toPort(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.toPort = mapped
    }

    internal fun build(): SecurityGroupEgressArgs = SecurityGroupEgressArgs(
        cidrBlocks = cidrBlocks,
        description = description,
        fromPort = fromPort ?: throw PulumiNullFieldException("fromPort"),
        ipv6CidrBlocks = ipv6CidrBlocks,
        prefixListIds = prefixListIds,
        protocol = protocol ?: throw PulumiNullFieldException("protocol"),
        securityGroups = securityGroups,
        self = self,
        toPort = toPort ?: throw PulumiNullFieldException("toPort"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy