@@ -546,6 +546,26 @@ the configuration ID. In this case, configId must be omitted.`,
546546 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.` ,
547547 Elem : & schema.Schema {Type : schema .TypeString },
548548 },
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+ },
549569 "handlers" : {
550570 Type : schema .TypeList ,
551571 Computed : true ,
@@ -934,6 +954,12 @@ func resourceAppEngineFlexibleAppVersionCreate(d *schema.ResourceData, meta inte
934954 } else if v , ok := d .GetOkExists ("runtime_channel" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (runtimeChannelProp )) && (ok || ! reflect .DeepEqual (v , runtimeChannelProp )) {
935955 obj ["runtimeChannel" ] = runtimeChannelProp
936956 }
957+ flexibleRuntimeSettingsProp , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettings (d .Get ("flexible_runtime_settings" ), d , config )
958+ if err != nil {
959+ return err
960+ } else if v , ok := d .GetOkExists ("flexible_runtime_settings" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (flexibleRuntimeSettingsProp )) && (ok || ! reflect .DeepEqual (v , flexibleRuntimeSettingsProp )) {
961+ obj ["flexibleRuntimeSettings" ] = flexibleRuntimeSettingsProp
962+ }
937963 betaSettingsProp , err := expandAppEngineFlexibleAppVersionBetaSettings (d .Get ("beta_settings" ), d , config )
938964 if err != nil {
939965 return err
@@ -1190,6 +1216,9 @@ func resourceAppEngineFlexibleAppVersionRead(d *schema.ResourceData, meta interf
11901216 if err := d .Set ("runtime_channel" , flattenAppEngineFlexibleAppVersionRuntimeChannel (res ["runtimeChannel" ], d , config )); err != nil {
11911217 return fmt .Errorf ("Error reading FlexibleAppVersion: %s" , err )
11921218 }
1219+ if err := d .Set ("flexible_runtime_settings" , flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettings (res ["flexibleRuntimeSettings" ], d , config )); err != nil {
1220+ return fmt .Errorf ("Error reading FlexibleAppVersion: %s" , err )
1221+ }
11931222 if err := d .Set ("serving_status" , flattenAppEngineFlexibleAppVersionServingStatus (res ["servingStatus" ], d , config )); err != nil {
11941223 return fmt .Errorf ("Error reading FlexibleAppVersion: %s" , err )
11951224 }
@@ -1294,6 +1323,12 @@ func resourceAppEngineFlexibleAppVersionUpdate(d *schema.ResourceData, meta inte
12941323 } else if v , ok := d .GetOkExists ("runtime_channel" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , runtimeChannelProp )) {
12951324 obj ["runtimeChannel" ] = runtimeChannelProp
12961325 }
1326+ flexibleRuntimeSettingsProp , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettings (d .Get ("flexible_runtime_settings" ), d , config )
1327+ if err != nil {
1328+ return err
1329+ } else if v , ok := d .GetOkExists ("flexible_runtime_settings" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , flexibleRuntimeSettingsProp )) {
1330+ obj ["flexibleRuntimeSettings" ] = flexibleRuntimeSettingsProp
1331+ }
12971332 betaSettingsProp , err := expandAppEngineFlexibleAppVersionBetaSettings (d .Get ("beta_settings" ), d , config )
12981333 if err != nil {
12991334 return err
@@ -1747,6 +1782,29 @@ func flattenAppEngineFlexibleAppVersionRuntimeChannel(v interface{}, d *schema.R
17471782 return v
17481783}
17491784
1785+ func flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettings (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1786+ if v == nil {
1787+ return nil
1788+ }
1789+ original := v .(map [string ]interface {})
1790+ if len (original ) == 0 {
1791+ return nil
1792+ }
1793+ transformed := make (map [string ]interface {})
1794+ transformed ["operating_system" ] =
1795+ flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (original ["operatingSystem" ], d , config )
1796+ transformed ["runtime_version" ] =
1797+ flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (original ["runtimeVersion" ], d , config )
1798+ return []interface {}{transformed }
1799+ }
1800+ func flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1801+ return v
1802+ }
1803+
1804+ func flattenAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1805+ return v
1806+ }
1807+
17501808func flattenAppEngineFlexibleAppVersionServingStatus (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
17511809 return v
17521810}
@@ -2665,6 +2723,40 @@ func expandAppEngineFlexibleAppVersionRuntimeChannel(v interface{}, d tpgresourc
26652723 return v , nil
26662724}
26672725
2726+ func expandAppEngineFlexibleAppVersionFlexibleRuntimeSettings (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2727+ l := v .([]interface {})
2728+ if len (l ) == 0 || l [0 ] == nil {
2729+ return nil , nil
2730+ }
2731+ raw := l [0 ]
2732+ original := raw .(map [string ]interface {})
2733+ transformed := make (map [string ]interface {})
2734+
2735+ transformedOperatingSystem , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (original ["operating_system" ], d , config )
2736+ if err != nil {
2737+ return nil , err
2738+ } else if val := reflect .ValueOf (transformedOperatingSystem ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2739+ transformed ["operatingSystem" ] = transformedOperatingSystem
2740+ }
2741+
2742+ transformedRuntimeVersion , err := expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (original ["runtime_version" ], d , config )
2743+ if err != nil {
2744+ return nil , err
2745+ } else if val := reflect .ValueOf (transformedRuntimeVersion ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2746+ transformed ["runtimeVersion" ] = transformedRuntimeVersion
2747+ }
2748+
2749+ return transformed , nil
2750+ }
2751+
2752+ func expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsOperatingSystem (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2753+ return v , nil
2754+ }
2755+
2756+ func expandAppEngineFlexibleAppVersionFlexibleRuntimeSettingsRuntimeVersion (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2757+ return v , nil
2758+ }
2759+
26682760func expandAppEngineFlexibleAppVersionBetaSettings (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
26692761 if v == nil {
26702762 return map [string ]string {}, nil
0 commit comments