awsrulesfn

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package awsrulesfn provides AWS focused endpoint rule functions for evaluating endpoint resolution rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsVirtualHostableS3Bucket

func IsVirtualHostableS3Bucket(input string, allowSubDomains bool) bool

IsVirtualHostableS3Bucket returns if the input is a DNS compatible bucket name and can be used with Amazon S3 virtual hosted style addressing. Similar to [rulesfn.IsValidHostLabel] with the added restriction that the length of label must be [3:63] characters long, all lowercase, and not formatted as an IP address.

Types

type ARN

type ARN struct {
	Partition  string
	Service    string
	Region     string
	AccountId  string
	ResourceId OptionalStringSlice
}

ARN provides AWS ARN components broken out into a data structure.

func ParseARN

func ParseARN(input string) *ARN

ParseARN returns an ARN value parsed from the input string provided. If the ARN cannot be parsed nil will be returned, and error added to [ErrorCollector].

type OptionalStringSlice

type OptionalStringSlice []string

OptionalStringSlice provides a helper to safely get the index of a string slice that may be out of bounds. Returns pointer to string if index is valid. Otherwise returns nil.

func (OptionalStringSlice) Get

func (s OptionalStringSlice) Get(i int) *string

Get returns a string pointer of the string at index i if the index is valid. Otherwise returns nil.

type Partition

type Partition struct {
	ID            string                     `json:"id"`
	Regions       map[string]RegionOverrides `json:"regions"`
	RegionRegex   string                     `json:"regionRegex"`
	DefaultConfig PartitionConfig            `json:"outputs"`
}

Partition provides the metadata describing an AWS partition.

type PartitionConfig

type PartitionConfig struct {
	Name               string `json:"name"`
	DnsSuffix          string `json:"dnsSuffix"`
	DualStackDnsSuffix string `json:"dualStackDnsSuffix"`
	SupportsFIPS       bool   `json:"supportsFIPS"`
	SupportsDualStack  bool   `json:"supportsDualStack"`
}

PartitionConfig provides the endpoint metadata for an AWS region or partition.

func GetPartition

func GetPartition(region string) *PartitionConfig

GetPartition returns an AWS Partition for the region provided. If the partition cannot be determined nil will be returned.

type RegionOverrides

type RegionOverrides struct {
	Name               *string `json:"name"`
	DnsSuffix          *string `json:"dnsSuffix"`
	DualStackDnsSuffix *string `json:"dualStackDnsSuffix"`
	SupportsFIPS       *bool   `json:"supportsFIPS"`
	SupportsDualStack  *bool   `json:"supportsDualStack"`
}

Jump to

Keyboard shortcuts

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