com.pulumi.gcp.firebase.kotlin.AppCheckRecaptchaEnterpriseConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.firebase.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [AppCheckRecaptchaEnterpriseConfig].
*/
@PulumiTagMarker
public class AppCheckRecaptchaEnterpriseConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: AppCheckRecaptchaEnterpriseConfigArgs = AppCheckRecaptchaEnterpriseConfigArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend AppCheckRecaptchaEnterpriseConfigArgsBuilder.() -> Unit) {
val builder = AppCheckRecaptchaEnterpriseConfigArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): AppCheckRecaptchaEnterpriseConfig {
val builtJavaResource =
com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AppCheckRecaptchaEnterpriseConfig(builtJavaResource)
}
}
/**
* An app's reCAPTCHA Enterprise configuration object.
* To get more information about RecaptchaEnterpriseConfig, see:
* * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.recaptchaEnterpriseConfig)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/docs/app-check)
* ## Example Usage
* ### Firebase App Check Recaptcha Enterprise Config Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumi/time";
* // Enables the reCAPTCHA Enterprise API
* const recaptchaEnterprise = new gcp.projects.Service("recaptcha_enterprise", {
* project: "my-project-name",
* service: "recaptchaenterprise.googleapis.com",
* disableOnDestroy: false,
* });
* const _default = new gcp.firebase.WebApp("default", {
* project: "my-project-name",
* displayName: "Web App for reCAPTCHA Enterprise",
* });
* // It takes a while for App Check to recognize the new app
* // If your app already exists, you don't have to wait 30 seconds.
* const wait30s = new time.index.Sleep("wait_30s", {createDuration: "30s"});
* const defaultAppCheckRecaptchaEnterpriseConfig = new gcp.firebase.AppCheckRecaptchaEnterpriseConfig("default", {
* project: "my-project-name",
* appId: _default.appId,
* siteKey: "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw",
* tokenTtl: "7200s",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_time as time
* # Enables the reCAPTCHA Enterprise API
* recaptcha_enterprise = gcp.projects.Service("recaptcha_enterprise",
* project="my-project-name",
* service="recaptchaenterprise.googleapis.com",
* disable_on_destroy=False)
* default = gcp.firebase.WebApp("default",
* project="my-project-name",
* display_name="Web App for reCAPTCHA Enterprise")
* # It takes a while for App Check to recognize the new app
* # If your app already exists, you don't have to wait 30 seconds.
* wait30s = time.index.Sleep("wait_30s", create_duration=30s)
* default_app_check_recaptcha_enterprise_config = gcp.firebase.AppCheckRecaptchaEnterpriseConfig("default",
* project="my-project-name",
* app_id=default.app_id,
* site_key="6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw",
* token_ttl="7200s")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Time = Pulumi.Time;
* return await Deployment.RunAsync(() =>
* {
* // Enables the reCAPTCHA Enterprise API
* var recaptchaEnterprise = new Gcp.Projects.Service("recaptcha_enterprise", new()
* {
* Project = "my-project-name",
* ServiceName = "recaptchaenterprise.googleapis.com",
* DisableOnDestroy = false,
* });
* var @default = new Gcp.Firebase.WebApp("default", new()
* {
* Project = "my-project-name",
* DisplayName = "Web App for reCAPTCHA Enterprise",
* });
* // It takes a while for App Check to recognize the new app
* // If your app already exists, you don't have to wait 30 seconds.
* var wait30s = new Time.Index.Sleep("wait_30s", new()
* {
* CreateDuration = "30s",
* });
* var defaultAppCheckRecaptchaEnterpriseConfig = new Gcp.Firebase.AppCheckRecaptchaEnterpriseConfig("default", new()
* {
* Project = "my-project-name",
* AppId = @default.AppId,
* SiteKey = "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw",
* TokenTtl = "7200s",
* });
* });
* ```
* ```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-time/sdk/go/time"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // Enables the reCAPTCHA Enterprise API
* _, err := projects.NewService(ctx, "recaptcha_enterprise", &projects.ServiceArgs{
* Project: pulumi.String("my-project-name"),
* Service: pulumi.String("recaptchaenterprise.googleapis.com"),
* DisableOnDestroy: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = firebase.NewWebApp(ctx, "default", &firebase.WebAppArgs{
* Project: pulumi.String("my-project-name"),
* DisplayName: pulumi.String("Web App for reCAPTCHA Enterprise"),
* })
* if err != nil {
* return err
* }
* // It takes a while for App Check to recognize the new app
* // If your app already exists, you don't have to wait 30 seconds.
* _, err = time.NewSleep(ctx, "wait_30s", &time.SleepArgs{
* CreateDuration: "30s",
* })
* if err != nil {
* return err
* }
* _, err = firebase.NewAppCheckRecaptchaEnterpriseConfig(ctx, "default", &firebase.AppCheckRecaptchaEnterpriseConfigArgs{
* Project: pulumi.String("my-project-name"),
* AppId: _default.AppId,
* SiteKey: pulumi.String("6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw"),
* TokenTtl: pulumi.String("7200s"),
* })
* 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.Service;
* import com.pulumi.gcp.projects.ServiceArgs;
* import com.pulumi.gcp.firebase.WebApp;
* import com.pulumi.gcp.firebase.WebAppArgs;
* import com.pulumi.time.sleep;
* import com.pulumi.time.SleepArgs;
* import com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfig;
* import com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfigArgs;
* 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) {
* // Enables the reCAPTCHA Enterprise API
* var recaptchaEnterprise = new Service("recaptchaEnterprise", ServiceArgs.builder()
* .project("my-project-name")
* .service("recaptchaenterprise.googleapis.com")
* .disableOnDestroy(false)
* .build());
* var default_ = new WebApp("default", WebAppArgs.builder()
* .project("my-project-name")
* .displayName("Web App for reCAPTCHA Enterprise")
* .build());
* // It takes a while for App Check to recognize the new app
* // If your app already exists, you don't have to wait 30 seconds.
* var wait30s = new Sleep("wait30s", SleepArgs.builder()
* .createDuration("30s")
* .build());
* var defaultAppCheckRecaptchaEnterpriseConfig = new AppCheckRecaptchaEnterpriseConfig("defaultAppCheckRecaptchaEnterpriseConfig", AppCheckRecaptchaEnterpriseConfigArgs.builder()
* .project("my-project-name")
* .appId(default_.appId())
* .siteKey("6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw")
* .tokenTtl("7200s")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Enables the reCAPTCHA Enterprise API
* recaptchaEnterprise:
* type: gcp:projects:Service
* name: recaptcha_enterprise
* properties:
* project: my-project-name
* service: recaptchaenterprise.googleapis.com
* disableOnDestroy: false
* default:
* type: gcp:firebase:WebApp
* properties:
* project: my-project-name
* displayName: Web App for reCAPTCHA Enterprise
* # It takes a while for App Check to recognize the new app
* # If your app already exists, you don't have to wait 30 seconds.
* wait30s:
* type: time:sleep
* name: wait_30s
* properties:
* createDuration: 30s
* defaultAppCheckRecaptchaEnterpriseConfig:
* type: gcp:firebase:AppCheckRecaptchaEnterpriseConfig
* name: default
* properties:
* project: my-project-name
* appId: ${default.appId}
* siteKey: 6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw
* tokenTtl: 7200s
* ```
*
* ## Import
* RecaptchaEnterpriseConfig can be imported using any of these accepted formats:
* * `projects/{{project}}/apps/{{app_id}}/recaptchaEnterpriseConfig`
* * `{{project}}/{{app_id}}`
* * `{{app_id}}`
* When using the `pulumi import` command, RecaptchaEnterpriseConfig can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default projects/{{project}}/apps/{{app_id}}/recaptchaEnterpriseConfig
* ```
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default {{project}}/{{app_id}}
* ```
* ```sh
* $ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default {{app_id}}
* ```
*/
public class AppCheckRecaptchaEnterpriseConfig internal constructor(
override val javaResource: com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfig,
) : KotlinCustomResource(javaResource, AppCheckRecaptchaEnterpriseConfigMapper) {
/**
* The ID of an
* [Web App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id).
* - - -
*/
public val appId: Output
get() = javaResource.appId().applyValue({ args0 -> args0 })
/**
* The relative resource name of the reCAPTCHA Enterprise configuration object
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* The score-based site key created in reCAPTCHA Enterprise used to invoke reCAPTCHA and generate the reCAPTCHA tokens for your application.
* **Important**: This is not the siteSecret (as it is in reCAPTCHA v3), but rather your score-based reCAPTCHA Enterprise site key.
*/
public val siteKey: Output
get() = javaResource.siteKey().applyValue({ args0 -> args0 })
/**
* Specifies the duration for which App Check tokens exchanged from reCAPTCHA Enterprise artifacts will be valid.
* If unset, a default value of 1 hour is assumed. Must be between 30 minutes and 7 days, inclusive.
* A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
*/
public val tokenTtl: Output
get() = javaResource.tokenTtl().applyValue({ args0 -> args0 })
}
public object AppCheckRecaptchaEnterpriseConfigMapper :
ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfig::class == javaResource::class
override fun map(javaResource: Resource): AppCheckRecaptchaEnterpriseConfig =
AppCheckRecaptchaEnterpriseConfig(
javaResource as
com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfig,
)
}
/**
* @see [AppCheckRecaptchaEnterpriseConfig].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AppCheckRecaptchaEnterpriseConfig].
*/
public suspend fun appCheckRecaptchaEnterpriseConfig(
name: String,
block: suspend AppCheckRecaptchaEnterpriseConfigResourceBuilder.() -> Unit,
): AppCheckRecaptchaEnterpriseConfig {
val builder = AppCheckRecaptchaEnterpriseConfigResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AppCheckRecaptchaEnterpriseConfig].
* @param name The _unique_ name of the resulting resource.
*/
public fun appCheckRecaptchaEnterpriseConfig(name: String): AppCheckRecaptchaEnterpriseConfig {
val builder = AppCheckRecaptchaEnterpriseConfigResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy