June 20-22 Announcing HashiConf Europe full schedule: keynotes, sessions, labs & more Register Now
  • Infrastructure
    • terraform
    • packer
  • Networking
    • consul
  • Security
    • vault
    • boundary
  • Applications
    • nomad
    • waypoint
    • vagrant
  • HashiCorp Cloud Platform

    A fully managed platform to automate infrastructure on any cloud with HashiCorp products.

    • consul
    • terraform
    • vault
    • packerbeta
    Visit cloud.hashicorp.com
  • Overview
  • Tutorials
  • Docs
  • CLI
  • Plugins
  • Community
GitHub
Download
  • aws-ec2
  • aws-ecs
  • aws-lambda
  • aws-ssm
  • azure-container-instance
  • docker
  • exec
  • google-cloud-run
  • helm
  • kubernetes
  • nomad
  • pack
  • terraform-cloud
  • vault
Type '/' to Search

»Google Cloud Run

For a step by step tutorial on deploying a Waypoint application to Google Cloud Run, visit HashiCorp Learn

»Builders

Google Cloud Run uses Docker images for building, which are generated by these builders:

  • Docker
  • Cloud Native Buildpacks

»google-cloud-run (platform)

Deploy a container to Google Cloud Run.

»Interface

»Examples

project = "wpmini"

app "wpmini" {
  labels = {
    "service" = "wpmini",
    "env"     = "dev"
  }

  build {
    use "pack" {}

    registry {
      use "docker" {
        image = "gcr.io/waypoint-project-id/wpmini"
        tag   = "latest"
      }
    }
  }

  deploy {
    use "google-cloud-run" {
      project  = "waypoint-project-id"
      location = "europe-north1"

      port = 5000

      static_environment = {
        "NAME" : "World"
      }

      capacity {
        memory                     = 128
        cpu_count                  = 2
        max_requests_per_container = 10
        request_timeout            = 300
      }

      service_account_name = "cloudrun@waypoint-project-id.iam.gserviceaccount.com"

      auto_scaling {
        max = 10
      }

      cloudsql_instances = ["waypoint-project-id:europe-north1:sql-instance"]

      vpc_access {
        connector = "custom-vpc-connector"
        egress = "all"
      }
    }
  }

  release {
    use "google-cloud-run" {}
  }
}
project = "wpmini"

app "wpmini" {
  labels = {
    "service" = "wpmini",
    "env"     = "dev"
  }

  build {
    use "pack" {}

    registry {
      use "docker" {
        image = "gcr.io/waypoint-project-id/wpmini"
        tag   = "latest"
      }
    }
  }

  deploy {
    use "google-cloud-run" {
      project  = "waypoint-project-id"
      location = "europe-north1"

      port = 5000

      static_environment = {
        "NAME" : "World"
      }

      capacity {
        memory                     = 128
        cpu_count                  = 2
        max_requests_per_container = 10
        request_timeout            = 300
      }

      service_account_name = "cloudrun@waypoint-project-id.iam.gserviceaccount.com"

      auto_scaling {
        max = 10
      }

      cloudsql_instances = ["waypoint-project-id:europe-north1:sql-instance"]

      vpc_access {
        connector = "custom-vpc-connector"
        egress = "all"
      }
    }
  }

  release {
    use "google-cloud-run" {}
  }
}

»Required Parameters

These parameters are used in the use stanza for this plugin.

»auto_scaling

Configuration to control the auto scaling parameters for Cloud Run.

  • Type: cloudrun.AutoScaling

»auto_scaling.max

Maximum number of Cloud Run instances. When the maximum requests per container is exceeded, Cloud Run will create an additional container instance to handle load. This parameter controls the maximum number of instances that can be created.

»capacity

CPU, Memory, and resource limits for each Cloud Run instance.

  • Type: cloudrun.Capacity

»capacity.cpu_count

Number of CPUs to allocate the Cloud Run instance, min 1, max 2.

»capacity.max_requests_per_container

Maximum number of concurrent requests each instance can handle. When the maximum requests are exceeded, Cloud Run will create an additional instance.

»capacity.memory

Memory to allocate the Cloud Run instance specified in MB, min 128, max 4096.

»capacity.request_timeout

Maximum time a request can take before timing out, max 900.

»location

GCP location, e.g. europe-north-1.

  • Type: string

»project

GCP project ID where the Cloud Run instance will be deployed.

  • Type: string

»vpc_access (category)

VPCAccess details.

»vpc_access.connector

Set VPC Access Connector for the Cloud Run instance.

  • Type: string
  • Optional
»vpc_access.egress

Set VPC egress. Supported values are 'all' and 'private-ranges-only'.

  • Type: string
  • Optional

»Optional Parameters

These parameters are used in the use stanza for this plugin.

»cloudsql_instances

Specify list of CloudSQL instances that the Cloud Run instance will have access to.

  • Type: list of string
  • Optional

»port

The port your application listens on.

  • Type: int
  • Optional

»service_account_name

Specify a service account email that Cloud Run will use to run the service. You must have the iam.serviceAccounts.actAs permission on the service account.

  • Type: string
  • Optional

»static_environment

Additional environment variables to be added to the Cloud Run instance.

  • Type: map of string to string
  • Optional

»unauthenticated

Is public unauthenticated access allowed for the Cloud Run instance?.

  • Type: bool
  • Optional

»Output Attributes

Output attributes can be used in your waypoint.hcl as variables via artifact or deploy.

»id

  • Type: string

»region

  • Type: string

»resource

  • Type: cloudrun.Deployment_Resource

»resource_state

  • Type: opaqueany.Any

»revision_id

  • Type: string

»url

  • Type: string

»google-cloud-run (releasemanager)

Manipulates the Cloud Run APIs to make deployments active.

»Interface

»Required Parameters

This plugin has no required parameters.

»Optional Parameters

This plugin has no optional parameters.

github logoEdit this page

Using Waypoint

The best way to understand what Waypoint can enable for your projects is to give it a try.

Waypoint tutorials
Waypoint documentation
Tutorial

Get Started - Kubernetes

Build, deploy, and release applications to a Kubernetes cluster.

View
Tutorial

Introduction to Waypoint

Waypoint enables you to publish any application to any platform with a single file and a single command.

View

Waypoint is maintained by HashiCorp, Inc.

View Code of Conduct
DocumentationCLI ReferenceTutorialsIntegrations
All systems normal