@@ -72,10 +72,10 @@ func (rm *resourceManager) syncEventInvokeConfig(
72
72
input .DestinationConfig = destinations
73
73
}
74
74
if dspec .FunctionEventInvokeConfig .MaximumEventAgeInSeconds != nil {
75
- input .MaximumEventAgeInSeconds = aws . Int32 ( int32 ( * dspec .FunctionEventInvokeConfig .MaximumEventAgeInSeconds ) )
75
+ input .MaximumEventAgeInSeconds = int32OrNil ( dspec .FunctionEventInvokeConfig .MaximumEventAgeInSeconds )
76
76
}
77
77
if dspec .FunctionEventInvokeConfig .MaximumRetryAttempts != nil {
78
- input .MaximumRetryAttempts = aws . Int32 ( int32 ( * dspec .FunctionEventInvokeConfig .MaximumRetryAttempts ) )
78
+ input .MaximumRetryAttempts = int32OrNil ( dspec .FunctionEventInvokeConfig .MaximumRetryAttempts )
79
79
}
80
80
81
81
_ , err = rm .sdkapi .PutFunctionEventInvokeConfig (ctx , input )
@@ -116,7 +116,7 @@ func (rm *resourceManager) updateProvisionedConcurrency(
116
116
input := & svcsdk.PutProvisionedConcurrencyConfigInput {
117
117
FunctionName : aws .String (* dspec .FunctionName ),
118
118
Qualifier : aws .String (* dspec .Name ),
119
- ProvisionedConcurrentExecutions : aws . Int32 ( int32 ( * dspec .ProvisionedConcurrencyConfig .ProvisionedConcurrentExecutions ) ),
119
+ ProvisionedConcurrentExecutions : int32OrNil ( dspec .ProvisionedConcurrencyConfig .ProvisionedConcurrentExecutions ),
120
120
}
121
121
122
122
_ , err = rm .sdkapi .PutProvisionedConcurrencyConfig (ctx , input )
@@ -156,7 +156,7 @@ func (rm *resourceManager) setProvisionedConcurrencyConfig(
156
156
} else {
157
157
// creating ProvisionedConcurrency object to store the values returned from `Get` call
158
158
cloudProvisionedConcurrency := & svcapitypes.PutProvisionedConcurrencyConfigInput {}
159
- cloudProvisionedConcurrency .ProvisionedConcurrentExecutions = aws . Int64 ( int64 ( * getProvisionedConcurrencyConfigOutput .RequestedProvisionedConcurrentExecutions ) )
159
+ cloudProvisionedConcurrency .ProvisionedConcurrentExecutions = int64OrNil ( getProvisionedConcurrencyConfigOutput .RequestedProvisionedConcurrentExecutions )
160
160
ko .Spec .ProvisionedConcurrencyConfig = cloudProvisionedConcurrency
161
161
}
162
162
@@ -174,8 +174,8 @@ func (rm *resourceManager) setFunctionEventInvokeConfigFromResponse(
174
174
cloudFunctionEventInvokeConfig .DestinationConfig .OnSuccess = & svcapitypes.OnSuccess {}
175
175
cloudFunctionEventInvokeConfig .DestinationConfig .OnFailure .Destination = getFunctionEventInvokeConfigOutput .DestinationConfig .OnFailure .Destination
176
176
cloudFunctionEventInvokeConfig .DestinationConfig .OnSuccess .Destination = getFunctionEventInvokeConfigOutput .DestinationConfig .OnSuccess .Destination
177
- cloudFunctionEventInvokeConfig .MaximumEventAgeInSeconds = aws . Int64 ( int64 ( * getFunctionEventInvokeConfigOutput .MaximumEventAgeInSeconds ) )
178
- cloudFunctionEventInvokeConfig .MaximumRetryAttempts = aws . Int64 ( int64 ( * getFunctionEventInvokeConfigOutput .MaximumRetryAttempts ) )
177
+ cloudFunctionEventInvokeConfig .MaximumEventAgeInSeconds = int64OrNil ( getFunctionEventInvokeConfigOutput .MaximumEventAgeInSeconds )
178
+ cloudFunctionEventInvokeConfig .MaximumRetryAttempts = int64OrNil ( getFunctionEventInvokeConfigOutput .MaximumRetryAttempts )
179
179
ko .Spec .FunctionEventInvokeConfig = cloudFunctionEventInvokeConfig
180
180
181
181
}
@@ -237,3 +237,18 @@ func (rm *resourceManager) setResourceAdditionalFields(
237
237
238
238
return nil
239
239
}
240
+
241
+
242
+ func int32OrNil (val * int64 ) * int32 {
243
+ if val != nil {
244
+ return aws .Int32 (int32 (* val ))
245
+ }
246
+ return nil
247
+ }
248
+
249
+ func int64OrNil (val * int32 ) * int64 {
250
+ if val != nil {
251
+ return aws .Int64 (int64 (* val ))
252
+ }
253
+ return nil
254
+ }
0 commit comments