Skip to content

Add support for VPC connectors in functions.runWith #752

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

Merged

Conversation

pcboy
Copy link
Contributor

@pcboy pcboy commented Aug 6, 2020

Description

This PR adds support for vpcConnectors inside runWith.
Refers to #552 and my corresponding PR in firebase-tools: #2525

Code sample

functions
      .runWith({
        vpcConnector: 'test-connector',
        vpcConnectorEgressSettings: 'PRIVATE_RANGES_ONLY'
      })
      .auth.user()
      .onCreate((user) => user);

@pcboy pcboy force-pushed the add-support-for-vpc-connector-in-runwith branch 2 times, most recently from fbb1170 to f76bfe2 Compare August 6, 2020 05:21
@pcboy pcboy marked this pull request as ready for review August 6, 2020 05:26
@laurenzlong laurenzlong requested a review from mbleigh August 7, 2020 21:21
Copy link
Contributor

@mbleigh mbleigh left a comment

Choose a reason for hiding this comment

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

Thanks for writing this! One small change but overall looks good.

Note that the internal API review process needs to complete before we can merge / release this. I'll come back around when that's done.

@pcboy pcboy force-pushed the add-support-for-vpc-connector-in-runwith branch 3 times, most recently from d9ecac1 to 4227bd0 Compare August 8, 2020 00:43
@pcboy pcboy force-pushed the add-support-for-vpc-connector-in-runwith branch from 4227bd0 to 4552ac4 Compare August 8, 2020 00:49
@joshdifabio
Copy link

joshdifabio commented Aug 13, 2020

It looks like the Google Cloud console UI for editing cloud functions is currently broken for Firebase functions, which makes it impossible to assign a VPC connector to a Firebase function right now, so it'd be great to get this merged and avoid having to use that fragile UI forevermore.

@cubissimo
Copy link

If someone still stucked into this, i built a gcloud function (who works with gcloud console or gcloud cli to assign the vpc) to act like a "proxy" routing out egress traffic with a vpc connector.

And i call this proxy function from my firebase functions when need to use the vpc.

I know its very aweful but there no way to do this direct in firebase by now.

Copy link
Contributor

@laurenzlong laurenzlong left a comment

Choose a reason for hiding this comment

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

I tried this out in conjunction with firebase/firebase-tools#2525 and it worked great!
Screen Shot 2020-08-20 at 4 15 05 PM

@laurenzlong laurenzlong changed the title Add support for vpc connectors in runWith Add support for VPC connectors in functions.runWith Aug 20, 2020
@laurenzlong laurenzlong merged commit 6b15ff7 into firebase:master Aug 20, 2020
@edyrkaj
Copy link

edyrkaj commented Dec 11, 2020

Hi,
Which are the available options for:
vpcConnectorEgressSettings => ('PRIVATE_RANGES_ONLY' | 'ALL_TRAFFIC') I am supposing this based on values of two radio buttons that exists on cloud function / edit / network.

Just found on your code changes. If someone is looking for that you can find here:
https://github.com/firebase/firebase-functions/pull/752/files#diff-ed71fa16fbb4c22460844cc3c67d7951389ce13ec815fe6a09d77ab6912585ffR50

Thnx

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

Successfully merging this pull request may close these issues.

7 participants