Documentation
¶
Index ¶
- Constants
- Variables
- func EcrRepositoryReadConfig(config *api.Config) (api.Config, error)
- func ReadAuthServiceAccountConfig(config *api.Config) (api.Config, error)
- func ReadRdsMysqlConfig(config *api.Config) (api.Config, error)
- func ReadRdsPostgresConfig(config *api.Config) (api.Config, error)
- func ReadSecretsConfig(config *api.Config) (api.Config, error)
- func ReadSecretsProviderConfig(config *api.Config) (api.Config, error)
- func ReadStateStorageConfig(config *api.Config) (api.Config, error)
- func ReadTemplateConfig(config *api.Config) (api.Config, error)
- func S3BucketReadConfig(config *api.Config) (api.Config, error)
- func ToAwsLambdaConfig(tpl any, stackCfg *api.StackConfigSingleImage) (any, error)
- func ToEcsFargateConfig(tpl any, composeCfg compose.Config, stackCfg *api.StackConfigCompose) (any, error)
- func ToStaticSiteConfig(tpl any, stackDir, stackName string, stackCfg *api.StackConfigStatic) (any, error)
- type AccountConfig
- type CloudExtras
- type EcrLifecyclePolicy
- type EcrLifecyclePolicyAction
- type EcrLifecyclePolicySelection
- type EcrLifecycleRule
- type EcrRepository
- type EcsFargateConfig
- type EcsFargateContainer
- type EcsFargateDependsOn
- type EcsFargateInput
- type EcsFargateMountPoint
- type EcsFargateProbe
- type EcsFargateResources
- type EcsFargateScale
- type EcsFargateScalePolicy
- type EcsFargateScalePolicyType
- type EcsFargateVolume
- type FargateRollingUpdate
- type LambdaInput
- type LambdaInvokeMode
- type LambdaRoutingType
- type LambdaSchedule
- type LoadBalancerType
- type MysqlConfig
- type PostgresConfig
- type ProbeHttpGet
- type S3Bucket
- type SecretsConfig
- type SecretsProviderConfig
- type SecurityGroup
- type SecurityGroupRule
- type StateStorageConfig
- type StaticSiteInput
- type TemplateConfig
Constants ¶
View Source
const ( AuthTypeAWSToken = "aws-token" SecretsTypeAWSSecretsManager = "aws-secrets-manager" SecretsProviderTypeAwsKms = "aws-kms" StateStorageTypeS3Bucket = "s3-bucket" )
View Source
const ( LambdaRoutingApiGw = "api-gateway" LambdaRoutingFunctionUrl = "function-url" LambdaInvokeModeBuffered = "BUFFERED" LambdaInvokeModeResponseStream = "RESPONSE_STREAM" LoadBalancerTypeAlb LoadBalancerType = "alb" LoadBalancerTypeNlb LoadBalancerType = "nlb" )
View Source
const ProviderType = "aws"
View Source
const ResourceTypeEcrRepository = "ecr-repository"
View Source
const (
ResourceTypeRdsMysql = "aws-rds-mysql"
)
View Source
const (
ResourceTypeRdsPostgres = "aws-rds-postgres"
)
View Source
const ResourceTypeS3Bucket = "s3-bucket"
View Source
const (
TemplateTypeAwsLambda = "aws-lambda"
)
View Source
const (
TemplateTypeEcsFargate = "ecs-fargate"
)
View Source
const TemplateTypeStaticWebsite = "aws-static-website"
Variables ¶
View Source
var DefaultEcrLifecyclePolicy = EcrLifecyclePolicy{ Rules: []EcrLifecycleRule{ { RulePriority: 1, Description: "Keep only 3 last images", Selection: EcrLifecyclePolicySelection{ TagStatus: "any", CountType: "imageCountMoreThan", CountNumber: 3, }, Action: EcrLifecyclePolicyAction{ Type: "expire", }, }, }, }
DefaultEcrLifecyclePolicy is the default ECR lifecycle policy (keep only 3 last images)
Functions ¶
func ToAwsLambdaConfig ¶
func ToAwsLambdaConfig(tpl any, stackCfg *api.StackConfigSingleImage) (any, error)
func ToEcsFargateConfig ¶
func ToStaticSiteConfig ¶
Types ¶
type AccountConfig ¶
type AccountConfig struct {
Account string `json:"account" yaml:"account"`
AccessKey string `json:"accessKey" yaml:"accessKey"`
SecretAccessKey string `json:"secretAccessKey" yaml:"secretAccessKey"`
Region string `json:"region" yaml:"region"`
api.Credentials `json:",inline" yaml:",inline"`
}
func (*AccountConfig) CredentialsValue ¶
func (r *AccountConfig) CredentialsValue() string
func (*AccountConfig) ProjectIdValue ¶
func (r *AccountConfig) ProjectIdValue() string
func (*AccountConfig) ProviderType ¶
func (r *AccountConfig) ProviderType() string
type CloudExtras ¶
type CloudExtras struct {
AwsRoles []string `json:"awsRoles" yaml:"awsRoles"`
LambdaSchedule *LambdaSchedule `json:"lambdaSchedule,omitempty" yaml:"lambdaSchedule,omitempty"` // e.g. for lambda functions to be triggered on schedule
LambdaSchedules []LambdaSchedule `json:"lambdaSchedules,omitempty" yaml:"lambdaSchedules,omitempty"` // e.g. for lambda functions to be triggered on schedule
LambdaRoutingType LambdaRoutingType `json:"lambdaRoutingType" yaml:"lambdaRoutingType"`
LambdaInvokeMode LambdaInvokeMode `json:"lambdaInvokeMode" yaml:"lambdaInvokeMode"` // invoke mode for lambda
SecurityGroup *SecurityGroup `json:"securityGroup,omitempty" yaml:"securityGroup,omitempty"`
LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty" yaml:"loadBalancerType,omitempty"` // default: alb
}
type EcrLifecyclePolicy ¶
type EcrLifecyclePolicy struct {
Rules []EcrLifecycleRule `json:"rules" yaml:"rules"`
}
type EcrLifecyclePolicyAction ¶
type EcrLifecyclePolicyAction struct {
Type string `json:"type" yaml:"type"`
}
type EcrLifecycleRule ¶
type EcrLifecycleRule struct {
RulePriority int `json:"rulePriority" yaml:"rulePriority"`
Description string `json:"description" yaml:"description"`
Selection EcrLifecyclePolicySelection `json:"selection" yaml:"selection"`
Action EcrLifecyclePolicyAction `json:"action" yaml:"action"`
}
type EcrRepository ¶
type EcrRepository struct {
AccountConfig `json:",inline" yaml:",inline"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
LifecyclePolicy *EcrLifecyclePolicy `json:"lifecyclePolicy" yaml:"lifecyclePolicy"`
}
type EcsFargateConfig ¶
type EcsFargateConfig struct {
api.Credentials `json:",inline" yaml:",inline"`
AccountConfig `json:",inline" yaml:",inline"`
Cpu int `json:"cpu" yaml:"cpu"`
Memory int `json:"memory" yaml:"memory"`
EphemeralStorageGB int `json:"ephemeralStorageGB" yaml:"ephemeralStorageGB"`
Version string `json:"version" yaml:"version"`
}
func (*EcsFargateConfig) CredentialsValue ¶
func (r *EcsFargateConfig) CredentialsValue() string
func (*EcsFargateConfig) ProjectIdValue ¶
func (r *EcsFargateConfig) ProjectIdValue() string
type EcsFargateContainer ¶
type EcsFargateContainer struct {
Name string `json:"name" yaml:"name"`
Image api.ContainerImage `json:"image" yaml:"image"`
Env map[string]string `json:"env" yaml:"env"`
Secrets map[string]string `json:"secrets" yaml:"secrets"`
Port int `json:"port" yaml:"port"`
LivenessProbe EcsFargateProbe `json:"livenessProbe" yaml:"livenessProbe"`
StartupProbe EcsFargateProbe `json:"startupProbe" yaml:"startupProbe"`
MountPoints []EcsFargateMountPoint `json:"mountPoints" yaml:"mountPoints"`
Cpu int `json:"cpu" yaml:"cpu"`
Memory int `json:"memory" yaml:"memory"`
DependsOn []EcsFargateDependsOn `json:"dependsOn" yaml:"dependsOn"`
}
type EcsFargateDependsOn ¶
type EcsFargateInput ¶
type EcsFargateInput struct {
TemplateConfig `json:"templateConfig" yaml:"templateConfig"`
Scale EcsFargateScale `json:"scale" yaml:"scale"`
Containers []EcsFargateContainer `json:"containers" yaml:"containers"`
IngressContainer EcsFargateContainer `json:"ingressContainer" yaml:"ingressContainer"`
Config EcsFargateConfig `json:"config" yaml:"config"`
Domain string `json:"domain" yaml:"domain"`
DomainProxied *bool `json:"domainProxied" yaml:"domainProxied"`
RefResourceNames []string `json:"refResourceNames" yaml:"refResourceNames"`
Secrets map[string]string `json:"secrets" yaml:"secrets"`
BaseDnsZone string `json:"baseDnsZone" yaml:"baseDnsZone"`
Dependencies []api.StackConfigDependencyResource `json:"dependencies" yaml:"dependencies"`
Volumes []EcsFargateVolume `json:"volumes" yaml:"volumes"`
Alerts *api.AlertsConfig `json:"alerts" yaml:"alerts"`
ComposeDir string `json:"composeDir" yaml:"composeDir"`
CloudExtras *CloudExtras `json:"cloudExtras" yaml:"cloudExtras"`
StackConfig *api.StackConfigCompose `json:"stackConfig" yaml:"stackConfig"`
}
func (*EcsFargateInput) DependsOnResources ¶
func (i *EcsFargateInput) DependsOnResources() []api.StackConfigDependencyResource
func (*EcsFargateInput) OverriddenBaseZone ¶
func (i *EcsFargateInput) OverriddenBaseZone() string
func (*EcsFargateInput) Uses ¶
func (i *EcsFargateInput) Uses() []string
type EcsFargateMountPoint ¶
type EcsFargateProbe ¶
type EcsFargateProbe struct {
Command []string `json:"command" yaml:"command"`
HttpGet ProbeHttpGet `json:"httpGet" yaml:"httpGet"`
InitialDelaySeconds int `json:"initialDelaySeconds" yaml:"initialDelaySeconds"`
TimeoutSeconds int `json:"timeoutSeconds" yaml:"timeoutSeconds"`
IntervalSeconds int `json:"intervalSeconds" yaml:"intervalSeconds"`
Retries int `json:"retries" yaml:"retries"`
}
func (*EcsFargateProbe) FromHealthCheck ¶
func (p *EcsFargateProbe) FromHealthCheck(svc types.ServiceConfig, port int)
type EcsFargateResources ¶
type EcsFargateScale ¶
type EcsFargateScale struct {
Min int `json:"min" yaml:"min"`
Max int `json:"max" yaml:"max"`
Policies []EcsFargateScalePolicy `json:"policy" yaml:"policy"`
Update FargateRollingUpdate `json:"update" yaml:"update"`
}
type EcsFargateScalePolicy ¶
type EcsFargateScalePolicy struct {
Type EcsFargateScalePolicyType `json:"type" yaml:"type"`
TargetValue int `yaml:"targetValue" json:"targetValue"`
ScaleInCooldown int `json:"scaleInCooldown" yaml:"scaleInCooldown"`
ScaleOutCooldown int `json:"scaleOutCooldown" yaml:"scaleOutCooldown"`
}
type EcsFargateScalePolicyType ¶
type EcsFargateScalePolicyType string
const ( ScaleCpu EcsFargateScalePolicyType = "cpu" ScaleMemory EcsFargateScalePolicyType = "memory" )
type EcsFargateVolume ¶
type EcsFargateVolume struct {
Name string `json:"name" yaml:"name"`
}
type FargateRollingUpdate ¶
type LambdaInput ¶
type LambdaInput struct {
AccountConfig `json:",inline" yaml:",inline"`
StackConfig api.StackConfigSingleImage `json:"stackConfig" yaml:"stackConfig"`
}
func (*LambdaInput) Uses ¶
func (l *LambdaInput) Uses() []string
type LambdaInvokeMode ¶
type LambdaInvokeMode string
type LambdaRoutingType ¶
type LambdaRoutingType string
type LambdaSchedule ¶
type LoadBalancerType ¶
type LoadBalancerType string
type MysqlConfig ¶
type MysqlConfig struct {
AccountConfig `json:",inline" yaml:",inline"`
Name string `json:"name" yaml:"name"`
InstanceClass string `json:"instanceClass" yaml:"instanceClass"`
AllocateStorage *int `json:"allocateStorage" yaml:"allocateStorage"`
EngineVersion string `json:"engineVersion" yaml:"engineVersion"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
DatabaseName *string `json:"databaseName" yaml:"databaseName"`
EngineName *string `json:"engineName,omitempty" yaml:"engineName,omitempty"`
}
type PostgresConfig ¶
type PostgresConfig struct {
AccountConfig `json:",inline" yaml:",inline"`
Name string `json:"name" yaml:"name"`
InstanceClass string `json:"instanceClass" yaml:"instanceClass"`
AllocateStorage *int `json:"allocateStorage" yaml:"allocateStorage"`
EngineVersion string `json:"engineVersion" yaml:"engineVersion"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
DatabaseName *string `json:"databaseName" yaml:"databaseName"`
}
type ProbeHttpGet ¶
type S3Bucket ¶
type S3Bucket struct {
AccountConfig `json:",inline" yaml:",inline"`
*api.StaticSiteConfig `json:",inline,omitempty" yaml:",inline,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
AllowOnlyHttps bool `json:"allowOnlyHttps" yaml:"allowOnlyHttps"`
}
type SecretsConfig ¶
type SecretsConfig struct {
AccountConfig `json:",inline" yaml:",inline"`
}
type SecretsProviderConfig ¶
type SecretsProviderConfig struct {
AccountConfig `json:",inline" yaml:",inline"`
Provision bool `json:"provision" yaml:"provision"`
// must be in the format:
// awskms://1234abcd-12ab-34cd-56ef-1234567890ab?region=us-east-1
KeyName string `json:"keyName" yaml:"keyName"`
}
func (*SecretsProviderConfig) IsProvisionEnabled ¶
func (sa *SecretsProviderConfig) IsProvisionEnabled() bool
func (*SecretsProviderConfig) KeyUrl ¶
func (sa *SecretsProviderConfig) KeyUrl() string
type SecurityGroup ¶
type SecurityGroup struct {
Ingress *SecurityGroupRule `json:"ingress,omitempty" yaml:"ingress,omitempty"`
}
type SecurityGroupRule ¶
type SecurityGroupRule struct {
AllowOnlyCloudflare *bool `json:"allowOnlyCloudflare,omitempty" yaml:"allowOnlyCloudflare,omitempty"`
CidrBlocks *[]string `json:"cidrBlocks,omitempty" yaml:"cidrBlocks,omitempty"`
Ipv6CidrBlocks *[]string `json:"ipv6CidrBlocks,omitempty" yaml:"ipv6CidrBlocks,omitempty"`
}
type StateStorageConfig ¶
type StateStorageConfig struct {
AccountConfig `json:",inline" yaml:",inline"`
BucketName string `json:"bucketName" yaml:"bucketName"`
Provision bool `json:"provision" yaml:"provision"`
}
func (*StateStorageConfig) IsProvisionEnabled ¶
func (sa *StateStorageConfig) IsProvisionEnabled() bool
func (*StateStorageConfig) StorageUrl ¶
func (sa *StateStorageConfig) StorageUrl() string
type StaticSiteInput ¶
type StaticSiteInput struct {
TemplateConfig `json:"templateConfig" yaml:"templateConfig"`
api.StackConfigStatic `json:",inline" yaml:",inline"`
StackDir string `json:"stackDir" yaml:"stackDir"`
StackName string `json:"stackName" yaml:"stackName"`
}
type TemplateConfig ¶
type TemplateConfig struct {
AccountConfig `json:",inline" yaml:",inline"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.