Documentation ¶
Index ¶
- Constants
- Variables
- func CamelCase(i interface{}) interface{}
- func CheckQuery(t *testing.T, item *sdp.Query, itemName string, expectedType string, ...)
- func FormatScope(accountID, region string) string
- func GetAutoConfig(t *testing.T) (aws.Config, string, string)
- func HandleTagsError(ctx context.Context, err error) map[string]string
- func ParseScope(scope string) (string, string, error)
- func PtrBool(v bool) *bool
- func PtrFloat32(v float32) *float32
- func PtrFloat64(v float64) *float64
- func PtrInt32(v int32) *int32
- func PtrInt64(v int64) *int64
- func PtrString(v string) *string
- func PtrTime(v time.Time) *time.Time
- func ToAttributesCase(i interface{}, exclusions ...string) (*sdp.ItemAttributes, error)
- func WrapAWSError(err error) *sdp.QueryError
- type ARN
- type AWSItemType
- type AlwaysGetSource
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Cache() *sdpcache.Cache
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Get(ctx context.Context, scope string, query string, ignoreCache bool) (*sdp.Item, error)
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) List(ctx context.Context, scope string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Name() string
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Scopes() []string
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Search(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) SearchARN(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) SearchCustom(ctx context.Context, scope string, query string) ([]*sdp.Item, error)
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Type() string
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Validate() error
- func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Weight() int
- type ClientStructType
- type DescribeOnlySource
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Cache() *sdpcache.Cache
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Get(ctx context.Context, scope string, query string, ignoreCache bool) (*sdp.Item, error)
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) List(ctx context.Context, scope string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Name() string
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Paginated() bool
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Scopes() []string
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Search(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Type() string
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Validate() error
- func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Weight() int
- type E2ETest
- type GetListSource
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Cache() *sdpcache.Cache
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Get(ctx context.Context, scope string, query string, ignoreCache bool) (*sdp.Item, error)
- func (s *GetListSource[AWSItem, ClientStruct, Options]) List(ctx context.Context, scope string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Name() string
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Scopes() []string
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Search(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *GetListSource[AWSItem, ClientStruct, Options]) SearchARN(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *GetListSource[AWSItem, ClientStruct, Options]) SearchCustom(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Type() string
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Validate() error
- func (s *GetListSource[AWSItem, ClientStruct, Options]) Weight() int
- type InputType
- type LimitBucket
- type MaxParallel
- type OptionsType
- type OutputType
- type Paginator
- type QueryTest
- type QueryTests
- type Subnet
- type VPCConfig
Constants ¶
const DefaultCacheDuration = 1 * time.Hour
const DefaultMaxResultsPerPage = 100
const DefaultRefillDuration = time.Second
DefaultRefillDuration How often LimitBuckets are refilled by default
Variables ¶
var Acronyms = []string{
"ACL",
"ADFS",
"AES",
"AI",
"AMI",
"API",
"ARN",
"ASG",
"AWS",
"AZ",
"CDN",
"CIDR",
"CLI",
"CORS",
"DaaS",
"DDoS",
"DMS",
"DNS",
"DoS",
"EBS",
"EC2",
"ECS",
"EFS",
"EIP",
"ELB",
"EMR",
"ENI",
"FaaS",
"FIFO",
"HPC",
"HTTP",
"HTTPS",
"HVM",
"IaaS",
"IAM",
"ICMP",
"IGW",
"IOPS",
"IOT",
"IP",
"IPSec",
"iSCSI",
"JSON",
"KMS",
"LB",
"MFA",
"MITM",
"MPLS",
"MPP",
"MSTSC",
"NAT",
"NFS",
"NS",
"OLAP",
"OLTP",
"PaaS",
"PCI DSS",
"PV",
"RAID",
"RAM",
"RDS",
"RRS",
"S3",
"S3 IA",
"SaaS",
"SaaS",
"SAML",
"SDK",
"SES",
"SLA",
"SMS",
"SNS",
"SOA",
"SOAP",
"SQS",
"SSE",
"SSH",
"SSL",
"SSO",
"STS",
"SWF",
"TCP",
"TLS",
"TPM",
"TPM",
"TPS",
"TTL",
"VDI",
"VLAN",
"VM",
"VPC",
"VPG",
"VPN",
"VTL",
"WAF",
}
var TestTags = []types.Tag{
{
Key: &purposeKey,
Value: &tagValue,
},
{
Key: &nameKey,
Value: &tagValue,
},
}
Functions ¶
func CamelCase ¶
func CamelCase(i interface{}) interface{}
CamelCase converts all keys in an object to camel case recursively, this includes ignoring known acronyms
func CheckQuery ¶
func CheckQuery(t *testing.T, item *sdp.Query, itemName string, expectedType string, expectedQuery string, expectedScope string)
CheckQuery Checks that an item request matches the expected params
func FormatScope ¶
FormatScope Formats an account ID and region into the corresponding Overmind scope. This will be in the format {accountID}.{region}
func GetAutoConfig ¶
GetAutoConfig Uses automatic local config (i.e. `aws configure`) to get an AWS config object, AWS account ID and region. Skips the tests if this is unavailable
func HandleTagsError ¶
Adds an event to the span to note the error, and returns a set of tags that return a standardised set of tags that contains `errorGettingTags` and `error`
func ParseScope ¶
ParseScope Parses a scope and returns the account id and region
func PtrFloat32 ¶
func PtrFloat64 ¶
func ToAttributesCase ¶
ToAttributesCase Converts any interface to SDP attributes and also fixes case to be the correct `camelCase`. Excluded fields can also be provided, the field names should be provided in the final camelCase format. Arrays are also sorted to ensure consistency.
func WrapAWSError ¶
func WrapAWSError(err error) *sdp.QueryError
WrapAWSError Wraps an AWS error in the appropriate SDP error
Types ¶
type ARN ¶
A parsed representation of the parts of the ARN that Overmind needs to care about
Format example:
arn:partition:service:region:account-id:resource-type:resource-id
func ParseARN ¶
ParseARN Parses an ARN and tries to determine the resource ID from it. The logic is that the resource ID will be the last component when separated by slashes or colons: https://devopscube.com/aws-arn-guide/
func (*ARN) ResourceID ¶
ResourceID The ID of the resource, this is everything after the type and might also include a version or other components depending on the service e.g. ecs-template-ecs-demo-app:1 would be the ResourceID for "arn:aws:ecs:eu-west-1:052392120703:task-definition/ecs-template-ecs-demo-app:1"
type AWSItemType ¶
type AWSItemType any
AWSItemType A struct that represents the item in the AWS API e.g. https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/route53@v1.25.2/types#HostedZone
type AlwaysGetSource ¶
type AlwaysGetSource[ListInput InputType, ListOutput OutputType, GetInput InputType, GetOutput OutputType, ClientStruct ClientStructType, Options OptionsType] struct { ItemType string // The type of items to return Client ClientStruct // The AWS API client AccountID string // The AWS account ID Region string // The AWS region this is related to MaxParallel MaxParallel // How many Get request to run in parallel for a single List request // Disables List(), meaning all calls will return empty results. This does // not affect Search() DisableList bool // A function that gets the details of a given item. This should include the // tags if relevant GetFunc func(ctx context.Context, client ClientStruct, scope string, input GetInput) (*sdp.Item, error) // The input to the ListFunc. This is static ListInput ListInput // A function that maps from the SDP get inputs to the relevant input for // the GetFunc GetInputMapper func(scope, query string) GetInput // If this is set, Search queries will always use the automatic ARN resolver // if the input is an ARN, falling back to the `SearchInputMapper` if it // isn't AlwaysSearchARNs bool // Maps search terms from an SDP Search request into the relevant input for // the ListFunc. If this is not set, Search() will handle ARNs like most AWS // sources. Note that this and `SearchGetInputMapper` are mutually exclusive SearchInputMapper func(scope, query string) (ListInput, error) // Maps search terms from an SDP Search request into the relevant input for // the GetFunc. If this is not set, Search() will handle ARNs like most AWS // sources. Note that this and `SearchInputMapper` are mutually exclusive SearchGetInputMapper func(scope, query string) (GetInput, error) // A function that returns a paginator for the ListFunc ListFuncPaginatorBuilder func(client ClientStruct, input ListInput) Paginator[ListOutput, Options] // A function that accepts the output of a ListFunc and maps this to a slice // of inputs to pass to the GetFunc. The input used for the ListFunc is also // included in case it is required ListFuncOutputMapper func(output ListOutput, input ListInput) ([]GetInput, error) CacheDuration time.Duration // How long to cache items for // contains filtered or unexported fields }
AlwaysGetSource This source is designed for AWS APIs that have separate List and Get functions. It also assumes that the results of the list function cannot be converted directly into items as they do not contain enough information, and therefore they always need to be passed to the Get function before returning. An example is the `ListClusters` API in EKS which returns a list of cluster names.
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Cache ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Cache() *sdpcache.Cache
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) List ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) List(ctx context.Context, scope string, ignoreCache bool) ([]*sdp.Item, error)
List Lists all available items. This is done by running the ListFunc, then passing these results to GetFunc in order to get the details
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Name ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Name() string
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Scopes ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Scopes() []string
List of scopes that this source is capable of find items for. This will be in the format {accountID}.{region}
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Search ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Search(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
Search Searches for AWS resources by ARN
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) SearchARN ¶
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) SearchCustom ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) SearchCustom(ctx context.Context, scope string, query string) ([]*sdp.Item, error)
SearchCustom Searches using custom mapping logic. The SearchInputMapper is used to create an input for ListFunc, at which point the usual logic is used
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Type ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Type() string
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Validate ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Validate() error
Validate Checks that the source has been set up correctly
func (*AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Weight ¶
func (s *AlwaysGetSource[ListInput, ListOutput, GetInput, GetOutput, ClientStruct, Options]) Weight() int
Weight Returns the priority weighting of items returned by this sourcs. This is used to resolve conflicts where two sources of the same type return an item for a GET request. In this instance only one item can be seen on, so the one with the higher weight value will win.
type ClientStructType ¶
type ClientStructType any
ClientStructType represents the AWS API client that actions are run against. This is usually a struct that comes from the `New()` or `NewFromConfig()` functions in the relevant package e.g. https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/eks@v1.26.0#Client
type DescribeOnlySource ¶
type DescribeOnlySource[Input InputType, Output OutputType, ClientStruct ClientStructType, Options OptionsType] struct { MaxResultsPerPage int32 // Max results per page when making API queries ItemType string // The type of items that will be returned CacheDuration time.Duration // How long to cache items for // The function that should be used to describe the resources that this // source is related to DescribeFunc func(ctx context.Context, client ClientStruct, input Input) (Output, error) // A function that returns the input object that will be passed to // DescribeFunc for a GET request InputMapperGet func(scope, query string) (Input, error) // A function that returns the input object that will be passed to // DescribeFunc for a LIST request InputMapperList func(scope string) (Input, error) // A function that maps a search query to the required input. If this is // unset then a search request will default to searching by ARN InputMapperSearch func(ctx context.Context, client ClientStruct, scope string, query string) (Input, error) // A function that returns a paginator for this API. If this is nil, we will // assume that the API is not paginated e.g. // https://aws.github.io/aws-sdk-go-v2/docs/making-requests/#using-paginators PaginatorBuilder func(client ClientStruct, params Input) Paginator[Output, Options] // A function that returns a slice of items for a given output. The scope // and input are passed in on order to assist in creating the items if // needed, but primarily this function should iterate over the output and // create new items for each result OutputMapper func(ctx context.Context, client ClientStruct, scope string, input Input, output Output) ([]*sdp.Item, error) // The region that this source is configured in, each source can only be // configured for one region. Getting data from many regions requires a // source per region. This is used in the scope of returned resources Region string // AccountID The id of the account that is being used. This is used by // sources as the first element in the scope AccountID string // Client The AWS client to use when making requests Client ClientStruct // UseListForGet If true, the source will use the List function to get items // This option should be used when the Describe function does not support // getting a single item by ID. The source will then filter the items // itself. // InputMapperGet should still be defined. It will be used to create the // input for the List function. The output of the List function will be // filtered by the source to find the item with the matching ID. // See the directconnect-virtual-gateway source for an example of this. UseListForGet bool // contains filtered or unexported fields }
DescribeOnlySource Generates a source for AWS APIs that only use a `Describe` function for both List and Get operations. EC2 is a good example of this, where running Describe with no params returns everything, but params can be supplied to reduce the number of results.
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Cache ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Cache() *sdpcache.Cache
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Get ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Get(ctx context.Context, scope string, query string, ignoreCache bool) (*sdp.Item, error)
Get Get a single item with a given scope and query. The item returned should have a UniqueAttributeValue that matches the `query` parameter. The ctx parameter contains a golang context object which should be used to allow this source to timeout or be cancelled when executing potentially long-running actions
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) List ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) List(ctx context.Context, scope string, ignoreCache bool) ([]*sdp.Item, error)
List Lists all items in a given scope
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Name ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Name() string
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Paginated ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Paginated() bool
Paginated returns whether or not this source is using a paginated API
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Scopes ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Scopes() []string
List of scopes that this source is capable of find items for. This will be in the format {accountID}.{region}
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Search ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Search(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
Search Searches for AWS resources by ARN
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Type ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Type() string
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Validate ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Validate() error
Validate Checks that the source is correctly set up and returns an error if not
func (*DescribeOnlySource[Input, Output, ClientStruct, Options]) Weight ¶
func (s *DescribeOnlySource[Input, Output, ClientStruct, Options]) Weight() int
Weight Returns the priority weighting of items returned by this source. This is used to resolve conflicts where two sources of the same type return an item for a GET request. In this instance only one item can be seen on, so the one with the higher weight value will win.
type E2ETest ¶
type E2ETest struct { // The source to test Source discovery.Source // A search query that should return > 0 results GoodSearchQuery *string // Skips get tests SkipGet bool // Skips list tests SkipList bool // Skips checking that a know bad get query returns a NOTFOUND error SkipNotFoundCheck bool // A timeout used for all tests Timeout time.Duration }
E2ETest A struct that runs end to end tests on a fully configured source. These tests aren't particularly detailed, but they are designed to ensure that there aren't any really obvious error when it's actually configured with AWS credentials
type GetListSource ¶
type GetListSource[AWSItem AWSItemType, ClientStruct ClientStructType, Options OptionsType] struct { ItemType string // The type of items that will be returned Client ClientStruct // The AWS API client AccountID string // The AWS account ID Region string // The AWS region this is related to SupportGlobalResources bool // If true, this will also support resources in the "aws" scope which are global CacheDuration time.Duration // How long to cache items for // Disables List(), meaning all calls will return empty results. This does // not affect Search() DisableList bool // GetFunc Gets the details of a specific item, returns the AWS // representation of that item, and an error GetFunc func(ctx context.Context, client ClientStruct, scope string, query string) (AWSItem, error) // ListFunc Lists all items that it can find. Returning a slice of AWS items ListFunc func(ctx context.Context, client ClientStruct, scope string) ([]AWSItem, error) // Optional search func that will be used for Search Requests. If this is // unset, Search will simply use ARNs SearchFunc func(ctx context.Context, client ClientStruct, scope string, query string) ([]AWSItem, error) // ItemMapper Maps an AWS representation of an item to the SDP version ItemMapper func(scope string, awsItem AWSItem) (*sdp.Item, error) // ListTagsFunc Optional function that will be used to list tags for a // resource ListTagsFunc func(context.Context, AWSItem, ClientStruct) (map[string]string, error) // contains filtered or unexported fields }
GetListSource A source for AWS APIs where the Get and List functions both return the full item, such as many of the IAM APIs
func (*GetListSource[AWSItem, ClientStruct, Options]) Cache ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Cache() *sdpcache.Cache
func (*GetListSource[AWSItem, ClientStruct, Options]) List ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) List(ctx context.Context, scope string, ignoreCache bool) ([]*sdp.Item, error)
List Lists all available items. This is done by running the ListFunc, then passing these results to GetFunc in order to get the details
func (*GetListSource[AWSItem, ClientStruct, Options]) Name ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Name() string
func (*GetListSource[AWSItem, ClientStruct, Options]) Scopes ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Scopes() []string
List of scopes that this source is capable of find items for. This will be in the format {accountID}.{region}
func (*GetListSource[AWSItem, ClientStruct, Options]) Search ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Search(ctx context.Context, scope string, query string, ignoreCache bool) ([]*sdp.Item, error)
Search Searches for AWS resources by ARN
func (*GetListSource[AWSItem, ClientStruct, Options]) SearchCustom ¶
func (*GetListSource[AWSItem, ClientStruct, Options]) Type ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Type() string
func (*GetListSource[AWSItem, ClientStruct, Options]) Validate ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Validate() error
Validate Checks that the source has been set up correctly
func (*GetListSource[AWSItem, ClientStruct, Options]) Weight ¶
func (s *GetListSource[AWSItem, ClientStruct, Options]) Weight() int
Weight Returns the priority weighting of items returned by this source. This is used to resolve conflicts where two sources of the same type return an item for a GET request. In this instance only one item can be seen on, so the one with the higher weight value will win.
type InputType ¶
type InputType any
InputType is the type of data that will be sent to the DesribeFunc. This is typically a struct ending with the word Input such as: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/eks@v1.26.0#DescribeClusterInput
type LimitBucket ¶
type LimitBucket struct { // The maximum number of tokens that can be the bucket MaxCapacity int // How many tokens refill per refillDuration RefillRate int // How often tokens refill RefillDuration time.Duration // contains filtered or unexported fields }
LimitBucket A struct that limits API usage in the same way that EC2 does: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/throttling.html
func (*LimitBucket) Start ¶
func (b *LimitBucket) Start(ctx context.Context)
func (*LimitBucket) Wait ¶
func (b *LimitBucket) Wait(ctx context.Context)
Waits for a token. Passing a context allows allows this to add a span event if there is a long wait, and also allows this to be cancelled
type MaxParallel ¶
type MaxParallel int
MaxParallel An integer that defaults to 10
func (MaxParallel) Value ¶
func (m MaxParallel) Value() int
Value Get the value of MaxParallel, defaulting to 10
type OptionsType ¶
type OptionsType any
OptionsType The options struct that is passed to the client when it created, and also to `optFns` when getting more pages: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/eks@v1.26.0#ListClustersPaginator.NextPage
type OutputType ¶
type OutputType any
OutputType is the type of output to expect from the DescribeFunc, this is usually named the same as the input type, but with `Output` on the end e.g. https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/eks@v1.26.0#DescribeClusterOutput
type Paginator ¶
type Paginator[Output OutputType, Options OptionsType] interface { HasMorePages() bool NextPage(context.Context, ...func(Options)) (Output, error) }
Paginator Represents an AWS API Paginator: https://aws.github.io/aws-sdk-go-v2/docs/making-requests/#using-paginators The Output param should be the type of output that this specific paginator returns e.g. *ec2.DescribeInstancesOutput
type QueryTests ¶
type QueryTests []QueryTest
func (QueryTests) Execute ¶
func (i QueryTests) Execute(t *testing.T, item *sdp.Item)
type VPCConfig ¶
type VPCConfig struct { // These are populated after Fetching ID *string // Subnets in this VPC Subnets []*Subnet // contains filtered or unexported fields }
func (*VPCConfig) CreateGateway ¶
CreateGateway Creates a new internet gateway for the duration of the test to save 40$ per month vs running it 24/7
func (*VPCConfig) RunCleanup ¶
func (v *VPCConfig) RunCleanup()