95 lines
3.6 KiB
Go
95 lines
3.6 KiB
Go
package main
|
|
|
|
const DeploymentNameSuffix = "navi-service"
|
|
|
|
type Deployment struct {
|
|
Name string `json:"name" valid:"required"`
|
|
NameSuffix string
|
|
}
|
|
|
|
type Manifest struct {
|
|
Environment string `json:"environment"`
|
|
ExtraResources *ExtraResources `json:"extraResources" valid:"required"`
|
|
Team *Team `json:"team"`
|
|
Deployment *Deployment `json:"deployment"`
|
|
StateStoreBackend *StateStoreBackend
|
|
}
|
|
|
|
type ExtraResources struct {
|
|
//TODO: Remove environment from ExtraResources once all apps have migrated to new schema
|
|
Environment string `json:"environment"`
|
|
Workspace string
|
|
Database *Database `json:"database"`
|
|
ServiceRole *ServiceRole `json:"aws_access"`
|
|
S3Buckets []S3Bucket `json:"s3_buckets"`
|
|
}
|
|
|
|
//We provide defaults in respective terraforms instead of here to keep all values at one place
|
|
type Database struct {
|
|
AwsInstanceClass string `json:"awsInstanceClass"`
|
|
PsqlFamily string `json:"psqlFamily"`
|
|
PsqlEngineVersion string `json:"psqlEngineVersion"`
|
|
User string `json:"user" valid:"required"`
|
|
Password string `json:"password" valid:"required"`
|
|
SizeInGb int `json:"sizeInGb"`
|
|
DbNames []string `json:"dbNames"`
|
|
InstanceName string `json:"instanceName" valid:"required"`
|
|
BackupDisabled bool `json:"backupDisabled"`
|
|
MultiAZDisabled bool `json:"multiAZDisabled"`
|
|
ApplyImmediately bool `json:"applyImmediately"`
|
|
DbExtensions []string `json:"dbExtensions"`
|
|
MonitoringUser string `env:"MONITORING_USER"`
|
|
MonitoringPassword string `env:"MONITORING_PASSWORD"`
|
|
ReadonlyUser string `json:"readonlyUser"`
|
|
ReadonlyPassword string `json:"readonlyPassword"`
|
|
PerformanceInsightsEnabled bool `json:"performanceInsightsEnabled"`
|
|
ReadReplica *ReadReplica `json:"readReplica"`
|
|
RdsAlertThresholds *RdsAlertThresholds `json:"rdsAlertThresholds"`
|
|
}
|
|
|
|
type Team struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type Policies struct {
|
|
Actions []string `json:"actions"`
|
|
Resource string `json:"resource" valid:"required,matches((^arn.*)|(^\\*$))~Policy resource must be an aws arn or *"`
|
|
}
|
|
|
|
type ServiceRole struct {
|
|
Policies []Policies `json:"policies"`
|
|
}
|
|
|
|
type StateStoreBackend struct {
|
|
BucketName string
|
|
AWSProfile string
|
|
}
|
|
|
|
type S3Bucket struct {
|
|
BucketName string `json:"anonymizedBucketName" valid:"required"`
|
|
BucketTag string `json:"bucketTag" valid:"required"`
|
|
LifecycleRules []map[string]LifecycleRule `json:"lifecycleRules" valid:"required"`
|
|
}
|
|
|
|
type RdsAlertThresholds struct {
|
|
CpuUtilization int `json:"cpuUtilization"`
|
|
CpuCreditBalance int `json:"cpuCreditBalance"`
|
|
BurstBalance int `json:"burstBalance"`
|
|
DBConnections int `json:"dbConnections"`
|
|
QueueDepth int `json:"queueDepth"`
|
|
FreeStorageSpacePercent int `json:"freeStorageSpacePercent"`
|
|
FreeMemoryTooLowInMB int `json:"freeMemoryTooLowInMB"`
|
|
ReadLatency float64 `json:"readLatency"`
|
|
WriteLatency float64 `json:"writeLatency"`
|
|
}
|
|
|
|
type LifecycleRule struct {
|
|
Days int `json:"days"`
|
|
StorageClass string `json:"storageClass"`
|
|
}
|
|
|
|
type ReadReplica struct {
|
|
AwsInstanceClass string `json:"awsInstanceClass" valid:"required"`
|
|
PerformanceInsightsEnabled bool `json:"performanceInsightsEnabled"`
|
|
}
|