Merge branch 'v2' into INFRA-3107
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
app_name: infra-provisioner-v2
|
||||
version: v2.47.2
|
||||
version: v2.48.2
|
||||
|
||||
@@ -240,7 +240,8 @@ func templateResourceTf(templateName, resourceDir string, manifest *Manifest, de
|
||||
|
||||
err = t.Execute(tfOut, manifest)
|
||||
if err != nil {
|
||||
log.Fatalf("\nErr: %v", err)
|
||||
log.Fatalf("\nError while Templating %s. \nPlease ensure %s is present in the manifest, if present please check if the configurations are correct.\n"+
|
||||
"Err: %v", resourceDir, templateDirMap[resourceDir], err)
|
||||
return err
|
||||
}
|
||||
tfOut.Close()
|
||||
|
||||
@@ -35,10 +35,10 @@ module "s3-buckets" {
|
||||
DataSensitivity = "PII_SPI"
|
||||
{{- end }}
|
||||
|
||||
{{- with .Metadata.DisasterRecovery }}
|
||||
DisasterRecovery = {{ . | quote }}
|
||||
{{- if .Metadata.DisasterRecovery }}
|
||||
DisableDRBackup = {{ if eq .Metadata.DisasterRecovery "True" }}"False"{{ else }}"True"{{ end }}
|
||||
{{- else }}
|
||||
DisasterRecovery = "True"
|
||||
DisableDRBackup = "False"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
@@ -212,6 +212,10 @@ module "rds" {
|
||||
ebs_io_balance_alarm_threshold = {{ .ExtraResources.Database.RdsAlertThresholds.EBSIOBalance | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .ExtraResources.Database.RdsAlertThresholds.TotalIOPS }}
|
||||
total_iops_alarm_threshold = {{ .ExtraResources.Database.RdsAlertThresholds.TotalIOPS | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if .ExtraResources.Database.RdsAlertDurations }}
|
||||
@@ -260,6 +264,10 @@ module "rds" {
|
||||
ebs_io_balance_alarm_evaluation_period = {{ .ExtraResources.Database.RdsAlertDurations.EBSIOBalance | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .ExtraResources.Database.RdsAlertDurations.TotalIOPS }}
|
||||
total_iops_alarm_evaluation_period = {{ .ExtraResources.Database.RdsAlertDurations.TotalIOPS | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if .ExtraResources.Database.StorageEncrypted }}
|
||||
|
||||
@@ -21,7 +21,7 @@ module "s3-buckets" {
|
||||
Name = "foo"
|
||||
Environment = "dev"
|
||||
DataSensitivity = "PII_SPI"
|
||||
DisasterRecovery = "True"
|
||||
DisableDRBackup = "False"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ module "rds" {
|
||||
write_latency_alarm_threshold = "0.5"
|
||||
ebs_byte_balance_alarm_threshold = "70"
|
||||
ebs_io_balance_alarm_threshold = "70"
|
||||
total_iops_alarm_threshold = "80"
|
||||
cpu_utilization_alarm_evaluation_period = "15"
|
||||
cpucredit_balance_alarm_evaluation_period = "5"
|
||||
burst_balance_alarm_evaluation_period = "5"
|
||||
@@ -77,6 +78,7 @@ module "rds" {
|
||||
write_latency_alarm_evaluation_period = "5"
|
||||
ebs_byte_balance_alarm_evaluation_period = "5"
|
||||
ebs_io_balance_alarm_evaluation_period = "5"
|
||||
total_iops_alarm_evaluation_period = "10"
|
||||
storage_encrypted = false
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ module "s3-buckets" {
|
||||
Name = "foo"
|
||||
Environment = "dev"
|
||||
DataSensitivity = "PII_SPI"
|
||||
DisasterRecovery = "True"
|
||||
DisableDRBackup = "False"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ module "s3-buckets" {
|
||||
Name = "foo"
|
||||
Environment = "dev"
|
||||
DataSensitivity = "PII_SPI"
|
||||
DisasterRecovery = "True"
|
||||
DisableDRBackup = "False"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
6
testdata/sample_infra_manifest.json
vendored
6
testdata/sample_infra_manifest.json
vendored
@@ -49,7 +49,8 @@
|
||||
"readLatency": 0.5,
|
||||
"writeLatency": 0.5,
|
||||
"ebsByteBalance": 70,
|
||||
"ebsIOBalance": 70
|
||||
"ebsIOBalance": 70,
|
||||
"totalIOPS": 80
|
||||
},
|
||||
"rdsAlertDurations": {
|
||||
"cpuUtilization": 15,
|
||||
@@ -62,7 +63,8 @@
|
||||
"readLatency": 5,
|
||||
"writeLatency": 5,
|
||||
"ebsByteBalance": 5,
|
||||
"ebsIOBalance": 5
|
||||
"ebsIOBalance": 5,
|
||||
"totalIOPS": 10
|
||||
}
|
||||
},
|
||||
"docdb": {
|
||||
|
||||
12
types.go
12
types.go
@@ -282,6 +282,7 @@ type RdsAlertThresholds struct {
|
||||
WriteLatency float64 `json:"writeLatency"`
|
||||
EBSByteBalance int `json:"ebsByteBalance"`
|
||||
EBSIOBalance int `json:"ebsIOBalance"`
|
||||
TotalIOPS int `json:"totalIOPS" `
|
||||
}
|
||||
|
||||
type RdsAlertDurations struct {
|
||||
@@ -296,6 +297,7 @@ type RdsAlertDurations struct {
|
||||
WriteLatency int `json:"writeLatency"`
|
||||
EBSByteBalance int `json:"ebsByteBalance"`
|
||||
EBSIOBalance int `json:"ebsIOBalance"`
|
||||
TotalIOPS int `json:"totalIOPS"`
|
||||
}
|
||||
|
||||
type AuroraAlertThresholds struct {
|
||||
@@ -378,6 +380,16 @@ var InfraVerticals = map[string]string{
|
||||
"lending": "",
|
||||
}
|
||||
|
||||
var templateDirMap = map[string]string{
|
||||
DIR_RDS_TF: "DATABASE",
|
||||
DIR_ELASTIC_CACHE_TF: "ELASTIC CACHE",
|
||||
DIR_DOCDB_TF: "DOCUMENT DB",
|
||||
DIR_AWS_ROLES_TF: "AWS ACCESS",
|
||||
DIR_S3_BUCKETS_TF: "S3 BUCKETS",
|
||||
DIR_DYNAMODB_TF: "DYNAMODB",
|
||||
DIR_AURORADB_TF: "DATABASE",
|
||||
}
|
||||
|
||||
type ExtraResourceData struct {
|
||||
ResourceName string `json:"resourceName"`
|
||||
IsDeployed bool `json:"isDeployed"`
|
||||
|
||||
Reference in New Issue
Block a user