regions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const All = "all"
View Source
const Global = "global"

Variables

This section is empty.

Functions

func IsValid

func IsValid(region string) bool

IsValid returns true if the given region is recognized as valid.

func SetConfigRegion

func SetConfigRegion(cfg *aws.Config, regions []Region)

SetConfigRegion updates the aws.Config value with one of the regions in the passed list, to ensure there is always configured region.

Types

type Region

type Region struct {
	// contains filtered or unexported fields
}

Region holds details on a region as used by the aws.Provider.

func SelectRegions

func SelectRegions(ctx context.Context, configuredRegions []string, awsConfig aws.Config) ([]Region, error)

SelectRegions returns the regions the user has selected, from either the cloudgrep config, AWS config, or prompting. The special value "all" can be present by itself in configuredRegions to automatically select all enabled regions in the account.

func (Region) ID

func (r Region) ID() string

ID returns the identifier for the region, or "global" for the global region.

func (Region) IsGlobal

func (r Region) IsGlobal() bool

IsGlobal returns true if this Region refers to the global region, false otherwise.

func (Region) IsServiceSupported

func (r Region) IsServiceSupported(serviceEndpointID string) bool

IsServiceSupported returns true if the service, identified by its endpoint, is supported in this region. Assumes all services are supported in the global region

func (Region) String

func (r Region) String() string

Jump to

Keyboard shortcuts

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