Documentation ¶
Index ¶
- func API(service string) map[string][]string
- func NewTFState(maps []*Map) (*tf.State, error)
- func Register(id string, newFunc interface{}, iface svcIface, roots ...interface{}) struct{}
- func ServiceNames() []string
- func Walk(maps []*Map, fn WalkFunc) error
- type Call
- type Ctx
- func (ctx *Ctx) ARN(resource ...string) *string
- func (*Ctx) CopyInput(dst interface{}, field string, out output)
- func (*Ctx) Group(dst interface{}, dstField string, src interface{}, srcField string, max int)
- func (*Ctx) HandleError(*aws.Request, *Err)
- func (ctx *Ctx) ImportResources(typ string, attrs tfx.AttrGen) error
- func (*Ctx) Input(out output) interface{}
- func (ctx *Ctx) MakeResources(typ string, attrs tfx.AttrGen) error
- func (ctx *Ctx) Mode(test Mode) bool
- func (ctx *Ctx) SetMode(m Mode)
- func (*Ctx) Split(dst interface{}, dstField string, src interface{}, srcField string)
- func (ctx *Ctx) Strings(src interface{}, srcField string) []string
- func (*Ctx) UpdateRequest(*aws.Request)
- type Err
- type IO
- type Map
- type Mode
- type Opts
- type Service
- type Stats
- type WalkFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func API ¶
API returns a map of all supported APIs and their dependencies for the specified service.
func NewTFState ¶
NewTFState combines resources from all maps into a single Terraform state.
func Register ¶
func Register(id string, newFunc interface{}, iface svcIface, roots ...interface{}) struct{}
Register adds a new scannable service to the registry.
func ServiceNames ¶
func ServiceNames() []string
ServiceNames returns the names of all scannable services.
Types ¶
type Call ¶
type Call struct { ID string `json:"-"` // Unique call ID Stats *Stats `json:"#stats,omitempty"` // Call statistics Src map[string]int `json:"src,omitempty"` // Source call IDs In interface{} `json:"in,omitempty"` // API *Input struct Out []interface{} `json:"out,omitempty"` // API *Output struct Err *Err `json:"err,omitempty"` // Decoded error // contains filtered or unexported fields }
Call is one specific instance of an API call.
type Ctx ¶
type Ctx struct { Map // Scan results // contains filtered or unexported fields }
Ctx contains the scan state for one service/region combination.
func TestCtx ¶
func TestCtx(iface interface{}) *Ctx
TestCtx returns a context for unit testing a scanner implementation.
func (*Ctx) CopyInput ¶
CopyInput copies the value of an Input struct field that generated out into a new Input slice. It is equivalent to:
v := ctx.Input(out).(*T).Field for i := range dst { dst[i].Field = v }
func (*Ctx) Group ¶
Group populates one slice Input struct field in *dst using up to max src slice values. If max is <= 0, then all src values are added to one Input struct. If srcField is specified, src must be a slice of structs or struct pointers containing the named field.
func (*Ctx) HandleError ¶
HandleError can be overridden by service scanners to set err.Ignore flag if the error is part of normal service behavior and is safe to ignore.
func (*Ctx) ImportResources ¶
ImportResources adds new resources to ctx.Resources. See ImportResources method of tfx.ProviderMap for more info.
func (*Ctx) Input ¶
func (*Ctx) Input(out output) interface{}
Input returns the Input struct that generated the given Output struct.
func (*Ctx) MakeResources ¶
MakeResources adds new resources to ctx.Resources. See MakeResources method of tfx.ProviderMap for more info.
func (*Ctx) Split ¶
Split populates one non-slice Input struct field in *dst for each src slice value. If srcField is specified, src must be a slice of structs or struct pointers containing the named field.
func (*Ctx) Strings ¶
Strings extracts string values from a slice of structs or struct pointers containing the named field.
func (*Ctx) UpdateRequest ¶
UpdateRequest can be overridden by service scanners to modify each request before it is sent to fix broken SDK models.
type Err ¶
type Err struct { Status int // HTTP status code Code string // AWS error code Message string // Error message RequestID string // AWS request ID Ignore bool // Error was expected, safe to ignore Cause *Err `json:",omitempty"` // Original cause // contains filtered or unexported fields }
Err contains information about an API call error.
type IO ¶
type IO map[string]interface{}
IO replaces SDK Input/Output struct types in Calls when a Map is compacted.
type Map ¶
type Map struct { arn.Ctx Service string Calls map[string][]*Call Resources map[string]*tf.ResourceState }
Map contains all calls for one account/region/service, indexed by API name. Resources are indexed by Terraform state keys.
type Mode ¶
type Mode uint32
Mode is a bitset that determines service scanning behavior. Scanners may issue different API calls in different modes.
type Opts ¶
type Opts struct { Mode Mode // Scan mode Regions []string // AWS regions Services []string // Service names Workers int // Maximum number of concurrent API calls }
Opts specifies optional scan parameters.
type Service ¶
type Service struct { ID string // Endpoint ID NewFunc interface{} // SDK client constructor Iface interface{} // Scanner implementation Roots []interface{} // Root inputs }
Service contains information about one registered service.
func ServiceInfo ¶
ServiceInfo returns information about one registered service.
type Stats ¶
type Stats struct { Order int // Call issue order (-1 for combined stats) Requests int // Total number of requests Retries int // Number of retried requests Errors int // Number of terminal, non-ignored errors QueueTime float64 // Time spent waiting for a worker ExecTime float64 // Execution time (to worker and back) MinRoundTrip float64 // Fastest response time MaxRoundTrip float64 // Slowest response time // contains filtered or unexported fields }
Stats contains performance information for one or more calls. All times are in seconds.
func (*Stats) RoundTimes ¶
func (s *Stats) RoundTimes()
RoundTimes rounds all times to the nearest millisecond.