All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.network.NetworkSecurityRuleArgs 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.
// *** 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;
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;
public final class NetworkSecurityRuleArgs extends com.pulumi.resources.ResourceArgs {
public static final NetworkSecurityRuleArgs Empty = new NetworkSecurityRuleArgs();
/**
* Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
*
*/
@Import(name="access", required=true)
private Output access;
/**
* @return Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
*
*/
public Output access() {
return this.access;
}
/**
* A description for this rule. Restricted to 140 characters.
*
*/
@Import(name="description")
private @Nullable Output description;
/**
* @return A description for this rule. Restricted to 140 characters.
*
*/
public Optional> description() {
return Optional.ofNullable(this.description);
}
/**
* CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
*
*/
@Import(name="destinationAddressPrefix")
private @Nullable Output destinationAddressPrefix;
/**
* @return CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
*
*/
public Optional> destinationAddressPrefix() {
return Optional.ofNullable(this.destinationAddressPrefix);
}
/**
* List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
*
*/
@Import(name="destinationAddressPrefixes")
private @Nullable Output> destinationAddressPrefixes;
/**
* @return List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
*
*/
public Optional>> destinationAddressPrefixes() {
return Optional.ofNullable(this.destinationAddressPrefixes);
}
/**
* A List of destination Application Security Group IDs
*
*/
@Import(name="destinationApplicationSecurityGroupIds")
private @Nullable Output destinationApplicationSecurityGroupIds;
/**
* @return A List of destination Application Security Group IDs
*
*/
public Optional> destinationApplicationSecurityGroupIds() {
return Optional.ofNullable(this.destinationApplicationSecurityGroupIds);
}
/**
* 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.
*
*/
@Import(name="destinationPortRange")
private @Nullable Output destinationPortRange;
/**
* @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);
}
/**
* List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
*
*/
@Import(name="destinationPortRanges")
private @Nullable Output> destinationPortRanges;
/**
* @return List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
*
*/
public Optional>> destinationPortRanges() {
return Optional.ofNullable(this.destinationPortRanges);
}
/**
* The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
*
*/
@Import(name="direction", required=true)
private Output direction;
/**
* @return The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
*
*/
public Output direction() {
return this.direction;
}
/**
* The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
*
*/
@Import(name="name")
private @Nullable Output name;
/**
* @return The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
*
*/
public Optional> name() {
return Optional.ofNullable(this.name);
}
/**
* The name of the Network Security Group that we want to attach the rule to. Changing this forces a new resource to be created.
*
*/
@Import(name="networkSecurityGroupName", required=true)
private Output networkSecurityGroupName;
/**
* @return The name of the Network Security Group that we want to attach the rule to. Changing this forces a new resource to be created.
*
*/
public Output networkSecurityGroupName() {
return this.networkSecurityGroupName;
}
/**
* 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.
*
*/
@Import(name="priority", required=true)
private Output priority;
/**
* @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 Output priority() {
return this.priority;
}
/**
* Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
*
*/
@Import(name="protocol", required=true)
private Output protocol;
/**
* @return Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
*
*/
public Output protocol() {
return this.protocol;
}
/**
* The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
*
*/
@Import(name="resourceGroupName", required=true)
private Output resourceGroupName;
/**
* @return The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* 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.
*
*/
@Import(name="sourceAddressPrefix")
private @Nullable Output sourceAddressPrefix;
/**
* @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);
}
/**
* List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
*
*/
@Import(name="sourceAddressPrefixes")
private @Nullable Output> sourceAddressPrefixes;
/**
* @return List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
*
*/
public Optional>> sourceAddressPrefixes() {
return Optional.ofNullable(this.sourceAddressPrefixes);
}
/**
* A List of source Application Security Group IDs
*
*/
@Import(name="sourceApplicationSecurityGroupIds")
private @Nullable Output sourceApplicationSecurityGroupIds;
/**
* @return A List of source Application Security Group IDs
*
*/
public Optional> sourceApplicationSecurityGroupIds() {
return Optional.ofNullable(this.sourceApplicationSecurityGroupIds);
}
/**
* 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.
*
*/
@Import(name="sourcePortRange")
private @Nullable Output sourcePortRange;
/**
* @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);
}
/**
* List of source ports or port ranges. This is required if `source_port_range` is not specified.
*
*/
@Import(name="sourcePortRanges")
private @Nullable Output> sourcePortRanges;
/**
* @return List of source ports or port ranges. This is required if `source_port_range` is not specified.
*
*/
public Optional>> sourcePortRanges() {
return Optional.ofNullable(this.sourcePortRanges);
}
private NetworkSecurityRuleArgs() {}
private NetworkSecurityRuleArgs(NetworkSecurityRuleArgs $) {
this.access = $.access;
this.description = $.description;
this.destinationAddressPrefix = $.destinationAddressPrefix;
this.destinationAddressPrefixes = $.destinationAddressPrefixes;
this.destinationApplicationSecurityGroupIds = $.destinationApplicationSecurityGroupIds;
this.destinationPortRange = $.destinationPortRange;
this.destinationPortRanges = $.destinationPortRanges;
this.direction = $.direction;
this.name = $.name;
this.networkSecurityGroupName = $.networkSecurityGroupName;
this.priority = $.priority;
this.protocol = $.protocol;
this.resourceGroupName = $.resourceGroupName;
this.sourceAddressPrefix = $.sourceAddressPrefix;
this.sourceAddressPrefixes = $.sourceAddressPrefixes;
this.sourceApplicationSecurityGroupIds = $.sourceApplicationSecurityGroupIds;
this.sourcePortRange = $.sourcePortRange;
this.sourcePortRanges = $.sourcePortRanges;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(NetworkSecurityRuleArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private NetworkSecurityRuleArgs $;
public Builder() {
$ = new NetworkSecurityRuleArgs();
}
public Builder(NetworkSecurityRuleArgs defaults) {
$ = new NetworkSecurityRuleArgs(Objects.requireNonNull(defaults));
}
/**
* @param access Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
*
* @return builder
*
*/
public Builder access(Output access) {
$.access = access;
return this;
}
/**
* @param access Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
*
* @return builder
*
*/
public Builder access(String access) {
return access(Output.of(access));
}
/**
* @param description A description for this rule. Restricted to 140 characters.
*
* @return builder
*
*/
public Builder description(@Nullable Output description) {
$.description = description;
return this;
}
/**
* @param description A description for this rule. Restricted to 140 characters.
*
* @return builder
*
*/
public Builder description(String description) {
return description(Output.of(description));
}
/**
* @param destinationAddressPrefix CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
*
* @return builder
*
*/
public Builder destinationAddressPrefix(@Nullable Output destinationAddressPrefix) {
$.destinationAddressPrefix = destinationAddressPrefix;
return this;
}
/**
* @param destinationAddressPrefix CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
*
* @return builder
*
*/
public Builder destinationAddressPrefix(String destinationAddressPrefix) {
return destinationAddressPrefix(Output.of(destinationAddressPrefix));
}
/**
* @param destinationAddressPrefixes List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
*
* @return builder
*
*/
public Builder destinationAddressPrefixes(@Nullable Output> destinationAddressPrefixes) {
$.destinationAddressPrefixes = destinationAddressPrefixes;
return this;
}
/**
* @param destinationAddressPrefixes List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
*
* @return builder
*
*/
public Builder destinationAddressPrefixes(List destinationAddressPrefixes) {
return destinationAddressPrefixes(Output.of(destinationAddressPrefixes));
}
/**
* @param destinationAddressPrefixes List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
*
* @return builder
*
*/
public Builder destinationAddressPrefixes(String... destinationAddressPrefixes) {
return destinationAddressPrefixes(List.of(destinationAddressPrefixes));
}
/**
* @param destinationApplicationSecurityGroupIds A List of destination Application Security Group IDs
*
* @return builder
*
*/
public Builder destinationApplicationSecurityGroupIds(@Nullable Output destinationApplicationSecurityGroupIds) {
$.destinationApplicationSecurityGroupIds = destinationApplicationSecurityGroupIds;
return this;
}
/**
* @param destinationApplicationSecurityGroupIds A List of destination Application Security Group IDs
*
* @return builder
*
*/
public Builder destinationApplicationSecurityGroupIds(String destinationApplicationSecurityGroupIds) {
return destinationApplicationSecurityGroupIds(Output.of(destinationApplicationSecurityGroupIds));
}
/**
* @param destinationPortRange 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.
*
* @return builder
*
*/
public Builder destinationPortRange(@Nullable Output destinationPortRange) {
$.destinationPortRange = destinationPortRange;
return this;
}
/**
* @param destinationPortRange 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.
*
* @return builder
*
*/
public Builder destinationPortRange(String destinationPortRange) {
return destinationPortRange(Output.of(destinationPortRange));
}
/**
* @param destinationPortRanges List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
*
* @return builder
*
*/
public Builder destinationPortRanges(@Nullable Output> destinationPortRanges) {
$.destinationPortRanges = destinationPortRanges;
return this;
}
/**
* @param destinationPortRanges List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
*
* @return builder
*
*/
public Builder destinationPortRanges(List destinationPortRanges) {
return destinationPortRanges(Output.of(destinationPortRanges));
}
/**
* @param destinationPortRanges List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
*
* @return builder
*
*/
public Builder destinationPortRanges(String... destinationPortRanges) {
return destinationPortRanges(List.of(destinationPortRanges));
}
/**
* @param direction The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
*
* @return builder
*
*/
public Builder direction(Output direction) {
$.direction = direction;
return this;
}
/**
* @param direction The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
*
* @return builder
*
*/
public Builder direction(String direction) {
return direction(Output.of(direction));
}
/**
* @param name The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder name(@Nullable Output name) {
$.name = name;
return this;
}
/**
* @param name The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder name(String name) {
return name(Output.of(name));
}
/**
* @param networkSecurityGroupName The name of the Network Security Group that we want to attach the rule to. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder networkSecurityGroupName(Output networkSecurityGroupName) {
$.networkSecurityGroupName = networkSecurityGroupName;
return this;
}
/**
* @param networkSecurityGroupName The name of the Network Security Group that we want to attach the rule to. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder networkSecurityGroupName(String networkSecurityGroupName) {
return networkSecurityGroupName(Output.of(networkSecurityGroupName));
}
/**
* @param priority 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.
*
* @return builder
*
*/
public Builder priority(Output priority) {
$.priority = priority;
return this;
}
/**
* @param priority 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.
*
* @return builder
*
*/
public Builder priority(Integer priority) {
return priority(Output.of(priority));
}
/**
* @param protocol Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
*
* @return builder
*
*/
public Builder protocol(Output protocol) {
$.protocol = protocol;
return this;
}
/**
* @param protocol Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
*
* @return builder
*
*/
public Builder protocol(String protocol) {
return protocol(Output.of(protocol));
}
/**
* @param resourceGroupName The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder resourceGroupName(Output resourceGroupName) {
$.resourceGroupName = resourceGroupName;
return this;
}
/**
* @param resourceGroupName The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
*
* @return builder
*
*/
public Builder resourceGroupName(String resourceGroupName) {
return resourceGroupName(Output.of(resourceGroupName));
}
/**
* @param sourceAddressPrefix 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.
*
* @return builder
*
*/
public Builder sourceAddressPrefix(@Nullable Output sourceAddressPrefix) {
$.sourceAddressPrefix = sourceAddressPrefix;
return this;
}
/**
* @param sourceAddressPrefix 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.
*
* @return builder
*
*/
public Builder sourceAddressPrefix(String sourceAddressPrefix) {
return sourceAddressPrefix(Output.of(sourceAddressPrefix));
}
/**
* @param sourceAddressPrefixes List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
*
* @return builder
*
*/
public Builder sourceAddressPrefixes(@Nullable Output> sourceAddressPrefixes) {
$.sourceAddressPrefixes = sourceAddressPrefixes;
return this;
}
/**
* @param sourceAddressPrefixes List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
*
* @return builder
*
*/
public Builder sourceAddressPrefixes(List sourceAddressPrefixes) {
return sourceAddressPrefixes(Output.of(sourceAddressPrefixes));
}
/**
* @param sourceAddressPrefixes List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
*
* @return builder
*
*/
public Builder sourceAddressPrefixes(String... sourceAddressPrefixes) {
return sourceAddressPrefixes(List.of(sourceAddressPrefixes));
}
/**
* @param sourceApplicationSecurityGroupIds A List of source Application Security Group IDs
*
* @return builder
*
*/
public Builder sourceApplicationSecurityGroupIds(@Nullable Output sourceApplicationSecurityGroupIds) {
$.sourceApplicationSecurityGroupIds = sourceApplicationSecurityGroupIds;
return this;
}
/**
* @param sourceApplicationSecurityGroupIds A List of source Application Security Group IDs
*
* @return builder
*
*/
public Builder sourceApplicationSecurityGroupIds(String sourceApplicationSecurityGroupIds) {
return sourceApplicationSecurityGroupIds(Output.of(sourceApplicationSecurityGroupIds));
}
/**
* @param sourcePortRange 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.
*
* @return builder
*
*/
public Builder sourcePortRange(@Nullable Output sourcePortRange) {
$.sourcePortRange = sourcePortRange;
return this;
}
/**
* @param sourcePortRange 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.
*
* @return builder
*
*/
public Builder sourcePortRange(String sourcePortRange) {
return sourcePortRange(Output.of(sourcePortRange));
}
/**
* @param sourcePortRanges List of source ports or port ranges. This is required if `source_port_range` is not specified.
*
* @return builder
*
*/
public Builder sourcePortRanges(@Nullable Output> sourcePortRanges) {
$.sourcePortRanges = sourcePortRanges;
return this;
}
/**
* @param sourcePortRanges List of source ports or port ranges. This is required if `source_port_range` is not specified.
*
* @return builder
*
*/
public Builder sourcePortRanges(List sourcePortRanges) {
return sourcePortRanges(Output.of(sourcePortRanges));
}
/**
* @param sourcePortRanges List of source ports or port ranges. This is required if `source_port_range` is not specified.
*
* @return builder
*
*/
public Builder sourcePortRanges(String... sourcePortRanges) {
return sourcePortRanges(List.of(sourcePortRanges));
}
public NetworkSecurityRuleArgs build() {
if ($.access == null) {
throw new MissingRequiredPropertyException("NetworkSecurityRuleArgs", "access");
}
if ($.direction == null) {
throw new MissingRequiredPropertyException("NetworkSecurityRuleArgs", "direction");
}
if ($.networkSecurityGroupName == null) {
throw new MissingRequiredPropertyException("NetworkSecurityRuleArgs", "networkSecurityGroupName");
}
if ($.priority == null) {
throw new MissingRequiredPropertyException("NetworkSecurityRuleArgs", "priority");
}
if ($.protocol == null) {
throw new MissingRequiredPropertyException("NetworkSecurityRuleArgs", "protocol");
}
if ($.resourceGroupName == null) {
throw new MissingRequiredPropertyException("NetworkSecurityRuleArgs", "resourceGroupName");
}
return $;
}
}
}