@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
140 lines • 5.82 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppCheckDeviceCheckConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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:
*
* * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.deviceCheckConfig)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/docs/app-check)
*
* ## Example Usage
*
* ### Firebase App Check Device Check Config Full
*
* ```typescript
* 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.index.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
*
* 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:
*
* ```sh
* $ pulumi import gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig default projects/{{project}}/apps/{{app_id}}/deviceCheckConfig
* ```
*
* ```sh
* $ pulumi import gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig default {{project}}/{{app_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig default {{app_id}}
* ```
*/
class AppCheckDeviceCheckConfig extends pulumi.CustomResource {
/**
* Get an existing AppCheckDeviceCheckConfig resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new AppCheckDeviceCheckConfig(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AppCheckDeviceCheckConfig. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AppCheckDeviceCheckConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appId"] = state?.appId;
resourceInputs["keyId"] = state?.keyId;
resourceInputs["name"] = state?.name;
resourceInputs["privateKey"] = state?.privateKey;
resourceInputs["privateKeySet"] = state?.privateKeySet;
resourceInputs["project"] = state?.project;
resourceInputs["tokenTtl"] = state?.tokenTtl;
}
else {
const args = argsOrState;
if (args?.appId === undefined && !opts.urn) {
throw new Error("Missing required property 'appId'");
}
if (args?.keyId === undefined && !opts.urn) {
throw new Error("Missing required property 'keyId'");
}
if (args?.privateKey === undefined && !opts.urn) {
throw new Error("Missing required property 'privateKey'");
}
resourceInputs["appId"] = args?.appId;
resourceInputs["keyId"] = args?.keyId;
resourceInputs["privateKey"] = args?.privateKey ? pulumi.secret(args.privateKey) : undefined;
resourceInputs["project"] = args?.project;
resourceInputs["tokenTtl"] = args?.tokenTtl;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["privateKeySet"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["privateKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(AppCheckDeviceCheckConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.AppCheckDeviceCheckConfig = AppCheckDeviceCheckConfig;
/** @internal */
AppCheckDeviceCheckConfig.__pulumiType = 'gcp:firebase/appCheckDeviceCheckConfig:AppCheckDeviceCheckConfig';
//# sourceMappingURL=appCheckDeviceCheckConfig.js.map
;