All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.firebase.kotlin.ExtensionsInstance.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.firebase.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.firebase.kotlin.outputs.ExtensionsInstanceConfig
import com.pulumi.gcp.firebase.kotlin.outputs.ExtensionsInstanceErrorStatus
import com.pulumi.gcp.firebase.kotlin.outputs.ExtensionsInstanceRuntimeData
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
import kotlin.collections.List
import com.pulumi.gcp.firebase.kotlin.outputs.ExtensionsInstanceConfig.Companion.toKotlin as extensionsInstanceConfigToKotlin
import com.pulumi.gcp.firebase.kotlin.outputs.ExtensionsInstanceErrorStatus.Companion.toKotlin as extensionsInstanceErrorStatusToKotlin
import com.pulumi.gcp.firebase.kotlin.outputs.ExtensionsInstanceRuntimeData.Companion.toKotlin as extensionsInstanceRuntimeDataToKotlin

/**
 * Builder for [ExtensionsInstance].
 */
@PulumiTagMarker
public class ExtensionsInstanceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ExtensionsInstanceArgs = ExtensionsInstanceArgs()

    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 ExtensionsInstanceArgsBuilder.() -> Unit) {
        val builder = ExtensionsInstanceArgsBuilder()
        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(): ExtensionsInstance {
        val builtJavaResource = com.pulumi.gcp.firebase.ExtensionsInstance(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ExtensionsInstance(builtJavaResource)
    }
}

/**
 * ## Example Usage
 * ### Firebase Extentions Instance Resize Image
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const images = new gcp.storage.Bucket("images", {
 *     project: "my-project-name",
 *     name: "bucket-id",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 *     forceDestroy: true,
 * });
 * const resizeImage = new gcp.firebase.ExtensionsInstance("resize_image", {
 *     project: "my-project-name",
 *     instanceId: "storage-resize-images",
 *     config: {
 *         extensionRef: "firebase/storage-resize-images",
 *         extensionVersion: "0.2.2",
 *         params: {
 *             DELETE_ORIGINAL_FILE: "false",
 *             MAKE_PUBLIC: "false",
 *             IMAGE_TYPE: "false",
 *             IS_ANIMATED: "true",
 *             FUNCTION_MEMORY: "1024",
 *             DO_BACKFILL: "false",
 *             IMG_SIZES: "200x200",
 *             IMG_BUCKET: images.name,
 *         },
 *         systemParams: {
 *             "firebaseextensions.v1beta.function/location": "",
 *             "firebaseextensions.v1beta.function/maxInstances": "3000",
 *             "firebaseextensions.v1beta.function/minInstances": "0",
 *             "firebaseextensions.v1beta.function/vpcConnectorEgressSettings": "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED",
 *         },
 *         allowedEventTypes: ["firebase.extensions.storage-resize-images.v1.onCompletion"],
 *         eventarcChannel: "projects/my-project-name/locations//channels/firebase",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * images = gcp.storage.Bucket("images",
 *     project="my-project-name",
 *     name="bucket-id",
 *     location="US",
 *     uniform_bucket_level_access=True,
 *     force_destroy=True)
 * resize_image = gcp.firebase.ExtensionsInstance("resize_image",
 *     project="my-project-name",
 *     instance_id="storage-resize-images",
 *     config=gcp.firebase.ExtensionsInstanceConfigArgs(
 *         extension_ref="firebase/storage-resize-images",
 *         extension_version="0.2.2",
 *         params={
 *             "DELETE_ORIGINAL_FILE": "false",
 *             "MAKE_PUBLIC": "false",
 *             "IMAGE_TYPE": "false",
 *             "IS_ANIMATED": "true",
 *             "FUNCTION_MEMORY": "1024",
 *             "DO_BACKFILL": "false",
 *             "IMG_SIZES": "200x200",
 *             "IMG_BUCKET": images.name,
 *         },
 *         system_params={
 *             "firebaseextensions.v1beta.function/location": "",
 *             "firebaseextensions.v1beta.function/maxInstances": "3000",
 *             "firebaseextensions.v1beta.function/minInstances": "0",
 *             "firebaseextensions.v1beta.function/vpcConnectorEgressSettings": "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED",
 *         },
 *         allowed_event_types=["firebase.extensions.storage-resize-images.v1.onCompletion"],
 *         eventarc_channel="projects/my-project-name/locations//channels/firebase",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var images = new Gcp.Storage.Bucket("images", new()
 *     {
 *         Project = "my-project-name",
 *         Name = "bucket-id",
 *         Location = "US",
 *         UniformBucketLevelAccess = true,
 *         ForceDestroy = true,
 *     });
 *     var resizeImage = new Gcp.Firebase.ExtensionsInstance("resize_image", new()
 *     {
 *         Project = "my-project-name",
 *         InstanceId = "storage-resize-images",
 *         Config = new Gcp.Firebase.Inputs.ExtensionsInstanceConfigArgs
 *         {
 *             ExtensionRef = "firebase/storage-resize-images",
 *             ExtensionVersion = "0.2.2",
 *             Params =
 *             {
 *                 { "DELETE_ORIGINAL_FILE", "false" },
 *                 { "MAKE_PUBLIC", "false" },
 *                 { "IMAGE_TYPE", "false" },
 *                 { "IS_ANIMATED", "true" },
 *                 { "FUNCTION_MEMORY", "1024" },
 *                 { "DO_BACKFILL", "false" },
 *                 { "IMG_SIZES", "200x200" },
 *                 { "IMG_BUCKET", images.Name },
 *             },
 *             SystemParams =
 *             {
 *                 { "firebaseextensions.v1beta.function/location", "" },
 *                 { "firebaseextensions.v1beta.function/maxInstances", "3000" },
 *                 { "firebaseextensions.v1beta.function/minInstances", "0" },
 *                 { "firebaseextensions.v1beta.function/vpcConnectorEgressSettings", "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED" },
 *             },
 *             AllowedEventTypes = new[]
 *             {
 *                 "firebase.extensions.storage-resize-images.v1.onCompletion",
 *             },
 *             EventarcChannel = "projects/my-project-name/locations//channels/firebase",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		images, err := storage.NewBucket(ctx, "images", &storage.BucketArgs{
 * 			Project:                  pulumi.String("my-project-name"),
 * 			Name:                     pulumi.String("bucket-id"),
 * 			Location:                 pulumi.String("US"),
 * 			UniformBucketLevelAccess: pulumi.Bool(true),
 * 			ForceDestroy:             pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = firebase.NewExtensionsInstance(ctx, "resize_image", &firebase.ExtensionsInstanceArgs{
 * 			Project:    pulumi.String("my-project-name"),
 * 			InstanceId: pulumi.String("storage-resize-images"),
 * 			Config: &firebase.ExtensionsInstanceConfigArgs{
 * 				ExtensionRef:     pulumi.String("firebase/storage-resize-images"),
 * 				ExtensionVersion: pulumi.String("0.2.2"),
 * 				Params: pulumi.StringMap{
 * 					"DELETE_ORIGINAL_FILE": pulumi.String("false"),
 * 					"MAKE_PUBLIC":          pulumi.String("false"),
 * 					"IMAGE_TYPE":           pulumi.String("false"),
 * 					"IS_ANIMATED":          pulumi.String("true"),
 * 					"FUNCTION_MEMORY":      pulumi.String("1024"),
 * 					"DO_BACKFILL":          pulumi.String("false"),
 * 					"IMG_SIZES":            pulumi.String("200x200"),
 * 					"IMG_BUCKET":           images.Name,
 * 				},
 * 				SystemParams: pulumi.StringMap{
 * 					"firebaseextensions.v1beta.function/location":                   pulumi.String(""),
 * 					"firebaseextensions.v1beta.function/maxInstances":               pulumi.String("3000"),
 * 					"firebaseextensions.v1beta.function/minInstances":               pulumi.String("0"),
 * 					"firebaseextensions.v1beta.function/vpcConnectorEgressSettings": pulumi.String("VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED"),
 * 				},
 * 				AllowedEventTypes: pulumi.StringArray{
 * 					pulumi.String("firebase.extensions.storage-resize-images.v1.onCompletion"),
 * 				},
 * 				EventarcChannel: pulumi.String("projects/my-project-name/locations//channels/firebase"),
 * 			},
 * 		})
 * 		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.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.firebase.ExtensionsInstance;
 * import com.pulumi.gcp.firebase.ExtensionsInstanceArgs;
 * import com.pulumi.gcp.firebase.inputs.ExtensionsInstanceConfigArgs;
 * 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 images = new Bucket("images", BucketArgs.builder()
 *             .project("my-project-name")
 *             .name("bucket-id")
 *             .location("US")
 *             .uniformBucketLevelAccess(true)
 *             .forceDestroy(true)
 *             .build());
 *         var resizeImage = new ExtensionsInstance("resizeImage", ExtensionsInstanceArgs.builder()
 *             .project("my-project-name")
 *             .instanceId("storage-resize-images")
 *             .config(ExtensionsInstanceConfigArgs.builder()
 *                 .extensionRef("firebase/storage-resize-images")
 *                 .extensionVersion("0.2.2")
 *                 .params(Map.ofEntries(
 *                     Map.entry("DELETE_ORIGINAL_FILE", false),
 *                     Map.entry("MAKE_PUBLIC", false),
 *                     Map.entry("IMAGE_TYPE", false),
 *                     Map.entry("IS_ANIMATED", true),
 *                     Map.entry("FUNCTION_MEMORY", 1024),
 *                     Map.entry("DO_BACKFILL", false),
 *                     Map.entry("IMG_SIZES", "200x200"),
 *                     Map.entry("IMG_BUCKET", images.name())
 *                 ))
 *                 .systemParams(Map.ofEntries(
 *                     Map.entry("firebaseextensions.v1beta.function/location", ""),
 *                     Map.entry("firebaseextensions.v1beta.function/maxInstances", 3000),
 *                     Map.entry("firebaseextensions.v1beta.function/minInstances", 0),
 *                     Map.entry("firebaseextensions.v1beta.function/vpcConnectorEgressSettings", "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED")
 *                 ))
 *                 .allowedEventTypes("firebase.extensions.storage-resize-images.v1.onCompletion")
 *                 .eventarcChannel("projects/my-project-name/locations//channels/firebase")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   images:
 *     type: gcp:storage:Bucket
 *     properties:
 *       project: my-project-name
 *       name: bucket-id
 *       location: US
 *       uniformBucketLevelAccess: true # Delete all objects when the bucket is deleted
 *       forceDestroy: true
 *   resizeImage:
 *     type: gcp:firebase:ExtensionsInstance
 *     name: resize_image
 *     properties:
 *       project: my-project-name
 *       instanceId: storage-resize-images
 *       config:
 *         extensionRef: firebase/storage-resize-images
 *         extensionVersion: 0.2.2
 *         params:
 *           DELETE_ORIGINAL_FILE: false
 *           MAKE_PUBLIC: false
 *           IMAGE_TYPE: false
 *           IS_ANIMATED: true
 *           FUNCTION_MEMORY: 1024
 *           DO_BACKFILL: false
 *           IMG_SIZES: 200x200
 *           IMG_BUCKET: ${images.name}
 *         systemParams:
 *           firebaseextensions.v1beta.function/location:
 *           firebaseextensions.v1beta.function/maxInstances: 3000
 *           firebaseextensions.v1beta.function/minInstances: 0
 *           firebaseextensions.v1beta.function/vpcConnectorEgressSettings: VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED
 *         allowedEventTypes:
 *           - firebase.extensions.storage-resize-images.v1.onCompletion
 *         eventarcChannel: projects/my-project-name/locations//channels/firebase
 * ```
 * 
 * ## Import
 * Instance can be imported using any of these accepted formats:
 * * `projects/{{project}}/instances/{{instance_id}}`
 * * `{{project}}/{{instance_id}}`
 * * `{{instance_id}}`
 * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:firebase/extensionsInstance:ExtensionsInstance default projects/{{project}}/instances/{{instance_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/extensionsInstance:ExtensionsInstance default {{project}}/{{instance_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:firebase/extensionsInstance:ExtensionsInstance default {{instance_id}}
 * ```
 */
public class ExtensionsInstance internal constructor(
    override val javaResource: com.pulumi.gcp.firebase.ExtensionsInstance,
) : KotlinCustomResource(javaResource, ExtensionsInstanceMapper) {
    /**
     * The current Config of the Extension Instance.
     * Structure is documented below.
     */
    public val config: Output
        get() = javaResource.config().applyValue({ args0 ->
            args0.let({ args0 ->
                extensionsInstanceConfigToKotlin(args0)
            })
        })

    /**
     * The time at which the Extension Instance was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * If this Instance has `state: ERRORED`, the error messages
     * will be found here.
     * Structure is documented below.
     */
    public val errorStatuses: Output>
        get() = javaResource.errorStatuses().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> extensionsInstanceErrorStatusToKotlin(args0) })
            })
        })

    /**
     * A weak etag that is computed by the server based on other configuration
     * values and may be sent on update and delete requests to ensure the
     * client has an up-to-date value before proceeding.
     */
    public val etag: Output
        get() = javaResource.etag().applyValue({ args0 -> args0 })

    /**
     * The ID to use for the Extension Instance, which will become the final
     * component of the instance's name.
     */
    public val instanceId: Output
        get() = javaResource.instanceId().applyValue({ args0 -> args0 })

    /**
     * The name of the last operation that acted on this Extension
     * Instance
     */
    public val lastOperationName: Output
        get() = javaResource.lastOperationName().applyValue({ args0 -> args0 })

    /**
     * The type of the last operation that acted on the Extension Instance.
     */
    public val lastOperationType: Output
        get() = javaResource.lastOperationType().applyValue({ args0 -> args0 })

    /**
     * The fully-qualified resource name of the Extension Instance.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Data set by the extension instance at runtime.
     * Structure is documented below.
     */
    public val runtimeDatas: Output>
        get() = javaResource.runtimeDatas().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    extensionsInstanceRuntimeDataToKotlin(args0)
                })
            })
        })

    /**
     * The email of the service account to be used at runtime by compute resources
     * created for the operation of the Extension instance.
     */
    public val serviceAccountEmail: Output
        get() = javaResource.serviceAccountEmail().applyValue({ args0 -> args0 })

    /**
     * The processing state of the extension instance.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * The time at which the Extension Instance was updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object ExtensionsInstanceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.firebase.ExtensionsInstance::class == javaResource::class

    override fun map(javaResource: Resource): ExtensionsInstance = ExtensionsInstance(
        javaResource as
            com.pulumi.gcp.firebase.ExtensionsInstance,
    )
}

/**
 * @see [ExtensionsInstance].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ExtensionsInstance].
 */
public suspend fun extensionsInstance(
    name: String,
    block: suspend ExtensionsInstanceResourceBuilder.() -> Unit,
): ExtensionsInstance {
    val builder = ExtensionsInstanceResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ExtensionsInstance].
 * @param name The _unique_ name of the resulting resource.
 */
public fun extensionsInstance(name: String): ExtensionsInstance {
    val builder = ExtensionsInstanceResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy