The latest release of firebase (https://github.com/firebase/firebase-functions/releases/tag/v3.11.0) allows us to specify a VPC connector for a function to use.
export const redis = functions.runWith({
vpcConnector: 'my-redis-connector',
vpcConnectorEgressSettings: 'PRIVATE_RANGES_ONLY'
}).https.onRequest((req, res) => {
const client = redisLib.createClient(REDIS_PORT, REDIS_HOST)
if (client.connected === true) {
return res.status(200).send({redis: 'found'});
} else {
return res.status(404).send({ redis: 'not found'});
}
})
After deploying the function using the firebase tools CLI firebase deploy --only functions:redis, I don't see the vpc connecter being created: gcp-function-after-deployment
Is there a different way of deploying the firebase function, besides using the gcloud that will take the vpcConnector?