2020-01-13 18:49:36 +05:30
|
|
|
package main
|
|
|
|
|
|
2020-05-27 13:51:41 +05:30
|
|
|
const DeploymentNameSuffix = "navi-service"
|
2020-02-26 20:01:33 +05:30
|
|
|
|
|
|
|
|
type Deployment struct {
|
2020-05-27 13:51:41 +05:30
|
|
|
Name string `json:"name" valid:"required"`
|
2020-02-26 20:01:33 +05:30
|
|
|
NameSuffix string
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-13 18:49:36 +05:30
|
|
|
type Manifest struct {
|
2020-08-26 11:30:09 +05:30
|
|
|
Environment string `json:"environment"`
|
2020-06-15 13:55:00 +05:30
|
|
|
ExtraResources *ExtraResources `json:"extraResources" valid:"required"`
|
2020-05-27 13:51:41 +05:30
|
|
|
Team *Team `json:"team"`
|
2020-06-15 13:18:36 +05:30
|
|
|
Deployment *Deployment `json:"deployment"`
|
2020-05-27 13:51:41 +05:30
|
|
|
StateStoreBackend *StateStoreBackend
|
2020-01-13 18:49:36 +05:30
|
|
|
}
|
|
|
|
|
|
2020-01-14 15:29:50 +05:30
|
|
|
type ExtraResources struct {
|
2020-07-05 13:24:25 +05:30
|
|
|
//TODO: Remove environment from ExtraResources once all apps have migrated to new schema
|
2020-10-12 19:05:56 +05:30
|
|
|
Environment string `json:"environment"`
|
|
|
|
|
Workspace string `json:"workspace"`
|
2020-05-27 13:51:41 +05:30
|
|
|
Database *Database `json:"database"`
|
|
|
|
|
ServiceRole *ServiceRole `json:"aws_access"`
|
2020-06-29 15:52:29 +05:30
|
|
|
S3Buckets []S3Bucket `json:"s3_buckets"`
|
2020-01-13 18:49:36 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//We provide defaults in respective terraforms instead of here to keep all values at one place
|
2020-01-14 15:29:50 +05:30
|
|
|
type Database struct {
|
2020-08-26 11:30:09 +05:30
|
|
|
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"`
|
2020-07-31 13:25:50 +05:30
|
|
|
RdsAlertThresholds *RdsAlertThresholds `json:"rdsAlertThresholds"`
|
2020-08-26 11:30:09 +05:30
|
|
|
Parameters map[string]string `json:"parameters"`
|
2020-01-13 18:49:36 +05:30
|
|
|
}
|
2020-02-26 15:27:00 +05:30
|
|
|
|
2020-02-26 12:55:57 +05:30
|
|
|
type Team struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
}
|
2020-02-26 17:17:59 +05:30
|
|
|
|
2020-02-26 15:27:00 +05:30
|
|
|
type Policies struct {
|
2020-02-26 17:33:50 +05:30
|
|
|
Actions []string `json:"actions"`
|
2020-05-27 13:51:41 +05:30
|
|
|
Resource string `json:"resource" valid:"required,matches((^arn.*)|(^\\*$))~Policy resource must be an aws arn or *"`
|
2020-02-26 12:55:57 +05:30
|
|
|
}
|
2020-02-26 15:27:00 +05:30
|
|
|
|
|
|
|
|
type ServiceRole struct {
|
|
|
|
|
Policies []Policies `json:"policies"`
|
2020-10-12 10:52:00 +05:30
|
|
|
RoleName string `json:"roleName"`
|
2020-02-26 15:27:00 +05:30
|
|
|
}
|
2020-02-26 22:45:48 +05:30
|
|
|
|
|
|
|
|
type StateStoreBackend struct {
|
|
|
|
|
BucketName string
|
|
|
|
|
AWSProfile string
|
2020-03-18 12:31:15 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type S3Bucket struct {
|
2020-06-29 15:52:29 +05:30
|
|
|
BucketName string `json:"anonymizedBucketName" valid:"required"`
|
|
|
|
|
BucketTag string `json:"bucketTag" valid:"required"`
|
2020-09-09 20:40:26 +05:30
|
|
|
LifecycleRules []map[string]LifecycleRule `json:"lifecycleRules"`
|
2020-04-05 23:31:19 +05:30
|
|
|
}
|
|
|
|
|
|
2020-07-30 18:52:56 +05:30
|
|
|
type RdsAlertThresholds struct {
|
2020-07-30 19:15:35 +05:30
|
|
|
CpuUtilization int `json:"cpuUtilization"`
|
|
|
|
|
CpuCreditBalance int `json:"cpuCreditBalance"`
|
|
|
|
|
BurstBalance int `json:"burstBalance"`
|
|
|
|
|
DBConnections int `json:"dbConnections"`
|
|
|
|
|
QueueDepth int `json:"queueDepth"`
|
|
|
|
|
FreeStorageSpacePercent int `json:"freeStorageSpacePercent"`
|
2020-08-04 11:21:39 +05:30
|
|
|
FreeMemoryTooLowInMB int `json:"freeMemoryTooLowInMB"`
|
2020-07-30 19:15:35 +05:30
|
|
|
ReadLatency float64 `json:"readLatency"`
|
|
|
|
|
WriteLatency float64 `json:"writeLatency"`
|
2020-07-30 18:52:56 +05:30
|
|
|
}
|
|
|
|
|
|
2020-04-05 23:31:19 +05:30
|
|
|
type LifecycleRule struct {
|
2020-06-29 11:30:18 +05:30
|
|
|
Days int `json:"days"`
|
|
|
|
|
StorageClass string `json:"storageClass"`
|
2020-04-06 11:47:06 +05:30
|
|
|
}
|
2020-06-26 11:32:06 +05:30
|
|
|
|
|
|
|
|
type ReadReplica struct {
|
2020-06-29 11:30:18 +05:30
|
|
|
AwsInstanceClass string `json:"awsInstanceClass" valid:"required"`
|
|
|
|
|
PerformanceInsightsEnabled bool `json:"performanceInsightsEnabled"`
|
2020-06-26 11:32:06 +05:30
|
|
|
}
|