Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pulumi.Asset support to lambda function #182

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lblackstone
Copy link
Member

Fix #124

@@ -828,6 +828,11 @@ func (ctx *context) genProperties(parentName string, typeSchema *jsschema.Schema
Description: value.Description,
TypeSpec: *typeSpec,
}
if parentName == "FunctionCode" && name == "ZipFile" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we rename a property in Google native to something like contents. I'm not sure we want to do this here... but worth discussing?

@lblackstone lblackstone marked this pull request as ready for review October 27, 2021 21:23
@lblackstone lblackstone force-pushed the lblackstone/lambda-assets branch 3 times, most recently from 0d626a5 to 7c733a5 Compare October 27, 2021 21:30
const updated = { "response": response + "World!" };
callback(null, updated);
};`,
zipFile: new pulumi.asset.FileAsset("world_function.js"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I'm not a fan of the zipFile property... There's no zip in here, right? Should we rename to code, as in the classic provider? The motivation is that we are changing the behavior of a property, so we may rename it as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm conflicted on this. I agree that the name is confusing, but I'm also hesitant to change the name at the native provider layer. I would be more open to adding an alias, perhaps. My main concern is that we should make it easy for integrators to build on top of the native layer, so I think we should avoid changing the API in incompatible ways.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that's reasonable. Let's proceed with the current name for now then.

Copy link
Contributor

@viveklak viveklak Nov 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider updating the description field in the schema for this attribute to make the confusing semantics clearer?

Copy link
Member

@mikhailshilkov mikhailshilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with two small remarks

provider/pkg/provider/provider.go Show resolved Hide resolved
provider/pkg/schema/convert.go Show resolved Hide resolved
@mikhailshilkov
Copy link
Member

Thinking of this again, I think we shouldn't ship this until we are sure we can support archives (which it sounds like we may not be able to).

@lblackstone lblackstone marked this pull request as draft November 1, 2021 17:52
@lblackstone
Copy link
Member Author

Thinking of this again, I think we shouldn't ship this until we are sure we can support archives (which it sounds like we may not be able to).

Converted the PR to draft so we don't merge accidentally.

@Jimmy89
Copy link

Jimmy89 commented Mar 23, 2023

@lblackstone I'm wondering if there is any update on the status of this PR. It looks like it's halted, while so much progress was made. Having support for the pulumi asset functionality would be really nice.

@lblackstone
Copy link
Member Author

@lblackstone I'm wondering if there is any update on the status of this PR. It looks like it's halted, while so much progress was made. Having support for the pulumi asset functionality would be really nice.

It's been a long time since I looked at this, but my recollection is that the upstream Cloud Control API didn't support this, which is why it stalled out. I'm not sure if that has changed in the meantime.

Maybe @danielrbradley knows?

@danielrbradley
Copy link
Member

I wasn't involved in this the first time around, but my inital though looking through is that we're going to exceed the field size limit quite quickly using this approach, but maybe this would still have value for small use cases.

An alternative approach might be to wrap up the upload of the assets to S3 within a component though I'm not exactly sure where this would live - perhaps a separate component provider?

@danielrbradley
Copy link
Member

A second thought on this PR ... we should move the asset version into an alternative field to ensure the resource aligns to the underlying spec, but then we have an additional Asset field which can be used to populate the ZipFile string from an asset for convinience while maintaining compatability.

@t0yv0
Copy link
Member

t0yv0 commented Mar 26, 2024

@mjeffryes claims this one is stale. Should we close? Any plans to carry forward?

@danielrbradley
Copy link
Member

@t0yv0 I think this is useful to keep around as it's still an accurate summary of the changes needing to be made to tie this through. I do think we're still wanting to support Assets in some capacity, though I'd suggest that this might be either:

  1. Through a separate property to avoid a breaking change on the existing string field.
  2. Via a component within the provider which actually uploads the asset into an S3 blob to avoid the size and single-file limitations of putting this inline. This would require also implementing S3 blob manually for this provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda Function doesn't support pulumi assets
6 participants