config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config handles environment variable parsing and validation for the ecs-arc controller. It produces a typed Config struct from environment variables, with no AWS or GitHub API calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// GitHubAppClientID is the GitHub App Client ID (e.g. "Iv1.abc123").
	GitHubAppClientID string
	// GitHubAppInstallationID is the installation ID of the GitHub App.
	GitHubAppInstallationID int64
	// GitHubAppPrivateKey is the PEM-encoded private key of the GitHub App.
	GitHubAppPrivateKey string
	// GitHubOrg is the GitHub organization name.
	GitHubOrg string
	// GitHubConfigURL is derived from GitHubOrg: "https://github.com/{org}".
	GitHubConfigURL string

	// ScaleSetNamePrefix is an optional prefix for scale set names.
	// When set, scale set names become "{prefix}-{taskDefFamily}".
	ScaleSetNamePrefix string

	// ECSCluster is the ECS cluster name or ARN.
	ECSCluster string
	// ECSSubnets is the list of subnet IDs for awsvpc network mode.
	ECSSubnets []string
	// ECSSecurityGroups is the list of security group IDs.
	ECSSecurityGroups []string
	// ECSCapacityProvider is the optional capacity provider name.
	ECSCapacityProvider string

	// TaskDefinitions is the list of ECS task definition family names.
	TaskDefinitions []string

	// RunnerExtraLabels are additional GitHub Actions labels to apply to every
	// runner scale set. Comma-separated list of label names.
	RunnerExtraLabels []string
}

Config holds all configuration for the ecs-arc controller.

func Load

func Load() (*Config, error)

Load reads configuration from environment variables and returns a validated Config. It returns an error if any required variable is missing or invalid.

func (*Config) ScaleSetName

func (c *Config) ScaleSetName(taskDefFamily string) string

ScaleSetName returns the scale set name for a given task definition family. If ScaleSetNamePrefix is set, the name is "{prefix}-{family}". Otherwise, the name is just the family name.

Jump to

Keyboard shortcuts

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