AppCheckDeviceCheckConfig class

An app's DeviceCheck configuration object. Note that the Team ID registered with your app is used as part of the validation process. Make sure your gcp.firebase.AppleApp has a teamId present.

To get more information about DeviceCheckConfig, see:

Example Usage

Firebase App Check Device Check Config Full

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

const _default = new gcp.firebase.AppleApp("default", {
    project: "my-project-name",
    displayName: "Apple app",
    bundleId: "bundle.id.devicecheck",
    teamId: "9987654321",
});
// 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 defaultAppCheckDeviceCheckConfig = new gcp.firebase.AppCheckDeviceCheckConfig("default", {
    project: "my-project-name",
    appId: _default.appId,
    tokenTtl: "7200s",
    keyId: "Key ID",
    privateKey: std.file({
        input: "path/to/private-key.p8",
    }).then(invoke => invoke.result),
}, {
    dependsOn: [wait30s],
});
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std
import pulumiverse_time as time

default = gcp.firebase.AppleApp("default",
    project="my-project-name",
    display_name="Apple app",
    bundle_id="bundle.id.devicecheck",
    team_id="9987654321")
# 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_device_check_config = gcp.firebase.AppCheckDeviceCheckConfig("default",
    project="my-project-name",
    app_id=default.app_id,
    token_ttl="7200s",
    key_id="Key ID",
    private_key=std.file(input="path/to/private-key.p8").result,
    opts = pulumi.ResourceOptions(depends_on=[wait30s]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;
using Time = Pulumiverse.Time;

return await Deployment.RunAsync(() =>
{
    var @default = new Gcp.Firebase.AppleApp("default", new()
    {
        Project = "my-project-name",
        DisplayName = "Apple app",
        BundleId = "bundle.id.devicecheck",
        TeamId = "9987654321",
    });

    // 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 defaultAppCheckDeviceCheckConfig = new Gcp.Firebase.AppCheckDeviceCheckConfig("default", new()
    {
        Project = "my-project-name",
        AppId = @default.AppId,
        TokenTtl = "7200s",
        KeyId = "Key ID",
        PrivateKey = Std.File.Invoke(new()
        {
            Input = "path/to/private-key.p8",
        }).Apply(invoke => invoke.Result),
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            wait30s,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"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.NewAppleApp(ctx, "default", &firebase.AppleAppArgs{
			Project:     pulumi.String("my-project-name"),
			DisplayName: pulumi.String("Apple app"),
			BundleId:    pulumi.String("bundle.id.devicecheck"),
			TeamId:      pulumi.String("9987654321"),
		})
		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
		}
		invokeFile, err := std.File(ctx, &std.FileArgs{
			Input: "path/to/private-key.p8",
		}, nil)
		if err != nil {
			return err
		}
		_, err = firebase.NewAppCheckDeviceCheckConfig(ctx, "default", &firebase.AppCheckDeviceCheckConfigArgs{
			Project:    pulumi.String("my-project-name"),
			AppId:      _default.AppId,
			TokenTtl:   pulumi.String("7200s"),
			KeyId:      pulumi.String("Key ID"),
			PrivateKey: pulumi.String(invokeFile.Result),
		}, pulumi.DependsOn([]pulumi.Resource{
			wait30s,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
    std = {
      source = "pulumi/std"
    }
    time = {
      source = "pulumi/time"
    }
  }
}

resource "gcp_firebase_appleapp" "default" {
  project      = "my-project-name"
  display_name = "Apple app"
  bundle_id    = "bundle.id.devicecheck"
  team_id      = "9987654321"
}
# 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_appleapp.default]
  create_duration = "30s"
}
resource "gcp_firebase_appcheckdevicecheckconfig" "default" {
  depends_on  = [time_sleep.wait_30s]
  project     = "my-project-name"
  app_id      = gcp_firebase_appleapp.default.app_id
  token_ttl   = "7200s"
  key_id      = "Key ID"
  private_key = file("path/to/private-key.p8")
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firebase.AppleApp;
import com.pulumi.gcp.firebase.AppleAppArgs;
import com.pulumiverse.time.Sleep;
import com.pulumiverse.time.SleepArgs;
import com.pulumi.gcp.firebase.AppCheckDeviceCheckConfig;
import com.pulumi.gcp.firebase.AppCheckDeviceCheckConfigArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FileArgs;
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 AppleApp("default", AppleAppArgs.builder()
            .project("my-project-name")
            .displayName("Apple app")
            .bundleId("bundle.id.devicecheck")
            .teamId("9987654321")
            .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 defaultAppCheckDeviceCheckConfig = new AppCheckDeviceCheckConfig("defaultAppCheckDeviceCheckConfig", AppCheckDeviceCheckConfigArgs.builder()
            .project("my-project-name")
            .appId(default_.appId())
            .tokenTtl("7200s")
            .keyId("Key ID")
            .privateKey(StdFunctions.file(FileArgs.builder()
                .input("path/to/private-key.p8")
                .build()).result())
            .build(), CustomResourceOptions.builder()
                .dependsOn(wait30s)
                .build());

    }
}
resources:
  default:
    type: gcp:firebase:AppleApp
    properties:
      project: my-project-name
      displayName: Apple app
      bundleId: bundle.id.devicecheck
      teamId: '9987654321'
  # 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}
  defaultAppCheckDeviceCheckConfig:
    type: gcp:firebase:AppCheckDeviceCheckConfig
    name: default
    properties:
      project: my-project-name
      appId: ${default.appId}
      tokenTtl: 7200s
      keyId: Key ID
      privateKey:
        fn::invoke:
          function: std:file
          arguments:
            input: path/to/private-key.p8
          return: result
    options:
      dependsOn:
        - ${wait30s}

Import

DeviceCheckConfig can be imported using any of these accepted formats:

  • projects/{{project}}/apps/{{app_id}}/deviceCheckConfig
  • {{project}}/{{app_id}}
  • {{app_id}}

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

$ pulumi import gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig default projects/{{project}}/apps/{{app_id}}/deviceCheckConfig
$ pulumi import gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig default {{project}}/{{app_id}}
$ pulumi import gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig default {{app_id}}

Constructors

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

Properties

appId ↔ Output<String>
The ID of an Apple 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
keyId ↔ Output<String>
The key identifier of a private key enabled with DeviceCheck, created in your Apple Developer account.
latefinal
name ↔ Output<String>
The relative resource name of the DeviceCheck configuration object
latefinal
privateKey ↔ Output<String>
The contents of the private key (.p8) file associated with the key specified by keyId. Note: This property is sensitive and will not be displayed in the plan.
latefinal
privateKeySet ↔ Output<bool>
Whether the privateKey field was previously set. Since App Check will never return the privateKey field, this field is the only way to find out whether it was previously set.
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
tokenTtl ↔ Output<String>
Specifies the duration for which App Check tokens exchanged from DeviceCheck 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, {AppCheckDeviceCheckConfigState? state, CustomResourceOptions? options}) → AppCheckDeviceCheckConfig
Gets an existing AppCheckDeviceCheckConfig resource's state with the given name and id.