Implement lambda function import #3376
Labels
area/import
An issue related to `pulumi import` or the import resource option.
kind/enhancement
Improvements or new features
size/M
Estimated effort to complete (up to 5 days).
Hello!
Issue details
Currently lambda functions created with Pulumi assets or archives fail to import cleanly into Pulumi, specifically Pulumi does not recover the original source code or source package from the cloud and repackage it into the Pulumi program. Users that need to import lambda functions currently end up resorting to workarounds and it is not a good experience see for example the discussion below and in the associated PR:
#2392
There's some indication that upstream is not fixing it in and has related issues:
Option 1: document how to actually import lambdas
We could at least work through what's the recommended way to import lambda functions in this provider is, and document it, possibly enhancing error messages to guide the user. It seems that recovering the source package should be possible from the console. Trying to see if there is a programmatic way as well? https://docs.aws.amazon.com/cli/latest/reference/lambda/#cli-aws-lambda does not seem to indicate it. If the code can be recovered, it can be turned into an S3 object and the function can then be specified in Pulumi using the indirect via Amazon S3 (using the s3_bucket, s3_key and s3_object_version arguments) method.
Option 2: build smooth automatic import
If recovering the source can be done programmatically, we can automate this all so that the import results in a new s3 object and a lambda code that references it using s3_key.
Affected area/feature
The text was updated successfully, but these errors were encountered: