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

com.pulumi.awsnative.ec2.kotlin.SecurityGroupIngressArgs.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.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.SecurityGroupIngressArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::EC2::SecurityGroupIngress
 * @property cidrIp The IPv4 ranges
 * @property cidrIpv6 [VPC only] The IPv6 ranges
 * @property description Updates the description of an ingress (inbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously
 * @property fromPort The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
 * Use this for ICMP and any protocol that uses ports.
 * @property groupId The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
 * You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
 * @property groupName The name of the security group.
 * @property ipProtocol The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers).
 * [VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
 * @property sourcePrefixListId [EC2-VPC only] The ID of a prefix list.
 * @property sourceSecurityGroupId The ID of the security group. You must specify either the security group ID or the security group name. For security groups in a nondefault VPC, you must specify the security group ID.
 * @property sourceSecurityGroupName [EC2-Classic, default VPC] The name of the source security group.
 * You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
 * @property sourceSecurityGroupOwnerId [nondefault VPC] The AWS account ID that owns the source security group. You can't specify this property with an IP address range.
 * If you specify SourceSecurityGroupName or SourceSecurityGroupId and that security group is owned by a different account than the account creating the stack, you must specify the SourceSecurityGroupOwnerId; otherwise, this property is optional.
 * @property toPort The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. If you specify all ICMP/ICMPv6 types, you must specify all codes.
 * Use this for ICMP and any protocol that uses ports.
 */
public data class SecurityGroupIngressArgs(
    public val cidrIp: Output? = null,
    public val cidrIpv6: Output? = null,
    public val description: Output? = null,
    public val fromPort: Output? = null,
    public val groupId: Output? = null,
    public val groupName: Output? = null,
    public val ipProtocol: Output? = null,
    public val sourcePrefixListId: Output? = null,
    public val sourceSecurityGroupId: Output? = null,
    public val sourceSecurityGroupName: Output? = null,
    public val sourceSecurityGroupOwnerId: Output? = null,
    public val toPort: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.SecurityGroupIngressArgs =
        com.pulumi.awsnative.ec2.SecurityGroupIngressArgs.builder()
            .cidrIp(cidrIp?.applyValue({ args0 -> args0 }))
            .cidrIpv6(cidrIpv6?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .fromPort(fromPort?.applyValue({ args0 -> args0 }))
            .groupId(groupId?.applyValue({ args0 -> args0 }))
            .groupName(groupName?.applyValue({ args0 -> args0 }))
            .ipProtocol(ipProtocol?.applyValue({ args0 -> args0 }))
            .sourcePrefixListId(sourcePrefixListId?.applyValue({ args0 -> args0 }))
            .sourceSecurityGroupId(sourceSecurityGroupId?.applyValue({ args0 -> args0 }))
            .sourceSecurityGroupName(sourceSecurityGroupName?.applyValue({ args0 -> args0 }))
            .sourceSecurityGroupOwnerId(sourceSecurityGroupOwnerId?.applyValue({ args0 -> args0 }))
            .toPort(toPort?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SecurityGroupIngressArgs].
 */
@PulumiTagMarker
public class SecurityGroupIngressArgsBuilder internal constructor() {
    private var cidrIp: Output? = null

    private var cidrIpv6: Output? = null

    private var description: Output? = null

    private var fromPort: Output? = null

    private var groupId: Output? = null

    private var groupName: Output? = null

    private var ipProtocol: Output? = null

    private var sourcePrefixListId: Output? = null

    private var sourceSecurityGroupId: Output? = null

    private var sourceSecurityGroupName: Output? = null

    private var sourceSecurityGroupOwnerId: Output? = null

    private var toPort: Output? = null

    /**
     * @param value The IPv4 ranges
     */
    @JvmName("gqdxvqagjqwequtb")
    public suspend fun cidrIp(`value`: Output) {
        this.cidrIp = value
    }

    /**
     * @param value [VPC only] The IPv6 ranges
     */
    @JvmName("vuddecmhlbkkmagw")
    public suspend fun cidrIpv6(`value`: Output) {
        this.cidrIpv6 = value
    }

    /**
     * @param value Updates the description of an ingress (inbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously
     */
    @JvmName("psvvxecwtvtbpwri")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
     * Use this for ICMP and any protocol that uses ports.
     */
    @JvmName("ldvkbdwigovfaudd")
    public suspend fun fromPort(`value`: Output) {
        this.fromPort = value
    }

    /**
     * @param value The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
     * You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
     */
    @JvmName("lnxmsfbaauospdbs")
    public suspend fun groupId(`value`: Output) {
        this.groupId = value
    }

    /**
     * @param value The name of the security group.
     */
    @JvmName("dxryywoepywceqqm")
    public suspend fun groupName(`value`: Output) {
        this.groupName = value
    }

    /**
     * @param value The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers).
     * [VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
     */
    @JvmName("vlcfcysfflahqmda")
    public suspend fun ipProtocol(`value`: Output) {
        this.ipProtocol = value
    }

    /**
     * @param value [EC2-VPC only] The ID of a prefix list.
     */
    @JvmName("tqjxyhidebgayqqn")
    public suspend fun sourcePrefixListId(`value`: Output) {
        this.sourcePrefixListId = value
    }

    /**
     * @param value The ID of the security group. You must specify either the security group ID or the security group name. For security groups in a nondefault VPC, you must specify the security group ID.
     */
    @JvmName("tscihmnrjcckwdmb")
    public suspend fun sourceSecurityGroupId(`value`: Output) {
        this.sourceSecurityGroupId = value
    }

    /**
     * @param value [EC2-Classic, default VPC] The name of the source security group.
     * You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
     */
    @JvmName("aqebajimsqfmpbws")
    public suspend fun sourceSecurityGroupName(`value`: Output) {
        this.sourceSecurityGroupName = value
    }

    /**
     * @param value [nondefault VPC] The AWS account ID that owns the source security group. You can't specify this property with an IP address range.
     * If you specify SourceSecurityGroupName or SourceSecurityGroupId and that security group is owned by a different account than the account creating the stack, you must specify the SourceSecurityGroupOwnerId; otherwise, this property is optional.
     */
    @JvmName("ngaqytifarqfwrpg")
    public suspend fun sourceSecurityGroupOwnerId(`value`: Output) {
        this.sourceSecurityGroupOwnerId = value
    }

    /**
     * @param value The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. If you specify all ICMP/ICMPv6 types, you must specify all codes.
     * Use this for ICMP and any protocol that uses ports.
     */
    @JvmName("uqjlviparoisyjcj")
    public suspend fun toPort(`value`: Output) {
        this.toPort = value
    }

    /**
     * @param value The IPv4 ranges
     */
    @JvmName("aikbeytqualvnunf")
    public suspend fun cidrIp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cidrIp = mapped
    }

    /**
     * @param value [VPC only] The IPv6 ranges
     */
    @JvmName("acbrntqwxjrphmnu")
    public suspend fun cidrIpv6(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cidrIpv6 = mapped
    }

    /**
     * @param value Updates the description of an ingress (inbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously
     */
    @JvmName("ihtsrmpubfbtwqar")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
     * Use this for ICMP and any protocol that uses ports.
     */
    @JvmName("fxamfecmvltwdpyw")
    public suspend fun fromPort(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fromPort = mapped
    }

    /**
     * @param value The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
     * You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
     */
    @JvmName("srnxigldkcgwriuw")
    public suspend fun groupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.groupId = mapped
    }

    /**
     * @param value The name of the security group.
     */
    @JvmName("vytstnucqojetqar")
    public suspend fun groupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.groupName = mapped
    }

    /**
     * @param value The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers).
     * [VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
     */
    @JvmName("dslghxegpittygvr")
    public suspend fun ipProtocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipProtocol = mapped
    }

    /**
     * @param value [EC2-VPC only] The ID of a prefix list.
     */
    @JvmName("imvlqfpeoogjdxpe")
    public suspend fun sourcePrefixListId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePrefixListId = mapped
    }

    /**
     * @param value The ID of the security group. You must specify either the security group ID or the security group name. For security groups in a nondefault VPC, you must specify the security group ID.
     */
    @JvmName("sijaclxuvlfkxntr")
    public suspend fun sourceSecurityGroupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceSecurityGroupId = mapped
    }

    /**
     * @param value [EC2-Classic, default VPC] The name of the source security group.
     * You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
     */
    @JvmName("pblipqgxdbfaktlk")
    public suspend fun sourceSecurityGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceSecurityGroupName = mapped
    }

    /**
     * @param value [nondefault VPC] The AWS account ID that owns the source security group. You can't specify this property with an IP address range.
     * If you specify SourceSecurityGroupName or SourceSecurityGroupId and that security group is owned by a different account than the account creating the stack, you must specify the SourceSecurityGroupOwnerId; otherwise, this property is optional.
     */
    @JvmName("tqhhdyqphqbhikgq")
    public suspend fun sourceSecurityGroupOwnerId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceSecurityGroupOwnerId = mapped
    }

    /**
     * @param value The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. If you specify all ICMP/ICMPv6 types, you must specify all codes.
     * Use this for ICMP and any protocol that uses ports.
     */
    @JvmName("njtxpvaojeapqpsj")
    public suspend fun toPort(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.toPort = mapped
    }

    internal fun build(): SecurityGroupIngressArgs = SecurityGroupIngressArgs(
        cidrIp = cidrIp,
        cidrIpv6 = cidrIpv6,
        description = description,
        fromPort = fromPort,
        groupId = groupId,
        groupName = groupName,
        ipProtocol = ipProtocol,
        sourcePrefixListId = sourcePrefixListId,
        sourceSecurityGroupId = sourceSecurityGroupId,
        sourceSecurityGroupName = sourceSecurityGroupName,
        sourceSecurityGroupOwnerId = sourceSecurityGroupOwnerId,
        toPort = toPort,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy