diff --git a/bindata.go b/bindata.go index 337a227..935ca53 100644 --- a/bindata.go +++ b/bindata.go @@ -1,7 +1,5 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// templates/aws-roles-tf/deploy.sh -// templates/aws-roles-tf/main.tf // templates/rds-tf/deploy.sh // templates/rds-tf/main.tf @@ -81,98 +79,14 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _bindataTemplatesAwsrolestfDeploysh = []byte( - "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\xd1\xee\xd2\x30\x14\xc6\xef\xfb\x14\x9f\xdb\x12\xae\xb6\xff\x03" + - "\x18\x62\x06\x2c\x6a\x22\x68\x18\x44\x2f\x48\x48\xe9\xce\x58\xb3\xae\x5d\xda\x8e\x41\xc6\xde\xdd\x80\x88\x44\xbd" + - "\xec\xd7\xdf\x39\xbf\xf3\x85\xef\xde\x0e\x52\xbf\xb9\x8a\xb1\x10\x74\x96\x1e\x7d\x45\x1a\x5c\x5f\x20\x4c\xd3\x70" + - "\x5d\xa0\xe4\x52\x39\xe6\xc8\x23\x26\x16\xa2\x26\x6a\xe1\x2d\x17\x35\x4c\x09\x5f\x11\x14\x77\x1e\x74\x26\xd1\x79" + - "\x2a\x7e\x8f\x31\x6f\x79\x8b\xc9\xed\x6f\xff\x88\xa6\x91\xe8\xac\x25\xfd\x0c\xde\xe3\xaf\x60\x1a\xcd\xd2\xfc\xd3" + - "\x7e\xfe\x75\xb9\x4c\x57\x8b\x09\x16\xd9\x6c\xfb\xf1\x76\x98\xa8\x0c\xb8\x06\x59\x6b\x2c\x1a\x72\x8e\x1f\x09\x07" + - "\x2a\x8d\xa5\xfb\xd5\x52\x1f\x1f\xc2\x3b\x1a\xec\x82\x68\x78\x55\x8f\xbb\xe0\x4f\x1f\xa9\xa8\x40\x2f\x7d\xf5\xab" + - "\xb0\x30\x05\x21\xfa\x90\x04\x13\x64\x3f\x3e\x6f\x98\x27\x6b\x79\x69\x6c\x03\xa9\xa5\x7f\x79\xf6\xc6\xd6\xae\xe5" + - "\x82\xe0\x48\x91\xf0\x18\x06\x24\xdf\x9f\xe1\x38\xe2\x7a\xc5\xff\x70\x4d\xfd\x3f\xec\xcb\x5e\xde\xb6\xea\x82\x98" + - "\x77\xde\xc4\xbc\x6d\xad\x39\x11\xab\xbb\x03\x09\xaf\x20\x8c\x2e\xe5\x11\x9d\xa3\x58\x18\xed\xe9\xec\x11\x0e\xf3" + - "\x2f\xdb\x7c\x93\xad\xc7\x27\xf5\xd8\x50\xde\x2d\x39\xd9\x93\x14\xb4\x36\x8a\x92\x15\x6f\x6e\xb2\xe4\xc2\x1b\x85" + - "\x58\x23\x1c\x56\xe9\x32\xcb\xbf\xa5\xf3\x6c\x64\x3f\x03\x00\x00\xff\xff\xa2\x4c\xce\x13\xfc\x01\x00\x00") - -func bindataTemplatesAwsrolestfDeployshBytes() ([]byte, error) { - return bindataRead( - _bindataTemplatesAwsrolestfDeploysh, - "templates/aws-roles-tf/deploy.sh", - ) -} - - - -func bindataTemplatesAwsrolestfDeploysh() (*asset, error) { - bytes, err := bindataTemplatesAwsrolestfDeployshBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{ - name: "templates/aws-roles-tf/deploy.sh", - size: 508, - md5checksum: "", - mode: os.FileMode(420), - modTime: time.Unix(1582716552, 0), - } - - a := &asset{bytes: bytes, info: info} - - return a, nil -} - -var _bindataTemplatesAwsrolestfMaintf = []byte( - "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x90\x31\x8f\xe3\x20\x10\x85\x7b\xff\x8a\x91\x7b\x6c\x9d\xae\x8b\x14" + - "\xe9\x9a\x6b\xae\xb8\x62\x77\xfb\x08\xe3\xb1\x8d\x0c\x8c\x17\x86\x64\xa3\x84\xff\xbe\x02\xb4\x51\x36\x59\x3a\x46" + - "\xef\xbd\x79\xf3\x31\x7a\x2f\x27\xf2\x16\x2e\x0d\xc0\x20\xd5\x8a\x6e\x84\x36\xfc\x6e\xcb\x00\x60\x88\x6a\x45\x86" + - "\xef\x6f\x0f\xad\x93\x47\x2d\x06\xe9\x56\x71\x8b\x10\x8a\xac\x95\x6e\x14\x81\x25\x63\x5b\xec\x1e\x67\x4d\xee\xd9" + - "\x2e\x37\x11\x28\xf2\x22\x7e\x55\xdd\x8a\x67\x78\x7a\x7b\x68\x03\xfa\xa3\x56\x28\xb4\xb4\xc2\x93\xc1\x50\xe5\x27" + - "\xf2\x6b\xd8\xa4\xc2\xc3\x8a\xe7\xc3\xe6\x71\xd2\x1f\x59\xae\xa5\x2d\xaa\xfe\x72\x81\xee\xaf\x3b\x6a\x4f\xce\xa2" + - "\x63\x48\xa9\x8c\x5e\x6b\xdc\x0b\x19\xec\xfe\x4b\x8b\x90\x52\x0d\xdc\x3c\x4d\xda\xe0\xd3\x7e\x65\xc7\x2a\x90\xca" + - "\xfc\x58\xb0\xf2\x11\x74\x72\xe8\xc5\x14\x8d\x11\x8a\x1c\x7b\x32\xd9\x96\x9a\xd4\x34\x96\xc6\x68\xb0\x74\x2b\x27" + - "\x54\xb2\x81\xa2\x57\x78\x17\x34\x6b\xde\xed\x42\x58\x76\x7d\x3f\x6b\xfe\x33\x6b\x5e\xe2\xd0\x29\x3b\x76\x05\x35" + - "\xa3\x5a\x3a\xed\xfa\xf2\xd1\x6e\xf2\xb2\xbf\x31\xe9\x66\xcd\x79\x1d\xde\x1d\x9c\x33\x1f\x21\x5c\xe1\x3d\x12\xe7" + - "\xa3\x73\x81\x8a\xe2\x90\x13\xbe\x4a\x3c\x20\x82\x2b\xd8\x18\xf8\x8d\xfe\x05\x72\xd9\x95\x9a\xcf\x00\x00\x00\xff" + - "\xff\x48\x68\xe4\x76\x30\x02\x00\x00") - -func bindataTemplatesAwsrolestfMaintfBytes() ([]byte, error) { - return bindataRead( - _bindataTemplatesAwsrolestfMaintf, - "templates/aws-roles-tf/main.tf", - ) -} - - - -func bindataTemplatesAwsrolestfMaintf() (*asset, error) { - bytes, err := bindataTemplatesAwsrolestfMaintfBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{ - name: "templates/aws-roles-tf/main.tf", - size: 560, - md5checksum: "", - mode: os.FileMode(420), - modTime: time.Unix(1582711555, 0), - } - - a := &asset{bytes: bytes, info: info} - - return a, nil -} - var _bindataTemplatesRdstfDeploysh = []byte( - "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\xcc\x4b\x8e\xc2\x30\x0c\x80\xe1\xfd\x9c\xc2\xa3\x59\x37\x3d\xc1\x9c" + - "\x83\x65\xe4\x26\xa6\x44\x34\x89\x65\xbb\xad\x50\xdb\xbb\xb3\x41\x50\x01\x0b\xc4\xce\x8f\x5f\xdf\xdf\x6f\xdb\xa5" + - "\xd2\xea\xe9\xc7\x48\x04\x8f\x55\x32\xa4\x92\x6c\xb7\xce\x55\xce\xca\x18\x08\x94\x06\x0a\x06\xcb\x02\xee\x70\x3f" + - "\x6e\x1b\xac\x2b\xbc\xcb\x0b\xcd\x2f\xed\xce\x45\xe6\xe1\x02\x8d\xa1\xf4\x64\xff\xb9\xc6\x71\x20\x27\x51\x5d\x44" + - "\x43\x87\xb3\x7a\x1d\xbb\x42\xe6\x53\x54\x17\x6a\xce\x58\xa2\x67\x49\x13\x1a\xdd\x5e\x0a\x0d\x8e\x56\x1b\x64\x96" + - "\x3a\xd1\x27\xf8\x63\xf4\xa9\xa8\x61\x09\xf4\x35\xc2\x55\xad\x17\x52\x1f\xbb\x27\xe3\x1a\x00\x00\xff\xff\xb9\x7c" + - "\xda\xf4\x57\x01\x00\x00") + "\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") func bindataTemplatesRdstfDeployshBytes() ([]byte, error) { return bindataRead( @@ -191,10 +105,10 @@ func bindataTemplatesRdstfDeploysh() (*asset, error) { info := bindataFileInfo{ name: "templates/rds-tf/deploy.sh", - size: 343, + size: 373, md5checksum: "", mode: os.FileMode(420), - modTime: time.Unix(1582711358, 0), + modTime: time.Unix(1582701520, 0), } a := &asset{bytes: bytes, info: info} @@ -203,22 +117,24 @@ func bindataTemplatesRdstfDeploysh() (*asset, error) { } var _bindataTemplatesRdstfMaintf = []byte( - "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x53\x4d\x8f\x9b\x30\x10\xbd\xf3\x2b\x46\xb9\x9b\xa8\xea\x2d\xd2\x4a" + - "\xad\xba\xdb\x6a\x7b\xa8\x56\xea\xc7\x15\x19\x33\x10\x0b\x7b\x4c\x3c\x26\x34\xcb\xf2\xdf\x2b\x30\xd9\xc2\x26\x39" + - "\xac\x6f\xcc\xbc\x37\xef\x43\x22\xa0\xf7\xb2\x74\xde\x42\x9f\x00\xe4\x52\xd5\x48\x05\x6c\xf8\xe3\x66\x1a\x00\xe4" + - "\xad\xaa\x31\xc0\xfa\xdd\xc1\x86\xe4\x51\x8b\x5c\x52\x2d\x5e\x4f\x08\xe5\xac\x95\x54\x08\x0e\x32\xe0\x66\xa2\x7b" + - "\xac\xb4\xa3\x4b\xba\x6c\x04\xbb\x36\xec\xc5\x87\x88\xab\xf1\x04\x17\xef\x0e\x36\xbe\xe0\x08\xe8\x9c\xaf\xb9\x91" + - "\x0a\xb3\x1a\x4f\x59\xe3\xb1\xd4\x7f\x67\x40\xd4\xe3\x6d\xdf\x43\x7a\x2f\x83\xcc\x25\x63\xfa\x48\x1c\x24\x29\xfc" + - "\x21\x2d\xc2\x30\xc4\x23\x8d\x77\xa5\x36\x78\xa1\xa2\x6c\x11\x01\x52\x99\xab\x36\x62\x0b\xc2\x75\x84\x5e\x94\xad" + - "\x31\x42\x39\x0a\xde\x99\x91\x36\x24\x43\x92\x58\x57\xb4\x06\xa3\xe1\xa9\x3a\x76\xad\x57\xb8\xb8\x51\xe9\xb0\xdb" + - "\x31\xef\x77\xdb\x6d\xa5\xc3\xa7\x4a\x87\x7d\x9b\xa7\xca\x16\xe9\xd4\x65\x40\xb5\x4f\x35\x6d\xa7\x0f\x4d\xa5\x97" + - "\x5b\x5f\x70\x5a\xe9\x30\x6a\x20\x1d\xb5\x77\x64\x91\xc2\x74\x6d\xcc\xfa\xb0\x98\xbd\xc0\xa1\x75\x61\x4c\x9a\x00" + - "\xe8\x39\x7b\x46\x63\xf8\x08\xbe\x5e\xcc\x8a\xd6\x48\xe6\xce\xf9\xe2\xec\x78\x45\x7b\x3a\x2f\x57\x14\xd6\xcf\xb8" + - "\x2c\x6a\x45\xf9\xa9\x9f\xf1\x91\xbe\xe5\x11\xda\x32\xfa\x9b\xd0\xdf\xe3\x72\x71\x39\x01\x28\xe6\x1d\x5f\xc3\xdf" + - "\xe7\xa3\x7d\x86\x17\xb0\x2d\x87\x5f\xee\x3b\x3b\x9a\x79\x7d\x2f\x40\x97\x0b\xec\xe7\x8e\xcf\x99\xbf\x18\xc9\x1c" + - "\xed\xc8\x8e\xb3\xd7\x9e\xd4\x34\x7f\xa3\x71\xc1\x5b\x25\x1f\x65\xc6\x5f\xe5\x86\xe8\x13\x1f\xcc\x57\x69\xb5\x39" + - "\xcd\xdd\xf2\xc1\x64\x65\x1c\xbc\x6d\xf6\x3f\xf4\xbd\x0a\x0f\x54\x69\xc2\x3f\xe8\x59\xc7\xfc\xb3\x10\x4e\xf3\xec" + - "\x38\x2f\xae\x08\xae\x99\xb7\x74\x87\xe4\x5f\x00\x00\x00\xff\xff\xf5\xc3\xcf\xc3\x20\x04\x00\x00") + "\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") func bindataTemplatesRdstfMaintfBytes() ([]byte, error) { return bindataRead( @@ -237,10 +153,10 @@ func bindataTemplatesRdstfMaintf() (*asset, error) { info := bindataFileInfo{ name: "templates/rds-tf/main.tf", - size: 1056, + size: 1316, md5checksum: "", mode: os.FileMode(420), - modTime: time.Unix(1582711358, 0), + modTime: time.Unix(1582701559, 0), } a := &asset{bytes: bytes, info: info} @@ -312,10 +228,8 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. // var _bindata = map[string]func() (*asset, error){ - "templates/aws-roles-tf/deploy.sh": bindataTemplatesAwsrolestfDeploysh, - "templates/aws-roles-tf/main.tf": bindataTemplatesAwsrolestfMaintf, - "templates/rds-tf/deploy.sh": bindataTemplatesRdstfDeploysh, - "templates/rds-tf/main.tf": bindataTemplatesRdstfMaintf, + "templates/rds-tf/deploy.sh": bindataTemplatesRdstfDeploysh, + "templates/rds-tf/main.tf": bindataTemplatesRdstfMaintf, } // @@ -371,10 +285,6 @@ type bintree struct { var _bintree = &bintree{Func: nil, Children: map[string]*bintree{ "templates": {Func: nil, Children: map[string]*bintree{ - "aws-roles-tf": {Func: nil, Children: map[string]*bintree{ - "deploy.sh": {Func: bindataTemplatesAwsrolestfDeploysh, Children: map[string]*bintree{}}, - "main.tf": {Func: bindataTemplatesAwsrolestfMaintf, Children: map[string]*bintree{}}, - }}, "rds-tf": {Func: nil, Children: map[string]*bintree{ "deploy.sh": {Func: bindataTemplatesRdstfDeploysh, Children: map[string]*bintree{}}, "main.tf": {Func: bindataTemplatesRdstfMaintf, Children: map[string]*bintree{}}, diff --git a/resource.go b/resource.go index c67f345..9c51655 100644 --- a/resource.go +++ b/resource.go @@ -49,7 +49,7 @@ func templateResourceTf(templateName, resourceDir string, manifest *Manifest) er return err } - err = t.Execute(tfOut, manifest.ExtraResources) + err = t.Execute(tfOut, manifest) if err != nil { log.Fatalf("\nErr: %v", err) return err diff --git a/sample_infra_manifest.json b/sample_infra_manifest.json index db5e6e1..d932826 100644 --- a/sample_infra_manifest.json +++ b/sample_infra_manifest.json @@ -25,5 +25,8 @@ } ] } + }, + "team": { + "name": "LoanOrigination" } } diff --git a/templates/rds-tf/deploy.sh b/templates/rds-tf/deploy.sh index 8bfd697..ddfacc9 100644 --- a/templates/rds-tf/deploy.sh +++ b/templates/rds-tf/deploy.sh @@ -1,6 +1,6 @@ #!/bin/sh terraform init -terraform workspace select {{ .Workspace }} || terraform workspace new {{ .Workspace }} +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.postgres_db -auto-approve diff --git a/templates/rds-tf/main.tf b/templates/rds-tf/main.tf index e9c5ab3..c755ab0 100644 --- a/templates/rds-tf/main.tf +++ b/templates/rds-tf/main.tf @@ -3,7 +3,7 @@ terraform { bucket = "navi-bank-terraform-command-state" region = "ap-south-1" key = "rds" - workspace_key_prefix = "rds-states/{{ .Database.InstanceName }}" + workspace_key_prefix = "rds-states/{{ .ExtraResources.Database.InstanceName }}" profile = "cmd" acl = "bucket-owner-full-control" } @@ -11,23 +11,27 @@ terraform { module "rds" { source = "git::ssh://git@github.cmd.navi-tech.in/navi-infra/rds.git" - environment = {{ .Environment | quote }} - instance_name = {{ .Database.InstanceName | quote }} - password = {{ .Database.Password | quote }} - size = {{ .Database.SizeInGb }} - user = {{ .Database.User | quote }} + environment = {{ .ExtraResources.Environment | quote }} + instance_name = {{ .ExtraResources.Database.InstanceName | quote }} + password = {{ .ExtraResources.Database.Password | quote }} + size = {{ .ExtraResources.Database.SizeInGb }} + user = {{ .ExtraResources.Database.User | quote }} - databases = {{ .Database.DbNames | mustToJson }} - - {{- if .Database.AwsInstanceClass }} - aws_instance_class = {{ .Database.AwsInstanceClass | quote }} + databases = {{ .ExtraResources.Database.DbNames | mustToJson }} + database_tags = { + Team = {{ .Team.Name | quote }} + } + + {{- if .ExtraResources.Database.AwsInstanceClass }} + aws_instance_class = {{ .ExtraResources.Database.AwsInstanceClass | quote }} {{- end }} - {{- if .Database.PsqlFamily }} - psql_family = {{ .Database.PsqlFamily | quote }} + {{- if .ExtraResources.Database.PsqlFamily }} + psql_family = {{ .ExtraResources.Database.PsqlFamily | quote }} {{- end }} - {{- if .Database.PsqlEngineVersion }} - psql_engine_version = {{ .Database.PsqlEngineVersion | quote }} + {{- if .ExtraResources.Database.PsqlEngineVersion }} + psql_engine_version = {{ .ExtraResources.Database.PsqlEngineVersion | quote }} {{- end }} + } diff --git a/types.go b/types.go index ff03f23..dbd18a5 100644 --- a/types.go +++ b/types.go @@ -9,6 +9,7 @@ var workspaceMap = map[string]string { type Manifest struct { ExtraResources ExtraResources `json:"extraResources"` + Team Team `json:"team"` } type ExtraResources struct { @@ -38,4 +39,7 @@ type ServiceRole struct { type Policies struct { Actions []string `json:"actions"` Resource string `json:"resource"` -} \ No newline at end of file +} +type Team struct { + Name string `json:"name"` +}