rule

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolTCP = "tcp"
	ProtocolUDP = "udp"
	ProtoclICMP = "icmp"
)

Protocol constants

View Source
const CIDRSuffix = "/32"

CIDRSuffix is the netmask for a single IP address.

View Source
const DescriptionPrefix = "AUTOGENERATED: "

DescriptionPrefix is the description to attach to a security group rule.

Variables

This section is empty.

Functions

func Add

func Add(rules []Rule, sg *ec2.SecurityGroup, ec2Client ec2iface.EC2API) error

Add adds ingress and egress rules to a security group.

func Cleanup

func Cleanup(rules []Rule, sg *ec2.SecurityGroup, ec2Client ec2iface.EC2API) error

Cleanup removes rules from a security group which are *not* in the provided list of rules.

func Exists

func Exists(ip string, rule Rule, sg *ec2.SecurityGroup) bool

Exists returns a boolean for whether or not a given IP address in a rule already exists in a security group.

Types

type Rule

type Rule struct {
	// Name is the FQDN.
	Name string `json:"name"`

	// Port is the port to allow traffic to.
	Port int `json:"port"`

	// Protocol is the network protocol.
	Protocol string `json:"protocol"`

	// Egress specifies whether the rule is ingress (default) or egress.
	Egress bool `json:"egress"`

	// CIDRs is populated with the resolved FQDN.
	CIDRs []string
}

Rule is one or more security group rules for a host.

func (*Rule) Resolve

func (r *Rule) Resolve() ([]string, error)

Resolve resolves the rule's name to IP addresses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL