@@ -822,7 +822,7 @@ def prepare_gsi_for_restore(gsi, billing_mode):
822822 "Projection" : gsi ["Projection" ],
823823 }
824824
825- if billing_mode != PAY_PER_REQUEST_BILLING_MODE :
825+ if billing_mode != PAY_PER_REQUEST_BILLING_MODE and "ProvisionedThroughput" in gsi :
826826 result ["ProvisionedThroughput" ] = prepare_provisioned_throughput_for_restore (
827827 gsi ["ProvisionedThroughput" ]
828828 )
@@ -900,6 +900,9 @@ def do_restore(
900900 original_gsi_read_capacities = []
901901 if table_global_secondary_indexes is not None :
902902 for gsi in table_global_secondary_indexes :
903+ if "ProvisionedThroughput" not in gsi :
904+ continue
905+
903906 # keeps track of original gsi write capacity units. If provisioned capacity is 0, set to
904907 # RESTORE_WRITE_CAPACITY as fallback given that 0 is not allowed for write capacities
905908 original_gsi_write_capacity = gsi ["ProvisionedThroughput" ][
@@ -1065,6 +1068,9 @@ def do_restore(
10651068 if table_global_secondary_indexes is not None :
10661069 gsi_data = []
10671070 for gsi in table_global_secondary_indexes :
1071+ if "ProvisionedThroughput" not in gsi :
1072+ continue
1073+
10681074 wcu = gsi ["ProvisionedThroughput" ]["WriteCapacityUnits" ]
10691075 rcu = gsi ["ProvisionedThroughput" ]["ReadCapacityUnits" ]
10701076 original_gsi_write_capacity = original_gsi_write_capacities .pop (0 )
0 commit comments