vpc

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSubnetsFound = fmt.Errorf("no subnets found")
View Source
var ErrNoVPCsFound = fmt.Errorf("No VPCs found.")

Functions

func AddIGtoRT

func AddIGtoRT(vpc, ig string, e2 *ec2.Client) (err error)

func AddRouteToRT

func AddRouteToRT(rt, dest, gateway string, e2 *ec2.Client) error

func CreateSubnets

func CreateSubnets(vpc VPC, e2 *ec2.Client) (err error)

func NewIG

func NewIG(vpc VPC, e2 *ec2.Client) (id string, err error)

func NewRT

func NewRT(vpc VPC, e2 *ec2.Client) (err error)

func SubnetsToIds

func SubnetsToIds(subnets []Subnet) (out []string)

func Tag

func Tag(tags []ec2types.Tag, key string) string

func VPCHasIG

func VPCHasIG(v string, e2 *ec2.Client) (id string, err error)

func ValidateCIDR

func ValidateCIDR(cidr string) error

Types

type Route

type Route struct {
	Dest    string
	Gateway string
}

type RouteTable

type RouteTable struct {
	Id     string
	Vpc    string
	Routes []Route
}

func GetRT

func GetRT(v string, e2 *ec2.Client) (RouteTable, error)

func (RouteTable) CoutainsRoute

func (rt RouteTable) CoutainsRoute(dest string) bool

type Subnet

type Subnet struct {
	VPC    string
	AZ     string
	Id     string
	Name   string
	CIDR   string
	CIDRv6 string
}

func GetSubnets

func GetSubnets(v string, e2 *ec2.Client) (subnets []Subnet, err error)

type VPC

type VPC struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	CIDR   string `json:"cidr"`
	CIDRv6 string `json:"cidr_v6"`
}

func GetVPC

func GetVPC(name string, e2 *ec2.Client) (vpc VPC, err error)

func NewVPC

func NewVPC(name string, cidr string, e2 *ec2.Client) (vpc VPC, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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