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

com.pulumi.azure.network.outputs.NetworkSecurityGroupSecurityRule Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.10.0-alpha.1731737215
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.azure.network.outputs;

import com.pulumi.core.annotations.CustomType;
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;

@CustomType
public final class NetworkSecurityGroupSecurityRule {
    /**
     * @return Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
     * 
     */
    private String access;
    /**
     * @return A description for this rule. Restricted to 140 characters.
     * 
     */
    private @Nullable String description;
    /**
     * @return CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `destination_address_prefixes` is not specified.
     * 
     */
    private @Nullable String destinationAddressPrefix;
    /**
     * @return List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
     * 
     */
    private @Nullable List destinationAddressPrefixes;
    /**
     * @return A List of destination Application Security Group IDs
     * 
     */
    private @Nullable List destinationApplicationSecurityGroupIds;
    /**
     * @return Destination Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `destination_port_ranges` is not specified.
     * 
     */
    private @Nullable String destinationPortRange;
    /**
     * @return List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
     * 
     */
    private @Nullable List destinationPortRanges;
    /**
     * @return The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
     * 
     */
    private String direction;
    /**
     * @return The name of the security rule.
     * 
     */
    private String name;
    /**
     * @return Specifies 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.
     * 
     */
    private Integer priority;
    /**
     * @return Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
     * 
     */
    private String protocol;
    /**
     * @return CIDR or source IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `source_address_prefixes` is not specified.
     * 
     */
    private @Nullable String sourceAddressPrefix;
    /**
     * @return List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
     * 
     */
    private @Nullable List sourceAddressPrefixes;
    /**
     * @return A List of source Application Security Group IDs
     * 
     */
    private @Nullable List sourceApplicationSecurityGroupIds;
    /**
     * @return Source Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `source_port_ranges` is not specified.
     * 
     */
    private @Nullable String sourcePortRange;
    /**
     * @return List of source ports or port ranges. This is required if `source_port_range` is not specified.
     * 
     */
    private @Nullable List sourcePortRanges;

    private NetworkSecurityGroupSecurityRule() {}
    /**
     * @return Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
     * 
     */
    public String access() {
        return this.access;
    }
    /**
     * @return A description for this rule. Restricted to 140 characters.
     * 
     */
    public Optional description() {
        return Optional.ofNullable(this.description);
    }
    /**
     * @return CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `destination_address_prefixes` is not specified.
     * 
     */
    public Optional destinationAddressPrefix() {
        return Optional.ofNullable(this.destinationAddressPrefix);
    }
    /**
     * @return List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
     * 
     */
    public List destinationAddressPrefixes() {
        return this.destinationAddressPrefixes == null ? List.of() : this.destinationAddressPrefixes;
    }
    /**
     * @return A List of destination Application Security Group IDs
     * 
     */
    public List destinationApplicationSecurityGroupIds() {
        return this.destinationApplicationSecurityGroupIds == null ? List.of() : this.destinationApplicationSecurityGroupIds;
    }
    /**
     * @return Destination Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `destination_port_ranges` is not specified.
     * 
     */
    public Optional destinationPortRange() {
        return Optional.ofNullable(this.destinationPortRange);
    }
    /**
     * @return List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
     * 
     */
    public List destinationPortRanges() {
        return this.destinationPortRanges == null ? List.of() : this.destinationPortRanges;
    }
    /**
     * @return The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
     * 
     */
    public String direction() {
        return this.direction;
    }
    /**
     * @return The name of the security rule.
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return Specifies 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 Integer priority() {
        return this.priority;
    }
    /**
     * @return Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
     * 
     */
    public String protocol() {
        return this.protocol;
    }
    /**
     * @return CIDR or source IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `source_address_prefixes` is not specified.
     * 
     */
    public Optional sourceAddressPrefix() {
        return Optional.ofNullable(this.sourceAddressPrefix);
    }
    /**
     * @return List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
     * 
     */
    public List sourceAddressPrefixes() {
        return this.sourceAddressPrefixes == null ? List.of() : this.sourceAddressPrefixes;
    }
    /**
     * @return A List of source Application Security Group IDs
     * 
     */
    public List sourceApplicationSecurityGroupIds() {
        return this.sourceApplicationSecurityGroupIds == null ? List.of() : this.sourceApplicationSecurityGroupIds;
    }
    /**
     * @return Source Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `source_port_ranges` is not specified.
     * 
     */
    public Optional sourcePortRange() {
        return Optional.ofNullable(this.sourcePortRange);
    }
    /**
     * @return List of source ports or port ranges. This is required if `source_port_range` is not specified.
     * 
     */
    public List sourcePortRanges() {
        return this.sourcePortRanges == null ? List.of() : this.sourcePortRanges;
    }

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

    public static Builder builder(NetworkSecurityGroupSecurityRule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private String access;
        private @Nullable String description;
        private @Nullable String destinationAddressPrefix;
        private @Nullable List destinationAddressPrefixes;
        private @Nullable List destinationApplicationSecurityGroupIds;
        private @Nullable String destinationPortRange;
        private @Nullable List destinationPortRanges;
        private String direction;
        private String name;
        private Integer priority;
        private String protocol;
        private @Nullable String sourceAddressPrefix;
        private @Nullable List sourceAddressPrefixes;
        private @Nullable List sourceApplicationSecurityGroupIds;
        private @Nullable String sourcePortRange;
        private @Nullable List sourcePortRanges;
        public Builder() {}
        public Builder(NetworkSecurityGroupSecurityRule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.access = defaults.access;
    	      this.description = defaults.description;
    	      this.destinationAddressPrefix = defaults.destinationAddressPrefix;
    	      this.destinationAddressPrefixes = defaults.destinationAddressPrefixes;
    	      this.destinationApplicationSecurityGroupIds = defaults.destinationApplicationSecurityGroupIds;
    	      this.destinationPortRange = defaults.destinationPortRange;
    	      this.destinationPortRanges = defaults.destinationPortRanges;
    	      this.direction = defaults.direction;
    	      this.name = defaults.name;
    	      this.priority = defaults.priority;
    	      this.protocol = defaults.protocol;
    	      this.sourceAddressPrefix = defaults.sourceAddressPrefix;
    	      this.sourceAddressPrefixes = defaults.sourceAddressPrefixes;
    	      this.sourceApplicationSecurityGroupIds = defaults.sourceApplicationSecurityGroupIds;
    	      this.sourcePortRange = defaults.sourcePortRange;
    	      this.sourcePortRanges = defaults.sourcePortRanges;
        }

        @CustomType.Setter
        public Builder access(String access) {
            if (access == null) {
              throw new MissingRequiredPropertyException("NetworkSecurityGroupSecurityRule", "access");
            }
            this.access = access;
            return this;
        }
        @CustomType.Setter
        public Builder description(@Nullable String description) {

            this.description = description;
            return this;
        }
        @CustomType.Setter
        public Builder destinationAddressPrefix(@Nullable String destinationAddressPrefix) {

            this.destinationAddressPrefix = destinationAddressPrefix;
            return this;
        }
        @CustomType.Setter
        public Builder destinationAddressPrefixes(@Nullable List destinationAddressPrefixes) {

            this.destinationAddressPrefixes = destinationAddressPrefixes;
            return this;
        }
        public Builder destinationAddressPrefixes(String... destinationAddressPrefixes) {
            return destinationAddressPrefixes(List.of(destinationAddressPrefixes));
        }
        @CustomType.Setter
        public Builder destinationApplicationSecurityGroupIds(@Nullable List destinationApplicationSecurityGroupIds) {

            this.destinationApplicationSecurityGroupIds = destinationApplicationSecurityGroupIds;
            return this;
        }
        public Builder destinationApplicationSecurityGroupIds(String... destinationApplicationSecurityGroupIds) {
            return destinationApplicationSecurityGroupIds(List.of(destinationApplicationSecurityGroupIds));
        }
        @CustomType.Setter
        public Builder destinationPortRange(@Nullable String destinationPortRange) {

            this.destinationPortRange = destinationPortRange;
            return this;
        }
        @CustomType.Setter
        public Builder destinationPortRanges(@Nullable List destinationPortRanges) {

            this.destinationPortRanges = destinationPortRanges;
            return this;
        }
        public Builder destinationPortRanges(String... destinationPortRanges) {
            return destinationPortRanges(List.of(destinationPortRanges));
        }
        @CustomType.Setter
        public Builder direction(String direction) {
            if (direction == null) {
              throw new MissingRequiredPropertyException("NetworkSecurityGroupSecurityRule", "direction");
            }
            this.direction = direction;
            return this;
        }
        @CustomType.Setter
        public Builder name(String name) {
            if (name == null) {
              throw new MissingRequiredPropertyException("NetworkSecurityGroupSecurityRule", "name");
            }
            this.name = name;
            return this;
        }
        @CustomType.Setter
        public Builder priority(Integer priority) {
            if (priority == null) {
              throw new MissingRequiredPropertyException("NetworkSecurityGroupSecurityRule", "priority");
            }
            this.priority = priority;
            return this;
        }
        @CustomType.Setter
        public Builder protocol(String protocol) {
            if (protocol == null) {
              throw new MissingRequiredPropertyException("NetworkSecurityGroupSecurityRule", "protocol");
            }
            this.protocol = protocol;
            return this;
        }
        @CustomType.Setter
        public Builder sourceAddressPrefix(@Nullable String sourceAddressPrefix) {

            this.sourceAddressPrefix = sourceAddressPrefix;
            return this;
        }
        @CustomType.Setter
        public Builder sourceAddressPrefixes(@Nullable List sourceAddressPrefixes) {

            this.sourceAddressPrefixes = sourceAddressPrefixes;
            return this;
        }
        public Builder sourceAddressPrefixes(String... sourceAddressPrefixes) {
            return sourceAddressPrefixes(List.of(sourceAddressPrefixes));
        }
        @CustomType.Setter
        public Builder sourceApplicationSecurityGroupIds(@Nullable List sourceApplicationSecurityGroupIds) {

            this.sourceApplicationSecurityGroupIds = sourceApplicationSecurityGroupIds;
            return this;
        }
        public Builder sourceApplicationSecurityGroupIds(String... sourceApplicationSecurityGroupIds) {
            return sourceApplicationSecurityGroupIds(List.of(sourceApplicationSecurityGroupIds));
        }
        @CustomType.Setter
        public Builder sourcePortRange(@Nullable String sourcePortRange) {

            this.sourcePortRange = sourcePortRange;
            return this;
        }
        @CustomType.Setter
        public Builder sourcePortRanges(@Nullable List sourcePortRanges) {

            this.sourcePortRanges = sourcePortRanges;
            return this;
        }
        public Builder sourcePortRanges(String... sourcePortRanges) {
            return sourcePortRanges(List.of(sourcePortRanges));
        }
        public NetworkSecurityGroupSecurityRule build() {
            final var _resultValue = new NetworkSecurityGroupSecurityRule();
            _resultValue.access = access;
            _resultValue.description = description;
            _resultValue.destinationAddressPrefix = destinationAddressPrefix;
            _resultValue.destinationAddressPrefixes = destinationAddressPrefixes;
            _resultValue.destinationApplicationSecurityGroupIds = destinationApplicationSecurityGroupIds;
            _resultValue.destinationPortRange = destinationPortRange;
            _resultValue.destinationPortRanges = destinationPortRanges;
            _resultValue.direction = direction;
            _resultValue.name = name;
            _resultValue.priority = priority;
            _resultValue.protocol = protocol;
            _resultValue.sourceAddressPrefix = sourceAddressPrefix;
            _resultValue.sourceAddressPrefixes = sourceAddressPrefixes;
            _resultValue.sourceApplicationSecurityGroupIds = sourceApplicationSecurityGroupIds;
            _resultValue.sourcePortRange = sourcePortRange;
            _resultValue.sourcePortRanges = sourcePortRanges;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy