Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: Ignore some not founds in lambda functions (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
irmatov committed Jul 22, 2022
1 parent 7c17ddc commit 865e1c6
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions resources/services/lambda/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,9 @@ func resolvePolicyCodeSigningConfig(ctx context.Context, meta schema.ClientMeta,
options.Region = c.Region
})
if err != nil {
if c.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
if signing.CodeSigningConfig == nil {
Expand Down Expand Up @@ -1244,14 +1247,18 @@ func fetchLambdaFunctionEventInvokeConfigs(ctx context.Context, meta schema.Clie
if p.Configuration == nil {
return nil
}
svc := meta.(*client.Client).Services().Lambda
cl := meta.(*client.Client)
svc := cl.Services().Lambda
config := lambda.ListFunctionEventInvokeConfigsInput{
FunctionName: p.Configuration.FunctionName,
}

for {
output, err := svc.ListFunctionEventInvokeConfigs(ctx, &config)
if err != nil {
if cl.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
res <- output.FunctionEventInvokeConfigs
Expand Down Expand Up @@ -1361,14 +1368,18 @@ func fetchLambdaFunctionConcurrencyConfigs(ctx context.Context, meta schema.Clie
return nil
}

svc := meta.(*client.Client).Services().Lambda
cl := meta.(*client.Client)
svc := cl.Services().Lambda
config := lambda.ListProvisionedConcurrencyConfigsInput{
FunctionName: p.Configuration.FunctionName,
}

for {
output, err := svc.ListProvisionedConcurrencyConfigs(ctx, &config)
if err != nil {
if cl.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
res <- output.ProvisionedConcurrencyConfigs
Expand All @@ -1385,14 +1396,18 @@ func fetchLambdaFunctionEventSourceMappings(ctx context.Context, meta schema.Cli
return nil
}

svc := meta.(*client.Client).Services().Lambda
cl := meta.(*client.Client)
svc := cl.Services().Lambda
config := lambda.ListEventSourceMappingsInput{
FunctionName: p.Configuration.FunctionName,
}

for {
output, err := svc.ListEventSourceMappings(ctx, &config)
if err != nil {
if cl.IsNotFoundError(err) {
return nil
}
return diag.WrapError(err)
}
res <- output.EventSourceMappings
Expand Down

0 comments on commit 865e1c6

Please sign in to comment.