config

package
v0.0.0-...-0fd85f3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvGitBranch            = "SELF_BRANCH_OVERRIDE"
	EnvGitSha               = "SELF_SHA_OVERRIDE"
	EnvOwnerPrefixResources = "SELF_PREFIX_RESOURCES_WITH_OWNER"
	EnvOwnerPrefixRoutes    = "SELF_PREFIX_ROUTE_KEY_WITH_OWNER"
	EnvEcrId                = "SELF_ECR_REGISTRY_ID"
	EnvEcrRegion            = "SELF_ECR_REGISTRY_REGION"
	EnvGwId                 = "SELF_API_GATEWAY_ID"
	EnvAuthType             = "SELF_API_GATEWAY_AUTH_TYPE"
	EnvAuthorizerId         = "SELF_API_GATEWAY_AUTHORIZER_ID"
	EnvSgIds                = "SELF_SECURITY_GROUP_IDS"
	EnvSnIds                = "SELF_SUBNET_IDS"
	EnvBusName              = "SELF_SELF_BUS_NAME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id     string
	Region string
}

type ApiGateway

type ApiGateway struct {
	Id *string
}

type BuildTime

type BuildTime struct {
	manifest.BuildTime
	Computed Computed
}

type Bus

type Bus struct {
	Name *string
}

type Caller

type Caller struct {
	Arn string
}

type Computed

type Computed struct {
	Registry     ComputedRegistry
	Repository   ComputedRepository
	Resource     ComputedResource
	Resources    ComputedResources
	TemplateData ComputedTemplateData
}

type ComputedRegistry

type ComputedRegistry struct {
	Url string
}

type ComputedRepository

type ComputedRepository struct {
	Name string
	Url  string
}

func (*ComputedRepository) Solve

func (r *ComputedRepository) Solve(registry Registry, repository Repository, git gitlib.DotGit, name string)

type ComputedResource

type ComputedResource struct {
	Name   string
	Policy struct {
		Arn string
	}
	Role struct {
		Arn string
	}
	Tags map[string]string
}

func (*ComputedResource) Solve

func (r *ComputedResource) Solve(account Account, resource Resource, git gitlib.DotGit, name string)

type ComputedResources

type ComputedResources struct {
	EphemeralStorage int32    `json:"ephemeralStorage"`
	MemorySize       int32    `json:"memorySize"`
	Timeout          int32    `json:"timeout"`
	Http             bool     `json:"http"`
	AuthType         string   `json:"authType"`
	AuthorizerId     *string  `json:"authorizerId"`
	Audience         []string `json:"audience"`
	RouteKey         string   `json:"routeKey"`
}

func (*ComputedResources) Solve

func (resources *ComputedResources) Solve(repository Repository, git gitlib.DotGit, resourcesJson, name string)

type ComputedTemplateData

type ComputedTemplateData struct {
	AccountId         string
	Region            string
	RegistryRegion    string
	RegistryAccountId string
}

func (*ComputedTemplateData) Solve

func (t *ComputedTemplateData) Solve(account Account, registry Registry)

type Config

type Config struct {
	Selfish      []Selfish
	Caller       Caller
	Account      Account
	Bus          Bus
	Git          gitlib.DotGit
	Registry     Registry
	Repository   Repository
	Resource     Resource
	ApiGateway   ApiGateway
	Vpc          Vpc
	TemplateData TemplateData
	Version      string
	AwsConfig    aws.Config `json:"-"`
}

func Stateful

func Stateful(ctx context.Context, awsConfig aws.Config, stsc STSClient, ecrc ECRClient) (c Config, err error)

Initialize configuration from AWS and local filesystem.

func Stateless

func Stateless(ctx context.Context, awsConfig aws.Config, stsc STSClient, ecrc ECRClient, event Event) (c Config, err error)

Initialize configuration from AWS only.

func (Config) AssumeRoleWithPolicy

func (c Config) AssumeRoleWithPolicy(ctx context.Context, policy string) (*types.Credentials, error)

func (Config) BuildTime

func (c Config) BuildTime(buildPath string) (BuildTime, error)

Generate buildtime configuration from a selfish path.

func (Config) ComputeBuildTime

func (c Config) ComputeBuildTime(mfst manifest.BuildTime) (BuildTime, error)

func (Config) ComputeDeployTime

func (c Config) ComputeDeployTime(mfst manifest.DeployTime) (DeployTime, error)

func (Config) DeployTime

func (c Config) DeployTime(labels map[string]string) (DeployTime, error)

Generate deploytime configuration from release labels.

func (*Config) FromAws

func (c *Config) FromAws(ctx context.Context, awsConfig aws.Config, stsc STSClient, ecrc ECRClient) (err error)

func (*Config) FromCwd

func (c *Config) FromCwd(ctx context.Context) (err error)

func (*Config) FromEvent

func (c *Config) FromEvent(ctx context.Context, event Event) (err error)

func (Config) Scaffold

func (c Config) Scaffold(templateName, functionName string) error

func (Config) Template

func (c Config) Template(document string) (string, error)

type DeployTime

type DeployTime struct {
	manifest.DeployTime
	Computed Computed
}

type ECRClient

type ECRClient interface {
	DescribeRegistry(ctx context.Context, params *ecr.DescribeRegistryInput, optFns ...func(*ecr.Options)) (*ecr.DescribeRegistryOutput, error)
}

type Event

type Event struct {
	Source     string      `json:"source"`
	DetailType string      `json:"detail-type"`
	Detail     EventDetail `json:"detail"`
}

type EventDetail

type EventDetail struct {
	Traceparent    string   `json:"traceparent"`
	Tracestate     string   `json:"tracestate"`
	Action         string   `json:"action"`
	Sha            string   `json:"sha"`
	Branch         string   `json:"branch"`
	Origin         string   `json:"origin"`
	RepositoryName string   `json:"repository-name"`
	ResourceName   string   `json:"resource-name"`
	ExceptAccounts []string `json:"except-accounts"`
}

type Git

type Git struct {
	Origin string
	Path   string
	Branch string
	Sha    string
	Root   string
	Dirty  bool
}

type Registry

type Registry struct {
	Id     string
	Region string
	Url    string
}

type Repository

type Repository struct {
	Namespace string
}

type Resource

type Resource struct {
	Namespace string
}

type STSClient

type STSClient interface {
	GetCallerIdentity(ctx context.Context, params *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error)
	AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error)
}

type Selfish

type Selfish struct {
	Path string
	Name string
}

type TemplateData

type TemplateData struct {
	AccountId         string
	Region            string
	RegistryRegion    string
	RegistryAccountId string
}

type Vpc

type Vpc struct {
	SecurityGroupIds []string
	SubnetIds        []string
}

Directories

Path Synopsis
embedded

Jump to

Keyboard shortcuts

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