settings

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockSettings = Settings{
	Accounts: map[string]Account{
		"perkbox-mock": {
			IamRole:       "arn:aws:iam::123456789:role/cloud-access-bot",
			AccountNumber: "123456789",
		},
		"perkbox-mock2": {
			IamRole:       "arn:aws:iam::9876543221:role/cloud-access-bot",
			AccountNumber: "9876543221",
		},
	},
	IdentiyRegion:  "eu-west-1",
	Regions:        []string{"eu-region-1"},
	LoginRoles:     []string{"SSO-A", "SSO-B"},
	ApprovalGroups: []string{"devops"},
	DynamoDbTable:  "DynamoTableName",
	RequestCommand: "request",
	AuditCommand:   "audit",
}

Functions

This section is empty.

Types

type Account

type Account struct {
	IamRole       string `yaml:"iam_role"`
	AccountNumber string `yaml:"account_number"`
	AccountAlias  string `yaml:"account_alias"`
}

type Settings

type Settings struct {
	Accounts       map[string]Account
	IdentiyRegion  string   `yaml:"identiyRegion"`
	Regions        []string `yaml:"regions"`
	LoginRoles     []string `yaml:"loginRoles"`
	ApprovalGroups []string `yaml:"approvalGroups"`
	DynamoDbTable  string   `yaml:"dynamoDbTable"`
	RequestCommand string   `yaml:"request_command"`
	AuditCommand   string   `yaml:"audit_command"`
}

func NewConfigMock

func NewConfigMock() (Settings, error)

func NewLocalConfig

func NewLocalConfig(path string) (Settings, error)

func NewS3Config

func NewS3Config(cfg aws.Config, key string, bucket string) (Settings, error)

func (Settings) GetAccountNameAccountNum

func (s Settings) GetAccountNameAccountNum(accountNum string) string

func (Settings) GetAccountNames

func (s Settings) GetAccountNames() []string

func (Settings) GetAccountNumFromName

func (s Settings) GetAccountNumFromName(accountName string) string

func (Settings) GetAuditCommand

func (s Settings) GetAuditCommand() string

func (Settings) GetDynamodbTable

func (s Settings) GetDynamodbTable() string

func (Settings) GetLoginRoles

func (s Settings) GetLoginRoles() []string

func (Settings) GetRequestCommand

func (s Settings) GetRequestCommand() string

func (Settings) GetRoleArn

func (s Settings) GetRoleArn(accountName string) (string, error)

Jump to

Keyboard shortcuts

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