schema

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpMethods = []string{"GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "ANY"}

Functions

func EnrichWithData

func EnrichWithData(data map[string]string, override map[string]string) map[string]string

func ProcessData

func ProcessData(data map[string]string, arguments Arguments, settings TerralessSettings) map[string]string

func ProcessString

func ProcessString(check string, arguments Arguments, settings TerralessSettings) string

Types

type Arguments

type Arguments struct {
	AuthProvider         string
	Config               string
	Environment          string
	ForceDeploy          bool
	GlobalConfig         string
	LogLevel             string
	NoDeploy             bool
	NoProviderGeneration bool
	NoUpload             bool
	PluginDirectory      string
	TerralessDirectory   string
	TerraformCommand     string
	Variables            map[string]string
}

type Extension added in v0.1.31

type Extension interface {
	Exec(globalConfig TerralessGlobalConfig, data TerralessData) error
	Info() PluginInfo
}

type ExtensionExecArgs added in v0.1.44

type ExtensionExecArgs struct {
	GlobalConfig  TerralessGlobalConfig
	TerralessData TerralessData
}

type ExtensionPlugin added in v0.1.31

type ExtensionPlugin struct {
	Impl Extension
}

Implementation of plugin.Plugin

func (ExtensionPlugin) Client added in v0.1.31

func (ExtensionPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*ExtensionPlugin) Server added in v0.1.31

func (plugin *ExtensionPlugin) Server(broker *plugin.MuxBroker) (interface{}, error)

type ExtensionRPC added in v0.1.31

type ExtensionRPC struct {
	// contains filtered or unexported fields
}

RPC

func (*ExtensionRPC) Exec added in v0.1.31

func (g *ExtensionRPC) Exec(globalConfig TerralessGlobalConfig, terralessData TerralessData) error

func (*ExtensionRPC) Info added in v0.1.31

func (g *ExtensionRPC) Info() PluginInfo

type ExtensionRPCServer added in v0.1.31

type ExtensionRPCServer struct {
	Impl Extension
}

RPC Server

func (*ExtensionRPCServer) Exec added in v0.1.31

func (server *ExtensionRPCServer) Exec(args ExtensionExecArgs, resp *error) error

func (*ExtensionRPCServer) Info added in v0.1.31

func (server *ExtensionRPCServer) Info(args interface{}, resp *PluginInfo) error

type FunctionEvent added in v0.1.12

type FunctionEvent struct {
	FunctionName  string
	FunctionEvent TerralessFunctionEvent
}

type FunctionEvents added in v0.1.12

type FunctionEvents struct {
	Events map[string][]FunctionEvent
}

type GenerateHelperFunctionCommandArgs added in v0.3.1

type GenerateHelperFunctionCommandArgs struct {
	TeamName     string
	ProviderName string
	RoleName     string
}

type PermissionData added in v0.1.42

type PermissionData struct {
	Actions   []string `yaml:"Actions"`
	Effect    string   `yaml:"Effect"`
	Resources []string `yaml:"Resources"`
}

type Permissions added in v0.1.42

type Permissions struct {
	Type string           `yaml:"Type"`
	Data []PermissionData `yaml:"Data"`
}

type PluginInfo added in v0.1.31

type PluginInfo struct {
	Name    string
	Version string
}

type ProcessUploadArgs added in v0.1.35

type ProcessUploadArgs struct {
	TerralessData TerralessData
	Upload        TerralessUpload
}

type Provider

type Provider interface {
	CanHandle(resourceType string) bool
	FinalizeTemplates(terralessData TerralessData) string
	GenerateHelperFunctionCommand(teamName string, providerName string, roleName string) string
	Info() PluginInfo
	PrepareSession(terralessConfig TerralessConfig) map[string]string
	ProcessUpload(terralessData TerralessData, upload TerralessUpload) []string
	RenderAuthorizerTemplates(config TerralessConfig) string
	RenderCertificateTemplates(config TerralessConfig) string
	RenderEndpointTemplates(config TerralessConfig) string
	RenderFunctionTemplates(resourceType string, functionEvents FunctionEvents, terralessData *TerralessData) string
	RenderUploadTemplates(terralessData TerralessData) string
}

type ProviderPlugin added in v0.1.31

type ProviderPlugin struct {
	Impl Provider
}

func (ProviderPlugin) Client added in v0.1.32

func (ProviderPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*ProviderPlugin) Server added in v0.1.32

func (plugin *ProviderPlugin) Server(broker *plugin.MuxBroker) (interface{}, error)

type ProviderRPC added in v0.1.31

type ProviderRPC struct {
	// contains filtered or unexported fields
}

RPC

func (*ProviderRPC) CanHandle added in v0.1.33

func (g *ProviderRPC) CanHandle(resourceType string) bool

func (*ProviderRPC) FinalizeTemplates added in v0.1.33

func (g *ProviderRPC) FinalizeTemplates(terralessData TerralessData) string

func (*ProviderRPC) GenerateHelperFunctionCommand added in v0.3.1

func (g *ProviderRPC) GenerateHelperFunctionCommand(teamName string, providerName string, roleName string) string

func (*ProviderRPC) Info added in v0.1.33

func (g *ProviderRPC) Info() PluginInfo

func (*ProviderRPC) PrepareSession added in v0.1.33

func (g *ProviderRPC) PrepareSession(terralessConfig TerralessConfig) map[string]string

func (*ProviderRPC) ProcessUpload added in v0.1.33

func (g *ProviderRPC) ProcessUpload(terralessData TerralessData, upload TerralessUpload) []string

func (*ProviderRPC) RenderAuthorizerTemplates added in v0.1.33

func (g *ProviderRPC) RenderAuthorizerTemplates(config TerralessConfig) string

func (*ProviderRPC) RenderCertificateTemplates added in v0.1.33

func (g *ProviderRPC) RenderCertificateTemplates(config TerralessConfig) string

func (*ProviderRPC) RenderEndpointTemplates added in v0.1.33

func (g *ProviderRPC) RenderEndpointTemplates(config TerralessConfig) string

func (*ProviderRPC) RenderFunctionTemplates added in v0.1.33

func (g *ProviderRPC) RenderFunctionTemplates(resourceType string, functionEvents FunctionEvents, terralessData *TerralessData) string

func (*ProviderRPC) RenderUploadTemplates added in v0.1.33

func (g *ProviderRPC) RenderUploadTemplates(terralessData TerralessData) string

type ProviderRPCServer added in v0.1.31

type ProviderRPCServer struct {
	Impl Provider
}

RPC Server

func (*ProviderRPCServer) CanHandle added in v0.1.33

func (server *ProviderRPCServer) CanHandle(resourceType string, resp *bool) error

func (*ProviderRPCServer) FinalizeTemplates added in v0.1.33

func (server *ProviderRPCServer) FinalizeTemplates(terralessData TerralessData, resp *string) error

func (*ProviderRPCServer) GenerateHelperFunctionCommand added in v0.3.1

func (server *ProviderRPCServer) GenerateHelperFunctionCommand(args GenerateHelperFunctionCommandArgs, resp *string) error

func (*ProviderRPCServer) Info added in v0.1.33

func (server *ProviderRPCServer) Info(args interface{}, resp *PluginInfo) error

func (*ProviderRPCServer) PrepareSession added in v0.1.33

func (server *ProviderRPCServer) PrepareSession(terralessConfig TerralessConfig, resp *map[string]string) error

func (*ProviderRPCServer) ProcessUpload added in v0.1.33

func (server *ProviderRPCServer) ProcessUpload(args ProcessUploadArgs, resp *[]string) error

func (*ProviderRPCServer) RenderAuthorizerTemplates added in v0.1.33

func (server *ProviderRPCServer) RenderAuthorizerTemplates(config TerralessConfig, resp *string) error

func (*ProviderRPCServer) RenderCertificateTemplates added in v0.1.33

func (server *ProviderRPCServer) RenderCertificateTemplates(config TerralessConfig, resp *string) error

func (*ProviderRPCServer) RenderEndpointTemplates added in v0.1.33

func (server *ProviderRPCServer) RenderEndpointTemplates(config TerralessConfig, resp *string) error

func (*ProviderRPCServer) RenderFunctionTemplates added in v0.1.33

func (server *ProviderRPCServer) RenderFunctionTemplates(args RenderFunctionTemplatesArgs, resp *string) error

func (*ProviderRPCServer) RenderUploadTemplates added in v0.1.33

func (server *ProviderRPCServer) RenderUploadTemplates(terralessData TerralessData, resp *string) error

type RenderFunctionTemplatesArgs added in v0.1.35

type RenderFunctionTemplatesArgs struct {
	ResourceType   string
	FunctionEvents FunctionEvents
	TerralessData  *TerralessData
}

type TerralessActiveProvider

type TerralessActiveProvider struct {
	Team      string              `yaml:"Team"`
	Providers []TerralessProvider `yaml:"Providers"`
}

type TerralessAuthorizer

type TerralessAuthorizer struct {
	AuthorizerType string   `yaml:"AuthorizerType"`
	Type           string   `yaml:"Type"`
	Name           string   `yaml:"Name"`
	ProviderArns   []string `yaml:"ProviderArns"`

	// only for rendering template
	TerraformName string
}

type TerralessBackend

type TerralessBackend struct {
	Data       map[string]string `yaml:"Data"`
	Name       string            `yaml:"Name"`
	Provider   string            `yaml:"Provider"`
	Type       string            `yaml:"Type"`
	Workspaces map[string]string `yaml:"Workspaces"`
}

type TerralessCertificate

type TerralessCertificate struct {
	Aliases   []string `yaml:"Aliases"`
	Domain    string   `yaml:"Domain"`
	Type      string   `yaml:"Type"`
	Providers []string `yaml:"Providers"`
	ZoneId    string   `yaml:"ZoneId"`

	// only for rendering template
	ProjectName   string
	TerraformName string
}

type TerralessCloudfront

type TerralessCloudfront struct {
	Aliases                   []string                   `yaml:"Aliases"`
	Caching                   TerralessCloudfrontCaching `yaml:"Caching"`
	Certificate               string                     `yaml:"Certificate"`
	Handler                   string                     `yaml:"Handler"`
	LambdaFunctionAssociation map[string]string          `yaml:"LambdaFunctionAssociation"`
	NoCreateBucket            bool                       `yaml:"NoCreateBucket"`
	Domain                    string                     `yaml:"Domain"`
	LoggingEnabled            bool                       `yaml:"LoggingEnabled"`
	PriceClass                string                     `yaml:"PriceClass"`
}

type TerralessCloudfrontCaching

type TerralessCloudfrontCaching struct {
	DefaultTTL int `yaml:"DefaultTTL"`
	MinTTL     int `yaml:"MinTTL"`
	MaxTTL     int `yaml:"MaxTTL"`
}

type TerralessConfig

type TerralessConfig struct {
	Authorizers  map[string]TerralessAuthorizer
	Backend      TerralessBackend
	Certificates map[string]TerralessCertificate
	Endpoints    []TerralessEndpoint
	Functions    map[string]TerralessFunction
	Package      TerralessPackage
	ProjectName  string
	Providers    map[string]TerralessProvider
	Settings     TerralessSettings
	SourcePath   string
	TargetPath   string
	Uploads      []TerralessUpload

	// only for rendering template
	HasProvider map[string]bool
	Runtimes    []string
}

func BuildTerralessConfig

func BuildTerralessConfig(globalCfg TerralessGlobalConfig, projectCfg TerralessProjectConfig, arguments Arguments) TerralessConfig

func (TerralessConfig) Validate

func (cfg TerralessConfig) Validate() []string

type TerralessCors

type TerralessCors struct {
	Headers []string `yaml:"Headers"`
	Origin  string   `yaml:"Origin"`
}

type TerralessData

type TerralessData struct {
	ActiveProviders map[string]TerralessProvider
	Arguments       Arguments
	Config          TerralessConfig
	GlobalConfig    TerralessGlobalConfig
	Plugins         []TerralessPlugin
}

type TerralessEndpoint added in v0.1.12

type TerralessEndpoint struct {
	Aliases     []string `yaml:"Aliases"`
	BasePath    string   `yaml:"BasePath"`
	Certificate string   `yaml:"Certificate"`
	Domain      string   `yaml:"Domain"`
	Type        string   `yaml:"Type"`

	// only for rendering template
	TerralessCertificate TerralessCertificate
	TerraformName        string
}

type TerralessFunction

type TerralessFunction struct {
	Description string                   `yaml:"Description"`
	Environment map[string]string        `yaml:"Environment"`
	Events      []TerralessFunctionEvent `yaml:"Events"`
	Handler     string                   `yaml:"Handler"`
	MemorySize  int                      `yaml:"MemorySize"`
	RoleArn     string                   `yaml:"RoleArn"`
	Runtime     string                   `yaml:"Runtime"`
	Timeout     int                      `yaml:"Timeout"`
	Type        string                   `yaml:"Type"`

	// only for rendering template
	AddApiGatewayPermission bool
	FunctionName            string
	ProjectName             string
	RenderEnvironment       bool
}

type TerralessFunctionEvent

type TerralessFunctionEvent struct {
	Authorizer string            `yaml:"Authorizer"`
	Arn        string            `yaml:"Arn"`
	Cors       TerralessCors     `yaml:"Cors"`
	Event      map[string]string `yaml:"Event"`
	Method     string            `yaml:"Method"`
	Path       string            `yaml:"Path"`
	Rate       string            `yaml:"Rate"`
	Route      string            `yaml:"Route"`
	Type       string            `yaml:"Type"`

	// only for rendering template
	Authorization       string
	AuthorizerId        string
	FunctionName        string
	Idx                 string
	ProjectName         string
	PathsRendered       map[string]string
	ResourceNameForPath string
}

type TerralessGlobalConfig

type TerralessGlobalConfig struct {
	Backends []TerralessBackend `yaml:"Backends"`
	Plugins  []TerralessPlugin  `yaml:"Plugins"`
	Teams    []TerralessTeam    `yaml:"Teams"`
	Uploads  []TerralessUpload  `yaml:"Uploads"`
}

type TerralessPackage

type TerralessPackage struct {
	BuildCommand      string `yaml:"BuildCommand"`
	LambdaArchiveFile string `yaml:"LambdaArchiveFile"`
	SourceDir         string `yaml:"SourceDir"`
	OutputPath        string
}

type TerralessPlugin added in v0.1.31

type TerralessPlugin struct {
	Name    string `yaml:"Name"`
	Version string `yaml:"Version"`
}

type TerralessProjectConfig

type TerralessProjectConfig struct {
	Authorizers     map[string]TerralessAuthorizer  `yaml:"Authorizers"`
	ActiveProviders []TerralessActiveProvider       `yaml:"ActiveProviders"`
	Backend         TerralessBackend                `yaml:"Backend"`
	Certificates    map[string]TerralessCertificate `yaml:"Certificates"`
	Endpoints       []TerralessEndpoint             `yaml:"Endpoints"`
	Functions       map[string]TerralessFunction    `yaml:"Functions"`
	Package         TerralessPackage                `yaml:"Package"`
	ProjectName     string                          `yaml:"ProjectName"`
	Settings        TerralessSettings               `yaml:"Settings"`
	SourcePath      string                          `yaml:"SourcePath"`
	TargetPath      string                          `yaml:"TargetPath"`
	Uploads         []TerralessUpload               `yaml:"Uploads"`

	// only for rendering template
	HasProvider map[string]bool
	Runtimes    []string
	TeamData    map[string]map[string]string
}

func (*TerralessProjectConfig) Validate

type TerralessProvider

type TerralessProvider struct {
	Data  map[string]string `yaml:"Data"`
	Name  string            `yaml:"Name"`
	Roles []string          `yaml:"Roles"`
	Type  string            `yaml:"Type"`
}

type TerralessSettings

type TerralessSettings struct {
	AutoSignIn           bool              `yaml:"AutoSignIn"`
	AutoSignInInCloud    bool              `yaml:"AutoSignInInCloud"`
	NoProviderGeneration bool              `yaml:"NoProviderGeneration"`
	Permissions          []Permissions     `yaml:"Permissions"`
	Runtime              string            `yaml:"Runtime"`
	TerraformPluginDir   string            `yaml:"TerraformPluginDir"`
	Variables            map[string]string `yaml:"Variables"`
}

type TerralessTeam

type TerralessTeam struct {
	Data      map[string]string   `yaml:"Data"`
	Name      string              `yaml:"Name"`
	Providers []TerralessProvider `yaml:"Providers"`
}

type TerralessType

type TerralessType struct {
	Data map[string]string `yaml:"Data"`
	Name string            `yaml:"Name"`
	Type string            `yaml:"Type"`
}

type TerralessUpload

type TerralessUpload struct {
	Bucket     string              `yaml:"Bucket"`
	Cloudfront TerralessCloudfront `yaml:"Cloudfront"`
	Provider   string              `yaml:"Provider"`
	Region     string              `yaml:"Region"`
	Source     string              `yaml:"Source"`
	Target     string              `yaml:"Target"`
	Type       string              `yaml:"Type"`

	// only for rendering template
	Certificate      TerralessCertificate
	Environment      string
	LambdaAtEdgeFile string
	OwnCertificate   bool
	ProjectName      string
}

Jump to

Keyboard shortcuts

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