sync

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAllLocalGraphs

func LoadAllLocalGraphs(profile string) (cloud.GraphAPI, error)

func LoadLocalGraphForService

func LoadLocalGraphForService(serviceName, profile, region string) cloud.GraphAPI

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 LoadLocalGraphs

func LoadLocalGraphs(profile, region string) (cloud.GraphAPI, error)

func LocalRegions added in v1.3.0

func LocalRegions(profile string) []string

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 Diff

type Diff struct {
	From       *repo.Rev
	To         *repo.Rev
	InfraDiff  *graph.Diff
	AccessDiff *graph.Diff
}

Diff represents the deleted/inserted RDF triples of a revision

func BuildDiff

func BuildDiff(from, to *repo.Rev, root string) (*Diff, error)

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

func NewSyncer(l ...*logger.Logger) (Syncer, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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