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

com.pulumi.azurenative.network.inputs.SecurityRuleArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
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.azurenative.network.inputs;

import com.pulumi.azurenative.network.enums.SecurityRuleAccess;
import com.pulumi.azurenative.network.enums.SecurityRuleDirection;
import com.pulumi.azurenative.network.enums.SecurityRuleProtocol;
import com.pulumi.azurenative.network.inputs.ApplicationSecurityGroupArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Network security rule.
 * 
 */
public final class SecurityRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final SecurityRuleArgs Empty = new SecurityRuleArgs();

    /**
     * The network traffic is allowed or denied.
     * 
     */
    @Import(name="access", required=true)
    private Output> access;

    /**
     * @return The network traffic is allowed or denied.
     * 
     */
    public Output> access() {
        return this.access;
    }

    /**
     * A description for this rule. Restricted to 140 chars.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return A description for this rule. Restricted to 140 chars.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
     * 
     */
    @Import(name="destinationAddressPrefix")
    private @Nullable Output destinationAddressPrefix;

    /**
     * @return The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
     * 
     */
    public Optional> destinationAddressPrefix() {
        return Optional.ofNullable(this.destinationAddressPrefix);
    }

    /**
     * The destination address prefixes. CIDR or destination IP ranges.
     * 
     */
    @Import(name="destinationAddressPrefixes")
    private @Nullable Output> destinationAddressPrefixes;

    /**
     * @return The destination address prefixes. CIDR or destination IP ranges.
     * 
     */
    public Optional>> destinationAddressPrefixes() {
        return Optional.ofNullable(this.destinationAddressPrefixes);
    }

    /**
     * The application security group specified as destination.
     * 
     */
    @Import(name="destinationApplicationSecurityGroups")
    private @Nullable Output> destinationApplicationSecurityGroups;

    /**
     * @return The application security group specified as destination.
     * 
     */
    public Optional>> destinationApplicationSecurityGroups() {
        return Optional.ofNullable(this.destinationApplicationSecurityGroups);
    }

    /**
     * The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     * 
     */
    @Import(name="destinationPortRange")
    private @Nullable Output destinationPortRange;

    /**
     * @return The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     * 
     */
    public Optional> destinationPortRange() {
        return Optional.ofNullable(this.destinationPortRange);
    }

    /**
     * The destination port ranges.
     * 
     */
    @Import(name="destinationPortRanges")
    private @Nullable Output> destinationPortRanges;

    /**
     * @return The destination port ranges.
     * 
     */
    public Optional>> destinationPortRanges() {
        return Optional.ofNullable(this.destinationPortRanges);
    }

    /**
     * The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
     * 
     */
    @Import(name="direction", required=true)
    private Output> direction;

    /**
     * @return The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
     * 
     */
    public Output> direction() {
        return this.direction;
    }

    /**
     * A unique read-only string that changes whenever the resource is updated.
     * 
     */
    @Import(name="etag")
    private @Nullable Output etag;

    /**
     * @return A unique read-only string that changes whenever the resource is updated.
     * 
     */
    public Optional> etag() {
        return Optional.ofNullable(this.etag);
    }

    /**
     * Resource ID.
     * 
     */
    @Import(name="id")
    private @Nullable Output id;

    /**
     * @return Resource ID.
     * 
     */
    public Optional> id() {
        return Optional.ofNullable(this.id);
    }

    /**
     * The name of the resource that is unique within a resource group. This name can be used to access the resource.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The name of the resource that is unique within a resource group. This name can be used to access the resource.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
     * 
     */
    @Import(name="priority")
    private @Nullable Output priority;

    /**
     * @return The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
     * 
     */
    public Optional> priority() {
        return Optional.ofNullable(this.priority);
    }

    /**
     * Network protocol this rule applies to.
     * 
     */
    @Import(name="protocol", required=true)
    private Output> protocol;

    /**
     * @return Network protocol this rule applies to.
     * 
     */
    public Output> protocol() {
        return this.protocol;
    }

    /**
     * The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
     * 
     */
    @Import(name="provisioningState")
    private @Nullable Output provisioningState;

    /**
     * @return The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
     * 
     */
    public Optional> provisioningState() {
        return Optional.ofNullable(this.provisioningState);
    }

    /**
     * The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
     * 
     */
    @Import(name="sourceAddressPrefix")
    private @Nullable Output sourceAddressPrefix;

    /**
     * @return The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
     * 
     */
    public Optional> sourceAddressPrefix() {
        return Optional.ofNullable(this.sourceAddressPrefix);
    }

    /**
     * The CIDR or source IP ranges.
     * 
     */
    @Import(name="sourceAddressPrefixes")
    private @Nullable Output> sourceAddressPrefixes;

    /**
     * @return The CIDR or source IP ranges.
     * 
     */
    public Optional>> sourceAddressPrefixes() {
        return Optional.ofNullable(this.sourceAddressPrefixes);
    }

    /**
     * The application security group specified as source.
     * 
     */
    @Import(name="sourceApplicationSecurityGroups")
    private @Nullable Output> sourceApplicationSecurityGroups;

    /**
     * @return The application security group specified as source.
     * 
     */
    public Optional>> sourceApplicationSecurityGroups() {
        return Optional.ofNullable(this.sourceApplicationSecurityGroups);
    }

    /**
     * The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     * 
     */
    @Import(name="sourcePortRange")
    private @Nullable Output sourcePortRange;

    /**
     * @return The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     * 
     */
    public Optional> sourcePortRange() {
        return Optional.ofNullable(this.sourcePortRange);
    }

    /**
     * The source port ranges.
     * 
     */
    @Import(name="sourcePortRanges")
    private @Nullable Output> sourcePortRanges;

    /**
     * @return The source port ranges.
     * 
     */
    public Optional>> sourcePortRanges() {
        return Optional.ofNullable(this.sourcePortRanges);
    }

    /**
     * The type of the resource.
     * 
     */
    @Import(name="type")
    private @Nullable Output type;

    /**
     * @return The type of the resource.
     * 
     */
    public Optional> type() {
        return Optional.ofNullable(this.type);
    }

    private SecurityRuleArgs() {}

    private SecurityRuleArgs(SecurityRuleArgs $) {
        this.access = $.access;
        this.description = $.description;
        this.destinationAddressPrefix = $.destinationAddressPrefix;
        this.destinationAddressPrefixes = $.destinationAddressPrefixes;
        this.destinationApplicationSecurityGroups = $.destinationApplicationSecurityGroups;
        this.destinationPortRange = $.destinationPortRange;
        this.destinationPortRanges = $.destinationPortRanges;
        this.direction = $.direction;
        this.etag = $.etag;
        this.id = $.id;
        this.name = $.name;
        this.priority = $.priority;
        this.protocol = $.protocol;
        this.provisioningState = $.provisioningState;
        this.sourceAddressPrefix = $.sourceAddressPrefix;
        this.sourceAddressPrefixes = $.sourceAddressPrefixes;
        this.sourceApplicationSecurityGroups = $.sourceApplicationSecurityGroups;
        this.sourcePortRange = $.sourcePortRange;
        this.sourcePortRanges = $.sourcePortRanges;
        this.type = $.type;
    }

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

    public static final class Builder {
        private SecurityRuleArgs $;

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

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

        /**
         * @param access The network traffic is allowed or denied.
         * 
         * @return builder
         * 
         */
        public Builder access(Output> access) {
            $.access = access;
            return this;
        }

        /**
         * @param access The network traffic is allowed or denied.
         * 
         * @return builder
         * 
         */
        public Builder access(Either access) {
            return access(Output.of(access));
        }

        /**
         * @param access The network traffic is allowed or denied.
         * 
         * @return builder
         * 
         */
        public Builder access(String access) {
            return access(Either.ofLeft(access));
        }

        /**
         * @param access The network traffic is allowed or denied.
         * 
         * @return builder
         * 
         */
        public Builder access(SecurityRuleAccess access) {
            return access(Either.ofRight(access));
        }

        /**
         * @param description A description for this rule. Restricted to 140 chars.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description A description for this rule. Restricted to 140 chars.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
         * 
         * @return builder
         * 
         */
        public Builder destinationAddressPrefix(@Nullable Output destinationAddressPrefix) {
            $.destinationAddressPrefix = destinationAddressPrefix;
            return this;
        }

        /**
         * @param destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
         * 
         * @return builder
         * 
         */
        public Builder destinationAddressPrefix(String destinationAddressPrefix) {
            return destinationAddressPrefix(Output.of(destinationAddressPrefix));
        }

        /**
         * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges.
         * 
         * @return builder
         * 
         */
        public Builder destinationAddressPrefixes(@Nullable Output> destinationAddressPrefixes) {
            $.destinationAddressPrefixes = destinationAddressPrefixes;
            return this;
        }

        /**
         * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges.
         * 
         * @return builder
         * 
         */
        public Builder destinationAddressPrefixes(List destinationAddressPrefixes) {
            return destinationAddressPrefixes(Output.of(destinationAddressPrefixes));
        }

        /**
         * @param destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges.
         * 
         * @return builder
         * 
         */
        public Builder destinationAddressPrefixes(String... destinationAddressPrefixes) {
            return destinationAddressPrefixes(List.of(destinationAddressPrefixes));
        }

        /**
         * @param destinationApplicationSecurityGroups The application security group specified as destination.
         * 
         * @return builder
         * 
         */
        public Builder destinationApplicationSecurityGroups(@Nullable Output> destinationApplicationSecurityGroups) {
            $.destinationApplicationSecurityGroups = destinationApplicationSecurityGroups;
            return this;
        }

        /**
         * @param destinationApplicationSecurityGroups The application security group specified as destination.
         * 
         * @return builder
         * 
         */
        public Builder destinationApplicationSecurityGroups(List destinationApplicationSecurityGroups) {
            return destinationApplicationSecurityGroups(Output.of(destinationApplicationSecurityGroups));
        }

        /**
         * @param destinationApplicationSecurityGroups The application security group specified as destination.
         * 
         * @return builder
         * 
         */
        public Builder destinationApplicationSecurityGroups(ApplicationSecurityGroupArgs... destinationApplicationSecurityGroups) {
            return destinationApplicationSecurityGroups(List.of(destinationApplicationSecurityGroups));
        }

        /**
         * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
         * 
         * @return builder
         * 
         */
        public Builder destinationPortRange(@Nullable Output destinationPortRange) {
            $.destinationPortRange = destinationPortRange;
            return this;
        }

        /**
         * @param destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
         * 
         * @return builder
         * 
         */
        public Builder destinationPortRange(String destinationPortRange) {
            return destinationPortRange(Output.of(destinationPortRange));
        }

        /**
         * @param destinationPortRanges The destination port ranges.
         * 
         * @return builder
         * 
         */
        public Builder destinationPortRanges(@Nullable Output> destinationPortRanges) {
            $.destinationPortRanges = destinationPortRanges;
            return this;
        }

        /**
         * @param destinationPortRanges The destination port ranges.
         * 
         * @return builder
         * 
         */
        public Builder destinationPortRanges(List destinationPortRanges) {
            return destinationPortRanges(Output.of(destinationPortRanges));
        }

        /**
         * @param destinationPortRanges The destination port ranges.
         * 
         * @return builder
         * 
         */
        public Builder destinationPortRanges(String... destinationPortRanges) {
            return destinationPortRanges(List.of(destinationPortRanges));
        }

        /**
         * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
         * 
         * @return builder
         * 
         */
        public Builder direction(Output> direction) {
            $.direction = direction;
            return this;
        }

        /**
         * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
         * 
         * @return builder
         * 
         */
        public Builder direction(Either direction) {
            return direction(Output.of(direction));
        }

        /**
         * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
         * 
         * @return builder
         * 
         */
        public Builder direction(String direction) {
            return direction(Either.ofLeft(direction));
        }

        /**
         * @param direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
         * 
         * @return builder
         * 
         */
        public Builder direction(SecurityRuleDirection direction) {
            return direction(Either.ofRight(direction));
        }

        /**
         * @param etag A unique read-only string that changes whenever the resource is updated.
         * 
         * @return builder
         * 
         */
        public Builder etag(@Nullable Output etag) {
            $.etag = etag;
            return this;
        }

        /**
         * @param etag A unique read-only string that changes whenever the resource is updated.
         * 
         * @return builder
         * 
         */
        public Builder etag(String etag) {
            return etag(Output.of(etag));
        }

        /**
         * @param id Resource ID.
         * 
         * @return builder
         * 
         */
        public Builder id(@Nullable Output id) {
            $.id = id;
            return this;
        }

        /**
         * @param id Resource ID.
         * 
         * @return builder
         * 
         */
        public Builder id(String id) {
            return id(Output.of(id));
        }

        /**
         * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the resource that is unique within a resource group. This name can be used to access the resource.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
         * 
         * @return builder
         * 
         */
        public Builder priority(@Nullable Output priority) {
            $.priority = priority;
            return this;
        }

        /**
         * @param priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
         * 
         * @return builder
         * 
         */
        public Builder priority(Integer priority) {
            return priority(Output.of(priority));
        }

        /**
         * @param protocol Network protocol this rule applies to.
         * 
         * @return builder
         * 
         */
        public Builder protocol(Output> protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol Network protocol this rule applies to.
         * 
         * @return builder
         * 
         */
        public Builder protocol(Either protocol) {
            return protocol(Output.of(protocol));
        }

        /**
         * @param protocol Network protocol this rule applies to.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Either.ofLeft(protocol));
        }

        /**
         * @param protocol Network protocol this rule applies to.
         * 
         * @return builder
         * 
         */
        public Builder protocol(SecurityRuleProtocol protocol) {
            return protocol(Either.ofRight(protocol));
        }

        /**
         * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
         * 
         * @return builder
         * 
         */
        public Builder provisioningState(@Nullable Output provisioningState) {
            $.provisioningState = provisioningState;
            return this;
        }

        /**
         * @param provisioningState The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
         * 
         * @return builder
         * 
         */
        public Builder provisioningState(String provisioningState) {
            return provisioningState(Output.of(provisioningState));
        }

        /**
         * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
         * 
         * @return builder
         * 
         */
        public Builder sourceAddressPrefix(@Nullable Output sourceAddressPrefix) {
            $.sourceAddressPrefix = sourceAddressPrefix;
            return this;
        }

        /**
         * @param sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
         * 
         * @return builder
         * 
         */
        public Builder sourceAddressPrefix(String sourceAddressPrefix) {
            return sourceAddressPrefix(Output.of(sourceAddressPrefix));
        }

        /**
         * @param sourceAddressPrefixes The CIDR or source IP ranges.
         * 
         * @return builder
         * 
         */
        public Builder sourceAddressPrefixes(@Nullable Output> sourceAddressPrefixes) {
            $.sourceAddressPrefixes = sourceAddressPrefixes;
            return this;
        }

        /**
         * @param sourceAddressPrefixes The CIDR or source IP ranges.
         * 
         * @return builder
         * 
         */
        public Builder sourceAddressPrefixes(List sourceAddressPrefixes) {
            return sourceAddressPrefixes(Output.of(sourceAddressPrefixes));
        }

        /**
         * @param sourceAddressPrefixes The CIDR or source IP ranges.
         * 
         * @return builder
         * 
         */
        public Builder sourceAddressPrefixes(String... sourceAddressPrefixes) {
            return sourceAddressPrefixes(List.of(sourceAddressPrefixes));
        }

        /**
         * @param sourceApplicationSecurityGroups The application security group specified as source.
         * 
         * @return builder
         * 
         */
        public Builder sourceApplicationSecurityGroups(@Nullable Output> sourceApplicationSecurityGroups) {
            $.sourceApplicationSecurityGroups = sourceApplicationSecurityGroups;
            return this;
        }

        /**
         * @param sourceApplicationSecurityGroups The application security group specified as source.
         * 
         * @return builder
         * 
         */
        public Builder sourceApplicationSecurityGroups(List sourceApplicationSecurityGroups) {
            return sourceApplicationSecurityGroups(Output.of(sourceApplicationSecurityGroups));
        }

        /**
         * @param sourceApplicationSecurityGroups The application security group specified as source.
         * 
         * @return builder
         * 
         */
        public Builder sourceApplicationSecurityGroups(ApplicationSecurityGroupArgs... sourceApplicationSecurityGroups) {
            return sourceApplicationSecurityGroups(List.of(sourceApplicationSecurityGroups));
        }

        /**
         * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
         * 
         * @return builder
         * 
         */
        public Builder sourcePortRange(@Nullable Output sourcePortRange) {
            $.sourcePortRange = sourcePortRange;
            return this;
        }

        /**
         * @param sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
         * 
         * @return builder
         * 
         */
        public Builder sourcePortRange(String sourcePortRange) {
            return sourcePortRange(Output.of(sourcePortRange));
        }

        /**
         * @param sourcePortRanges The source port ranges.
         * 
         * @return builder
         * 
         */
        public Builder sourcePortRanges(@Nullable Output> sourcePortRanges) {
            $.sourcePortRanges = sourcePortRanges;
            return this;
        }

        /**
         * @param sourcePortRanges The source port ranges.
         * 
         * @return builder
         * 
         */
        public Builder sourcePortRanges(List sourcePortRanges) {
            return sourcePortRanges(Output.of(sourcePortRanges));
        }

        /**
         * @param sourcePortRanges The source port ranges.
         * 
         * @return builder
         * 
         */
        public Builder sourcePortRanges(String... sourcePortRanges) {
            return sourcePortRanges(List.of(sourcePortRanges));
        }

        /**
         * @param type The type of the resource.
         * 
         * @return builder
         * 
         */
        public Builder type(@Nullable Output type) {
            $.type = type;
            return this;
        }

        /**
         * @param type The type of the resource.
         * 
         * @return builder
         * 
         */
        public Builder type(String type) {
            return type(Output.of(type));
        }

        public SecurityRuleArgs build() {
            if ($.access == null) {
                throw new MissingRequiredPropertyException("SecurityRuleArgs", "access");
            }
            if ($.direction == null) {
                throw new MissingRequiredPropertyException("SecurityRuleArgs", "direction");
            }
            if ($.protocol == null) {
                throw new MissingRequiredPropertyException("SecurityRuleArgs", "protocol");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy