@@ -546,6 +546,26 @@ the configuration ID. In this case, configId must be omitted.`,
546
546
Description : `Environment variables available to the application. As these are not returned in the API request, Terraform will not detect any changes made outside of the Terraform config.` ,
547
547
Elem : & schema.Schema {Type : schema .TypeString },
548
548
},
549
+ "flexible_runtime_settings" : {
550
+ Type : schema .TypeList ,
551
+ Optional : true ,
552
+ Description : `Runtime settings for App Engine flexible environment.` ,
553
+ MaxItems : 1 ,
554
+ Elem : & schema.Resource {
555
+ Schema : map [string ]* schema.Schema {
556
+ "operating_system" : {
557
+ Type : schema .TypeString ,
558
+ Optional : true ,
559
+ Description : `Operating System of the application runtime.` ,
560
+ },
561
+ "runtime_version" : {
562
+ Type : schema .TypeString ,
563
+ Optional : true ,
564
+ Description : `The runtime version of an App Engine flexible application.` ,
565
+ },
566
+ },
567
+ },
568
+ },
549
569
"handlers" : {
550
570
Type : schema .TypeList ,
551
571
Computed : true ,
@@ -928,6 +948,12 @@ func resourceAppEngineFlexibleAppVersionCreate(d *schema.ResourceData, meta inte
928
948
} else if v , ok := d .GetOkExists ("runtime_channel" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (runtimeChannelProp )) && (ok || ! reflect .DeepEqual (v , runtimeChannelProp )) {
929
949
obj ["runtimeChannel" ] = runtimeChannelProp
930
950
}
951
+ flexibleRuntimeSettingsProp , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettings (d .Get ("flexible_runtime_settings" ), d , config )
952
+ if err != nil {
953
+ return err
954
+ } else if v , ok := d .GetOkExists ("flexible_runtime_settings" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (flexibleRuntimeSettingsProp )) && (ok || ! reflect .DeepEqual (v , flexibleRuntimeSettingsProp )) {
955
+ obj ["flexibleRuntimeSettings" ] = flexibleRuntimeSettingsProp
956
+ }
931
957
betaSettingsProp , err := expandAppEngineFlexibleAppVersionBetaSettings (d .Get ("beta_settings" ), d , config )
932
958
if err != nil {
933
959
return err
@@ -1184,6 +1210,9 @@ func resourceAppEngineFlexibleAppVersionRead(d *schema.ResourceData, meta interf
1184
1210
if err := d .Set ("runtime_channel" , flattenAppEngineFlexibleAppVersionRuntimeChannel (res ["runtimeChannel" ], d , config )); err != nil {
1185
1211
return fmt .Errorf ("Error reading FlexibleAppVersion: %s" , err )
1186
1212
}
1213
+ if err := d .Set ("flexible_runtime_settings" , flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettings (res ["flexibleRuntimeSettings" ], d , config )); err != nil {
1214
+ return fmt .Errorf ("Error reading FlexibleAppVersion: %s" , err )
1215
+ }
1187
1216
if err := d .Set ("serving_status" , flattenAppEngineFlexibleAppVersionServingStatus (res ["servingStatus" ], d , config )); err != nil {
1188
1217
return fmt .Errorf ("Error reading FlexibleAppVersion: %s" , err )
1189
1218
}
@@ -1288,6 +1317,12 @@ func resourceAppEngineFlexibleAppVersionUpdate(d *schema.ResourceData, meta inte
1288
1317
} else if v , ok := d .GetOkExists ("runtime_channel" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , runtimeChannelProp )) {
1289
1318
obj ["runtimeChannel" ] = runtimeChannelProp
1290
1319
}
1320
+ flexibleRuntimeSettingsProp , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettings (d .Get ("flexible_runtime_settings" ), d , config )
1321
+ if err != nil {
1322
+ return err
1323
+ } else if v , ok := d .GetOkExists ("flexible_runtime_settings" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , flexibleRuntimeSettingsProp )) {
1324
+ obj ["flexibleRuntimeSettings" ] = flexibleRuntimeSettingsProp
1325
+ }
1291
1326
betaSettingsProp , err := expandAppEngineFlexibleAppVersionBetaSettings (d .Get ("beta_settings" ), d , config )
1292
1327
if err != nil {
1293
1328
return err
@@ -1735,6 +1770,29 @@ func flattenAppEngineFlexibleAppVersionRuntimeChannel(v interface{}, d *schema.R
1735
1770
return v
1736
1771
}
1737
1772
1773
+ func flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettings (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1774
+ if v == nil {
1775
+ return nil
1776
+ }
1777
+ original := v .(map [string ]interface {})
1778
+ if len (original ) == 0 {
1779
+ return nil
1780
+ }
1781
+ transformed := make (map [string ]interface {})
1782
+ transformed ["operating_system" ] =
1783
+ flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (original ["operatingSystem" ], d , config )
1784
+ transformed ["runtime_version" ] =
1785
+ flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (original ["runtimeVersion" ], d , config )
1786
+ return []interface {}{transformed }
1787
+ }
1788
+ func flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1789
+ return v
1790
+ }
1791
+
1792
+ func flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1793
+ return v
1794
+ }
1795
+
1738
1796
func flattenAppEngineFlexibleAppVersionServingStatus (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1739
1797
return v
1740
1798
}
@@ -2642,6 +2700,40 @@ func expandAppEngineFlexibleAppVersionRuntimeChannel(v interface{}, d tpgresourc
2642
2700
return v , nil
2643
2701
}
2644
2702
2703
+ func expandAppEngineFlexibleAppVersionFlexibleRuntimeSettings (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2704
+ l := v .([]interface {})
2705
+ if len (l ) == 0 || l [0 ] == nil {
2706
+ return nil , nil
2707
+ }
2708
+ raw := l [0 ]
2709
+ original := raw .(map [string ]interface {})
2710
+ transformed := make (map [string ]interface {})
2711
+
2712
+ transformedOperatingSystem , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (original ["operating_system" ], d , config )
2713
+ if err != nil {
2714
+ return nil , err
2715
+ } else if val := reflect .ValueOf (transformedOperatingSystem ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2716
+ transformed ["operatingSystem" ] = transformedOperatingSystem
2717
+ }
2718
+
2719
+ transformedRuntimeVersion , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (original ["runtime_version" ], d , config )
2720
+ if err != nil {
2721
+ return nil , err
2722
+ } else if val := reflect .ValueOf (transformedRuntimeVersion ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2723
+ transformed ["runtimeVersion" ] = transformedRuntimeVersion
2724
+ }
2725
+
2726
+ return transformed , nil
2727
+ }
2728
+
2729
+ func expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2730
+ return v , nil
2731
+ }
2732
+
2733
+ func expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2734
+ return v , nil
2735
+ }
2736
+
2645
2737
func expandAppEngineFlexibleAppVersionBetaSettings (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
2646
2738
if v == nil {
2647
2739
return map [string ]string {}, nil
0 commit comments