stacks

package
v0.19.1295 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTemplateFetchBytes = templatefetch.MaxBytes

Variables

This section is empty.

Functions

func FormatRunnerEnvVars added in v0.19.850

func FormatRunnerEnvVars(cfg *app.AppRunnerConfig, runnerBinaryVersion string) string

FormatRunnerEnvVars converts an AppRunnerConfig's EnvVars hstore into a newline-delimited string of "export key=value" statements. Default values are injected only when not already defined in cfg.EnvVars.

func NewLocalTemplateFetchClient added in v0.19.1289

func NewLocalTemplateFetchClient() *http.Client

func NewTemplateFetchClient added in v0.19.1289

func NewTemplateFetchClient() *http.Client

func PhoneHomeRoleName added in v0.19.1091

func PhoneHomeRoleName(installID string) string

PhoneHomeRoleName is the deterministic IAM role name for an install's phone-home Lambda, matching the `<install_id>-<purpose>` convention the install stack's other roles already use (`<install_id>-provision`, `-maintenance`, `-deprovision`).

This is the single source of truth for the name. A cross-account grant naming this principal cannot be validated at deploy time — IAM accepts a resource policy that references a role which does not exist yet, and a mismatch only surfaces as an AccessDeniedException at phone-home time. Both the template and any policy that names the principal must derive it from here.

Types

type TemplateInput

type TemplateInput struct {
	Install                    *app.Install             `validate:"required"`
	CloudFormationStackVersion *app.InstallStackVersion `validate:"required"`
	InstallState               *state.State             `validate:"required"`
	AppCfg                     *app.AppConfig           `validate:"required"`

	Runner   *app.Runner              `validate:"required"`
	Settings *app.RunnerGroupSettings `validate:"required"`
	APIToken string                   `validate:"required"`

	// ConfiguredRunnerInstanceType is the instance type the app's runner config declares,
	// empty when it declares none. Settings.AWSInstanceType cannot express "unset" — the
	// stack generators resolve the platform default into it before rendering, because the
	// GCP tfvars and the persisted runner group settings both need a concrete value — and
	// the CloudFormation renderer needs the distinction to know whether it may fall back to
	// the nested runner template's own default.
	ConfiguredRunnerInstanceType string

	// runner env vars from runner.toml [env_vars] section, formatted as
	// newline-delimited "export key=value" pairs for injection into user-data.
	RunnerEnvVars string

	// subscripts and embedded templates
	RunnerInitScriptURL string `validate:"required"`

	// AWS-only: the inline source for the phone-home Lambda (Code.ZipFile). Unvalidated
	// because the Azure and GCP paths share this struct — ARM builds its own phone-home
	// script from PhoneHomeURL, and GCP has no equivalent resource. The AWS renderer
	// enforces it instead.
	PhonehomeScript string

	// Custom template URLs for VPC/VNet and runner nested/linked deployments (AWS CloudFormation, Azure ARM)
	VPCNestedStackTemplateURL    string
	RunnerNestedStackTemplateURL string

	// DeploymentScope is the ARM scope the Azure root template renders at, copied
	// from the app's stack config by the caller so the renderer reads one struct.
	// Empty means resource group, which is every install predating the field —
	// compare against app.StackDeploymentScopeSubscription rather than testing for
	// the resource-group value. Unvalidated because the AWS and GCP renderers share
	// this struct and never set it.
	DeploymentScope app.StackDeploymentScope

	// Where the phone-home token map lives, for the Lambda to fetch at invocation
	// time. Never the token itself: the rendered template is fetched
	// unauthenticated from S3 via the quick-link, so it may only carry the secret's
	// location. Empty whenever phone-home auth is not active for the install, which
	// is why these are unvalidated — the GCP path shares this struct and never sets
	// them.
	PhoneHomeSecretARN    string
	PhoneHomeSecretRegion string

	// Azure-only: the managed identity the phone-home script authenticates as. A name,
	// not a credential, so unlike the fields above it is safe in a template anyone can
	// fetch. Empty whenever Azure phone-home auth is not active for the install, which
	// is what leaves the script unauthenticated for stacks that predate it.
	PhoneHomeIdentityName string

	// Switches the AWS renderer to custom-stacks-only mode.
	CustomStacksOnly bool

	// Switches the AWS renderer to app-bundle compile mode: install-input
	// references in custom nested stack parameters are hoisted into top-level
	// template parameters instead of baking synthetic compile-time values.
	BundleCompile bool

	// Each custom stack's Parameters as authored, keyed by stack name, before
	// RenderCustomNestedStackParameters rewrites install-input references into
	// literals.
	UnrenderedCustomStackParameters map[string]map[string]string
}

Directories

Path Synopsis
Package aws renders the install-stacks/aws Terraform module's tfvars file for an AWS install.
Package aws renders the install-stacks/aws Terraform module's tfvars file for an AWS install.

Jump to

Keyboard shortcuts

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