AppCheckRecaptchaEnterpriseConfig class

An app's reCAPTCHA Enterprise configuration object.

To get more information about RecaptchaEnterpriseConfig, see:

Example Usage

Firebase App Check Recaptcha Enterprise Config Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as time from "@pulumiverse/time";

// Enables the reCAPTCHA Enterprise API
const recaptchaEnterprise = new gcp.projects.Service("recaptcha_enterprise", {
    project: "my-project-name",
    service: "recaptchaenterprise.googleapis.com",
});
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.Sleep("wait_30s", {createDuration: "30s"}, {
    dependsOn: [_default],
});
const defaultAppCheckRecaptchaEnterpriseConfig = new gcp.firebase.AppCheckRecaptchaEnterpriseConfig("default", {
    project: "my-project-name",
    appId: _default.appId,
    siteKey: "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw",
    tokenTtl: "7200s",
}, {
    dependsOn: [wait30s],
});
import pulumi
import pulumi_gcp as gcp
import pulumiverse_time as time

# Enables the reCAPTCHA Enterprise API
recaptcha_enterprise = gcp.projects.Service("recaptcha_enterprise",
    project="my-project-name",
    service="recaptchaenterprise.googleapis.com")
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.Sleep("wait_30s", create_duration="30s",
opts = pulumi.ResourceOptions(depends_on=[default]))
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",
    opts = pulumi.ResourceOptions(depends_on=[wait30s]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Time = Pulumiverse.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",
    });

    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.Sleep("wait_30s", new()
    {
        CreateDuration = "30s",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            @default,
        },
    });

    var defaultAppCheckRecaptchaEnterpriseConfig = new Gcp.Firebase.AppCheckRecaptchaEnterpriseConfig("default", new()
    {
        Project = "my-project-name",
        AppId = @default.AppId,
        SiteKey = "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw",
        TokenTtl = "7200s",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            wait30s,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/projects"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-time/sdk/go/time"
)

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"),
		})
		if err != nil {
			return err
		}
		_default, 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.
		wait30s, err := time.NewSleep(ctx, "wait_30s", &time.SleepArgs{
			CreateDuration: pulumi.String("30s"),
		}, pulumi.DependsOn([]pulumi.Resource{
			_default,
		}))
		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"),
		}, pulumi.DependsOn([]pulumi.Resource{
			wait30s,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
    time = {
      source = "pulumi/time"
    }
  }
}

# Enables the reCAPTCHA Enterprise API
resource "gcp_projects_service" "recaptcha_enterprise" {
  project = "my-project-name"
  service = "recaptchaenterprise.googleapis.com"
}
resource "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.
resource "time_sleep" "wait_30s" {
  depends_on      = [gcp_firebase_webapp.default]
  create_duration = "30s"
}
resource "gcp_firebase_appcheckrecaptchaenterpriseconfig" "default" {
  depends_on = [time_sleep.wait_30s]
  project    = "my-project-name"
  app_id     = gcp_firebase_webapp.default.app_id
  site_key   = "6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw"
  token_ttl  = "7200s"
}
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.pulumiverse.time.Sleep;
import com.pulumiverse.time.SleepArgs;
import com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfig;
import com.pulumi.gcp.firebase.AppCheckRecaptchaEnterpriseConfigArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
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")
            .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(), CustomResourceOptions.builder()
                .dependsOn(default_)
                .build());

        var defaultAppCheckRecaptchaEnterpriseConfig = new AppCheckRecaptchaEnterpriseConfig("defaultAppCheckRecaptchaEnterpriseConfig", AppCheckRecaptchaEnterpriseConfigArgs.builder()
            .project("my-project-name")
            .appId(default_.appId())
            .siteKey("6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw")
            .tokenTtl("7200s")
            .build(), CustomResourceOptions.builder()
                .dependsOn(wait30s)
                .build());

    }
}
resources:
  # Enables the reCAPTCHA Enterprise API
  recaptchaEnterprise:
    type: gcp:projects:Service
    name: recaptcha_enterprise
    properties:
      project: my-project-name
      service: recaptchaenterprise.googleapis.com
  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
    options:
      dependsOn:
        - ${default}
  defaultAppCheckRecaptchaEnterpriseConfig:
    type: gcp:firebase:AppCheckRecaptchaEnterpriseConfig
    name: default
    properties:
      project: my-project-name
      appId: ${default.appId}
      siteKey: 6LdpMXIpAAAAANkwWQPgEdjEhal7ugkH9RK9ytuw
      tokenTtl: 7200s
    options:
      dependsOn:
        - ${wait30s}

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:

$ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default projects/{{project}}/apps/{{app_id}}/recaptchaEnterpriseConfig
$ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default {{project}}/{{app_id}}
$ pulumi import gcp:firebase/appCheckRecaptchaEnterpriseConfig:AppCheckRecaptchaEnterpriseConfig default {{app_id}}

Constructors

AppCheckRecaptchaEnterpriseConfig(String name, {AppCheckRecaptchaEnterpriseConfigArgs? args, CustomResourceOptions? options})
Creates a new AppCheckRecaptchaEnterpriseConfig. name The Pulumi resource name. args Arguments used to configure this AppCheckRecaptchaEnterpriseConfig. The set of arguments for AppCheckRecaptchaEnterpriseConfig. options Resource options controlling this resource's behavior.
AppCheckRecaptchaEnterpriseConfig.reference(String urn)
Creates a typed reference to an existing AppCheckRecaptchaEnterpriseConfig resource.

Properties

appId ↔ Output<String>
The ID of an Web App.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
The relative resource name of the reCAPTCHA Enterprise configuration object
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
siteKey ↔ Output<String>
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.
latefinal
tokenTtl ↔ Output<String>
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".
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {AppCheckRecaptchaEnterpriseConfigState? state, CustomResourceOptions? options}) → AppCheckRecaptchaEnterpriseConfig
Gets an existing AppCheckRecaptchaEnterpriseConfig resource's state with the given name and id.