Merge branch 'master' into ch5082

This commit is contained in:
piyush-sinha
2020-04-05 16:37:59 +05:30
6 changed files with 61 additions and 44 deletions

View File

@@ -111,8 +111,8 @@ func bindataTemplatesAwsrolestfDeploysh() (*asset, error) {
name: "templates/aws-roles-tf/deploy.sh",
size: 374,
md5checksum: "",
mode: os.FileMode(420),
modTime: time.Unix(1583091581, 0),
mode: os.FileMode(436),
modTime: time.Unix(1585549780, 0),
}
a := &asset{bytes: bytes, info: info}
@@ -154,8 +154,8 @@ func bindataTemplatesAwsrolestfMaintf() (*asset, error) {
name: "templates/aws-roles-tf/main.tf",
size: 735,
md5checksum: "",
mode: os.FileMode(420),
modTime: time.Unix(1583087747, 0),
mode: os.FileMode(436),
modTime: time.Unix(1585549780, 0),
}
a := &asset{bytes: bytes, info: info}
@@ -164,13 +164,13 @@ func bindataTemplatesAwsrolestfMaintf() (*asset, error) {
}
var _bindataTemplatesRdstfDeploysh = []byte(
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x8d\x41\x4e\xc4\x30\x0c\x45\xf7\x9c\xc2\x88\x75\xd3\x13\xb0\xe4\x02" +
"\x6c\x58\x46\x6e\x62\x4a\x44\x13\x47\xb6\xd3\x82\xda\xde\x9d\x0d\x9a\xa9\x46\x23\xcd\x68\x76\xb6\xfe\x7f\xef\xbf" +
"\x3c\xf7\x43\x2a\xbd\x7e\x3d\x19\x89\xe0\x27\x4b\x86\x54\x92\x1d\xde\x85\xe5\x5b\x2b\x06\x02\xa5\x89\x82\xc1\xba" +
"\x82\x7b\xfb\x31\xc1\x77\x52\x6e\x12\x48\xdd\xc7\xa9\xb3\xef\xb0\x6d\x70\x8d\x2e\xb4\xdc\x42\x0f\xab\x58\xeb\xf4" +
"\x0b\x9d\xa1\x8c\x64\xaf\x99\x63\x9b\xc8\x49\x54\x17\xd1\xd0\xe1\xa2\x5e\xdb\x50\xc8\x7c\x8a\xea\x02\xe7\x8c\x25" +
"\xfa\x2a\x69\x46\xa3\xff\x48\xa1\xc3\x66\xdc\x61\xad\xc2\x33\xdd\x23\x3f\x9f\x3e\x15\x35\x2c\x81\x1e\x96\x54\x56" +
"\x1b\x85\xd4\xc7\xe1\xc2\xf1\x17\x00\x00\xff\xff\x61\x91\x15\xf4\x75\x01\x00\x00")
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x8e\x31\x4e\xc4\x40\x0c\x45\x7b\x4e\x61\x44\x9d\xd9\x13\x50\x72\x01" +
"\x1a\xca\x91\x33\xf3\x59\x46\x24\xf6\xc8\x76\x12\xd0\xee\xde\x9d\x06\x41\x84\x90\x40\x82\xce\x96\xfd\xde\xff\x37" +
"\xd7\x87\xb1\xc9\xc1\x9f\xae\x02\x66\xfc\xa8\x36\x53\x93\x16\xbb\x75\x53\x7b\xf6\xce\x05\xe4\x98\x50\x82\x4e\x27" +
"\x4a\x77\x2f\x61\x7c\x0f\xd7\xc5\x0a\x3c\x3d\x7c\xfc\x5c\x2e\x74\x3e\xd3\x77\xb4\x60\xfb\x09\xdd\xa5\x72\xef\xd3" +
"\x2b\x0d\xc1\x76\x44\xdc\xce\x5a\x97\x09\xc9\xaa\xa7\xca\xc1\x89\x37\xcf\xbe\x8c\x82\xc8\xad\x7a\x2a\x3a\xcf\x2c" +
"\x35\x77\x6b\x2b\x07\xde\x4f\x4e\x03\x2f\xa1\x03\xf7\x6e\xba\xe2\x37\xf2\xcf\x31\x37\xf1\x60\x29\xf8\x17\x49\xc6" +
"\x0a\xf9\x43\xa1\xae\x1e\x47\x83\xe7\x3a\x7e\x71\xbc\x05\x00\x00\xff\xff\xb6\x6e\x64\x21\xc1\x01\x00\x00")
func bindataTemplatesRdstfDeployshBytes() ([]byte, error) {
return bindataRead(
@@ -189,10 +189,10 @@ func bindataTemplatesRdstfDeploysh() (*asset, error) {
info := bindataFileInfo{
name: "templates/rds-tf/deploy.sh",
size: 373,
size: 449,
md5checksum: "",
mode: os.FileMode(420),
modTime: time.Unix(1582717464, 0),
mode: os.FileMode(436),
modTime: time.Unix(1585715612, 0),
}
a := &asset{bytes: bytes, info: info}
@@ -201,24 +201,26 @@ func bindataTemplatesRdstfDeploysh() (*asset, error) {
}
var _bindataTemplatesRdstfMaintf = []byte(
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x53\x5d\x6b\xdb\x30\x14\x7d\xf7\xaf\xb8\xe4\x5d\x0e\x63\x6f\x85\xc2" +
"\xc6\x9a\x8d\xee\x61\x94\xad\xdb\xab\xb9\x96\xaf\x1d\x61\x7d\x24\xba\x72\xd2\x34\xcd\x7f\x1f\xb2\x9c\x2e\xc6\x69" +
"\x52\x98\xc0\x60\x5f\x9d\x73\xee\xb9\x47\x72\x20\xef\xb1\x76\xde\xc0\x3e\x03\x28\x51\xb6\x64\x2b\x98\xf1\xc7\x59" +
"\x5f\x00\x28\x3b\xd9\x52\x80\xf1\xba\x85\x99\xc5\x8d\x12\x25\xda\x56\xbc\x4a\x08\xe9\x8c\x41\x5b\x09\x0e\x18\x68" +
"\xd6\xd3\x3d\x35\xca\xd9\x29\x1d\x57\x82\x5d\x17\x96\xe2\x43\xc2\xb5\xb4\x83\xc9\xba\x85\x99\xaf\x38\x01\xb6\xce" +
"\xb7\xbc\x42\x49\x45\x4b\xbb\x62\xe5\xa9\x56\x4f\x03\x20\xf5\xe3\xf9\x7e\x0f\xf9\xe2\x29\x78\xfc\x49\xec\x3a\x2f" +
"\x89\xf3\x3b\x0c\x58\x22\x53\x7e\x6f\x39\xa0\x95\xf4\x03\x0d\xc1\xe1\x90\x34\x57\xde\xd5\x4a\xd3\xa4\xa9\x34\x55" +
"\x02\xa0\xd4\x67\x5d\xa5\x50\x84\xdb\x5a\xf2\xa2\xee\xb4\x16\xd2\xd9\xe0\x9d\x8e\xb4\x43\x76\xc8\x32\xe3\xaa\x4e" +
"\x53\xf2\xdf\x27\x99\x1c\x9d\x68\x34\x2a\xdc\xdc\x30\x2f\x6f\xe6\xf3\x46\x85\x4f\x8d\x0a\xcb\xae\xcc\xa5\xa9\xf2" +
"\x3e\xda\x40\x72\x99\x2b\x3b\xef\x3f\x94\xad\x3d\xce\x7d\xc5\x79\xa3\x42\xec\x41\x76\xa3\xbc\xb3\x86\x6c\xe8\xd5" +
"\xce\x8c\xbe\x38\x81\xbc\xc0\xba\x73\x21\x0e\x9e\x01\xa8\x21\x8a\xc2\xc6\x2c\xce\x72\xcf\xc7\x36\x52\x59\x21\xf3" +
"\xd6\xf9\xea\x38\xcf\x25\x95\x87\x23\x76\xa4\xc0\xea\x99\x4e\x53\xbd\xa4\xf0\x4b\x3d\xd3\xbd\xfd\x56\x26\x66\xc7" +
"\xe4\xdf\xcb\xfc\x1d\xb1\x27\x7d\x33\x80\x6a\xd8\xe3\x77\xd0\xef\xca\x38\x3a\xc3\x0b\x98\x8e\xc3\xa3\xfb\xce\xce" +
"\x26\x13\x47\x95\x22\x60\xc3\x51\x25\x4b\x76\x1e\x09\xcd\x20\x1a\x5f\xf3\x69\x74\xf1\xc9\x00\xf6\x7b\x01\xaa\x7e" +
"\xbb\xf5\xe7\x2d\x1f\xe3\xff\xa2\x91\x39\x91\x71\xcb\xc5\xeb\x09\xca\xbe\x7e\x79\x82\x89\xcc\xc8\x4b\x34\x11\xff" +
"\xf8\x94\xcc\x35\x4b\x0f\xbc\xd6\x5f\xd1\x28\xbd\x1b\x2e\x01\xaf\x75\x51\xa7\xc2\x95\x2b\xf0\x8f\xf9\x9f\xfd\x17" +
"\xb6\x51\x96\xfe\x90\x67\x75\x3c\x8a\xde\x06\xf5\xf5\x62\x33\x6c\x5c\xb7\x33\x16\x7a\xd3\xd5\x21\xfb\x1b\x00\x00" +
"\xff\xff\xa5\x20\x97\xf0\x24\x05\x00\x00")
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x94\x41\x6f\xd3\x4e\x10\xc5\xef\xfe\x14\xa3\xdc\xed\xfc\xff\xe2\x80" +
"\x54\x29\x12\x85\x16\x54\x24\x50\x05\x85\x03\x17\x6b\xbc\x1e\x3b\x2b\xaf\x77\xdd\x9d\xd9\xa6\x6d\x9a\xef\x8e\xd6" +
"\x9b\x94\x44\x49\x9a\x22\x7c\x4a\xc6\xef\xfd\xf6\xcd\x73\x1c\x21\xef\xb1\x71\xbe\x87\x65\x06\x50\xa1\xea\xc8\xd6" +
"\x30\xe1\x37\x93\x71\x00\x50\x05\xd5\x91\xc0\xee\x35\x83\x89\xc5\x3b\x9d\x57\x68\xbb\xfc\x19\x91\x2b\xd7\xf7\x68" +
"\xeb\x9c\x05\x85\x26\xa3\xdd\x53\xab\x9d\xdd\xb7\xe3\x90\xb3\x0b\x32\xcf\xff\x4f\xba\x8e\x1e\x60\xef\x9a\xc1\xc4" +
"\xd7\x9c\x04\x0b\xe7\x3b\x1e\x50\x51\xd9\xd1\x43\x39\x78\x6a\xf4\xfd\x5a\x90\xce\xe3\xe9\x72\x09\xc5\xe5\xbd\x78" +
"\xfc\x46\xec\x82\x57\xc4\xc5\x05\x0a\x56\xc8\x54\x5c\x59\x16\xb4\x8a\xbe\x62\x4f\xb0\x5a\x25\xe6\xe0\x5d\xa3\x0d" +
"\xed\x1d\xaa\xfa\x3a\x09\x50\x99\x83\xa9\x52\x29\xb9\x5b\x58\xf2\x79\x13\x8c\xc9\x95\xb3\xe2\x9d\x89\xb6\x55\xb6" +
"\xca\xb2\xde\xd5\xc1\x50\xca\x3f\x36\x99\x12\x6d\x31\x5a\x2d\x67\x67\xcc\xf3\xb3\xe9\xb4\xd5\xf2\xae\xd5\x32\x0f" +
"\x55\xa1\xfa\xba\x18\xab\x15\x52\xf3\x42\xdb\xe9\xf8\x45\xdb\xc6\xe3\xd4\xd7\x5c\xb4\x5a\xe2\x19\x64\xef\xb4\x77" +
"\xb6\x27\x2b\x23\xed\xc0\xea\x97\x5b\x92\x27\xb8\x0d\x4e\xe2\xe2\x19\x80\x5e\x57\x51\xda\xd8\xc5\x41\xef\xe1\xda" +
"\x76\x28\x03\x32\x2f\x9c\xaf\x37\xfb\xbc\x44\xb9\xde\x68\x77\x08\xac\x1f\x69\xbb\xd5\x97\x08\xdf\xf5\x23\x5d\xd9" +
"\x4f\x55\x72\x06\x26\xff\x5a\xe7\x8f\xa8\xdd\x3a\x37\x03\xa8\xd7\xf7\xf8\x15\xf6\x8b\x2a\xae\xce\xf0\x04\x7d\x60" +
"\xb9\x71\x9f\xd9\xd9\x14\x62\x43\x29\x05\x5b\x8e\x94\x2c\xc5\xb9\x21\xec\xd7\xd0\xf8\xb1\xd8\xaf\x6e\x0c\x21\x27" +
"\x64\x19\xc0\x72\x99\x83\x6e\x8e\x67\x3b\x5f\xf0\xe6\xf9\x7c\x30\xc8\x9c\xe8\xb8\xe0\xf2\xf9\x11\xab\x71\xfe\xf2" +
"\x8a\x7b\x98\x9d\xb0\x31\x44\xfc\x4b\x78\x5d\xa4\xf7\xa8\xba\x30\x5c\x68\xc6\xca\x50\x9d\x08\xd5\x38\x2b\x3d\x09" +
"\x59\xd1\xce\x96\x03\x79\xed\x6a\x98\xc1\x7f\x1b\xbe\x61\x3a\xa5\x7d\x7b\x2c\x8b\x75\x72\x3c\xcf\x97\x60\x44\x9f" +
"\xff\xda\x0d\xd4\xc7\x61\x89\x8f\x30\x03\xf1\x81\xfe\x7a\xc9\x6b\xbe\x35\x1f\xb1\xd7\xe6\x61\xfd\x2a\xf0\xad\x29" +
"\x9b\x34\x38\xf1\x22\xfc\x71\xfe\x43\xc9\x91\x72\x69\x5b\x6d\xe9\x27\x79\xd6\x9b\x1f\xe4\x18\x83\xc6\x79\x79\xb7" +
"\xbe\x71\x3a\xce\x2e\xe8\x68\xaa\x55\xf6\x3b\x00\x00\xff\xff\xf1\x7c\xe4\x55\x2a\x06\x00\x00")
func bindataTemplatesRdstfMaintfBytes() ([]byte, error) {
return bindataRead(
@@ -237,10 +239,10 @@ func bindataTemplatesRdstfMaintf() (*asset, error) {
info := bindataFileInfo{
name: "templates/rds-tf/main.tf",
size: 1316,
size: 1578,
md5checksum: "",
mode: os.FileMode(420),
modTime: time.Unix(1582717464, 0),
mode: os.FileMode(436),
modTime: time.Unix(1585825744, 0),
}
a := &asset{bytes: bytes, info: info}

View File

@@ -14,7 +14,7 @@ var storageBackendBucketMap = map[string]string{
"cmd": "navi-bank-terraform-command-state",
"dev": "navi-bank-terraform-nonprod-state",
"qa": "navi-bank-terraform-nonprod-state",
"automation": "navi-bank-terraform-nonprod-state",
"automation": "navi-bank-terraform-nonprod-state",
"spike": "navi-bank-terraform-nonprod-state",
}

View File

@@ -1,12 +1,12 @@
{
"extraResources": {
"environment": "dev",
"environment": "spike",
"database": {
"instanceName": "auth-service",
"user": "auth_service_user",
"password": "auth_service_password",
"instanceName": "foo-service",
"user": "foo_service_user",
"password": "foo_service_password",
"sizeInGb": 7,
"dbNames": ["auth_service"]
"dbNames": ["foo_service"]
},
"aws_access": {
"policies": [
@@ -40,9 +40,9 @@
]
},
"team": {
"name": "LoanOrigination"
"name": "Infra"
},
"deployment": {
"name": "auth"
"name": "foo"
}
}

View File

@@ -3,4 +3,5 @@ terraform init
terraform workspace select {{ .ExtraResources.Workspace }} || terraform workspace new {{ .ExtraResources.Workspace }}
terraform apply -target=module.rds.data.aws_subnet_ids.command_private_subnets -auto-approve
terraform apply -target=module.rds.module.rds_instance -auto-approve
terraform apply -target=module.rds.module.rds_instance_events -auto-approve
terraform apply -target=module.rds.module.postgres_db -auto-approve

View File

@@ -21,11 +21,23 @@ module "rds" {
database_tags = {
Team = {{ .Team.Name | quote }}
}
team = {{ .Team.Name | quote }}
{{- if .ExtraResources.Database.AwsInstanceClass }}
aws_instance_class = {{ .ExtraResources.Database.AwsInstanceClass | quote }}
{{- end }}
{{- if .ExtraResources.Database.BackupDisabled }}
backup_retention_period = 0
{{- else }}
backup_retention_period = 7
{{- end }}
{{- if not .ExtraResources.Database.MultiAZDisabled }}
multi_az = true
{{- end }}
{{- if .ExtraResources.Database.PsqlFamily }}
psql_family = {{ .ExtraResources.Database.PsqlFamily | quote }}
{{- end }}

View File

@@ -32,6 +32,8 @@ type Database struct {
SizeInGb int `json:"sizeInGb"`
DbNames []string `json:"dbNames"`
InstanceName string `json:"instanceName"`
BackupDisabled bool `json:"backupDisabled"`
MultiAZDisabled bool `json:"multiAZDisabled"`
}
type Team struct {