diff --git a/pkg/app/piped/cloudprovider/lambda/function.go b/pkg/app/piped/cloudprovider/lambda/function.go index 4f5469c1bc..5b57afe234 100644 --- a/pkg/app/piped/cloudprovider/lambda/function.go +++ b/pkg/app/piped/cloudprovider/lambda/function.go @@ -51,6 +51,8 @@ type FunctionManifestSpec struct { Name string `json:"name"` ImageURI string `json:"image"` Tags map[string]string `json:"tags,omitempty"` + Runtime string `json:"runtime"` + Handler string `json:"handler"` } func (fmp FunctionManifestSpec) validate() error { @@ -60,6 +62,12 @@ func (fmp FunctionManifestSpec) validate() error { if len(fmp.ImageURI) == 0 { return fmt.Errorf("image uri is missing") } + if len(fmp.Runtime) == 0 { + return fmt.Errorf("runtime is missing") + } + if len(fmp.Handler) == 0 { + return fmt.Errorf("handler is missing") + } return nil } diff --git a/pkg/app/piped/cloudprovider/lambda/function_test.go b/pkg/app/piped/cloudprovider/lambda/function_test.go index 8f75127adc..b434c3b1a9 100644 --- a/pkg/app/piped/cloudprovider/lambda/function_test.go +++ b/pkg/app/piped/cloudprovider/lambda/function_test.go @@ -34,6 +34,8 @@ func TestparseFunctionManifest(t *testing.T) { "kind": "LambdaFunction", "spec": { "name": "SimpleFunction", + "runtime": "nodejs12.x", + "handler": "SampleFunction", "image": "ecr.region.amazonaws.com/lambda-simple-function:v0.0.1" } }`, @@ -43,6 +45,8 @@ func TestparseFunctionManifest(t *testing.T) { Spec: FunctionManifestSpec{ Name: "SimpleFunction", ImageURI: "ecr.region.amazonaws.com/lambda-simple-function:v0.0.1", + Runtime: "nodejs12.x", + Handler: "SampleFunction", }, }, wantErr: false,