client

package
v0.0.0-...-f99fb5f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

TODO: Add multi-region support to AWS Client.

func NewClient

func NewClient(ctx context.Context, logger *logrus.Entry, region string) (*Client, error)

func (*Client) CreateCustomerGateway

func (c *Client) CreateCustomerGateway(ctx context.Context, ip, asn, tag string) (*CustomerGateway, error)

func (*Client) CreateVPNConnection

func (c *Client) CreateVPNConnection(
	ctx context.Context,
	customerGatewayID,
	transitGatewayID string,
	tunnelOptions [2]TunnelOption,
	tag string,
) (*VPNConnection, error)

func (*Client) DeleteCustomerGateway

func (c *Client) DeleteCustomerGateway(ctx context.Context, id string) error

func (*Client) DeleteVPNConnection

func (c *Client) DeleteVPNConnection(ctx context.Context, id string) error

func (*Client) GetDeviceConfiguration

func (c *Client) GetDeviceConfiguration(ctx context.Context, vpnConnectionId string) (*string, error)

func (*Client) GetTransitGateway

func (c *Client) GetTransitGateway(ctx context.Context, name string) (*TransitGateway, error)

func (*Client) GetVPC

func (c *Client) GetVPC(ctx context.Context, name string) (*VPC, error)

func (*Client) ListCustomerGateways

func (c *Client) ListCustomerGateways(ctx context.Context, filters ...ListCustomerGatewayFilter) ([]CustomerGateway, error)

func (*Client) ListTransitGateways

func (c *Client) ListTransitGateways(ctx context.Context) ([]*TransitGateway, error)

func (*Client) ListVPNConnections

func (c *Client) ListVPNConnections(ctx context.Context, filters ...ListVPNConnectionFilter) ([]*VPNConnection, error)

func (*Client) UpdateTransitGateway

func (c *Client) UpdateTransitGateway(ctx context.Context, tgw TransitGateway) error

TODO: Verify if modification doesn't require recreating existing Transit Gateway attachments.

type CustomerGateway

type CustomerGateway struct {
	ID    string
	ASN   string
	IP    string
	State string
	Tags  []Tag
}

func (CustomerGateway) String

func (cgw CustomerGateway) String() string

type ListCustomerGatewayFilter

type ListCustomerGatewayFilter interface {
	GetCustomerGatewayListFilter() types.Filter
}

type ListCustomerGatewayFilterIP

type ListCustomerGatewayFilterIP struct {
	Value string
}

func (ListCustomerGatewayFilterIP) GetCustomerGatewayListFilter

func (f ListCustomerGatewayFilterIP) GetCustomerGatewayListFilter() types.Filter

type ListVPNConnectionFilter

type ListVPNConnectionFilter interface {
	GetVPNConnectionListFilter() types.Filter
}

type ListVPNConnectionFilterCustomerGatewayID

type ListVPNConnectionFilterCustomerGatewayID struct {
	Value string
}

func (ListVPNConnectionFilterCustomerGatewayID) GetVPNConnectionListFilter

func (f ListVPNConnectionFilterCustomerGatewayID) GetVPNConnectionListFilter() types.Filter

type ListVPNConnectionFilterTransitGatewayID

type ListVPNConnectionFilterTransitGatewayID struct {
	Value string
}

func (ListVPNConnectionFilterTransitGatewayID) GetVPNConnectionListFilter

func (f ListVPNConnectionFilterTransitGatewayID) GetVPNConnectionListFilter() types.Filter

type Tag

type Tag struct {
	Key   string
	Value string
}

type TransitGateway

type TransitGateway struct {
	ID string
	// TODO: Replace VPC ID with the list of IDs.
	VPCID string
	ASN   string

	// All these options will be set to enable when creating
	// a connection with a BGP.
	//
	// This is required to automatically accept routes discovered
	// from the second side of connection.
	AutoAcceptSharedAttachments  bool
	DefaultRouteTableAssociation bool
	DefaultRouteTablePropagation bool
	VpnEcmpSupport               bool
	DnsSupport                   bool
}

func (TransitGateway) String

func (tgw TransitGateway) String() string

type TunnelOption

type TunnelOption struct {
	CIDR         string
	PreSharedKey string
}

type VPC

type VPC struct {
	Name string
	CIDR string
}

type VPNConnection

type VPNConnection struct {
	ID                string
	CustomerGatewayID string
	TransitGatewayID  string
	TunnelOptions     []VPNConnectionTunnelOption
	Configuration     string
	Tags              []Tag
}

func (VPNConnection) String

func (vpn VPNConnection) String() string

type VPNConnectionTunnelOption

type VPNConnectionTunnelOption struct {
	// TODO: Improve tunnel options to add additional
	// layers of security.
	CIDR string
}

func (VPNConnectionTunnelOption) String

func (vpn VPNConnectionTunnelOption) String() string

type XMLAddress

type XMLAddress struct {
	IPAddress   string `xml:"ip_address"`
	NetworkMask string `xml:"network_mask,omitempty"`
	NetworkCIDR string `xml:"network_cidr,omitempty"`
}

type XMLBgp

type XMLBgp struct {
	Asn      string `xml:"asn"`
	HoldTime string `xml:"hold_time"`
}

type XMLCustomerGateway

type XMLCustomerGateway struct {
	TunnelOutsideAddress XMLAddress `xml:"tunnel_outside_address"`
	TunnelInsideAddress  XMLAddress `xml:"tunnel_inside_address"`
	Bgp                  XMLBgp     `xml:"bgp"`
}

type XMLDeadPeerDetection

type XMLDeadPeerDetection struct {
	Interval string `xml:"interval"`
	Retries  string `xml:"retries"`
}

type XMLIke

type XMLIke struct {
	AuthenticationProtocol string `xml:"authentication_protocol"`
	EncryptionProtocol     string `xml:"encryption_protocol"`
	Lifetime               string `xml:"lifetime"`
	PerfectForwardSecrecy  string `xml:"perfect_forward_secrecy"`
	Mode                   string `xml:"mode"`
	PreSharedKey           string `xml:"pre_shared_key"`
}

type XMLIpsec

type XMLIpsec struct {
	Protocol                      string               `xml:"protocol"`
	AuthenticationProtocol        string               `xml:"authentication_protocol"`
	EncryptionProtocol            string               `xml:"encryption_protocol"`
	Lifetime                      string               `xml:"lifetime"`
	PerfectForwardSecrecy         string               `xml:"perfect_forward_secrecy"`
	Mode                          string               `xml:"mode"`
	ClearDfBit                    string               `xml:"clear_df_bit"`
	FragmentationBeforeEncryption string               `xml:"fragmentation_before_encryption"`
	TcpMssAdjustment              string               `xml:"tcp_mss_adjustment"`
	DeadPeerDetection             XMLDeadPeerDetection `xml:"dead_peer_detection"`
}

type XMLIpsecTunnel

type XMLIpsecTunnel struct {
	CustomerGateway XMLCustomerGateway `xml:"customer_gateway"`
	VpnGateway      XMLVpnGateway      `xml:"vpn_gateway"`
	Ike             XMLIke             `xml:"ike"`
	Ipsec           XMLIpsec           `xml:"ipsec"`
}

func (XMLIpsecTunnel) String

func (xml XMLIpsecTunnel) String() string

type XMLVpnConnection

type XMLVpnConnection struct {
	XMLName           xml.Name         `xml:"vpn_connection"`
	ID                string           `xml:"id,attr"`
	CustomerGatewayID string           `xml:"customer_gateway_id"`
	VpnGatewayID      string           `xml:"vpn_gateway_id"`
	VpnConnectionType string           `xml:"vpn_connection_type"`
	IpsecTunnels      []XMLIpsecTunnel `xml:"ipsec_tunnel"`
}

func VPNConnectionConfigToObject

func VPNConnectionConfigToObject(config string) (*XMLVpnConnection, error)

func (XMLVpnConnection) String

func (xml XMLVpnConnection) String() string

type XMLVpnGateway

type XMLVpnGateway struct {
	TunnelOutsideAddress XMLAddress `xml:"tunnel_outside_address"`
	TunnelInsideAddress  XMLAddress `xml:"tunnel_inside_address"`
	Bgp                  XMLBgp     `xml:"bgp"`
}

Jump to

Keyboard shortcuts

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