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

com.pulumi.aws.ec2.NetworkAclRuleArgs Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.ec2;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class NetworkAclRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final NetworkAclRuleArgs Empty = new NetworkAclRuleArgs();

    /**
     * The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24 ).
     * 
     */
    @Import(name="cidrBlock")
    private @Nullable Output cidrBlock;

    /**
     * @return The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24 ).
     * 
     */
    public Optional> cidrBlock() {
        return Optional.ofNullable(this.cidrBlock);
    }

    /**
     * Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet). Default `false`.
     * 
     */
    @Import(name="egress")
    private @Nullable Output egress;

    /**
     * @return Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet). Default `false`.
     * 
     */
    public Optional> egress() {
        return Optional.ofNullable(this.egress);
    }

    /**
     * The from port to match.
     * 
     */
    @Import(name="fromPort")
    private @Nullable Output fromPort;

    /**
     * @return The from port to match.
     * 
     */
    public Optional> fromPort() {
        return Optional.ofNullable(this.fromPort);
    }

    /**
     * ICMP protocol: The ICMP code. Required if specifying ICMP for the protocolE.g., -1
     * 
     * > **NOTE:** If the value of `protocol` is `-1` or `all`, the `from_port` and `to_port` values will be ignored and the rule will apply to all ports.
     * 
     * > **NOTE:** If the value of `icmp_type` is `-1` (which results in a wildcard ICMP type), the `icmp_code` must also be set to `-1` (wildcard ICMP code).
     * 
     * > Note: For more information on ICMP types and codes, see here: https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
     * 
     */
    @Import(name="icmpCode")
    private @Nullable Output icmpCode;

    /**
     * @return ICMP protocol: The ICMP code. Required if specifying ICMP for the protocolE.g., -1
     * 
     * > **NOTE:** If the value of `protocol` is `-1` or `all`, the `from_port` and `to_port` values will be ignored and the rule will apply to all ports.
     * 
     * > **NOTE:** If the value of `icmp_type` is `-1` (which results in a wildcard ICMP type), the `icmp_code` must also be set to `-1` (wildcard ICMP code).
     * 
     * > Note: For more information on ICMP types and codes, see here: https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
     * 
     */
    public Optional> icmpCode() {
        return Optional.ofNullable(this.icmpCode);
    }

    /**
     * ICMP protocol: The ICMP type. Required if specifying ICMP for the protocolE.g., -1
     * 
     */
    @Import(name="icmpType")
    private @Nullable Output icmpType;

    /**
     * @return ICMP protocol: The ICMP type. Required if specifying ICMP for the protocolE.g., -1
     * 
     */
    public Optional> icmpType() {
        return Optional.ofNullable(this.icmpType);
    }

    /**
     * The IPv6 CIDR block to allow or deny.
     * 
     */
    @Import(name="ipv6CidrBlock")
    private @Nullable Output ipv6CidrBlock;

    /**
     * @return The IPv6 CIDR block to allow or deny.
     * 
     */
    public Optional> ipv6CidrBlock() {
        return Optional.ofNullable(this.ipv6CidrBlock);
    }

    /**
     * The ID of the network ACL.
     * 
     */
    @Import(name="networkAclId", required=true)
    private Output networkAclId;

    /**
     * @return The ID of the network ACL.
     * 
     */
    public Output networkAclId() {
        return this.networkAclId;
    }

    /**
     * The protocol. A value of -1 means all protocols.
     * 
     */
    @Import(name="protocol", required=true)
    private Output protocol;

    /**
     * @return The protocol. A value of -1 means all protocols.
     * 
     */
    public Output protocol() {
        return this.protocol;
    }

    /**
     * Indicates whether to allow or deny the traffic that matches the rule. Accepted values: `allow` | `deny`
     * 
     */
    @Import(name="ruleAction", required=true)
    private Output ruleAction;

    /**
     * @return Indicates whether to allow or deny the traffic that matches the rule. Accepted values: `allow` | `deny`
     * 
     */
    public Output ruleAction() {
        return this.ruleAction;
    }

    /**
     * The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.
     * 
     */
    @Import(name="ruleNumber", required=true)
    private Output ruleNumber;

    /**
     * @return The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.
     * 
     */
    public Output ruleNumber() {
        return this.ruleNumber;
    }

    /**
     * The to port to match.
     * 
     */
    @Import(name="toPort")
    private @Nullable Output toPort;

    /**
     * @return The to port to match.
     * 
     */
    public Optional> toPort() {
        return Optional.ofNullable(this.toPort);
    }

    private NetworkAclRuleArgs() {}

    private NetworkAclRuleArgs(NetworkAclRuleArgs $) {
        this.cidrBlock = $.cidrBlock;
        this.egress = $.egress;
        this.fromPort = $.fromPort;
        this.icmpCode = $.icmpCode;
        this.icmpType = $.icmpType;
        this.ipv6CidrBlock = $.ipv6CidrBlock;
        this.networkAclId = $.networkAclId;
        this.protocol = $.protocol;
        this.ruleAction = $.ruleAction;
        this.ruleNumber = $.ruleNumber;
        this.toPort = $.toPort;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(NetworkAclRuleArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private NetworkAclRuleArgs $;

        public Builder() {
            $ = new NetworkAclRuleArgs();
        }

        public Builder(NetworkAclRuleArgs defaults) {
            $ = new NetworkAclRuleArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param cidrBlock The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24 ).
         * 
         * @return builder
         * 
         */
        public Builder cidrBlock(@Nullable Output cidrBlock) {
            $.cidrBlock = cidrBlock;
            return this;
        }

        /**
         * @param cidrBlock The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24 ).
         * 
         * @return builder
         * 
         */
        public Builder cidrBlock(String cidrBlock) {
            return cidrBlock(Output.of(cidrBlock));
        }

        /**
         * @param egress Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet). Default `false`.
         * 
         * @return builder
         * 
         */
        public Builder egress(@Nullable Output egress) {
            $.egress = egress;
            return this;
        }

        /**
         * @param egress Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet). Default `false`.
         * 
         * @return builder
         * 
         */
        public Builder egress(Boolean egress) {
            return egress(Output.of(egress));
        }

        /**
         * @param fromPort The from port to match.
         * 
         * @return builder
         * 
         */
        public Builder fromPort(@Nullable Output fromPort) {
            $.fromPort = fromPort;
            return this;
        }

        /**
         * @param fromPort The from port to match.
         * 
         * @return builder
         * 
         */
        public Builder fromPort(Integer fromPort) {
            return fromPort(Output.of(fromPort));
        }

        /**
         * @param icmpCode ICMP protocol: The ICMP code. Required if specifying ICMP for the protocolE.g., -1
         * 
         * > **NOTE:** If the value of `protocol` is `-1` or `all`, the `from_port` and `to_port` values will be ignored and the rule will apply to all ports.
         * 
         * > **NOTE:** If the value of `icmp_type` is `-1` (which results in a wildcard ICMP type), the `icmp_code` must also be set to `-1` (wildcard ICMP code).
         * 
         * > Note: For more information on ICMP types and codes, see here: https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
         * 
         * @return builder
         * 
         */
        public Builder icmpCode(@Nullable Output icmpCode) {
            $.icmpCode = icmpCode;
            return this;
        }

        /**
         * @param icmpCode ICMP protocol: The ICMP code. Required if specifying ICMP for the protocolE.g., -1
         * 
         * > **NOTE:** If the value of `protocol` is `-1` or `all`, the `from_port` and `to_port` values will be ignored and the rule will apply to all ports.
         * 
         * > **NOTE:** If the value of `icmp_type` is `-1` (which results in a wildcard ICMP type), the `icmp_code` must also be set to `-1` (wildcard ICMP code).
         * 
         * > Note: For more information on ICMP types and codes, see here: https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
         * 
         * @return builder
         * 
         */
        public Builder icmpCode(Integer icmpCode) {
            return icmpCode(Output.of(icmpCode));
        }

        /**
         * @param icmpType ICMP protocol: The ICMP type. Required if specifying ICMP for the protocolE.g., -1
         * 
         * @return builder
         * 
         */
        public Builder icmpType(@Nullable Output icmpType) {
            $.icmpType = icmpType;
            return this;
        }

        /**
         * @param icmpType ICMP protocol: The ICMP type. Required if specifying ICMP for the protocolE.g., -1
         * 
         * @return builder
         * 
         */
        public Builder icmpType(Integer icmpType) {
            return icmpType(Output.of(icmpType));
        }

        /**
         * @param ipv6CidrBlock The IPv6 CIDR block to allow or deny.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlock(@Nullable Output ipv6CidrBlock) {
            $.ipv6CidrBlock = ipv6CidrBlock;
            return this;
        }

        /**
         * @param ipv6CidrBlock The IPv6 CIDR block to allow or deny.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlock(String ipv6CidrBlock) {
            return ipv6CidrBlock(Output.of(ipv6CidrBlock));
        }

        /**
         * @param networkAclId The ID of the network ACL.
         * 
         * @return builder
         * 
         */
        public Builder networkAclId(Output networkAclId) {
            $.networkAclId = networkAclId;
            return this;
        }

        /**
         * @param networkAclId The ID of the network ACL.
         * 
         * @return builder
         * 
         */
        public Builder networkAclId(String networkAclId) {
            return networkAclId(Output.of(networkAclId));
        }

        /**
         * @param protocol The protocol. A value of -1 means all protocols.
         * 
         * @return builder
         * 
         */
        public Builder protocol(Output protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol The protocol. A value of -1 means all protocols.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Output.of(protocol));
        }

        /**
         * @param ruleAction Indicates whether to allow or deny the traffic that matches the rule. Accepted values: `allow` | `deny`
         * 
         * @return builder
         * 
         */
        public Builder ruleAction(Output ruleAction) {
            $.ruleAction = ruleAction;
            return this;
        }

        /**
         * @param ruleAction Indicates whether to allow or deny the traffic that matches the rule. Accepted values: `allow` | `deny`
         * 
         * @return builder
         * 
         */
        public Builder ruleAction(String ruleAction) {
            return ruleAction(Output.of(ruleAction));
        }

        /**
         * @param ruleNumber The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.
         * 
         * @return builder
         * 
         */
        public Builder ruleNumber(Output ruleNumber) {
            $.ruleNumber = ruleNumber;
            return this;
        }

        /**
         * @param ruleNumber The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number.
         * 
         * @return builder
         * 
         */
        public Builder ruleNumber(Integer ruleNumber) {
            return ruleNumber(Output.of(ruleNumber));
        }

        /**
         * @param toPort The to port to match.
         * 
         * @return builder
         * 
         */
        public Builder toPort(@Nullable Output toPort) {
            $.toPort = toPort;
            return this;
        }

        /**
         * @param toPort The to port to match.
         * 
         * @return builder
         * 
         */
        public Builder toPort(Integer toPort) {
            return toPort(Output.of(toPort));
        }

        public NetworkAclRuleArgs build() {
            if ($.networkAclId == null) {
                throw new MissingRequiredPropertyException("NetworkAclRuleArgs", "networkAclId");
            }
            if ($.protocol == null) {
                throw new MissingRequiredPropertyException("NetworkAclRuleArgs", "protocol");
            }
            if ($.ruleAction == null) {
                throw new MissingRequiredPropertyException("NetworkAclRuleArgs", "ruleAction");
            }
            if ($.ruleNumber == null) {
                throw new MissingRequiredPropertyException("NetworkAclRuleArgs", "ruleNumber");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy