# VMware Engine v1 API - Class ExternalAccessRule (1.7.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.7.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.6.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.5.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.4.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.3.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.2.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.1.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/1.0.0/Google.Cloud.VmwareEngine.V1.ExternalAccessRule)

    public sealed class ExternalAccessRule : IMessage<ExternalAccessRule>, IEquatable<ExternalAccessRule>, IDeepCloneable<ExternalAccessRule>, IBufferMessage, IMessage

Reference documentation and code samples for the VMware Engine v1 API class ExternalAccessRule.

External access firewall rules for filtering incoming traffic destined to
`ExternalAddress` resources.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ExternalAccessRule

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ExternalAccessRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ExternalAccessRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ExternalAccessRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.VmwareEngine.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1)

## Assembly

Google.Cloud.VmwareEngine.V1.dll

## Constructors

### ExternalAccessRule()

    public ExternalAccessRule()

### ExternalAccessRule(ExternalAccessRule)

    public ExternalAccessRule(ExternalAccessRule other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule` |

## Properties

### Action

    public ExternalAccessRule.Types.Action Action { get; set; }

The action that the external access rule performs.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Types.Action` |   |

### CreateTime

    public Timestamp CreateTime { get; set; }

Output only. Creation time of this resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### Description

    public string Description { get; set; }

User-provided description for this external access rule.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DestinationIpRanges

    public RepeatedField<ExternalAccessRule.Types.IpRange> DestinationIpRanges { get; }

If destination ranges are specified, the external access rule applies only
to the traffic that has a destination IP address in these ranges. The
specified IP addresses must have reserved external IP addresses in the
scope of the parent network policy. To match all external IP addresses in
the scope of the parent network policy, specify `0.0.0.0/0`. To match a
specific external IP address, specify it using the
`IpRange.external_address` property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Types.IpRange` |   |

### DestinationPorts

    public RepeatedField<string> DestinationPorts { get; }

A list of destination ports to which the external access rule applies. This
field is only applicable for the UDP or TCP protocol.
Each entry must be either an integer or a range. For example: `["22"]`,
`["80","443"]`, or `["12345-12349"]`. To match all destination ports,
specify `["0-65535"]`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### ExternalAccessRuleName

    public ExternalAccessRuleName ExternalAccessRuleName { get; set; }

[ExternalAccessRuleName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRuleName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule#Google_Cloud_VmwareEngine_V1_ExternalAccessRule_Name) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRuleName` |   |

### IpProtocol

    public string IpProtocol { get; set; }

The IP protocol to which the external access rule applies. This value can
be one of the following three protocol strings (not case-sensitive):
`tcp`, `udp`, or `icmp`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Name

    public string Name { get; set; }

Output only. The resource name of this external access rule.
Resource names are schemeless URIs that follow the conventions in
<https://cloud.google.com/apis/design/resource_names>.
For example:
`projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Priority

    public int Priority { get; set; }

External access rule priority, which determines the external access rule to
use when multiple rules apply. If multiple rules have the same priority,
their ordering is non-deterministic. If specific ordering is required,
assign unique priorities to enforce such ordering. The external access rule
priority is an integer from 100 to 4096, both inclusive. Lower integers
indicate higher precedence. For example, a rule with priority `100` has
higher precedence than a rule with priority `101`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### SourceIpRanges

    public RepeatedField<ExternalAccessRule.Types.IpRange> SourceIpRanges { get; }

If source ranges are specified, the external access rule applies only to
traffic that has a source IP address in these ranges. These ranges can
either be expressed in the CIDR format or as an IP address. As only inbound
rules are supported, `ExternalAddress` resources cannot be the source IP
addresses of an external access rule. To match all source addresses,
specify `0.0.0.0/0`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Types.IpRange` |   |

### SourcePorts

    public RepeatedField<string> SourcePorts { get; }

A list of source ports to which the external access rule applies. This
field is only applicable for the UDP or TCP protocol.
Each entry must be either an integer or a range. For example: `["22"]`,
`["80","443"]`, or `["12345-12349"]`. To match all source ports, specify
`["0-65535"]`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### State

    public ExternalAccessRule.Types.State State { get; set; }

Output only. The state of the resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.VmwareEngine.V1/latest/Google.Cloud.VmwareEngine.V1.ExternalAccessRule.Types.State` |   |

### Uid

    public string Uid { get; set; }

Output only. System-generated unique identifier for the resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### UpdateTime

    public Timestamp UpdateTime { get; set; }

Output only. Last update time of this resource.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |