@@ -822,7 +822,7 @@ def prepare_gsi_for_restore(gsi, billing_mode):
822
822
"Projection" : gsi ["Projection" ],
823
823
}
824
824
825
- if billing_mode != PAY_PER_REQUEST_BILLING_MODE :
825
+ if billing_mode != PAY_PER_REQUEST_BILLING_MODE and "ProvisionedThroughput" in gsi :
826
826
result ["ProvisionedThroughput" ] = prepare_provisioned_throughput_for_restore (
827
827
gsi ["ProvisionedThroughput" ]
828
828
)
@@ -900,6 +900,9 @@ def do_restore(
900
900
original_gsi_read_capacities = []
901
901
if table_global_secondary_indexes is not None :
902
902
for gsi in table_global_secondary_indexes :
903
+ if "ProvisionedThroughput" not in gsi :
904
+ continue
905
+
903
906
# keeps track of original gsi write capacity units. If provisioned capacity is 0, set to
904
907
# RESTORE_WRITE_CAPACITY as fallback given that 0 is not allowed for write capacities
905
908
original_gsi_write_capacity = gsi ["ProvisionedThroughput" ][
@@ -1065,6 +1068,9 @@ def do_restore(
1065
1068
if table_global_secondary_indexes is not None :
1066
1069
gsi_data = []
1067
1070
for gsi in table_global_secondary_indexes :
1071
+ if "ProvisionedThroughput" not in gsi :
1072
+ continue
1073
+
1068
1074
wcu = gsi ["ProvisionedThroughput" ]["WriteCapacityUnits" ]
1069
1075
rcu = gsi ["ProvisionedThroughput" ]["ReadCapacityUnits" ]
1070
1076
original_gsi_write_capacity = original_gsi_write_capacities .pop (0 )
0 commit comments