com.pulumi.gcp.firebase.kotlin.AppCheckPlayIntegrityConfig.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 [AppCheckPlayIntegrityConfig].
*/
@PulumiTagMarker
public class AppCheckPlayIntegrityConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: AppCheckPlayIntegrityConfigArgs = AppCheckPlayIntegrityConfigArgs()
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 AppCheckPlayIntegrityConfigArgsBuilder.() -> Unit) {
val builder = AppCheckPlayIntegrityConfigArgsBuilder()
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(): AppCheckPlayIntegrityConfig {
val builtJavaResource =
com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return AppCheckPlayIntegrityConfig(builtJavaResource)
}
}
/**
* An app's Play Integrity configuration object. Note that your registered SHA-256 certificate fingerprints are used to validate tokens issued by the Play Integrity API.
* Make sure your `gcp.firebase.AndroidApp` has at least one `sha256_hashes` present.
* To get more information about PlayIntegrityConfig, see:
* * [API documentation](https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/docs/app-check)
* ## Example Usage
* ### Firebase App Check Play Integrity Config Minimal
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumi/time";
* // Enables the Play Integrity API
* const playIntegrity = new gcp.projects.Service("play_integrity", {
* project: "my-project-name",
* service: "playintegrity.googleapis.com",
* disableOnDestroy: false,
* });
* const _default = new gcp.firebase.AndroidApp("default", {
* project: "my-project-name",
* displayName: "Play Integrity app",
* packageName: "package.name.playintegrity",
* sha1Hashes: ["2145bdf698b8715039bd0e83f2069bed435ac21c"],
* sha256Hashes: ["2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"],
* });
* // 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 defaultAppCheckPlayIntegrityConfig = new gcp.firebase.AppCheckPlayIntegrityConfig("default", {
* project: "my-project-name",
* appId: _default.appId,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_time as time
* # Enables the Play Integrity API
* play_integrity = gcp.projects.Service("play_integrity",
* project="my-project-name",
* service="playintegrity.googleapis.com",
* disable_on_destroy=False)
* default = gcp.firebase.AndroidApp("default",
* project="my-project-name",
* display_name="Play Integrity app",
* package_name="package.name.playintegrity",
* sha1_hashes=["2145bdf698b8715039bd0e83f2069bed435ac21c"],
* sha256_hashes=["2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"])
* # 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_play_integrity_config = gcp.firebase.AppCheckPlayIntegrityConfig("default",
* project="my-project-name",
* app_id=default.app_id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Time = Pulumi.Time;
* return await Deployment.RunAsync(() =>
* {
* // Enables the Play Integrity API
* var playIntegrity = new Gcp.Projects.Service("play_integrity", new()
* {
* Project = "my-project-name",
* ServiceName = "playintegrity.googleapis.com",
* DisableOnDestroy = false,
* });
* var @default = new Gcp.Firebase.AndroidApp("default", new()
* {
* Project = "my-project-name",
* DisplayName = "Play Integrity app",
* PackageName = "package.name.playintegrity",
* Sha1Hashes = new[]
* {
* "2145bdf698b8715039bd0e83f2069bed435ac21c",
* },
* Sha256Hashes = new[]
* {
* "2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc",
* },
* });
* // 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 defaultAppCheckPlayIntegrityConfig = new Gcp.Firebase.AppCheckPlayIntegrityConfig("default", new()
* {
* Project = "my-project-name",
* AppId = @default.AppId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
* "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 {
* // Enables the Play Integrity API
* _, err := projects.NewService(ctx, "play_integrity", &projects.ServiceArgs{
* Project: pulumi.String("my-project-name"),
* Service: pulumi.String("playintegrity.googleapis.com"),
* DisableOnDestroy: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = firebase.NewAndroidApp(ctx, "default", &firebase.AndroidAppArgs{
* Project: pulumi.String("my-project-name"),
* DisplayName: pulumi.String("Play Integrity app"),
* PackageName: pulumi.String("package.name.playintegrity"),
* Sha1Hashes: pulumi.StringArray{
* pulumi.String("2145bdf698b8715039bd0e83f2069bed435ac21c"),
* },
* Sha256Hashes: pulumi.StringArray{
* pulumi.String("2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"),
* },
* })
* 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
* }
* _, err = firebase.NewAppCheckPlayIntegrityConfig(ctx, "default", &firebase.AppCheckPlayIntegrityConfigArgs{
* Project: pulumi.String("my-project-name"),
* AppId: _default.AppId,
* })
* 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.projects.Service;
* import com.pulumi.gcp.projects.ServiceArgs;
* import com.pulumi.gcp.firebase.AndroidApp;
* import com.pulumi.gcp.firebase.AndroidAppArgs;
* import com.pulumi.time.sleep;
* import com.pulumi.time.SleepArgs;
* import com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfig;
* import com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfigArgs;
* 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) {
* // Enables the Play Integrity API
* var playIntegrity = new Service("playIntegrity", ServiceArgs.builder()
* .project("my-project-name")
* .service("playintegrity.googleapis.com")
* .disableOnDestroy(false)
* .build());
* var default_ = new AndroidApp("default", AndroidAppArgs.builder()
* .project("my-project-name")
* .displayName("Play Integrity app")
* .packageName("package.name.playintegrity")
* .sha1Hashes("2145bdf698b8715039bd0e83f2069bed435ac21c")
* .sha256Hashes("2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc")
* .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 defaultAppCheckPlayIntegrityConfig = new AppCheckPlayIntegrityConfig("defaultAppCheckPlayIntegrityConfig", AppCheckPlayIntegrityConfigArgs.builder()
* .project("my-project-name")
* .appId(default_.appId())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Enables the Play Integrity API
* playIntegrity:
* type: gcp:projects:Service
* name: play_integrity
* properties:
* project: my-project-name
* service: playintegrity.googleapis.com
* disableOnDestroy: false
* default:
* type: gcp:firebase:AndroidApp
* properties:
* project: my-project-name
* displayName: Play Integrity app
* packageName: package.name.playintegrity
* sha1Hashes:
* - 2145bdf698b8715039bd0e83f2069bed435ac21c
* sha256Hashes:
* - 2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc
* # 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
* defaultAppCheckPlayIntegrityConfig:
* type: gcp:firebase:AppCheckPlayIntegrityConfig
* name: default
* properties:
* project: my-project-name
* appId: ${default.appId}
* ```
*
* ### Firebase App Check Play Integrity Config Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumi/time";
* // Enables the Play Integrity API
* const playIntegrity = new gcp.projects.Service("play_integrity", {
* project: "my-project-name",
* service: "playintegrity.googleapis.com",
* disableOnDestroy: false,
* });
* const _default = new gcp.firebase.AndroidApp("default", {
* project: "my-project-name",
* displayName: "Play Integrity app",
* packageName: "package.name.playintegrity",
* sha1Hashes: ["2145bdf698b8715039bd0e83f2069bed435ac21c"],
* sha256Hashes: ["2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"],
* });
* // 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 defaultAppCheckPlayIntegrityConfig = new gcp.firebase.AppCheckPlayIntegrityConfig("default", {
* project: "my-project-name",
* appId: _default.appId,
* tokenTtl: "7200s",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_time as time
* # Enables the Play Integrity API
* play_integrity = gcp.projects.Service("play_integrity",
* project="my-project-name",
* service="playintegrity.googleapis.com",
* disable_on_destroy=False)
* default = gcp.firebase.AndroidApp("default",
* project="my-project-name",
* display_name="Play Integrity app",
* package_name="package.name.playintegrity",
* sha1_hashes=["2145bdf698b8715039bd0e83f2069bed435ac21c"],
* sha256_hashes=["2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"])
* # 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_play_integrity_config = gcp.firebase.AppCheckPlayIntegrityConfig("default",
* project="my-project-name",
* app_id=default.app_id,
* token_ttl="7200s")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Time = Pulumi.Time;
* return await Deployment.RunAsync(() =>
* {
* // Enables the Play Integrity API
* var playIntegrity = new Gcp.Projects.Service("play_integrity", new()
* {
* Project = "my-project-name",
* ServiceName = "playintegrity.googleapis.com",
* DisableOnDestroy = false,
* });
* var @default = new Gcp.Firebase.AndroidApp("default", new()
* {
* Project = "my-project-name",
* DisplayName = "Play Integrity app",
* PackageName = "package.name.playintegrity",
* Sha1Hashes = new[]
* {
* "2145bdf698b8715039bd0e83f2069bed435ac21c",
* },
* Sha256Hashes = new[]
* {
* "2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc",
* },
* });
* // 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 defaultAppCheckPlayIntegrityConfig = new Gcp.Firebase.AppCheckPlayIntegrityConfig("default", new()
* {
* Project = "my-project-name",
* AppId = @default.AppId,
* TokenTtl = "7200s",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
* "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 {
* // Enables the Play Integrity API
* _, err := projects.NewService(ctx, "play_integrity", &projects.ServiceArgs{
* Project: pulumi.String("my-project-name"),
* Service: pulumi.String("playintegrity.googleapis.com"),
* DisableOnDestroy: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = firebase.NewAndroidApp(ctx, "default", &firebase.AndroidAppArgs{
* Project: pulumi.String("my-project-name"),
* DisplayName: pulumi.String("Play Integrity app"),
* PackageName: pulumi.String("package.name.playintegrity"),
* Sha1Hashes: pulumi.StringArray{
* pulumi.String("2145bdf698b8715039bd0e83f2069bed435ac21c"),
* },
* Sha256Hashes: pulumi.StringArray{
* pulumi.String("2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc"),
* },
* })
* 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
* }
* _, err = firebase.NewAppCheckPlayIntegrityConfig(ctx, "default", &firebase.AppCheckPlayIntegrityConfigArgs{
* Project: pulumi.String("my-project-name"),
* AppId: _default.AppId,
* TokenTtl: pulumi.String("7200s"),
* })
* 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.projects.Service;
* import com.pulumi.gcp.projects.ServiceArgs;
* import com.pulumi.gcp.firebase.AndroidApp;
* import com.pulumi.gcp.firebase.AndroidAppArgs;
* import com.pulumi.time.sleep;
* import com.pulumi.time.SleepArgs;
* import com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfig;
* import com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfigArgs;
* 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) {
* // Enables the Play Integrity API
* var playIntegrity = new Service("playIntegrity", ServiceArgs.builder()
* .project("my-project-name")
* .service("playintegrity.googleapis.com")
* .disableOnDestroy(false)
* .build());
* var default_ = new AndroidApp("default", AndroidAppArgs.builder()
* .project("my-project-name")
* .displayName("Play Integrity app")
* .packageName("package.name.playintegrity")
* .sha1Hashes("2145bdf698b8715039bd0e83f2069bed435ac21c")
* .sha256Hashes("2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc")
* .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 defaultAppCheckPlayIntegrityConfig = new AppCheckPlayIntegrityConfig("defaultAppCheckPlayIntegrityConfig", AppCheckPlayIntegrityConfigArgs.builder()
* .project("my-project-name")
* .appId(default_.appId())
* .tokenTtl("7200s")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Enables the Play Integrity API
* playIntegrity:
* type: gcp:projects:Service
* name: play_integrity
* properties:
* project: my-project-name
* service: playintegrity.googleapis.com
* disableOnDestroy: false
* default:
* type: gcp:firebase:AndroidApp
* properties:
* project: my-project-name
* displayName: Play Integrity app
* packageName: package.name.playintegrity
* sha1Hashes:
* - 2145bdf698b8715039bd0e83f2069bed435ac21c
* sha256Hashes:
* - 2145bdf698b8715039bd0e83f2069bed435ac21ca1b2c3d4e5f6123456789abc
* # 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
* defaultAppCheckPlayIntegrityConfig:
* type: gcp:firebase:AppCheckPlayIntegrityConfig
* name: default
* properties:
* project: my-project-name
* appId: ${default.appId}
* tokenTtl: 7200s
* ```
*
* ## Import
* PlayIntegrityConfig can be imported using any of these accepted formats:
* * `projects/{{project}}/apps/{{app_id}}/playIntegrityConfig`
* * `{{project}}/{{app_id}}`
* * `{{app_id}}`
* When using the `pulumi import` command, PlayIntegrityConfig can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:firebase/appCheckPlayIntegrityConfig:AppCheckPlayIntegrityConfig default projects/{{project}}/apps/{{app_id}}/playIntegrityConfig
* ```
* ```sh
* $ pulumi import gcp:firebase/appCheckPlayIntegrityConfig:AppCheckPlayIntegrityConfig default {{project}}/{{app_id}}
* ```
* ```sh
* $ pulumi import gcp:firebase/appCheckPlayIntegrityConfig:AppCheckPlayIntegrityConfig default {{app_id}}
* ```
*/
public class AppCheckPlayIntegrityConfig internal constructor(
override val javaResource: com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfig,
) : KotlinCustomResource(javaResource, AppCheckPlayIntegrityConfigMapper) {
/**
* The ID of an
* [Android App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.androidApps#AndroidApp.FIELDS.app_id).
* - - -
*/
public val appId: Output
get() = javaResource.appId().applyValue({ args0 -> args0 })
/**
* The relative resource name of the Play Integrity configuration object
*/
public val name: Output
get() = javaResource.name().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 Play Integrity 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 AppCheckPlayIntegrityConfigMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfig::class == javaResource::class
override fun map(javaResource: Resource): AppCheckPlayIntegrityConfig =
AppCheckPlayIntegrityConfig(
javaResource as
com.pulumi.gcp.firebase.AppCheckPlayIntegrityConfig,
)
}
/**
* @see [AppCheckPlayIntegrityConfig].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [AppCheckPlayIntegrityConfig].
*/
public suspend fun appCheckPlayIntegrityConfig(
name: String,
block: suspend AppCheckPlayIntegrityConfigResourceBuilder.() -> Unit,
): AppCheckPlayIntegrityConfig {
val builder = AppCheckPlayIntegrityConfigResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [AppCheckPlayIntegrityConfig].
* @param name The _unique_ name of the resulting resource.
*/
public fun appCheckPlayIntegrityConfig(name: String): AppCheckPlayIntegrityConfig {
val builder = AppCheckPlayIntegrityConfigResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy