Skip to content

Commit

Permalink
add action field to the securityRule struct
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazkh committed Aug 23, 2023
1 parent 6232f31 commit e66c620
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ const (
SecurityRuleDirectionOutbound = SecurityRuleDirection("Outbound")
)

// SecurityRuleAction defines the action type for a security group rule.
type SecurityRuleAction string

const (
// SecurityRuleActionAllow allows traffic defined in the rule.
SecurityRuleActionAllow = SecurityRuleAction("Allow")

// SecurityRuleActionDeny denies traffic defined in the rule.
SecurityRuleActionDeny = SecurityRuleAction("Deny")
)

// SecurityRule defines an Azure security rule for security groups.
type SecurityRule struct {
// Name is a unique name within the network security group.
Expand Down Expand Up @@ -297,6 +308,9 @@ type SecurityRule struct {
// Destination is the destination address prefix. CIDR or destination IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
// +optional
Destination *string `json:"destination,omitempty"`
// Action specifies whether network traffic is allowed or denied. "Allow" or "Deny".
// +kubebuilder:validation:Enum=Allow;Deny
Action SecurityRuleAction `json:"action"`
}

// SecurityRules is a slice of Azure security rules for security groups.
Expand Down

0 comments on commit e66c620

Please sign in to comment.