v2

package
v0.30.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSProviderAccountIdGetter added in v0.21.0

func AWSProviderAccountIdGetter(comm Common) *json.Number

func AWSProviderAdditionalRegionsGetter added in v0.21.0

func AWSProviderAdditionalRegionsGetter(comm Common) []string

func AWSProviderProfileGetter added in v0.21.0

func AWSProviderProfileGetter(comm Common) *string

func AWSProviderRegionGetter added in v0.21.0

func AWSProviderRegionGetter(comm Common) *string

func AWSProviderVersionGetter added in v0.21.0

func AWSProviderVersionGetter(comm Common) *string

func AtlantisRoleNameGetter added in v0.24.0

func AtlantisRoleNameGetter(comm Common) *string

func AtlantisRolePathGetter added in v0.24.0

func AtlantisRolePathGetter(comm Common) *string

func BackendAccountIdGetter added in v0.24.0

func BackendAccountIdGetter(comm Common) *string

func BackendBucketGetter added in v0.21.0

func BackendBucketGetter(comm Common) *string

func BackendDynamoTableGetter added in v0.21.0

func BackendDynamoTableGetter(comm Common) *string

func BackendProfileGetter added in v0.21.0

func BackendProfileGetter(comm Common) *string

func BackendRegionGetter added in v0.21.0

func BackendRegionGetter(comm Common) *string

func BlessProviderAdditionalRegionsGetter added in v0.22.0

func BlessProviderAdditionalRegionsGetter(comm Common) []string

func BlessProviderProfileGetter added in v0.22.0

func BlessProviderProfileGetter(comm Common) *string

func BlessProviderRegionGetter added in v0.22.0

func BlessProviderRegionGetter(comm Common) *string

func BlessProviderVersionGetter added in v0.22.0

func BlessProviderVersionGetter(comm Common) *string

func ExtraVarsGetter added in v0.21.0

func ExtraVarsGetter(comm Common) map[string]string

func GithubProviderBaseURLGetter added in v0.30.0

func GithubProviderBaseURLGetter(comm Common) *string

func GithubProviderOrganizationGetter added in v0.30.0

func GithubProviderOrganizationGetter(comm Common) *string

func GithubProviderVersionGetter added in v0.30.0

func GithubProviderVersionGetter(comm Common) *string

func OktaProviderOrgNameGetter added in v0.23.0

func OktaProviderOrgNameGetter(comm Common) *string

func OktaProviderVersionGetter added in v0.23.0

func OktaProviderVersionGetter(comm Common) *string

func OwnerGetter added in v0.21.0

func OwnerGetter(comm Common) *string

func ProjectGetter added in v0.21.0

func ProjectGetter(comm Common) *string

func ResolveModuleTerraformVersion added in v0.21.0

func ResolveModuleTerraformVersion(def Defaults, module v1.Module) *string

func ResolveOptionalString added in v0.21.0

func ResolveOptionalString(getter func(Common) *string, commons ...Common) *string

func ResolveOptionalStringSlice added in v0.21.0

func ResolveOptionalStringSlice(getter func(Common) []string, commons ...Common) []string

func ResolveRequiredInt64 added in v0.21.0

func ResolveRequiredInt64(getter func(Common) *int64, commons ...Common) int64

ResolveRequiredInt will resolve the value and panic if it is nil. Only to be used after validations are run.

func ResolveRequiredString added in v0.21.0

func ResolveRequiredString(getter func(Common) *string, commons ...Common) string

ResolveRequiredString will resolve the value and panic if it is nil. Only to be used after validations are run.

func ResolveStringArray added in v0.21.0

func ResolveStringArray(def []string, override []string) []string

func ResolveStringMap added in v0.21.0

func ResolveStringMap(getter func(Common) map[string]string, commons ...Common) map[string]string

func ResolveTfLint added in v0.23.0

func ResolveTfLint(commons ...Common) v1.TfLint

func ResolveTravis added in v0.25.0

func ResolveTravis(commons ...Common) *v1.TravisCI

func SnowflakeProviderAccountGetter added in v0.21.0

func SnowflakeProviderAccountGetter(comm Common) *string

func SnowflakeProviderRegionGetter added in v0.21.0

func SnowflakeProviderRegionGetter(comm Common) *string

func SnowflakeProviderRoleGetter added in v0.21.0

func SnowflakeProviderRoleGetter(comm Common) *string

func SnowflakeProviderVersionGetter added in v0.22.0

func SnowflakeProviderVersionGetter(comm Common) *string

func TerraformVersionGetter added in v0.21.0

func TerraformVersionGetter(comm Common) *string

func TravisRoleNameGetter added in v0.25.0

func TravisRoleNameGetter(comm Common) *string

func TravisTestCommandGetter added in v0.25.0

func TravisTestCommandGetter(comm Common) *string

func ValidateAWSProvider added in v0.21.0

func ValidateAWSProvider(p *AWSProvider, component string) error

Types

type AWSProvider

type AWSProvider struct {
	// the aws provider is optional (above) but if supplied you must set account id and region
	AccountID         *json.Number `json:"account_id,omitempty" yaml:"account_id,omitempty"`
	AdditionalRegions []string     `json:"additional_regions,omitempty" yaml:"additional_regions,omitempty"`
	Profile           *string      `json:"profile,omitempty" yaml:"profile,omitempty"`
	Region            *string      `json:"region,omitempty" yaml:"region,omitempty"`
	Version           *string      `json:"version,omitempty" yaml:"version,omitempty"`
}

func ResolveAWSProvider added in v0.21.0

func ResolveAWSProvider(commons ...Common) *AWSProvider

ResolveAWSProvider will return an AWSProvder iff one of the required fields is set somewhere in the set of Common config objects passed in. Otherwise it will return nil.

type Account

type Account struct {
	Common `json:",inline" yaml:",inline"`
}

type Atlantis added in v0.24.0

type Atlantis struct {
	Enabled  *bool   `json:"enabled,omitempty"`
	RoleName *string `json:"role_name,omitempty"`
	RolePath *string `json:"role_path,omitempty"`
}

func ResolveAtlantis added in v0.24.0

func ResolveAtlantis(commons ...Common) *Atlantis

type Backend

type Backend struct {
	AccountID   *string `json:"account_id,omitempty" yaml:"account_id,omitempty"`
	Bucket      *string `json:"bucket,omitempty" yaml:"bucket,omitempty"`
	DynamoTable *string `json:"dynamodb_table,omitempty" yaml:"dynamodb_table,omitempty"`
	Profile     *string `json:"profile,omitempty" yaml:"profile,omitempty"`
	Region      *string `json:"region,omitempty" yaml:"region,omitempty"`
}

type BlessProvider added in v0.22.0

type BlessProvider struct {
	// the bless provider is optional (above) but if supplied you must set a region and aws_profile
	AdditionalRegions []string `json:"additional_regions,omitempty" yaml:"additional_regions,omitempty"`
	AWSProfile        *string  `json:"aws_profile,omitempty" yaml:"aws_profile,omitempty"`
	AWSRegion         *string  `json:"aws_region,omitempty" yaml:"aws_region,omitempty"`
	Version           *string  `json:"version,omitempty" yaml:"version,omitempty"`
}

BlessProvider allows for terraform-provider-bless configuration

func ResolveBlessProvider added in v0.22.0

func ResolveBlessProvider(commons ...Common) *BlessProvider

func (*BlessProvider) Validate added in v0.23.0

func (p *BlessProvider) Validate(component string) error

type Common

type Common struct {
	Backend          *Backend          `json:"backend,omitempty" yaml:"backend,omitempty"`
	ExtraVars        map[string]string `json:"extra_vars,omitempty" yaml:"extra_vars,omitempty"`
	Owner            *string           `json:"owner,omitempty" yaml:"owner,omitempty"`
	Project          *string           `json:"project,omitempty" yaml:"project,omitempty"`
	Providers        *Providers        `json:"providers,omitempty" yaml:"providers,omitempty"`
	TerraformVersion *string           `json:"terraform_version,omitempty" yaml:"terraform_version,omitempty"`
	Tools            *Tools            `json:"tools,omitempty" yaml:"tools,omitempty"`
}

type Component

type Component struct {
	Common `json:",inline" yaml:",inline"`

	EKS          *v1.EKSConfig     `json:"eks,omitempty" yaml:"eks,omitempty"`
	Kind         *v1.ComponentKind `json:"kind,omitempty" yaml:"kind,omitempty"`
	ModuleSource *string           `json:"module_source,omitempty" yaml:"module_source,omitempty"`
}

type Config

type Config struct {
	Accounts map[string]Account   `json:"accounts,omitempty" yaml:"accounts,omitempty"`
	Defaults Defaults             `json:"defaults" yaml:"defaults" validate:"required"`
	Docker   bool                 `json:"docker,omitempty" yaml:"docker,omitempty"`
	Envs     map[string]Env       `json:"envs,omitempty" yaml:"envs,omitempty"`
	Global   Component            `json:"global,omitempty" yaml:"global,omitempty"`
	Modules  map[string]v1.Module `json:"modules,omitempty" yaml:"modules,omitempty"`
	Plugins  v1.Plugins           `json:"plugins,omitempty" yaml:"plugins,omitempty"`
	Version  int                  `json:"version,omitempty" yaml:"version,omitempty" validate:"required,eq=2"`
}

func ReadConfig

func ReadConfig(fs afero.Fs, b []byte, configFile string) (*Config, error)

ReadConfig take a byte array as input and outputs a json or yaml config struct

func (*Config) Generate

func (c *Config) Generate(r *rand.Rand, size int) reflect.Value

Generate is used for test/quick integration. There are supposedly ways to do this without polluting the public api, but givent that fogg isn't an api, it doesn't seem like a big deal

func (*Config) Validate

func (c *Config) Validate() ([]string, error)

Validate validates the config

func (*Config) ValidateAWSProviders added in v0.21.0

func (c *Config) ValidateAWSProviders() error

func (*Config) ValidateAtlantis added in v0.24.0

func (c *Config) ValidateAtlantis() error

func (*Config) ValidateBlessProviders added in v0.22.0

func (c *Config) ValidateBlessProviders() error

func (*Config) ValidateOktaProviders added in v0.23.0

func (c *Config) ValidateOktaProviders() error

func (*Config) ValidateSnowflakeProviders added in v0.21.0

func (c *Config) ValidateSnowflakeProviders() error

func (*Config) ValidateToolsTfLint added in v0.23.0

func (c *Config) ValidateToolsTfLint() ([]string, error)

func (*Config) ValidateTravis added in v0.25.0

func (c *Config) ValidateTravis() error

func (*Config) WalkComponents added in v0.21.0

func (c *Config) WalkComponents(f func(component string, commons ...Common))

type Defaults

type Defaults struct {
	Common `json:",inline" yaml:",inline"`
}

type Env

type Env struct {
	Common `json:",inline" yaml:",inline"`

	Components map[string]Component `json:"components,omitempty" yaml:"components,omitempty"`
}

type GithubProvider added in v0.30.0

type GithubProvider struct {
	Organization *string `json:"organization,omitempty" yaml:"organization,omitempty"`
	BaseURL      *string `json:"base_url,omitempty" yaml:"base_url,omitempty"`
	Version      *string `json:"version,omitempty" yaml:"version,omitempty"`
}

func ResolveGithubProvider added in v0.30.0

func ResolveGithubProvider(commons ...Common) *GithubProvider

ResolveGithubProvider will return an GithubProvder iff one of the required fields is set somewhere in the set of Common config objects passed in. Otherwise it will return nil.

type OktaProvider added in v0.23.0

type OktaProvider struct {
	// the okta provider is optional (above) but if supplied you must set an OrgName
	OrgName *string `json:"org_name,omitempty" yaml:"org_name,omitempty"`
	Version *string `json:"version,omitempty" yaml:"version,omitempty"`
}

OktaProvider is an okta provider

func ResolveOktaProvider added in v0.23.0

func ResolveOktaProvider(commons ...Common) *OktaProvider

func (*OktaProvider) Validate added in v0.23.0

func (o *OktaProvider) Validate(component string) error

type Providers

type Providers struct {
	AWS       *AWSProvider       `json:"aws,omitempty" yaml:"aws,omitempty"`
	Bless     *BlessProvider     `json:"bless,omitempty" yaml:"bless,omitempty"`
	Github    *GithubProvider    `json:"github,omitempty" yaml:"github,omitempty"`
	Okta      *OktaProvider      `json:"okta,omitempty" yaml:"okta,omitempty"`
	Snowflake *SnowflakeProvider `json:"snowflake,omitempty" yaml:"snowflake,omitempty"`
}

type SnowflakeProvider added in v0.21.0

type SnowflakeProvider struct {
	Account *string `json:"account,omitempty" yaml:"account,omitempty"`
	Role    *string `json:"role,omitempty" yaml:"role,omitempty"`
	Region  *string `json:"region,omitempty" yaml:"region,omitempty"`
	Version *string `json:"version,omitempty" yaml:"version,omitempty"`
}

func ResolveSnowflakeProvider added in v0.21.0

func ResolveSnowflakeProvider(commons ...Common) *SnowflakeProvider

func (*SnowflakeProvider) Validate added in v0.23.0

func (p *SnowflakeProvider) Validate(component string) error

type Tools

type Tools struct {
	Atlantis *Atlantis    `json:"atlantis,omitempty" yaml:"atlantis,omitempty"`
	TravisCI *v1.TravisCI `json:"travis_ci,omitempty" yaml:"travis_ci,omitempty"`
	TfLint   *v1.TfLint   `json:"tflint,omitempty" yaml:"tflint,omitempty"`
}

Jump to

Keyboard shortcuts

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