Skip to content

Commit 89e17d5

Browse files
committed
this is preventing to see the error on Lambda function creation
1 parent c61ada3 commit 89e17d5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

infrastructure/infrastructure.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package infrastructure
22

33
import (
4-
"time"
5-
64
"github.com/aws/aws-sdk-go/aws"
75
"github.com/aws/aws-sdk-go/aws/awserr"
86
"github.com/aws/aws-sdk-go/aws/session"
@@ -50,6 +48,7 @@ func (infra *Infrastructure) setup() error {
5048
if err != nil {
5149
return err
5250
}
51+
5352
for _, region := range infra.regions {
5453
err = infra.createOrUpdateLambdaFunction(region, roleArn, zip)
5554
if err != nil {
@@ -99,15 +98,6 @@ func (infra *Infrastructure) createLambdaFunction(svc *lambda.Lambda, roleArn st
9998
Timeout: aws.Int64(300),
10099
})
101100
if err != nil {
102-
if awsErr, ok := err.(awserr.Error); ok {
103-
// Calling this function too soon after creating the role might
104-
// fail, so we should retry after a little while.
105-
// TODO: limit the number of retries.
106-
if awsErr.Code() == "InvalidParameterValueException" {
107-
time.Sleep(time.Second)
108-
return infra.createLambdaFunction(svc, roleArn, payload)
109-
}
110-
}
111101
return err
112102
}
113103
return createLambdaAlias(svc, function.Version)

0 commit comments

Comments
 (0)