deploy-cloudrun icon indicating copy to clipboard operation
deploy-cloudrun copied to clipboard

How to specify vpc-connector when deploying to cloud run.

Open mt185252 opened this issue 3 years ago • 1 comments

TL;DR

Hi There, I was trying to deploy an image to GCP cloud run, using this workflow. My question is : How can I specify the vpc-connector to be used by my cloud run instance to connect to other services in a VPC shared with my project.

When I deploy using the GCP Console / UI, I specify it under connections tab. Please refer to the attached screenshot below. image

Detailed design

No response

Additional information

No response

mt185252 avatar Jul 12 '22 08:07 mt185252

There isn't an input specific to VPC Connectors but, you can use the flags input to specify options that can be used for gcloud run deploy.

gcloud run deploy has an option for VPC Connectors so you could probably do something like,

    - id: 'deploy'
      uses: 'google-github-actions/deploy-cloudrun@v0'
      with:
        service: 'hello-cloud-run'
        image: 'gcr.io/cloudrun/hello'
        flags: --vpc-connector=YOUR_VPC_CONNECTOR

stefafafan avatar Jul 14 '22 00:07 stefafafan

Hi @mt185252, @stefafafan is correct. You can specify more advanced options like VPC service connectors using the flags argument.

sethvargo avatar Nov 29 '22 18:11 sethvargo