Skip to content

Providing your own Lambda@edge for OAC edge signing does not work #6557

@masterFlippy

Description

@masterFlippy

When providing my own edge function I get a error saying a lambda@edge can not have environment variables. I guess its because sst is injecting some env vars to sst.aws.Function.

    protection: {
        mode: "oac-with-edge-signing",
        edgeFunction: {
            arn: edgeFunction.nodes.function.apply(
                (fn) => fn.qualifiedArn,
            ) as $util.Output<sst.aws.FunctionArn>,
        },
    },

Will this be fixed or should i just use the transform as I am doing now to bypass it?

    $transform(sst.aws.Function, (args, opts, name) => {
        if (name.includes("EdgeFunction")) {
            args.environment = {};
        }
    });

EDIT:

this did not work:
$transform(sst.aws.Function, (args, opts, name) => {
if (name.includes("EdgeFunction")) {
args.environment = {};
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions