AppCheckDebugToken class

A debug token is a secret used during the development or integration testing of an app. It essentially allows the development or integration testing to bypass app attestation while still allowing App Check to enforce protection on supported production Firebase services.

To get more information about DebugToken, see:

Example Usage

Firebase App Check Debug Token Basic

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

const _default = new gcp.firebase.WebApp("default", {
    project: "my-project-name",
    displayName: "Web App for debug token",
});
// 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 defaultAppCheckDebugToken = new gcp.firebase.AppCheckDebugToken("default", {
    project: "my-project-name",
    appId: _default.appId,
    displayName: "Debug Token",
    token: "00000000-AAAA-BBBB-CCCC-000000000000",
}, {
    dependsOn: [wait30s],
});
import pulumi
import pulumi_gcp as gcp
import pulumiverse_time as time

default = gcp.firebase.WebApp("default",
    project="my-project-name",
    display_name="Web App for debug token")
# 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_debug_token = gcp.firebase.AppCheckDebugToken("default",
    project="my-project-name",
    app_id=default.app_id,
    display_name="Debug Token",
    token="00000000-AAAA-BBBB-CCCC-000000000000",
    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(() =>
{
    var @default = new Gcp.Firebase.WebApp("default", new()
    {
        Project = "my-project-name",
        DisplayName = "Web App for debug token",
    });

    // 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 defaultAppCheckDebugToken = new Gcp.Firebase.AppCheckDebugToken("default", new()
    {
        Project = "my-project-name",
        AppId = @default.AppId,
        DisplayName = "Debug Token",
        Token = "00000000-AAAA-BBBB-CCCC-000000000000",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            wait30s,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
	"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 {
		_default, err := firebase.NewWebApp(ctx, "default", &firebase.WebAppArgs{
			Project:     pulumi.String("my-project-name"),
			DisplayName: pulumi.String("Web App for debug token"),
		})
		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.NewAppCheckDebugToken(ctx, "default", &firebase.AppCheckDebugTokenArgs{
			Project:     pulumi.String("my-project-name"),
			AppId:       _default.AppId,
			DisplayName: pulumi.String("Debug Token"),
			Token:       pulumi.String("00000000-AAAA-BBBB-CCCC-000000000000"),
		}, pulumi.DependsOn([]pulumi.Resource{
			wait30s,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
    time = {
      source = "pulumi/time"
    }
  }
}

resource "gcp_firebase_webapp" "default" {
  project      = "my-project-name"
  display_name = "Web App for debug token"
}
# 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_appcheckdebugtoken" "default" {
  depends_on   = [time_sleep.wait_30s]
  project      = "my-project-name"
  app_id       = gcp_firebase_webapp.default.app_id
  display_name = "Debug Token"
  token        = "00000000-AAAA-BBBB-CCCC-000000000000"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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.AppCheckDebugToken;
import com.pulumi.gcp.firebase.AppCheckDebugTokenArgs;
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) {
        var default_ = new WebApp("default", WebAppArgs.builder()
            .project("my-project-name")
            .displayName("Web App for debug token")
            .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 defaultAppCheckDebugToken = new AppCheckDebugToken("defaultAppCheckDebugToken", AppCheckDebugTokenArgs.builder()
            .project("my-project-name")
            .appId(default_.appId())
            .displayName("Debug Token")
            .token("00000000-AAAA-BBBB-CCCC-000000000000")
            .build(), CustomResourceOptions.builder()
                .dependsOn(wait30s)
                .build());

    }
}
resources:
  default:
    type: gcp:firebase:WebApp
    properties:
      project: my-project-name
      displayName: Web App for debug token
  # 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}
  defaultAppCheckDebugToken:
    type: gcp:firebase:AppCheckDebugToken
    name: default
    properties:
      project: my-project-name
      appId: ${default.appId}
      displayName: Debug Token
      token: 00000000-AAAA-BBBB-CCCC-000000000000
    options:
      dependsOn:
        - ${wait30s}

Import

DebugToken can be imported using any of these accepted formats:

  • projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}}
  • {{project}}/{{app_id}}/{{debug_token_id}}
  • {{app_id}}/{{debug_token_id}}

When using the pulumi import command, DebugToken can be imported using one of the formats above. For example:

$ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default projects/{{project}}/apps/{{app_id}}/debugTokens/{{debug_token_id}}
$ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default {{project}}/{{app_id}}/{{debug_token_id}}
$ pulumi import gcp:firebase/appCheckDebugToken:AppCheckDebugToken default {{app_id}}/{{debug_token_id}}

Constructors

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

Properties

appId ↔ Output<String>
The ID of a Web App, Apple App, or Android App
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
debugTokenId ↔ Output<String>
The last segment of the resource name of the debug token.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
displayName ↔ Output<String>
A human readable display name used to identify this debug token.
latefinal
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
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
token ↔ Output<String>
The secret token itself. Must be provided during creation, and must be a UUID4, case insensitive. You may use a method of your choice such as random/random_uuid to generate the token. This field is immutable once set, and cannot be updated. You can, however, delete this debug token to revoke it. For security reasons, this field will never be populated in any response. Note: This property is sensitive and will not be displayed in the plan.
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, {AppCheckDebugTokenState? state, CustomResourceOptions? options}) → AppCheckDebugToken
Gets an existing AppCheckDebugToken resource's state with the given name and id.