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

com.pulumi.aws.ec2.inputs.SecurityGroupIngressArgs Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.60.0-alpha.1731982519
Show newest version
// *** 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.inputs;

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.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final SecurityGroupIngressArgs Empty = new SecurityGroupIngressArgs();

    /**
     * List of CIDR blocks.
     * 
     */
    @Import(name="cidrBlocks")
    private @Nullable Output> cidrBlocks;

    /**
     * @return List of CIDR blocks.
     * 
     */
    public Optional>> cidrBlocks() {
        return Optional.ofNullable(this.cidrBlocks);
    }

    /**
     * Description of this ingress rule.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return Description of this ingress rule.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * Start port (or ICMP type number if protocol is `icmp` or `icmpv6`).
     * 
     */
    @Import(name="fromPort", required=true)
    private Output fromPort;

    /**
     * @return Start port (or ICMP type number if protocol is `icmp` or `icmpv6`).
     * 
     */
    public Output fromPort() {
        return this.fromPort;
    }

    /**
     * List of IPv6 CIDR blocks.
     * 
     */
    @Import(name="ipv6CidrBlocks")
    private @Nullable Output> ipv6CidrBlocks;

    /**
     * @return List of IPv6 CIDR blocks.
     * 
     */
    public Optional>> ipv6CidrBlocks() {
        return Optional.ofNullable(this.ipv6CidrBlocks);
    }

    /**
     * List of Prefix List IDs.
     * 
     */
    @Import(name="prefixListIds")
    private @Nullable Output> prefixListIds;

    /**
     * @return List of Prefix List IDs.
     * 
     */
    public Optional>> prefixListIds() {
        return Optional.ofNullable(this.prefixListIds);
    }

    /**
     * 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 on the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
     * 
     * 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 source of the traffic.
     * 
     */
    @Import(name="protocol", required=true)
    private Output protocol;

    /**
     * @return 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 on the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
     * 
     * 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 source of the traffic.
     * 
     */
    public Output protocol() {
        return this.protocol;
    }

    /**
     * List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
     * 
     */
    @Import(name="securityGroups")
    private @Nullable Output> securityGroups;

    /**
     * @return List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
     * 
     */
    public Optional>> securityGroups() {
        return Optional.ofNullable(this.securityGroups);
    }

    /**
     * Whether the security group itself will be added as a source to this ingress rule.
     * 
     */
    @Import(name="self")
    private @Nullable Output self;

    /**
     * @return Whether the security group itself will be added as a source to this ingress rule.
     * 
     */
    public Optional> self() {
        return Optional.ofNullable(this.self);
    }

    /**
     * End range port (or ICMP code if protocol is `icmp`).
     * 
     */
    @Import(name="toPort", required=true)
    private Output toPort;

    /**
     * @return End range port (or ICMP code if protocol is `icmp`).
     * 
     */
    public Output toPort() {
        return this.toPort;
    }

    private SecurityGroupIngressArgs() {}

    private SecurityGroupIngressArgs(SecurityGroupIngressArgs $) {
        this.cidrBlocks = $.cidrBlocks;
        this.description = $.description;
        this.fromPort = $.fromPort;
        this.ipv6CidrBlocks = $.ipv6CidrBlocks;
        this.prefixListIds = $.prefixListIds;
        this.protocol = $.protocol;
        this.securityGroups = $.securityGroups;
        this.self = $.self;
        this.toPort = $.toPort;
    }

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

    public static final class Builder {
        private SecurityGroupIngressArgs $;

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

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

        /**
         * @param cidrBlocks List of CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder cidrBlocks(@Nullable Output> cidrBlocks) {
            $.cidrBlocks = cidrBlocks;
            return this;
        }

        /**
         * @param cidrBlocks List of CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder cidrBlocks(List cidrBlocks) {
            return cidrBlocks(Output.of(cidrBlocks));
        }

        /**
         * @param cidrBlocks List of CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder cidrBlocks(String... cidrBlocks) {
            return cidrBlocks(List.of(cidrBlocks));
        }

        /**
         * @param description Description of this ingress rule.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description Description of this ingress rule.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param fromPort Start port (or ICMP type number if protocol is `icmp` or `icmpv6`).
         * 
         * @return builder
         * 
         */
        public Builder fromPort(Output fromPort) {
            $.fromPort = fromPort;
            return this;
        }

        /**
         * @param fromPort Start port (or ICMP type number if protocol is `icmp` or `icmpv6`).
         * 
         * @return builder
         * 
         */
        public Builder fromPort(Integer fromPort) {
            return fromPort(Output.of(fromPort));
        }

        /**
         * @param ipv6CidrBlocks List of IPv6 CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlocks(@Nullable Output> ipv6CidrBlocks) {
            $.ipv6CidrBlocks = ipv6CidrBlocks;
            return this;
        }

        /**
         * @param ipv6CidrBlocks List of IPv6 CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlocks(List ipv6CidrBlocks) {
            return ipv6CidrBlocks(Output.of(ipv6CidrBlocks));
        }

        /**
         * @param ipv6CidrBlocks List of IPv6 CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder ipv6CidrBlocks(String... ipv6CidrBlocks) {
            return ipv6CidrBlocks(List.of(ipv6CidrBlocks));
        }

        /**
         * @param prefixListIds List of Prefix List IDs.
         * 
         * @return builder
         * 
         */
        public Builder prefixListIds(@Nullable Output> prefixListIds) {
            $.prefixListIds = prefixListIds;
            return this;
        }

        /**
         * @param prefixListIds List of Prefix List IDs.
         * 
         * @return builder
         * 
         */
        public Builder prefixListIds(List prefixListIds) {
            return prefixListIds(Output.of(prefixListIds));
        }

        /**
         * @param prefixListIds List of Prefix List IDs.
         * 
         * @return builder
         * 
         */
        public Builder prefixListIds(String... prefixListIds) {
            return prefixListIds(List.of(prefixListIds));
        }

        /**
         * @param 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 on the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
         * 
         * 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 source of the traffic.
         * 
         * @return builder
         * 
         */
        public Builder protocol(Output protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param 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 on the [IpPermission](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html) API reference.
         * 
         * 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 source of the traffic.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Output.of(protocol));
        }

        /**
         * @param securityGroups List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
         * 
         * @return builder
         * 
         */
        public Builder securityGroups(@Nullable Output> securityGroups) {
            $.securityGroups = securityGroups;
            return this;
        }

        /**
         * @param securityGroups List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
         * 
         * @return builder
         * 
         */
        public Builder securityGroups(List securityGroups) {
            return securityGroups(Output.of(securityGroups));
        }

        /**
         * @param securityGroups List of security groups. A group name can be used relative to the default VPC. Otherwise, group ID.
         * 
         * @return builder
         * 
         */
        public Builder securityGroups(String... securityGroups) {
            return securityGroups(List.of(securityGroups));
        }

        /**
         * @param self Whether the security group itself will be added as a source to this ingress rule.
         * 
         * @return builder
         * 
         */
        public Builder self(@Nullable Output self) {
            $.self = self;
            return this;
        }

        /**
         * @param self Whether the security group itself will be added as a source to this ingress rule.
         * 
         * @return builder
         * 
         */
        public Builder self(Boolean self) {
            return self(Output.of(self));
        }

        /**
         * @param toPort End range port (or ICMP code if protocol is `icmp`).
         * 
         * @return builder
         * 
         */
        public Builder toPort(Output toPort) {
            $.toPort = toPort;
            return this;
        }

        /**
         * @param toPort End range port (or ICMP code if protocol is `icmp`).
         * 
         * @return builder
         * 
         */
        public Builder toPort(Integer toPort) {
            return toPort(Output.of(toPort));
        }

        public SecurityGroupIngressArgs build() {
            if ($.fromPort == null) {
                throw new MissingRequiredPropertyException("SecurityGroupIngressArgs", "fromPort");
            }
            if ($.protocol == null) {
                throw new MissingRequiredPropertyException("SecurityGroupIngressArgs", "protocol");
            }
            if ($.toPort == null) {
                throw new MissingRequiredPropertyException("SecurityGroupIngressArgs", "toPort");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy