lattice

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxRulePriority       = 100
	InvalidBackendRefTgId = "INVALID"
)
View Source
const (
	K8SServiceNetworkOwnedByVPC = "K8SServiceNetworkOwnedByVPC"
	K8SServiceOwnedByVPC        = "K8SServiceOwnedByVPC"
)
View Source
const (
	K8SClusterNameKey      = aws.TagBase + "ClusterName"
	K8SServiceNameKey      = aws.TagBase + "ServiceName"
	K8SServiceNamespaceKey = aws.TagBase + "ServiceNamespace"
	K8SRouteNameKey        = aws.TagBase + "RouteName"
	K8SRouteNamespaceKey   = aws.TagBase + "RouteNamespace"
	K8SSourceTypeKey       = aws.TagBase + "SourceTypeKey"
	K8SProtocolVersionKey  = aws.TagBase + "ProtocolVersion"

	// Service specific tags
	K8SRouteTypeKey = aws.TagBase + "RouteType"

	MaxNamespaceLength = 55
	MaxNameLength      = 55
	RandomSuffixLength = 10
)
View Source
const (
	TargetGroupTypeIP TargetGroupType = "IP"

	SourceTypeSvcExport K8SSourceType = "ServiceExport"
	SourceTypeHTTPRoute K8SSourceType = "HTTPRoute"
	SourceTypeGRPCRoute K8SSourceType = "GRPCRoute"
	SourceTypeInvalid   K8SSourceType = "INVALID"
)
View Source
const (
	ServiceNetworkType = "ServiceNetwork"
	ServiceType        = "Service"
)
View Source
const AccessLogPolicyTagKey = aws.TagBase + "AccessLogPolicy"

Variables

This section is empty.

Functions

func GenerateTgName added in v0.0.18

func GenerateTgName(spec TargetGroupSpec) string

func TagFieldsMatch added in v0.0.18

func TagFieldsMatch(spec TargetGroupSpec, tags TargetGroupTagFields) bool

func TagsFromTGTagFields added in v1.0.0

func TagsFromTGTagFields(tagFields TargetGroupTagFields) map[string]*string

func TgNamePrefix added in v0.0.18

func TgNamePrefix(spec TargetGroupSpec) string

Types

type AccessLogSubscription added in v0.0.18

type AccessLogSubscription struct {
	core.ResourceMeta `json:"-"`
	Spec              AccessLogSubscriptionSpec    `json:"spec"`
	Status            *AccessLogSubscriptionStatus `json:"status,omitempty"`
}

func NewAccessLogSubscription added in v0.0.18

func NewAccessLogSubscription(
	stack core.Stack,
	spec AccessLogSubscriptionSpec,
	status *AccessLogSubscriptionStatus,
) *AccessLogSubscription

type AccessLogSubscriptionSpec added in v0.0.18

type AccessLogSubscriptionSpec struct {
	SourceType        SourceType
	SourceName        string
	DestinationArn    string
	ALPNamespacedName types.NamespacedName
	EventType         core.EventType
}

type AccessLogSubscriptionStatus added in v0.0.18

type AccessLogSubscriptionStatus struct {
	Arn string `json:"arn"`
}

type IAMAuthPolicy added in v0.0.18

type IAMAuthPolicy struct {
	Type       string
	Name       string
	ResourceId string
	Policy     string
}

func NewIAMAuthPolicy added in v0.0.18

func NewIAMAuthPolicy(k8sPolicy *anv1alpha1.IAMAuthPolicy) IAMAuthPolicy

type IAMAuthPolicyStatus added in v0.0.18

type IAMAuthPolicyStatus struct {
	ResourceId string
}

type K8SSourceType added in v0.0.18

type K8SSourceType string

func GetParentRefType added in v0.0.18

func GetParentRefType(s string) K8SSourceType

type Listener

type Listener struct {
	core.ResourceMeta `json:"-"`
	Spec              ListenerSpec    `json:"spec"`
	Status            *ListenerStatus `json:"status,omitempty"`
}

func NewListener

func NewListener(stack core.Stack, spec ListenerSpec) (*Listener, error)

type ListenerSpec

type ListenerSpec struct {
	StackServiceId    string `json:"stackserviceid"`
	K8SRouteName      string `json:"k8sroutename"`
	K8SRouteNamespace string `json:"k8sroutenamespace"`
	Port              int64  `json:"port"`
	Protocol          string `json:"protocol"`
}

type ListenerStatus

type ListenerStatus struct {
	Name        string `json:"name"`
	ListenerArn string `json:"listenerarn"`
	Id          string `json:"listenerid"`
	ServiceId   string `json:"serviceid"`
}

type RouteType added in v0.0.18

type RouteType string

type Rule

type Rule struct {
	core.ResourceMeta `json:"-"`
	Spec              RuleSpec    `json:"spec"`
	Status            *RuleStatus `json:"status,omitempty"`
}

func NewRule

func NewRule(stack core.Stack, spec RuleSpec) (*Rule, error)

type RuleAction

type RuleAction struct {
	TargetGroups []*RuleTargetGroup `json:"ruletarget"`
}

type RuleSpec

type RuleSpec struct {
	StackListenerId string                   `json:"stacklistenerid"`
	PathMatchValue  string                   `json:"pathmatchvalue"`
	PathMatchExact  bool                     `json:"pathmatchexact"`
	PathMatchPrefix bool                     `json:"pathmatchprefix"`
	MatchedHeaders  []vpclattice.HeaderMatch `json:"matchedheaders"`
	Method          string                   `json:"method"`
	Priority        int64                    `json:"priority"`
	Action          RuleAction               `json:"action"`
	CreateTime      time.Time                `json:"createtime"`
}

type RuleStatus

type RuleStatus struct {
	Name       string `json:"name"`
	Arn        string `json:"arn"`
	Id         string `json:"id"`
	ServiceId  string `json:"serviceid"`
	ListenerId string `json:"listenerid"`
	// we submit priority updates as a batch after all rules have been created/modified
	// this ensures we do not set the same priority on two rules at the same time
	// we have the Priority field here for convenience in these scenarios,
	// so we can check for differences and update as a batch when needed
	Priority int64 `json:"priority"`
}

type RuleTargetGroup

type RuleTargetGroup struct {
	StackTargetGroupId string                `json:"stacktargetgroupid"`
	SvcImportTG        *SvcImportTargetGroup `json:"svcimporttg"`
	LatticeTgId        string                `json:"latticetgid"`
	Weight             int64                 `json:"weight"`
}

type Service

type Service struct {
	core.ResourceMeta `json:"-"`
	Spec              ServiceSpec    `json:"spec"`
	Status            *ServiceStatus `json:"status,omitempty"`
	IsDeleted         bool           `json:"isdeleted"`
}

func NewLatticeService

func NewLatticeService(stack core.Stack, spec ServiceSpec) (*Service, error)

func (*Service) LatticeServiceName added in v0.0.17

func (s *Service) LatticeServiceName() string

type ServiceNetwork

type ServiceNetwork struct {
	core.ResourceMeta `json:"-"`
	Spec              ServiceNetworkSpec    `json:"spec"`
	Status            *ServiceNetworkStatus `json:"status,omitempty"`
}

func NewServiceNetwork

func NewServiceNetwork(stack core.Stack, id string, spec ServiceNetworkSpec) *ServiceNetwork

type ServiceNetworkSpec

type ServiceNetworkSpec struct {
	// The name of the ServiceNetwork
	Name             string    `json:"name"`
	Namespace        string    `json:"namespace"`
	Account          string    `json:"account"`
	SecurityGroupIds []*string `json:"securityGroupIds"`
	AssociateToVPC   bool
	IsDeleted        bool
}

type ServiceNetworkStatus

type ServiceNetworkStatus struct {
	ServiceNetworkARN    string    `json:"servicenetworkARN"`
	ServiceNetworkID     string    `json:"servicenetworkID"`
	SnvaSecurityGroupIds []*string `json:"securityGroupIds"`
}

type ServiceSpec

type ServiceSpec struct {
	ServiceTagFields
	ServiceNetworkNames []string `json:"servicenetworkhnames"`
	CustomerDomainName  string   `json:"customerdomainname"`
	CustomerCertARN     string   `json:"customercertarn"`
}

func (*ServiceSpec) LatticeServiceName added in v0.0.18

func (s *ServiceSpec) LatticeServiceName() string

type ServiceStatus

type ServiceStatus struct {
	Arn string `json:"arn"`
	Id  string `json:"id"`
	Dns string `json:"dns"`
}

type ServiceTagFields added in v0.0.18

type ServiceTagFields struct {
	RouteName      string
	RouteNamespace string
	RouteType      core.RouteType
}

func ServiceTagFieldsFromTags added in v0.0.18

func ServiceTagFieldsFromTags(tags map[string]*string) ServiceTagFields

func (*ServiceTagFields) ToTags added in v0.0.18

func (t *ServiceTagFields) ToTags() services.Tags

type SourceType added in v0.0.18

type SourceType string
const (
	ServiceNetworkSourceType SourceType = "ServiceNetwork"
	ServiceSourceType        SourceType = "Service"
)

type SvcImportTargetGroup added in v0.0.18

type SvcImportTargetGroup struct {
	K8SClusterName      string `json:"k8sclustername"`
	K8SServiceName      string `json:"k8sservicename"`
	K8SServiceNamespace string `json:"k8sservicenamespace"`
	VpcId               string `json:"vpcid"`
}

type Target

type Target struct {
	TargetIP  string `json:"targetip"`
	Port      int64  `json:"port"`
	Ready     bool   `json:"ready"`
	TargetRef types.NamespacedName
}

type TargetGroup

type TargetGroup struct {
	core.ResourceMeta `json:"-"`
	Spec              TargetGroupSpec    `json:"spec"`
	Status            *TargetGroupStatus `json:"status,omitempty"`
	IsDeleted         bool               `json:"isdeleted"`
}

func NewTargetGroup

func NewTargetGroup(stack core.Stack, spec TargetGroupSpec) (*TargetGroup, error)

type TargetGroupSpec

type TargetGroupSpec struct {
	VpcId             string                        `json:"vpcid"`
	Type              TargetGroupType               `json:"type"`
	Port              int32                         `json:"port"`
	Protocol          string                        `json:"protocol"`
	ProtocolVersion   string                        `json:"protocolversion"`
	IpAddressType     string                        `json:"ipaddresstype"`
	HealthCheckConfig *vpclattice.HealthCheckConfig `json:"healthcheckconfig"`
	TargetGroupTagFields
}

func (*TargetGroupSpec) Validate added in v0.0.18

func (t *TargetGroupSpec) Validate() error

type TargetGroupStatus

type TargetGroupStatus struct {
	Name string `json:"name"`
	Arn  string `json:"arn"`
	Id   string `json:"id"`
}

type TargetGroupTagFields added in v0.0.18

type TargetGroupTagFields struct {
	K8SClusterName      string        `json:"k8sclustername"`
	K8SSourceType       K8SSourceType `json:"k8ssourcetype"`
	K8SServiceName      string        `json:"k8sservicename"`
	K8SServiceNamespace string        `json:"k8sservicenamespace"`
	K8SRouteName        string        `json:"k8sroutename"`
	K8SRouteNamespace   string        `json:"k8sroutenamespace"`
	K8SProtocolVersion  string        `json:"k8sprotocolversion"`
}

func TGTagFieldsFromTags added in v0.0.18

func TGTagFieldsFromTags(tags map[string]*string) TargetGroupTagFields

func (*TargetGroupTagFields) IsSourceTypeRoute added in v0.0.18

func (t *TargetGroupTagFields) IsSourceTypeRoute() bool

func (*TargetGroupTagFields) IsSourceTypeServiceExport added in v0.0.18

func (t *TargetGroupTagFields) IsSourceTypeServiceExport() bool

type TargetGroupType

type TargetGroupType string

type Targets

type Targets struct {
	core.ResourceMeta `json:"-"`
	Spec              TargetsSpec `json:"spec"`
}

func NewTargets

func NewTargets(stack core.Stack, spec TargetsSpec) (*Targets, error)

type TargetsSpec

type TargetsSpec struct {
	StackTargetGroupId string   `json:"stacktargetgroupid"`
	TargetList         []Target `json:"targetlist"`
}

unlike target groups, which can reference a service export, targets are always sourced from the local cluster. When we update targets, we find all the target groups linked to the specific service

Jump to

Keyboard shortcuts

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