GetFunctionInfo retrieves information about a Lambda function
(ctx context.Context)
| 99 | |
| 100 | // GetFunctionInfo retrieves information about a Lambda function |
| 101 | func (d *LambdaDeployer) GetFunctionInfo(ctx context.Context) (*LambdaDeployResult, error) { |
| 102 | functionName := d.getFunctionName() |
| 103 | |
| 104 | input := &lambda.GetFunctionInput{ |
| 105 | FunctionName: aws.String(functionName), |
| 106 | } |
| 107 | |
| 108 | result, err := d.clients.Lambda.GetFunctionWithContext(ctx, input) |
| 109 | if err != nil { |
| 110 | if awsErr, ok := err.(awserr.Error); ok { |
| 111 | if awsErr.Code() == lambda.ErrCodeResourceNotFoundException { |
| 112 | return nil, fmt.Errorf("function not found: %s", functionName) |
| 113 | } |
| 114 | } |
| 115 | return nil, fmt.Errorf("failed to get function: %w", err) |
| 116 | } |
| 117 | |
| 118 | return d.extractFunctionInfo(result.Configuration), nil |
| 119 | } |
| 120 | |
| 121 | func (d *LambdaDeployer) createFunction(ctx context.Context, functionName string, zipData []byte, roleArn string) (*LambdaDeployResult, error) { |
| 122 | log.Printf("Creating new Lambda function...") |
no test coverage detected