com.pulumi.gcp.firebase.kotlin.AppCheckDeviceCheckConfig.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 [AppCheckDeviceCheckConfig].
*/
@PulumiTagMarker
public class AppCheckDeviceCheckConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: AppCheckDeviceCheckConfigArgs = AppCheckDeviceCheckConfigArgs()
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 AppCheckDeviceCheckConfigArgsBuilder.() -> Unit) {
val builder = AppCheckDeviceCheckConfigArgsBuilder()
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(): AppCheckDeviceCheckConfig {
val builtJavaResource =
com.pulumi.gcp.firebase.AppCheckDeviceCheckConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AppCheckDeviceCheckConfig(builtJavaResource)
}
}
/**
* 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 team_id 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 "@pulumi/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"});
* 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),
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_std as std
* import pulumi_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.index.Sleep("wait_30s", create_duration=30s)
* 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)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Std = Pulumi.Std;
* using Time = Pulumi.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.Index.Sleep("wait_30s", new()
* {
* CreateDuration = "30s",
* });
* 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),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "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 {
* _, 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.
* _, err = time.NewSleep(ctx, "wait_30s", &time.SleepArgs{
* CreateDuration: "30s",
* })
* 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: invokeFile.Result,
* })
* 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.firebase.AppleApp;
* import com.pulumi.gcp.firebase.AppleAppArgs;
* import com.pulumi.time.sleep;
* import com.pulumi.time.SleepArgs;
* import com.pulumi.gcp.firebase.AppCheckDeviceCheckConfig;
* import com.pulumi.gcp.firebase.AppCheckDeviceCheckConfigArgs;
* 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) {
* 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());
* 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());
* }
* }
* ```
* ```yaml
* 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
* 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
* ```
*
* ## 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}}
* ```
*/
public class AppCheckDeviceCheckConfig internal constructor(
override val javaResource: com.pulumi.gcp.firebase.AppCheckDeviceCheckConfig,
) : KotlinCustomResource(javaResource, AppCheckDeviceCheckConfigMapper) {
/**
* The ID of an
* [Apple App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.iosApps#IosApp.FIELDS.app_id).
* - - -
*/
public val appId: Output
get() = javaResource.appId().applyValue({ args0 -> args0 })
/**
* The key identifier of a private key enabled with DeviceCheck, created in your Apple Developer account.
*/
public val keyId: Output
get() = javaResource.keyId().applyValue({ args0 -> args0 })
/**
* The relative resource name of the DeviceCheck configuration object
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* 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.
*/
public val privateKey: Output
get() = javaResource.privateKey().applyValue({ args0 -> args0 })
/**
* 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.
*/
public val privateKeySet: Output
get() = javaResource.privateKeySet().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 })
/**
* 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".
*/
public val tokenTtl: Output
get() = javaResource.tokenTtl().applyValue({ args0 -> args0 })
}
public object AppCheckDeviceCheckConfigMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.firebase.AppCheckDeviceCheckConfig::class == javaResource::class
override fun map(javaResource: Resource): AppCheckDeviceCheckConfig =
AppCheckDeviceCheckConfig(javaResource as com.pulumi.gcp.firebase.AppCheckDeviceCheckConfig)
}
/**
* @see [AppCheckDeviceCheckConfig].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AppCheckDeviceCheckConfig].
*/
public suspend fun appCheckDeviceCheckConfig(
name: String,
block: suspend AppCheckDeviceCheckConfigResourceBuilder.() -> Unit,
): AppCheckDeviceCheckConfig {
val builder = AppCheckDeviceCheckConfigResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AppCheckDeviceCheckConfig].
* @param name The _unique_ name of the resulting resource.
*/
public fun appCheckDeviceCheckConfig(name: String): AppCheckDeviceCheckConfig {
val builder = AppCheckDeviceCheckConfigResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy