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 a serverless example #12

Merged
merged 2 commits into from
Jul 25, 2018
Merged

Add a serverless example #12

merged 2 commits into from
Jul 25, 2018

Conversation

lukehoban
Copy link
Member

Adds an example highlight Bucket, BucketObject and Function resources.

Uses pulumi.runtime.serializeFunction to generate the function from a JavaScript callback.

Notably, the resulting function maintains a stable identity across code updates, by building on pulumi/terraform-provider-google#4.

This is a first step toward a gcp-serverless library similar to aws-serverless.

Copy link
Member

@joeduffy joeduffy left a comment

Choose a reason for hiding this comment

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

Nice!! One comment below.

};

// Serialize JavaScript callback to text
let serializedFunction = pulumi.runtime.serializeFunction(handler);
Copy link
Member

Choose a reason for hiding this comment

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

I'm torn. I don't think we want to encourage many people to call these directly. I wonder if, until we have a abstraction to do this -- I assume a gcp.serverless.Function overlay as you allude to (symmetric with how we layer this for AWS) -- if we should stick to assets.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes - this PR is a stepping stone toward a gcp.serverless.Function. Next step will be to move this into that sort of overlay like in AWS and make the example use that instead.

@joeduffy
Copy link
Member

Azure Functions example is now in! Would love to get this into examples for launch if possible, then we'll have serverless for all three providers. @swgillespie got a spare cycle to look into this?

@swgillespie
Copy link
Contributor

@joeduffy I'm sorry, I just saw this. It looks like we need to take a patch to our Terraform provider fork for this to work?

Adds an example highlight Bucket, BucketObject and Function resources.

Uses `pulumi.runtime.serializeFunction` to generate the function from a JavaScript callback.

Notably, the resulting function maintains a stable identity across code updates, by building on pulumi/terraform-provider-google#4.

This is a first step toward a gcp-serverless library similar to aws-serverless.
And pick up latest `pulumi-master`.
@lukehoban lukehoban merged commit 0c16383 into master Jul 25, 2018
@pulumi-bot pulumi-bot deleted the lukehoban/serverless branch July 25, 2018 04:46
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.

3 participants