George Evans
11/24/2021, 12:26 PM// build from custom docker image
const processFunc = new lambda.DockerImageFunction(this, "ProcessGifUrl", { "code": lambda.DockerImageCode.fromImageAsset("./") });
const func = lambda.Function.fromFunctionArn(this, "ProcessFunc", processFunc.functionArn);
...
// api config
routes: {
"POST /process-gif": {
function: func,
methodOptions: {
apiKeyRequired: true,
authorizationType: AuthorizationType.NONE
}
},
Frank
George Evans
11/24/2021, 4:56 PMError: Invalid function definition for the "Lambda_POST_/do-not-use" Function
at Function.fromDefinition
George Evans
11/24/2021, 4:56 PMGeorge Evans
11/24/2021, 4:57 PMconst processFunc = new lambda.DockerImageFunction(this, "ProcessGifUrl", {
code: lambda.DockerImageCode.fromImageAsset("./", { file :"infrastructure/Dockerfile" }),
timeout: Duration.seconds(30),
memorySize: 1024,
environment: {
S3_ASSETS_BUCKET: bucket.s3Bucket.bucketName
}
});
const integration = new LambdaIntegration(processFunc);
const resource = api.restApi.root.addResource("process-gif", {
defaultMethodOptions: {
apiKeyRequired: true,
authorizationType: AuthorizationType.NONE,
}
});
resource.addMethod("POST", integration)
George Evans
11/24/2021, 4:58 PMFrank
ApiGatewayV1Api
right?George Evans
11/24/2021, 5:04 PMFrank
George Evans
11/24/2021, 5:07 PMGuy Shechter
03/05/2022, 9:02 PMFrank
lambda.DockerImageFunction
for most of our construct.Frank
sst.Api
construct? I can push out a release to support that first.Guy Shechter
03/05/2022, 9:22 PMFrank
George Evans
03/07/2022, 9:18 AMFrank