@@ -457,14 +457,8 @@ func resourceNATGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta
457457 return sdkdiag .AppendErrorf (diags , "retrieving availability zone ID to name map: %s" , err )
458458 }
459459
460- oldMap , err := processAZAddressSet (d .GetRawState (), azIDtoNameMap )
461- if err != nil {
462- return sdkdiag .AppendErrorf (diags , "processing old availability_zone_address set: %s" , err )
463- }
464- newMap , err := processAZAddressSet (d .GetRawConfig (), azIDtoNameMap )
465- if err != nil {
466- return sdkdiag .AppendErrorf (diags , "processing new availability_zone_address set: %s" , err )
467- }
460+ oldMap := processAZAddressSet (d .GetRawState (), azIDtoNameMap )
461+ newMap := processAZAddressSet (d .GetRawConfig (), azIDtoNameMap )
468462
469463 // Collect all unique AZ keys
470464 allKeys := make (map [string ]bool )
@@ -644,7 +638,7 @@ func expandNATGatewayAvailabilityZoneAddresses(vs []any, d *schema.ResourceData)
644638 }
645639 }
646640
647- if v := d .GetRawConfig ().GetAttr ("availability_zone_address" ).AsValueSlice ()[index ].GetAttr ("availability_zone" ); v .IsKnown () && ! v .IsNull () {
641+ if v := d .GetRawConfig ().GetAttr ("availability_zone_address" ).AsValueSlice ()[index ].GetAttr (names . AttrAvailabilityZone ); v .IsKnown () && ! v .IsNull () {
648642 address .AvailabilityZone = aws .String (m [names .AttrAvailabilityZone ].(string ))
649643 } else if v := d .GetRawConfig ().GetAttr ("availability_zone_address" ).AsValueSlice ()[index ].GetAttr ("availability_zone_id" ); v .IsKnown () && ! v .IsNull () {
650644 address .AvailabilityZoneId = aws .String (m ["availability_zone_id" ].(string ))
@@ -752,7 +746,7 @@ func retrieveAZListFromRawAttr(raw cty.Value, azIDtoNameMap map[string]string) (
752746 return azList , nil
753747}
754748
755- func processAZAddressSet (raw cty.Value , azIDtoNameMap map [string ]string ) ( map [string ]* schema.Set , error ) {
749+ func processAZAddressSet (raw cty.Value , azIDtoNameMap map [string ]string ) map [string ]* schema.Set {
756750 availabilityZoneAddressLen := len (raw .GetAttr ("availability_zone_address" ).AsValueSlice ())
757751 result := make (map [string ]* schema.Set )
758752 for i := 0 ; i < availabilityZoneAddressLen ; i ++ {
@@ -780,7 +774,7 @@ func processAZAddressSet(raw cty.Value, azIDtoNameMap map[string]string) (map[st
780774 result [az ] = schema .NewSet (schema .HashString , ids )
781775 }
782776 }
783- return result , nil
777+ return result
784778}
785779
786780// Associates allocation IDs to a regional NAT Gateway for a specific availability zone
0 commit comments