Documentation
¶
Index ¶
- func LoadAllLocalGraphs(profile string) (cloud.GraphAPI, error)
- func LoadLocalGraphForService(serviceName, profile, region string) cloud.GraphAPI
- func LoadLocalGraphForTypeInAllRegions(serviceName, resType, profile string) (cloud.GraphAPI, error)
- func LoadLocalGraphs(profile, region string) (cloud.GraphAPI, error)
- func LocalRegions(profile string) []string
- type Diff
- type Syncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadLocalGraphForTypeInAllRegions ¶ added in v1.3.0
func LoadLocalGraphForTypeInAllRegions(serviceName, resType, profile string) (cloud.GraphAPI, error)
LoadLocalGraphForTypeInAllRegions merges one resource type from every locally synced region into a single graph, recording on each resource the region it came from.
The region has to be applied here rather than read back from the data, because nothing in a synced graph records it: the region is expressed only by which directory the file sits in. Without this, merging regions would produce a list with no way to tell an instance in us-east-1 from one in eu-west-1 — and, for resources whose ID is a name rather than an ARN, two same-named resources in different regions would collide into one row.
Resources of a global service are returned with a region of "global", since asking for IAM users per region is meaningless.
func LocalRegions ¶ added in v1.3.0
LocalRegions lists the regions that have been synced locally for a profile, in sorted order. The "global" directory is not a region: it holds the services whose resources are not regional (IAM, Route53, CloudFront), and is reported separately by callers that need it.
Types ¶
type Syncer ¶
type Syncer interface {
repo.Repo
// Sync fetches the given services. ctx cancels the outbound AWS calls.
Sync(ctx context.Context, services ...cloud.Service) (map[string]cloud.GraphAPI, error)
}
var DefaultSyncer Syncer
func NewSyncer ¶
NewSyncer builds a Syncer backed by the local git repo in ~/.awless.
It returns an error rather than panicking: repo.New fails on a real runtime condition — an unwritable or unreadable ~/.awless — not a programmer error.
func NoOpSyncer ¶
func NoOpSyncer() Syncer