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

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

@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.WebAppArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * A Google Cloud Firebase web application instance
 * To get more information about WebApp, see:
 * * [API documentation](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps)
 * * How-to Guides
 *     * [Official Documentation](https://firebase.google.com/)
 * ## Example Usage
 * ### Firebase Web App Custom Api Key
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const web = new gcp.projects.ApiKey("web", {
 *     project: "my-project-name",
 *     name: "api-key",
 *     displayName: "Display Name",
 *     restrictions: {
 *         browserKeyRestrictions: {
 *             allowedReferrers: ["*"],
 *         },
 *     },
 * });
 * const _default = new gcp.firebase.WebApp("default", {
 *     project: "my-project-name",
 *     displayName: "Display Name",
 *     apiKeyId: web.uid,
 *     deletionPolicy: "DELETE",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * web = gcp.projects.ApiKey("web",
 *     project="my-project-name",
 *     name="api-key",
 *     display_name="Display Name",
 *     restrictions={
 *         "browser_key_restrictions": {
 *             "allowed_referrers": ["*"],
 *         },
 *     })
 * default = gcp.firebase.WebApp("default",
 *     project="my-project-name",
 *     display_name="Display Name",
 *     api_key_id=web.uid,
 *     deletion_policy="DELETE")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var web = new Gcp.Projects.ApiKey("web", new()
 *     {
 *         Project = "my-project-name",
 *         Name = "api-key",
 *         DisplayName = "Display Name",
 *         Restrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsArgs
 *         {
 *             BrowserKeyRestrictions = new Gcp.Projects.Inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs
 *             {
 *                 AllowedReferrers = new[]
 *                 {
 *                     "*",
 *                 },
 *             },
 *         },
 *     });
 *     var @default = new Gcp.Firebase.WebApp("default", new()
 *     {
 *         Project = "my-project-name",
 *         DisplayName = "Display Name",
 *         ApiKeyId = web.Uid,
 *         DeletionPolicy = "DELETE",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		web, err := projects.NewApiKey(ctx, "web", &projects.ApiKeyArgs{
 * 			Project:     pulumi.String("my-project-name"),
 * 			Name:        pulumi.String("api-key"),
 * 			DisplayName: pulumi.String("Display Name"),
 * 			Restrictions: &projects.ApiKeyRestrictionsArgs{
 * 				BrowserKeyRestrictions: &projects.ApiKeyRestrictionsBrowserKeyRestrictionsArgs{
 * 					AllowedReferrers: pulumi.StringArray{
 * 						pulumi.String("*"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewWebApp(ctx, "default", &firebase.WebAppArgs{
 * 			Project:        pulumi.String("my-project-name"),
 * 			DisplayName:    pulumi.String("Display Name"),
 * 			ApiKeyId:       web.Uid,
 * 			DeletionPolicy: pulumi.String("DELETE"),
 * 		})
 * 		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.projects.ApiKey;
 * import com.pulumi.gcp.projects.ApiKeyArgs;
 * import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs;
 * import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsBrowserKeyRestrictionsArgs;
 * import com.pulumi.gcp.firebase.WebApp;
 * import com.pulumi.gcp.firebase.WebAppArgs;
 * 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 web = new ApiKey("web", ApiKeyArgs.builder()
 *             .project("my-project-name")
 *             .name("api-key")
 *             .displayName("Display Name")
 *             .restrictions(ApiKeyRestrictionsArgs.builder()
 *                 .browserKeyRestrictions(ApiKeyRestrictionsBrowserKeyRestrictionsArgs.builder()
 *                     .allowedReferrers("*")
 *                     .build())
 *                 .build())
 *             .build());
 *         var default_ = new WebApp("default", WebAppArgs.builder()
 *             .project("my-project-name")
 *             .displayName("Display Name")
 *             .apiKeyId(web.uid())
 *             .deletionPolicy("DELETE")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:firebase:WebApp
 *     properties:
 *       project: my-project-name
 *       displayName: Display Name
 *       apiKeyId: ${web.uid}
 *       deletionPolicy: DELETE
 *   web:
 *     type: gcp:projects:ApiKey
 *     properties:
 *       project: my-project-name
 *       name: api-key
 *       displayName: Display Name
 *       restrictions:
 *         browserKeyRestrictions:
 *           allowedReferrers:
 *             - '*'
 * ```
 * 
 * ## Import
 * WebApp can be imported using any of these accepted formats:
 * * `{{project}} projects/{{project}}/webApps/{{app_id}}`
 * * `projects/{{project}}/webApps/{{app_id}}`
 * * `{{project}}/{{project}}/{{app_id}}`
 * * `webApps/{{app_id}}`
 * * `{{app_id}}`
 * When using the `pulumi import` command, WebApp can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:firebase/webApp:WebApp default {{project}} projects/{{project}}/webApps/{{app_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/webApp:WebApp default projects/{{project}}/webApps/{{app_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/webApp:WebApp default {{project}}/{{project}}/{{app_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/webApp:WebApp default webApps/{{app_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/webApp:WebApp default {{app_id}}
 * ```
 * @property apiKeyId The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the WebApp.
 * If apiKeyId is not set during creation, then Firebase automatically associates an apiKeyId with the WebApp.
 * This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned.
 * @property deletionPolicy
 * @property displayName The user-assigned display name of the App.
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class WebAppArgs(
    public val apiKeyId: Output? = null,
    public val deletionPolicy: Output? = null,
    public val displayName: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.firebase.WebAppArgs =
        com.pulumi.gcp.firebase.WebAppArgs.builder()
            .apiKeyId(apiKeyId?.applyValue({ args0 -> args0 }))
            .deletionPolicy(deletionPolicy?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [WebAppArgs].
 */
@PulumiTagMarker
public class WebAppArgsBuilder internal constructor() {
    private var apiKeyId: Output? = null

    private var deletionPolicy: Output? = null

    private var displayName: Output? = null

    private var project: Output? = null

    /**
     * @param value The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the WebApp.
     * If apiKeyId is not set during creation, then Firebase automatically associates an apiKeyId with the WebApp.
     * This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned.
     */
    @JvmName("afubraccuhouvghq")
    public suspend fun apiKeyId(`value`: Output) {
        this.apiKeyId = value
    }

    /**
     * @param value
     */
    @JvmName("qjgwqcprmclgvvog")
    public suspend fun deletionPolicy(`value`: Output) {
        this.deletionPolicy = value
    }

    /**
     * @param value The user-assigned display name of the App.
     * - - -
     */
    @JvmName("gehwucotfbidjqaq")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("ogjtqlhwobbndota")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The globally unique, Google-assigned identifier (UID) for the Firebase API key associated with the WebApp.
     * If apiKeyId is not set during creation, then Firebase automatically associates an apiKeyId with the WebApp.
     * This auto-associated key may be an existing valid key or, if no valid key exists, a new one will be provisioned.
     */
    @JvmName("kmvjnmnsosowwbxd")
    public suspend fun apiKeyId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiKeyId = mapped
    }

    /**
     * @param value
     */
    @JvmName("tdopjqlqksbjsntw")
    public suspend fun deletionPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deletionPolicy = mapped
    }

    /**
     * @param value The user-assigned display name of the App.
     * - - -
     */
    @JvmName("annjbhepnmscltju")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("hdjujiqlmfeujuai")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    internal fun build(): WebAppArgs = WebAppArgs(
        apiKeyId = apiKeyId,
        deletionPolicy = deletionPolicy,
        displayName = displayName,
        project = project,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy