hcl

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeResourceData added in v0.0.7

func DecodeResourceData(d *schema.ResourceData, target any) error

DecodeResourceData decodes TF resource data (HCL+schema filters/etc) into the given struct, using the `tf` tag. If a field doesn't have a `tf` tag, it won't be populated.

func EncodeResourceData added in v0.0.7

func EncodeResourceData(in any, d *schema.ResourceData) error

EncodeResourceData sets the values on the given ResourceData according to the struct's tf tags.

Types

type AccessRule added in v1.0.0

type AccessRule struct {
	AppID      string           `tf:"app"`
	Action     string           `tf:"action"`
	Name       string           `tf:"name"`
	Exceptions []AccessRuleItem `tf:"exception"`
	Includes   []AccessRuleItem `tf:"include"`
	Requires   []AccessRuleItem `tf:"require"`
}

func (*AccessRule) ResourceURL added in v1.0.0

func (h *AccessRule) ResourceURL(ID string) string

func (*AccessRule) ToTG added in v1.0.0

func (h *AccessRule) ToTG() tg.AppAccessRule

func (*AccessRule) URL added in v1.0.0

func (h *AccessRule) URL() string

func (*AccessRule) UpdateFromTG added in v1.0.0

func (h *AccessRule) UpdateFromTG(r tg.AppAccessRule)

type AccessRuleItem added in v1.0.0

type AccessRuleItem struct {
	Emails         []string `tf:"emails"`
	Everyone       bool     `tf:"everyone"`
	IPRanges       []string `tf:"ip_ranges"`
	Countries      []string `tf:"countries"`
	EmailsEndingIn []string `tf:"emails_ending_in"`
	IDPGroups      []string `tf:"idp_groups"`
	AccessGroups   []string `tf:"access_groups"`
}

func (*AccessRuleItem) ToTG added in v1.0.0

func (h *AccessRuleItem) ToTG() *tg.AppAccessRuleItem

func (*AccessRuleItem) UpdateFromTG added in v1.0.0

func (h *AccessRuleItem) UpdateFromTG(item tg.AppAccessRuleItem)

type Alarm added in v1.9.0

type Alarm struct {
	UID         string    `tf:"uid"`
	Name        string    `tf:"name"`
	Channels    []string  `tf:"channels"`
	Description string    `tf:"description"`
	Expr        string    `tf:"expr"`
	FreeText    string    `tf:"freetext"`
	Nodes       []string  `tf:"nodes"`
	Operator    string    `tf:"operator"`
	TagOperator string    `tf:"tag_operator"`
	Tags        []tagging `tf:"tag"`
	Enabled     bool      `tf:"enabled"`
	Threshold   string    `tf:"threshold"`
	Types       []string  `tf:"types"`
}

func (*Alarm) ResourceURL added in v1.9.0

func (h *Alarm) ResourceURL(ID string) string

func (*Alarm) ToTG added in v1.9.0

func (h *Alarm) ToTG() tg.Alarm

func (*Alarm) URL added in v1.9.0

func (h *Alarm) URL() string

func (*Alarm) UpdateFromTG added in v1.9.0

func (h *Alarm) UpdateFromTG(a tg.Alarm)

type AlarmChannel added in v1.9.0

type AlarmChannel struct {
	UID            string         `tf:"uid"`
	Name           string         `tf:"name"`
	Emails         []string       `tf:"emails"`
	GenericWebhook string         `tf:"generic_webhook"`
	MSTeams        string         `tf:"ms_teams"`
	OpsGenie       string         `tf:"ops_genie"`
	Pagerduty      string         `tf:"pagerduty"`
	Slack          []slackChannel `tf:"slack"`
}

func (*AlarmChannel) ResourceURL added in v1.9.0

func (h *AlarmChannel) ResourceURL(ID string) string

func (*AlarmChannel) ToTG added in v1.9.0

func (h *AlarmChannel) ToTG() tg.AlarmChannel

func (*AlarmChannel) URL added in v1.9.0

func (h *AlarmChannel) URL() string

func (*AlarmChannel) UpdateFromTG added in v1.9.0

func (h *AlarmChannel) UpdateFromTG(a tg.AlarmChannel)

type App added in v1.0.0

type App struct {
	AppType             string   `tf:"type"`
	Name                string   `tf:"name"`
	UID                 string   `tf:"uid"`
	Description         string   `tf:"description"`
	EdgeNodeID          string   `tf:"edge_node"`
	GatewayNodeID       string   `tf:"gateway_node"`
	IDPID               string   `tf:"idp"`
	IP                  string   `tf:"ip"`
	Port                int      `tf:"port"`
	Protocol            string   `tf:"protocol"`
	Hostname            string   `tf:"hostname"`
	SessionDuration     int      `tf:"session_duration"`
	TLSVerificationMode string   `tf:"tls_verification_mode"`
	TrustMode           string   `tf:"trust_mode"`
	GroupIDs            []string `tf:"visibility_groups"`
	WireGuardTemplate   string   `tf:"wireguard_template"`
	VRF                 string   `tf:"vrf"`
	VirtualNetwork      string   `tf:"virtual_network"`
	VirtualSourceIP     string   `tf:"virtual_source_ip"`
}

func (*App) ResourceURL added in v1.0.0

func (h *App) ResourceURL(ID string) string

func (*App) ToTG added in v1.0.0

func (h *App) ToTG() tg.App

func (*App) URL added in v1.0.0

func (h *App) URL() string

func (*App) UpdateFromTG added in v1.0.0

func (h *App) UpdateFromTG(a tg.App)

type AppACL added in v1.0.0

type AppACL struct {
	AppID       string   `tf:"app"`
	Description string   `tf:"description"`
	IPs         []string `tf:"ips"`
	PortRange   string   `tf:"port_range"`
	Protocol    string   `tf:"protocol"`
}

func (*AppACL) ResourceURL added in v1.0.0

func (h *AppACL) ResourceURL(ID string) string

func (*AppACL) ToTG added in v1.0.0

func (h *AppACL) ToTG() *tg.AppACL

func (*AppACL) URL added in v1.0.0

func (h *AppACL) URL() string

func (*AppACL) UpdateFromTG added in v1.0.0

func (h *AppACL) UpdateFromTG(r tg.AppACL)

type Connector added in v1.6.0

type Connector struct {
	NodeID      string `tf:"node_id"`
	ClusterFQDN string `tf:"cluster_fqdn"`
	Node        string `tf:"node"`
	Port        int    `tf:"port"`
	Protocol    string `tf:"protocol"`
	Service     string `tf:"service"`
	Description string `tf:"description"`
	RateLimit   int    `tf:"rate_limit,omitempty"`
}

func (*Connector) ToTG added in v1.6.0

func (c *Connector) ToTG(id string) tg.Connector

func (*Connector) UpdateFromTG added in v1.6.0

func (c *Connector) UpdateFromTG(conn tg.Connector)

type Group added in v1.3.7

type Group struct {
	Name        string `tf:"name"`
	UID         string `tf:"uid"`
	IDPID       string `tf:"idp_id"`
	Description string `tf:"description"`
}

Group holds the HCL representation of a group

func (*Group) ResourceURL added in v1.3.7

func (g *Group) ResourceURL(ID string) string

ResourceURL returns the URL for a specific group on the TG API side

func (*Group) ToTG added in v1.3.7

func (g *Group) ToTG() tg.Group

ToTG returns the TG API representation of a group from the HCL representation

func (*Group) URL added in v1.3.7

func (g *Group) URL() string

URL returns the URL for the group resource on the TG API side

func (*Group) UpdateFromTG added in v1.3.7

func (g *Group) UpdateFromTG(o tg.Group)

UpdateFromTG updates the HCL representation of a group from the TG API representation

type GroupMember added in v1.3.7

type GroupMember struct {
	GroupID string `tf:"group_id"`
	Email   string `tf:"email"`
}

GroupMember holds the HCL representation of a group member

type IDP added in v1.0.0

type IDP struct {
	UID         string `tf:"uid"`
	Type        string `tf:"type"`
	Description string `tf:"description"`
	Name        string `tf:"name"`
}

IDP holds HCL-marshaled TF state for an IDP

func (*IDP) ResourceURL added in v1.0.0

func (h *IDP) ResourceURL() string

ResourceURL sends back the IDP's specific URL for the TG API

func (*IDP) ToTG added in v1.0.0

func (h *IDP) ToTG() *tg.IDP

ToTG returns the IDP converted to a TG API consumable IDP

func (*IDP) URL added in v1.0.0

func (h *IDP) URL() string

URL sends back the generic IDP management URL for the TG API

func (*IDP) UpdateFromTG added in v1.0.0

func (h *IDP) UpdateFromTG(r tg.IDP)

UpdateFromTG updates the IDP with the IDP from the TG API

type IDPOpenIDConfig added in v1.3.7

type IDPOpenIDConfig struct {
	UID              string `tf:"idp_id"`
	Issuer           string `tf:"issuer"`
	ClientID         string `tf:"client_id"`
	Secret           string `tf:"secret"`
	AuthEndpoint     string `tf:"auth_endpoint"`
	TokenEndpoint    string `tf:"token_endpoint"`
	UserInfoEndpoint string `tf:"user_info_endpoint"`
}

IDPOpenIDConfig holds HCL-marshaled TF state for an IDP OpenID config

func (*IDPOpenIDConfig) ResourceURL added in v1.3.7

func (idp *IDPOpenIDConfig) ResourceURL(ID string) string

ResourceURL sends back the IDP OpenID config's specific URL for the TG API

func (*IDPOpenIDConfig) ToTG added in v1.3.7

func (idp *IDPOpenIDConfig) ToTG() tg.IDPOpenIDConfig

ToTG returns the IDP OpenID config converted to a TG API consumable IDP OpenID config

func (*IDPOpenIDConfig) UpdateFromTG added in v1.3.7

func (idp *IDPOpenIDConfig) UpdateFromTG(o tg.IDPOpenIDConfig)

UpdateFromTG updates the IDP OpenID config with the IDP OpenID config from the TG API

type IDPSAMLConfig added in v1.3.7

type IDPSAMLConfig struct {
	UID      string `tf:"idp_id"`
	LoginURL string `tf:"login_url"`
	Issuer   string `tf:"issuer"`
	Cert     string `tf:"cert"`
}

IDPSAMLConfig holds HCL-marshaled TF state for an IDP SAML config

func (*IDPSAMLConfig) ResourceURL added in v1.3.7

func (idp *IDPSAMLConfig) ResourceURL(ID string) string

ResourceURL sends back the IDP SAML config's specific URL for the TG API

func (*IDPSAMLConfig) ToTG added in v1.3.7

func (idp *IDPSAMLConfig) ToTG() tg.IDPSAMLConfig

ToTG returns the IDP SAML config converted to a TG API consumable IDP SAML config

func (*IDPSAMLConfig) UpdateFromTG added in v1.3.7

func (idp *IDPSAMLConfig) UpdateFromTG(o tg.IDPSAMLConfig)

UpdateFromTG updates the IDP SAML config with the IDP SAML config from the TG API

type KVMImage added in v1.0.0

type KVMImage struct {
	NodeID string `tf:"node_id"`
	UID    string `tf:"uid"`

	Description string `tf:"description"`
	DisplayName string `tf:"display_name"`
	Location    string `tf:"location"`
	OS          string `tf:"os"`
}

func (*KVMImage) ResourceURL added in v1.0.0

func (h *KVMImage) ResourceURL(ID string) string

func (*KVMImage) ToTG added in v1.0.0

func (h *KVMImage) ToTG() *tg.KVMImage

func (*KVMImage) URL added in v1.0.0

func (h *KVMImage) URL() string

func (*KVMImage) UpdateFromTG added in v1.0.0

func (h *KVMImage) UpdateFromTG(r tg.KVMImage)

type KVMVolume added in v1.0.0

type KVMVolume struct {
	NodeID string `tf:"node_id"`

	Name          string `tf:"name"`
	DeviceType    string `tf:"device_type"`
	DeviseBus     string `tf:"device_bus"`
	Size          int    `tf:"size"`
	ProvisionType string `tf:"provision_type"`
	Encrypted     bool   `tf:"encrypted"`
	Path          string `tf:"path"`
}

func (*KVMVolume) ResourceURL added in v1.0.0

func (h *KVMVolume) ResourceURL() string

func (*KVMVolume) ToTG added in v1.0.0

func (h *KVMVolume) ToTG() *tg.KVMVolume

func (*KVMVolume) URL added in v1.0.0

func (h *KVMVolume) URL() string

func (*KVMVolume) UpdateFromTG added in v1.0.0

func (h *KVMVolume) UpdateFromTG(r tg.KVMVolume)

type NetworkConfig added in v1.0.0

type NetworkConfig struct {
	DarkMode   bool `tf:"dark_mode"`
	Forwarding bool `tf:"forwarding"`

	Tunnels []NetworkTunnel `tf:"tunnel"`

	Interfaces []NetworkInterface `tf:"interface"`

	VRFs []VRF `tf:"vrf"`
}

func (*NetworkConfig) ToTG added in v1.0.0

func (h *NetworkConfig) ToTG() tg.NetworkConfig

func (*NetworkConfig) UpdateFromTG added in v1.0.0

func (h *NetworkConfig) UpdateFromTG(c tg.NetworkConfig)

type NetworkInterface added in v1.0.0

type NetworkInterface struct {
	NIC         string         `tf:"nic"`
	Routes      []NetworkRoute `tf:"route,omitempty"`
	CloudRoutes []NetworkRoute `tf:"cloud_route,omitempty"`
	ClusterIP   string         `tf:"cluster_ip,omitempty"`
	DHCP        bool           `tf:"dhcp"`
	Gateway     string         `tf:"gateway"`
	IP          string         `tf:"ip"`
	Mode        string         `tf:"mode,omitempty"`
	DNS         []string       `tf:"dns,omitempty"`
	Duplex      string         `tf:"duplex,omitempty"`
	Speed       int            `tf:"speed,omitempty"`
}

type NetworkRoute added in v1.7.0

type NetworkRoute struct {
	Route       string `tf:"route"`
	Description string `tf:"description"`
}

type NetworkTunnel added in v1.0.0

type NetworkTunnel struct {
	Enabled       bool   `tf:"enabled"`
	Name          string `tf:"name"`
	IKE           int    `tf:"ike,omitempty"`
	IKECipher     string `tf:"ike_cipher,omitempty"`
	IKEGroup      int    `tf:"ike_group,omitempty"`
	RekeyInterval int    `tf:"rekey_interval,omitempty"`
	IP            string `tf:"ip,omitempty"`
	Destination   string `tf:"destination,omitempty"`
	IPSecCipher   string `tf:"ipsec_cipher,omitempty"`
	PSK           string `tf:"psk,omitempty"`
	VRF           string `tf:"vrf,omitempty"`
	Type          string `tf:"type"`
	MTU           int    `tf:"mtu"`
	NetworkID     int    `tf:"network_id"`
	LocalID       string `tf:"local_id,omitempty"`
	RemoteID      string `tf:"remote_id,omitempty"`
	DPDRetries    int    `tf:"dpd_retries,omitempty"`
	DPDInterval   int    `tf:"dpd_interval,omitempty"`
	IFace         string `tf:"iface,omitempty"`
	PFS           int    `tf:"pfs"`
	ReplayWindow  int    `tf:"replay_window,omitempty"`
	RemoteSubnet  string `tf:"remote_subnet,omitempty"`
	LocalSubnet   string `tf:"local_subnet,omitempty"`
}

type Node added in v1.3.0

type Node struct {
	UID     string `tf:"node_id"`
	Enabled bool   `tf:"enabled"`
}

func (*Node) ResourceURL added in v1.3.0

func (h *Node) ResourceURL(ID string) string

func (*Node) ToTG added in v1.3.0

func (h *Node) ToTG() tg.NodeState

func (*Node) URL added in v1.3.0

func (h *Node) URL() string

func (*Node) UpdateFromTG added in v1.3.0

func (h *Node) UpdateFromTG(a tg.NodeState)

type PortalAuth added in v1.4.0

type PortalAuth struct {
	IDPID  string `tf:"idp_id"`
	Domain string `tf:"domain"`
}

func (*PortalAuth) ToTG added in v1.4.0

func (p *PortalAuth) ToTG() *tg.PortalAuth

ToTG returns the auth info converted to a TG API consumable

func (*PortalAuth) UpdateFromTG added in v1.4.0

func (p *PortalAuth) UpdateFromTG(r tg.PortalAuth)

UpdateFromTG updates the HCL struct with data from the TG API

type Service added in v1.6.0

type Service struct {
	NodeID      string `tf:"node_id"`
	ClusterFQDN string `tf:"cluster_fqdn"`
	Name        string `tf:"name"`
	Host        string `tf:"host"`
	Port        int    `tf:"port"`
	Protocol    string `tf:"protocol"`
	Description string `tf:"description"`
}

func (*Service) ToTG added in v1.6.0

func (s *Service) ToTG(id string) tg.Service

func (*Service) UpdateFromTG added in v1.6.0

func (s *Service) UpdateFromTG(svc tg.Service)

type Tagging added in v1.9.0

type Tagging struct {
	NodeID      string            `tf:"node_id"`
	ClusterFQDN string            `tf:"cluster_fqdn"`
	Tags        map[string]string `tf:"tags"`
}

type VRF added in v1.0.0

type VRF struct {
	Name       string     `tf:"name"`
	Forwarding bool       `tf:"forwarding"`
	ACLs       []VRFACL   `tf:"acl,omitempty"`
	Routes     []VRFRoute `tf:"route,omitempty"`
	NATs       []VRFNAT   `tf:"nat,omitempty"`
	Rules      []VRFRule  `tf:"rule,omitempty"`
}

type VRFACL added in v1.0.0

type VRFACL struct {
	Action      string `tf:"action"`
	Description string `tf:"description"`
	Protocol    string `tf:"protocol"`
	Source      string `tf:"source"`
	Dest        string `tf:"dest"`
	Line        int    `tf:"line"`
}

type VRFNAT added in v1.0.0

type VRFNAT struct {
	Source     string `tf:"source,omitempty"`
	Dest       string `tf:"dest,omitempty"`
	Masquerade bool   `tf:"masquerade"`
	ToSource   string `tf:"to_source,omitempty"`
	ToDest     string `tf:"to_dest,omitempty"`
}

type VRFRoute added in v1.0.0

type VRFRoute struct {
	Dest        string `tf:"dest"`
	Dev         string `tf:"dev"`
	Description string `tf:"description"`
	Metric      int    `tf:"metric"`
}

type VRFRule added in v1.0.0

type VRFRule struct {
	Protocol    string `tf:"protocol"`
	Line        int    `tf:"line"`
	Action      string `tf:"action"`
	Description string `tf:"description,omitempty"`
	Source      string `tf:"source,omitempty"`
	VRF         string `tf:"vrf,omitempty"`
	Dest        string `tf:"dest,omitempty"`
}

Jump to

Keyboard shortcuts

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