1. Packages
  2. GCP Global CloudRun
GCP Global CloudRun v0.0.3 published on Friday, Oct 15, 2021 by Paul Stack

GCP Global CloudRun

gcp-global-cloudrun logo
GCP Global CloudRun v0.0.3 published on Friday, Oct 15, 2021 by Paul Stack

    Easily create a globally load-balanced Google Cloud Run application using this component, which is available in all Pulumi languages.

    Example

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudrun from "@pulumi/gcp-global-cloudrun";
    
    const conf = new pulumi.Config()
    const project = conf.require("project")
    
    const deployment = new cloudrun.Deployment("my-sample-deployment", {
        projectId: project,
    
        imageName: "gcr.io/ahmetb-public/zoneprinter",
        serviceName: "demo-service-ts"
    });
    
    export const ip = deployment.ipAddress;
    
    import pulumi
    import pulumi_gcp_global_cloudrun as cloudrun
    
    config = pulumi.Config()
    project = config.require("project")
    
    deployment = cloudrun.Deployment("my-sample-deployment",
                                     project_id=project,
                                     image_name="gcr.io/ahmetb-public/zoneprinter",
                                     service_name="demo-service-py")
    
    pulumi.export('ip', deployment.ip_address)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    	cloudrun "github.com/pulumi/pulumi-gcp-global-cloudrun/sdk/go/gcp"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		c := config.New(ctx, "")
    		project := c.Require("project")
    
    		deployment, err := cloudrun.NewDeployment(ctx, "demo-deployment-go", &cloudrun.DeploymentArgs{
    			ImageName:   pulumi.String("gcr.io/ahmetb-public/zoneprinter"),
    			ServiceName: "demo-service-ts",
    			ProjectId:   project,
    		})
    		if err != nil {
    			return err
    		}
    
    		ctx.Export("ip", deployment.IpAddress)
    
    		return nil
    	})
    }
    
    gcp-global-cloudrun logo
    GCP Global CloudRun v0.0.3 published on Friday, Oct 15, 2021 by Paul Stack