config

package
v1.87.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultStackConfigFileExtension       = ".yaml"
	DefaultVendoringManifestFileExtension = ".yaml"
	CliConfigFileName                     = "atmos.yaml"
	SystemDirConfigFilePath               = "/usr/local/etc/atmos"
	WindowsAppDataEnvVar                  = "LOCALAPPDATA"

	// GlobalOptionsFlag is a custom flag to specify helmfile `GLOBAL OPTIONS`
	// https://github.com/roboll/helmfile#cli-reference
	GlobalOptionsFlag = "--global-options"

	TerraformCommandFlag        = "--terraform-command"
	TerraformDirFlag            = "--terraform-dir"
	HelmfileCommandFlag         = "--helmfile-command"
	HelmfileDirFlag             = "--helmfile-dir"
	CliConfigDirFlag            = "--config-dir"
	StackDirFlag                = "--stacks-dir"
	BasePathFlag                = "--base-path"
	WorkflowDirFlag             = "--workflows-dir"
	KubeConfigConfigFlag        = "--kubeconfig-path"
	JsonSchemaDirFlag           = "--schemas-jsonschema-dir"
	OpaDirFlag                  = "--schemas-opa-dir"
	CueDirFlag                  = "--schemas-cue-dir"
	AtmosManifestJsonSchemaFlag = "--schemas-atmos-manifest"

	DeployRunInitFlag           = "--deploy-run-init"
	AutoGenerateBackendFileFlag = "--auto-generate-backend-file"
	InitRunReconfigure          = "--init-run-reconfigure"

	FromPlanFlag       = "--from-plan"
	PlanFileFlag       = "--planfile"
	DryRunFlag         = "--dry-run"
	SkipInitFlag       = "--skip-init"
	RedirectStdErrFlag = "--redirect-stderr"

	HelpFlag1 = "-h"
	HelpFlag2 = "--help"

	ComponentVendorConfigFileName = "component.yaml"
	AtmosVendorConfigFileName     = "vendor.yaml"

	ImportSectionName      = "import"
	OverridesSectionName   = "overrides"
	ProvidersSectionName   = "providers"
	VarsSectionName        = "vars"
	SettingsSectionName    = "settings"
	EnvSectionName         = "env"
	BackendSectionName     = "backend"
	BackendTypeSectionName = "backend_type"
	MetadataSectionName    = "metadata"
	ComponentSectionName   = "component"
	ComponentsSectionName  = "components"
	CommandSectionName     = "command"
	TerraformSectionName   = "terraform"
	HelmfileSectionName    = "helmfile"

	LogsLevelFlag = "--logs-level"
	LogsFileFlag  = "--logs-file"

	SettingsListMergeStrategyFlag = "--settings-list-merge-strategy"

	// Atmos Pro
	AtmosProBaseUrlEnvVarName  = "ATMOS_PRO_BASE_URL"
	AtmosProEndpointEnvVarName = "ATMOS_PRO_ENDPOINT"
	AtmosProTokenEnvVarName    = "ATMOS_PRO_TOKEN"
	AtmosProDefaultBaseUrl     = "https://app.cloudposse.com"
	AtmosProDefaultEndpoint    = "api"
)

Variables

View Source
var (
	NotFound = errors.New("\n'atmos.yaml' CLI config was not found in any of the searched paths: system dir, home dir, current dir, ENV vars." +
		"\nYou can download a sample config and adapt it to your requirements from " +
		"https://raw.githubusercontent.com/cloudposse/atmos/main/examples/quick-start-advanced/atmos.yaml")
)

Functions

func FindAllStackConfigsInPaths added in v1.4.13

func FindAllStackConfigsInPaths(
	cliConfig schema.CliConfiguration,
	includeStackPaths []string,
	excludeStackPaths []string,
) ([]string, []string, error)

FindAllStackConfigsInPaths finds all stack manifests in the paths specified by globs

func FindAllStackConfigsInPathsForStack added in v1.4.13

func FindAllStackConfigsInPathsForStack(
	cliConfig schema.CliConfiguration,
	stack string,
	includeStackPaths []string,
	excludeStackPaths []string,
) ([]string, []string, bool, error)

FindAllStackConfigsInPathsForStack finds all stack manifests in the paths specified by globs for the provided stack

func GetContextFromVars added in v1.3.5

func GetContextFromVars(vars map[any]any) schema.Context

GetContextFromVars creates a context object from the provided variables

func GetContextPrefix added in v1.3.5

func GetContextPrefix(stack string, context schema.Context, stackNamePattern string, stackFile string) (string, error)

GetContextPrefix calculates context prefix from the context

func GetStackNameFromContextAndStackNamePattern added in v1.4.9

func GetStackNameFromContextAndStackNamePattern(
	namespace string,
	tenant string,
	environment string,
	stage string,
	stackNamePattern string,
) (string, error)

GetStackNameFromContextAndStackNamePattern calculates stack name from the provided context using the provided stack name pattern

func InitCliConfig added in v1.10.0

func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.CliConfiguration, error)

InitCliConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63

func ReplaceContextTokens added in v1.3.5

func ReplaceContextTokens(context schema.Context, pattern string) string

ReplaceContextTokens replaces context tokens in the provided pattern and returns a string with all the tokens replaced

Types

This section is empty.

Jump to

Keyboard shortcuts

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