All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.firebase.kotlin.HostingVersionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.firebase.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.firebase.HostingVersionArgs.builder
import com.pulumi.gcp.firebase.kotlin.inputs.HostingVersionConfigArgs
import com.pulumi.gcp.firebase.kotlin.inputs.HostingVersionConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Firebasehosting Version Redirect
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         redirects: [{
 *             glob: "/google/**",
 *             statusCode: 302,
 *             location: "https://www.google.com",
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Redirect to Google",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-id")
 * default_hosting_version = gcp.firebase.HostingVersion("default",
 *     site_id=default.site_id,
 *     config=gcp.firebase.HostingVersionConfigArgs(
 *         redirects=[gcp.firebase.HostingVersionConfigRedirectArgs(
 *             glob="/google/**",
 *             status_code=302,
 *             location="https://www.google.com",
 *         )],
 *     ))
 * default_hosting_release = gcp.firebase.HostingRelease("default",
 *     site_id=default.site_id,
 *     version_name=default_hosting_version.name,
 *     message="Redirect to Google")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id",
 *     });
 *     var defaultHostingVersion = new Gcp.Firebase.HostingVersion("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         Config = new Gcp.Firebase.Inputs.HostingVersionConfigArgs
 *         {
 *             Redirects = new[]
 *             {
 *                 new Gcp.Firebase.Inputs.HostingVersionConfigRedirectArgs
 *                 {
 *                     Glob = "/google/**",
 *                     StatusCode = 302,
 *                     Location = "https://www.google.com",
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingRelease = new Gcp.Firebase.HostingRelease("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         VersionName = defaultHostingVersion.Name,
 *         Message = "Redirect to Google",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-id"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultHostingVersion, err := firebase.NewHostingVersion(ctx, "default", &firebase.HostingVersionArgs{
 * 			SiteId: _default.SiteId,
 * 			Config: &firebase.HostingVersionConfigArgs{
 * 				Redirects: firebase.HostingVersionConfigRedirectArray{
 * 					&firebase.HostingVersionConfigRedirectArgs{
 * 						Glob:       pulumi.String("/google/**"),
 * 						StatusCode: pulumi.Int(302),
 * 						Location:   pulumi.String("https://www.google.com"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingRelease(ctx, "default", &firebase.HostingReleaseArgs{
 * 			SiteId:      _default.SiteId,
 * 			VersionName: defaultHostingVersion.Name,
 * 			Message:     pulumi.String("Redirect to Google"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.firebase.HostingVersion;
 * import com.pulumi.gcp.firebase.HostingVersionArgs;
 * import com.pulumi.gcp.firebase.inputs.HostingVersionConfigArgs;
 * import com.pulumi.gcp.firebase.HostingRelease;
 * import com.pulumi.gcp.firebase.HostingReleaseArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id")
 *             .build());
 *         var defaultHostingVersion = new HostingVersion("defaultHostingVersion", HostingVersionArgs.builder()
 *             .siteId(default_.siteId())
 *             .config(HostingVersionConfigArgs.builder()
 *                 .redirects(HostingVersionConfigRedirectArgs.builder()
 *                     .glob("/google/**")
 *                     .statusCode(302)
 *                     .location("https://www.google.com")
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingRelease = new HostingRelease("defaultHostingRelease", HostingReleaseArgs.builder()
 *             .siteId(default_.siteId())
 *             .versionName(defaultHostingVersion.name())
 *             .message("Redirect to Google")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-id
 *   defaultHostingVersion:
 *     type: gcp:firebase:HostingVersion
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       config:
 *         redirects:
 *           - glob: /google/**
 *             statusCode: 302
 *             location: https://www.google.com
 *   defaultHostingRelease:
 *     type: gcp:firebase:HostingRelease
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       versionName: ${defaultHostingVersion.name}
 *       message: Redirect to Google
 * ```
 * 
 * ### Firebasehosting Version Path
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         rewrites: [{
 *             glob: "**",
 *             path: "/index.html",
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Path Rewrite",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-id")
 * default_hosting_version = gcp.firebase.HostingVersion("default",
 *     site_id=default.site_id,
 *     config=gcp.firebase.HostingVersionConfigArgs(
 *         rewrites=[gcp.firebase.HostingVersionConfigRewriteArgs(
 *             glob="**",
 *             path="/index.html",
 *         )],
 *     ))
 * default_hosting_release = gcp.firebase.HostingRelease("default",
 *     site_id=default.site_id,
 *     version_name=default_hosting_version.name,
 *     message="Path Rewrite")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id",
 *     });
 *     var defaultHostingVersion = new Gcp.Firebase.HostingVersion("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         Config = new Gcp.Firebase.Inputs.HostingVersionConfigArgs
 *         {
 *             Rewrites = new[]
 *             {
 *                 new Gcp.Firebase.Inputs.HostingVersionConfigRewriteArgs
 *                 {
 *                     Glob = "**",
 *                     Path = "/index.html",
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingRelease = new Gcp.Firebase.HostingRelease("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         VersionName = defaultHostingVersion.Name,
 *         Message = "Path Rewrite",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-id"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultHostingVersion, err := firebase.NewHostingVersion(ctx, "default", &firebase.HostingVersionArgs{
 * 			SiteId: _default.SiteId,
 * 			Config: &firebase.HostingVersionConfigArgs{
 * 				Rewrites: firebase.HostingVersionConfigRewriteArray{
 * 					&firebase.HostingVersionConfigRewriteArgs{
 * 						Glob: pulumi.String("**"),
 * 						Path: pulumi.String("/index.html"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingRelease(ctx, "default", &firebase.HostingReleaseArgs{
 * 			SiteId:      _default.SiteId,
 * 			VersionName: defaultHostingVersion.Name,
 * 			Message:     pulumi.String("Path Rewrite"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.firebase.HostingVersion;
 * import com.pulumi.gcp.firebase.HostingVersionArgs;
 * import com.pulumi.gcp.firebase.inputs.HostingVersionConfigArgs;
 * import com.pulumi.gcp.firebase.HostingRelease;
 * import com.pulumi.gcp.firebase.HostingReleaseArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id")
 *             .build());
 *         var defaultHostingVersion = new HostingVersion("defaultHostingVersion", HostingVersionArgs.builder()
 *             .siteId(default_.siteId())
 *             .config(HostingVersionConfigArgs.builder()
 *                 .rewrites(HostingVersionConfigRewriteArgs.builder()
 *                     .glob("**")
 *                     .path("/index.html")
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingRelease = new HostingRelease("defaultHostingRelease", HostingReleaseArgs.builder()
 *             .siteId(default_.siteId())
 *             .versionName(defaultHostingVersion.name())
 *             .message("Path Rewrite")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-id
 *   defaultHostingVersion:
 *     type: gcp:firebase:HostingVersion
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       config:
 *         rewrites:
 *           - glob: '**'
 *             path: /index.html
 *   defaultHostingRelease:
 *     type: gcp:firebase:HostingRelease
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       versionName: ${defaultHostingVersion.name}
 *       message: Path Rewrite
 * ```
 * 
 * ### Firebasehosting Version Cloud Run
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultService = new gcp.cloudrunv2.Service("default", {
 *     project: "my-project-name",
 *     name: "cloud-run-service-via-hosting",
 *     location: "us-central1",
 *     ingress: "INGRESS_TRAFFIC_ALL",
 *     template: {
 *         containers: [{
 *             image: "us-docker.pkg.dev/cloudrun/container/hello",
 *         }],
 *     },
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         rewrites: [{
 *             glob: "/hello/**",
 *             run: {
 *                 serviceId: defaultService.name,
 *                 region: defaultService.location,
 *             },
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Cloud Run Integration",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-id")
 * default_service = gcp.cloudrunv2.Service("default",
 *     project="my-project-name",
 *     name="cloud-run-service-via-hosting",
 *     location="us-central1",
 *     ingress="INGRESS_TRAFFIC_ALL",
 *     template=gcp.cloudrunv2.ServiceTemplateArgs(
 *         containers=[gcp.cloudrunv2.ServiceTemplateContainerArgs(
 *             image="us-docker.pkg.dev/cloudrun/container/hello",
 *         )],
 *     ))
 * default_hosting_version = gcp.firebase.HostingVersion("default",
 *     site_id=default.site_id,
 *     config=gcp.firebase.HostingVersionConfigArgs(
 *         rewrites=[gcp.firebase.HostingVersionConfigRewriteArgs(
 *             glob="/hello/**",
 *             run=gcp.firebase.HostingVersionConfigRewriteRunArgs(
 *                 service_id=default_service.name,
 *                 region=default_service.location,
 *             ),
 *         )],
 *     ))
 * default_hosting_release = gcp.firebase.HostingRelease("default",
 *     site_id=default.site_id,
 *     version_name=default_hosting_version.name,
 *     message="Cloud Run Integration")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id",
 *     });
 *     var defaultService = new Gcp.CloudRunV2.Service("default", new()
 *     {
 *         Project = "my-project-name",
 *         Name = "cloud-run-service-via-hosting",
 *         Location = "us-central1",
 *         Ingress = "INGRESS_TRAFFIC_ALL",
 *         Template = new Gcp.CloudRunV2.Inputs.ServiceTemplateArgs
 *         {
 *             Containers = new[]
 *             {
 *                 new Gcp.CloudRunV2.Inputs.ServiceTemplateContainerArgs
 *                 {
 *                     Image = "us-docker.pkg.dev/cloudrun/container/hello",
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingVersion = new Gcp.Firebase.HostingVersion("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         Config = new Gcp.Firebase.Inputs.HostingVersionConfigArgs
 *         {
 *             Rewrites = new[]
 *             {
 *                 new Gcp.Firebase.Inputs.HostingVersionConfigRewriteArgs
 *                 {
 *                     Glob = "/hello/**",
 *                     Run = new Gcp.Firebase.Inputs.HostingVersionConfigRewriteRunArgs
 *                     {
 *                         ServiceId = defaultService.Name,
 *                         Region = defaultService.Location,
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingRelease = new Gcp.Firebase.HostingRelease("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         VersionName = defaultHostingVersion.Name,
 *         Message = "Cloud Run Integration",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudrunv2"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-id"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultService, err := cloudrunv2.NewService(ctx, "default", &cloudrunv2.ServiceArgs{
 * 			Project:  pulumi.String("my-project-name"),
 * 			Name:     pulumi.String("cloud-run-service-via-hosting"),
 * 			Location: pulumi.String("us-central1"),
 * 			Ingress:  pulumi.String("INGRESS_TRAFFIC_ALL"),
 * 			Template: &cloudrunv2.ServiceTemplateArgs{
 * 				Containers: cloudrunv2.ServiceTemplateContainerArray{
 * 					&cloudrunv2.ServiceTemplateContainerArgs{
 * 						Image: pulumi.String("us-docker.pkg.dev/cloudrun/container/hello"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultHostingVersion, err := firebase.NewHostingVersion(ctx, "default", &firebase.HostingVersionArgs{
 * 			SiteId: _default.SiteId,
 * 			Config: &firebase.HostingVersionConfigArgs{
 * 				Rewrites: firebase.HostingVersionConfigRewriteArray{
 * 					&firebase.HostingVersionConfigRewriteArgs{
 * 						Glob: pulumi.String("/hello/**"),
 * 						Run: &firebase.HostingVersionConfigRewriteRunArgs{
 * 							ServiceId: defaultService.Name,
 * 							Region:    defaultService.Location,
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingRelease(ctx, "default", &firebase.HostingReleaseArgs{
 * 			SiteId:      _default.SiteId,
 * 			VersionName: defaultHostingVersion.Name,
 * 			Message:     pulumi.String("Cloud Run Integration"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.cloudrunv2.Service;
 * import com.pulumi.gcp.cloudrunv2.ServiceArgs;
 * import com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateArgs;
 * import com.pulumi.gcp.firebase.HostingVersion;
 * import com.pulumi.gcp.firebase.HostingVersionArgs;
 * import com.pulumi.gcp.firebase.inputs.HostingVersionConfigArgs;
 * import com.pulumi.gcp.firebase.HostingRelease;
 * import com.pulumi.gcp.firebase.HostingReleaseArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id")
 *             .build());
 *         var defaultService = new Service("defaultService", ServiceArgs.builder()
 *             .project("my-project-name")
 *             .name("cloud-run-service-via-hosting")
 *             .location("us-central1")
 *             .ingress("INGRESS_TRAFFIC_ALL")
 *             .template(ServiceTemplateArgs.builder()
 *                 .containers(ServiceTemplateContainerArgs.builder()
 *                     .image("us-docker.pkg.dev/cloudrun/container/hello")
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingVersion = new HostingVersion("defaultHostingVersion", HostingVersionArgs.builder()
 *             .siteId(default_.siteId())
 *             .config(HostingVersionConfigArgs.builder()
 *                 .rewrites(HostingVersionConfigRewriteArgs.builder()
 *                     .glob("/hello/**")
 *                     .run(HostingVersionConfigRewriteRunArgs.builder()
 *                         .serviceId(defaultService.name())
 *                         .region(defaultService.location())
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingRelease = new HostingRelease("defaultHostingRelease", HostingReleaseArgs.builder()
 *             .siteId(default_.siteId())
 *             .versionName(defaultHostingVersion.name())
 *             .message("Cloud Run Integration")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-id
 *   defaultService:
 *     type: gcp:cloudrunv2:Service
 *     name: default
 *     properties:
 *       project: my-project-name
 *       name: cloud-run-service-via-hosting
 *       location: us-central1
 *       ingress: INGRESS_TRAFFIC_ALL
 *       template:
 *         containers:
 *           - image: us-docker.pkg.dev/cloudrun/container/hello
 *   defaultHostingVersion:
 *     type: gcp:firebase:HostingVersion
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       config:
 *         rewrites:
 *           - glob: /hello/**
 *             run:
 *               serviceId: ${defaultService.name}
 *               region: ${defaultService.location}
 *   defaultHostingRelease:
 *     type: gcp:firebase:HostingRelease
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       versionName: ${defaultHostingVersion.name}
 *       message: Cloud Run Integration
 * ```
 * 
 * ### Firebasehosting Version Cloud Functions
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     project: "my-project-name",
 *     name: "site-id-function-source",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 * });
 * const object = new gcp.storage.BucketObject("object", {
 *     name: "function-source.zip",
 *     bucket: bucket.name,
 *     source: new pulumi.asset.FileAsset("function-source.zip"),
 * });
 * const _function = new gcp.cloudfunctions.Function("function", {
 *     project: "my-project-name",
 *     name: "cloud-function-via-hosting",
 *     description: "A Cloud Function connected to Firebase Hosing",
 *     runtime: "nodejs16",
 *     availableMemoryMb: 128,
 *     sourceArchiveBucket: bucket.name,
 *     sourceArchiveObject: object.name,
 *     triggerHttp: true,
 *     entryPoint: "helloHttp",
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         rewrites: [{
 *             glob: "/hello/**",
 *             "function": _function.name,
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Cloud Functions Integration",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.firebase.HostingSite("default",
 *     project="my-project-name",
 *     site_id="site-id")
 * bucket = gcp.storage.Bucket("bucket",
 *     project="my-project-name",
 *     name="site-id-function-source",
 *     location="US",
 *     uniform_bucket_level_access=True)
 * object = gcp.storage.BucketObject("object",
 *     name="function-source.zip",
 *     bucket=bucket.name,
 *     source=pulumi.FileAsset("function-source.zip"))
 * function = gcp.cloudfunctions.Function("function",
 *     project="my-project-name",
 *     name="cloud-function-via-hosting",
 *     description="A Cloud Function connected to Firebase Hosing",
 *     runtime="nodejs16",
 *     available_memory_mb=128,
 *     source_archive_bucket=bucket.name,
 *     source_archive_object=object.name,
 *     trigger_http=True,
 *     entry_point="helloHttp")
 * default_hosting_version = gcp.firebase.HostingVersion("default",
 *     site_id=default.site_id,
 *     config=gcp.firebase.HostingVersionConfigArgs(
 *         rewrites=[gcp.firebase.HostingVersionConfigRewriteArgs(
 *             glob="/hello/**",
 *             function=function.name,
 *         )],
 *     ))
 * default_hosting_release = gcp.firebase.HostingRelease("default",
 *     site_id=default.site_id,
 *     version_name=default_hosting_version.name,
 *     message="Cloud Functions Integration")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Firebase.HostingSite("default", new()
 *     {
 *         Project = "my-project-name",
 *         SiteId = "site-id",
 *     });
 *     var bucket = new Gcp.Storage.Bucket("bucket", new()
 *     {
 *         Project = "my-project-name",
 *         Name = "site-id-function-source",
 *         Location = "US",
 *         UniformBucketLevelAccess = true,
 *     });
 *     var @object = new Gcp.Storage.BucketObject("object", new()
 *     {
 *         Name = "function-source.zip",
 *         Bucket = bucket.Name,
 *         Source = new FileAsset("function-source.zip"),
 *     });
 *     var function = new Gcp.CloudFunctions.Function("function", new()
 *     {
 *         Project = "my-project-name",
 *         Name = "cloud-function-via-hosting",
 *         Description = "A Cloud Function connected to Firebase Hosing",
 *         Runtime = "nodejs16",
 *         AvailableMemoryMb = 128,
 *         SourceArchiveBucket = bucket.Name,
 *         SourceArchiveObject = @object.Name,
 *         TriggerHttp = true,
 *         EntryPoint = "helloHttp",
 *     });
 *     var defaultHostingVersion = new Gcp.Firebase.HostingVersion("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         Config = new Gcp.Firebase.Inputs.HostingVersionConfigArgs
 *         {
 *             Rewrites = new[]
 *             {
 *                 new Gcp.Firebase.Inputs.HostingVersionConfigRewriteArgs
 *                 {
 *                     Glob = "/hello/**",
 *                     Function = function.Name,
 *                 },
 *             },
 *         },
 *     });
 *     var defaultHostingRelease = new Gcp.Firebase.HostingRelease("default", new()
 *     {
 *         SiteId = @default.SiteId,
 *         VersionName = defaultHostingVersion.Name,
 *         Message = "Cloud Functions Integration",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudfunctions"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := firebase.NewHostingSite(ctx, "default", &firebase.HostingSiteArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 			SiteId:  pulumi.String("site-id"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
 * 			Project:                  pulumi.String("my-project-name"),
 * 			Name:                     pulumi.String("site-id-function-source"),
 * 			Location:                 pulumi.String("US"),
 * 			UniformBucketLevelAccess: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		object, err := storage.NewBucketObject(ctx, "object", &storage.BucketObjectArgs{
 * 			Name:   pulumi.String("function-source.zip"),
 * 			Bucket: bucket.Name,
 * 			Source: pulumi.NewFileAsset("function-source.zip"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		function, err := cloudfunctions.NewFunction(ctx, "function", &cloudfunctions.FunctionArgs{
 * 			Project:             pulumi.String("my-project-name"),
 * 			Name:                pulumi.String("cloud-function-via-hosting"),
 * 			Description:         pulumi.String("A Cloud Function connected to Firebase Hosing"),
 * 			Runtime:             pulumi.String("nodejs16"),
 * 			AvailableMemoryMb:   pulumi.Int(128),
 * 			SourceArchiveBucket: bucket.Name,
 * 			SourceArchiveObject: object.Name,
 * 			TriggerHttp:         pulumi.Bool(true),
 * 			EntryPoint:          pulumi.String("helloHttp"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultHostingVersion, err := firebase.NewHostingVersion(ctx, "default", &firebase.HostingVersionArgs{
 * 			SiteId: _default.SiteId,
 * 			Config: &firebase.HostingVersionConfigArgs{
 * 				Rewrites: firebase.HostingVersionConfigRewriteArray{
 * 					&firebase.HostingVersionConfigRewriteArgs{
 * 						Glob:     pulumi.String("/hello/**"),
 * 						Function: function.Name,
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewHostingRelease(ctx, "default", &firebase.HostingReleaseArgs{
 * 			SiteId:      _default.SiteId,
 * 			VersionName: defaultHostingVersion.Name,
 * 			Message:     pulumi.String("Cloud Functions Integration"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.firebase.HostingSite;
 * import com.pulumi.gcp.firebase.HostingSiteArgs;
 * import com.pulumi.gcp.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.storage.BucketObject;
 * import com.pulumi.gcp.storage.BucketObjectArgs;
 * import com.pulumi.gcp.cloudfunctions.Function;
 * import com.pulumi.gcp.cloudfunctions.FunctionArgs;
 * import com.pulumi.gcp.firebase.HostingVersion;
 * import com.pulumi.gcp.firebase.HostingVersionArgs;
 * import com.pulumi.gcp.firebase.inputs.HostingVersionConfigArgs;
 * import com.pulumi.gcp.firebase.HostingRelease;
 * import com.pulumi.gcp.firebase.HostingReleaseArgs;
 * import com.pulumi.asset.FileAsset;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var default_ = new HostingSite("default", HostingSiteArgs.builder()
 *             .project("my-project-name")
 *             .siteId("site-id")
 *             .build());
 *         var bucket = new Bucket("bucket", BucketArgs.builder()
 *             .project("my-project-name")
 *             .name("site-id-function-source")
 *             .location("US")
 *             .uniformBucketLevelAccess(true)
 *             .build());
 *         var object = new BucketObject("object", BucketObjectArgs.builder()
 *             .name("function-source.zip")
 *             .bucket(bucket.name())
 *             .source(new FileAsset("function-source.zip"))
 *             .build());
 *         var function = new Function("function", FunctionArgs.builder()
 *             .project("my-project-name")
 *             .name("cloud-function-via-hosting")
 *             .description("A Cloud Function connected to Firebase Hosing")
 *             .runtime("nodejs16")
 *             .availableMemoryMb(128)
 *             .sourceArchiveBucket(bucket.name())
 *             .sourceArchiveObject(object.name())
 *             .triggerHttp(true)
 *             .entryPoint("helloHttp")
 *             .build());
 *         var defaultHostingVersion = new HostingVersion("defaultHostingVersion", HostingVersionArgs.builder()
 *             .siteId(default_.siteId())
 *             .config(HostingVersionConfigArgs.builder()
 *                 .rewrites(HostingVersionConfigRewriteArgs.builder()
 *                     .glob("/hello/**")
 *                     .function(function.name())
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultHostingRelease = new HostingRelease("defaultHostingRelease", HostingReleaseArgs.builder()
 *             .siteId(default_.siteId())
 *             .versionName(defaultHostingVersion.name())
 *             .message("Cloud Functions Integration")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:HostingSite
 *     properties:
 *       project: my-project-name
 *       siteId: site-id
 *   bucket:
 *     type: gcp:storage:Bucket
 *     properties:
 *       project: my-project-name
 *       name: site-id-function-source
 *       location: US
 *       uniformBucketLevelAccess: true
 *   object:
 *     type: gcp:storage:BucketObject
 *     properties:
 *       name: function-source.zip
 *       bucket: ${bucket.name}
 *       source:
 *         fn::FileAsset: function-source.zip
 *   function:
 *     type: gcp:cloudfunctions:Function
 *     properties:
 *       project: my-project-name
 *       name: cloud-function-via-hosting
 *       description: A Cloud Function connected to Firebase Hosing
 *       runtime: nodejs16
 *       availableMemoryMb: 128
 *       sourceArchiveBucket: ${bucket.name}
 *       sourceArchiveObject: ${object.name}
 *       triggerHttp: true
 *       entryPoint: helloHttp
 *   defaultHostingVersion:
 *     type: gcp:firebase:HostingVersion
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       config:
 *         rewrites:
 *           - glob: /hello/**
 *             function: ${function.name}
 *   defaultHostingRelease:
 *     type: gcp:firebase:HostingRelease
 *     name: default
 *     properties:
 *       siteId: ${default.siteId}
 *       versionName: ${defaultHostingVersion.name}
 *       message: Cloud Functions Integration
 * ```
 * 
 * ## Import
 * Version can be imported using any of these accepted formats:
 * * `sites/{{site_id}}/versions/{{version_id}}`
 * * `{{site_id}}/{{version_id}}`
 * When using the `pulumi import` command, Version can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:firebase/hostingVersion:HostingVersion default sites/{{site_id}}/versions/{{version_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/hostingVersion:HostingVersion default {{site_id}}/{{version_id}}
 * ```
 * @property config The configuration for the behavior of the site. This configuration exists in the `firebase.json` file.
 * Structure is documented below.
 * @property siteId Required. The ID of the site in which to create this Version.
 * - - -
 * */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
 */
public data class HostingVersionArgs(
    public val config: Output? = null,
    public val siteId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.firebase.HostingVersionArgs =
        com.pulumi.gcp.firebase.HostingVersionArgs.builder()
            .config(config?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .siteId(siteId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [HostingVersionArgs].
 */
@PulumiTagMarker
public class HostingVersionArgsBuilder internal constructor() {
    private var config: Output? = null

    private var siteId: Output? = null

    /**
     * @param value The configuration for the behavior of the site. This configuration exists in the `firebase.json` file.
     * Structure is documented below.
     */
    @JvmName("dnqsrlrroclbmbxf")
    public suspend fun config(`value`: Output) {
        this.config = value
    }

    /**
     * @param value Required. The ID of the site in which to create this Version.
     * - - -
     */
    @JvmName("pkelhcimvwfnbbee")
    public suspend fun siteId(`value`: Output) {
        this.siteId = value
    }

    /**
     * @param value The configuration for the behavior of the site. This configuration exists in the `firebase.json` file.
     * Structure is documented below.
     */
    @JvmName("wwgudmkcralmyemy")
    public suspend fun config(`value`: HostingVersionConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.config = mapped
    }

    /**
     * @param argument The configuration for the behavior of the site. This configuration exists in the `firebase.json` file.
     * Structure is documented below.
     */
    @JvmName("trmfqhpkqapxxbml")
    public suspend fun config(argument: suspend HostingVersionConfigArgsBuilder.() -> Unit) {
        val toBeMapped = HostingVersionConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.config = mapped
    }

    /**
     * @param value Required. The ID of the site in which to create this Version.
     * - - -
     */
    @JvmName("phcybifsmoxxaymm")
    public suspend fun siteId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.siteId = mapped
    }

    internal fun build(): HostingVersionArgs = HostingVersionArgs(
        config = config,
        siteId = siteId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy