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

com.pulumi.gcp.appengine.kotlin.StandardAppVersion.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.appengine.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionAutomaticScaling
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionBasicScaling
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionDeployment
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionEntrypoint
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionHandler
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionLibrary
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionManualScaling
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionVpcAccessConnector
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 kotlin.collections.Map
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionAutomaticScaling.Companion.toKotlin as standardAppVersionAutomaticScalingToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionBasicScaling.Companion.toKotlin as standardAppVersionBasicScalingToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionDeployment.Companion.toKotlin as standardAppVersionDeploymentToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionEntrypoint.Companion.toKotlin as standardAppVersionEntrypointToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionHandler.Companion.toKotlin as standardAppVersionHandlerToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionLibrary.Companion.toKotlin as standardAppVersionLibraryToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionManualScaling.Companion.toKotlin as standardAppVersionManualScalingToKotlin
import com.pulumi.gcp.appengine.kotlin.outputs.StandardAppVersionVpcAccessConnector.Companion.toKotlin as standardAppVersionVpcAccessConnectorToKotlin

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

    public var args: StandardAppVersionArgs = StandardAppVersionArgs()

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

/**
 * Standard App Version resource to create a new version of standard GAE Application.
 * Learn about the differences between the standard environment and the flexible environment
 * at https://cloud.google.com/appengine/docs/the-appengine-environments.
 * Currently supporting Zip and File Containers.
 * To get more information about StandardAppVersion, see:
 * * [API documentation](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/appengine/docs/standard)
 * ## Example Usage
 * ### App Engine Standard App Version
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const customServiceAccount = new gcp.serviceaccount.Account("custom_service_account", {
 *     accountId: "my-account",
 *     displayName: "Custom Service Account",
 * });
 * const gaeApi = new gcp.projects.IAMMember("gae_api", {
 *     project: customServiceAccount.project,
 *     role: "roles/compute.networkUser",
 *     member: pulumi.interpolate`serviceAccount:${customServiceAccount.email}`,
 * });
 * const storageViewer = new gcp.projects.IAMMember("storage_viewer", {
 *     project: customServiceAccount.project,
 *     role: "roles/storage.objectViewer",
 *     member: pulumi.interpolate`serviceAccount:${customServiceAccount.email}`,
 * });
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "appengine-static-content",
 *     location: "US",
 * });
 * const object = new gcp.storage.BucketObject("object", {
 *     name: "hello-world.zip",
 *     bucket: bucket.name,
 *     source: new pulumi.asset.FileAsset("./test-fixtures/hello-world.zip"),
 * });
 * const myappV1 = new gcp.appengine.StandardAppVersion("myapp_v1", {
 *     versionId: "v1",
 *     service: "myapp",
 *     runtime: "nodejs20",
 *     entrypoint: {
 *         shell: "node ./app.js",
 *     },
 *     deployment: {
 *         zip: {
 *             sourceUrl: pulumi.interpolate`https://storage.googleapis.com/${bucket.name}/${object.name}`,
 *         },
 *     },
 *     envVariables: {
 *         port: "8080",
 *     },
 *     automaticScaling: {
 *         maxConcurrentRequests: 10,
 *         minIdleInstances: 1,
 *         maxIdleInstances: 3,
 *         minPendingLatency: "1s",
 *         maxPendingLatency: "5s",
 *         standardSchedulerSettings: {
 *             targetCpuUtilization: 0.5,
 *             targetThroughputUtilization: 0.75,
 *             minInstances: 2,
 *             maxInstances: 10,
 *         },
 *     },
 *     deleteServiceOnDestroy: true,
 *     serviceAccount: customServiceAccount.email,
 * });
 * const myappV2 = new gcp.appengine.StandardAppVersion("myapp_v2", {
 *     versionId: "v2",
 *     service: "myapp",
 *     runtime: "nodejs20",
 *     appEngineApis: true,
 *     entrypoint: {
 *         shell: "node ./app.js",
 *     },
 *     deployment: {
 *         zip: {
 *             sourceUrl: pulumi.interpolate`https://storage.googleapis.com/${bucket.name}/${object.name}`,
 *         },
 *     },
 *     envVariables: {
 *         port: "8080",
 *     },
 *     basicScaling: {
 *         maxInstances: 5,
 *     },
 *     noopOnDestroy: true,
 *     serviceAccount: customServiceAccount.email,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * custom_service_account = gcp.serviceaccount.Account("custom_service_account",
 *     account_id="my-account",
 *     display_name="Custom Service Account")
 * gae_api = gcp.projects.IAMMember("gae_api",
 *     project=custom_service_account.project,
 *     role="roles/compute.networkUser",
 *     member=custom_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
 * storage_viewer = gcp.projects.IAMMember("storage_viewer",
 *     project=custom_service_account.project,
 *     role="roles/storage.objectViewer",
 *     member=custom_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
 * bucket = gcp.storage.Bucket("bucket",
 *     name="appengine-static-content",
 *     location="US")
 * object = gcp.storage.BucketObject("object",
 *     name="hello-world.zip",
 *     bucket=bucket.name,
 *     source=pulumi.FileAsset("./test-fixtures/hello-world.zip"))
 * myapp_v1 = gcp.appengine.StandardAppVersion("myapp_v1",
 *     version_id="v1",
 *     service="myapp",
 *     runtime="nodejs20",
 *     entrypoint=gcp.appengine.StandardAppVersionEntrypointArgs(
 *         shell="node ./app.js",
 *     ),
 *     deployment=gcp.appengine.StandardAppVersionDeploymentArgs(
 *         zip=gcp.appengine.StandardAppVersionDeploymentZipArgs(
 *             source_url=pulumi.Output.all(bucket.name, object.name).apply(lambda bucketName, objectName: f"https://storage.googleapis.com/{bucket_name}/{object_name}"),
 *         ),
 *     ),
 *     env_variables={
 *         "port": "8080",
 *     },
 *     automatic_scaling=gcp.appengine.StandardAppVersionAutomaticScalingArgs(
 *         max_concurrent_requests=10,
 *         min_idle_instances=1,
 *         max_idle_instances=3,
 *         min_pending_latency="1s",
 *         max_pending_latency="5s",
 *         standard_scheduler_settings=gcp.appengine.StandardAppVersionAutomaticScalingStandardSchedulerSettingsArgs(
 *             target_cpu_utilization=0.5,
 *             target_throughput_utilization=0.75,
 *             min_instances=2,
 *             max_instances=10,
 *         ),
 *     ),
 *     delete_service_on_destroy=True,
 *     service_account=custom_service_account.email)
 * myapp_v2 = gcp.appengine.StandardAppVersion("myapp_v2",
 *     version_id="v2",
 *     service="myapp",
 *     runtime="nodejs20",
 *     app_engine_apis=True,
 *     entrypoint=gcp.appengine.StandardAppVersionEntrypointArgs(
 *         shell="node ./app.js",
 *     ),
 *     deployment=gcp.appengine.StandardAppVersionDeploymentArgs(
 *         zip=gcp.appengine.StandardAppVersionDeploymentZipArgs(
 *             source_url=pulumi.Output.all(bucket.name, object.name).apply(lambda bucketName, objectName: f"https://storage.googleapis.com/{bucket_name}/{object_name}"),
 *         ),
 *     ),
 *     env_variables={
 *         "port": "8080",
 *     },
 *     basic_scaling=gcp.appengine.StandardAppVersionBasicScalingArgs(
 *         max_instances=5,
 *     ),
 *     noop_on_destroy=True,
 *     service_account=custom_service_account.email)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var customServiceAccount = new Gcp.ServiceAccount.Account("custom_service_account", new()
 *     {
 *         AccountId = "my-account",
 *         DisplayName = "Custom Service Account",
 *     });
 *     var gaeApi = new Gcp.Projects.IAMMember("gae_api", new()
 *     {
 *         Project = customServiceAccount.Project,
 *         Role = "roles/compute.networkUser",
 *         Member = customServiceAccount.Email.Apply(email => $"serviceAccount:{email}"),
 *     });
 *     var storageViewer = new Gcp.Projects.IAMMember("storage_viewer", new()
 *     {
 *         Project = customServiceAccount.Project,
 *         Role = "roles/storage.objectViewer",
 *         Member = customServiceAccount.Email.Apply(email => $"serviceAccount:{email}"),
 *     });
 *     var bucket = new Gcp.Storage.Bucket("bucket", new()
 *     {
 *         Name = "appengine-static-content",
 *         Location = "US",
 *     });
 *     var @object = new Gcp.Storage.BucketObject("object", new()
 *     {
 *         Name = "hello-world.zip",
 *         Bucket = bucket.Name,
 *         Source = new FileAsset("./test-fixtures/hello-world.zip"),
 *     });
 *     var myappV1 = new Gcp.AppEngine.StandardAppVersion("myapp_v1", new()
 *     {
 *         VersionId = "v1",
 *         Service = "myapp",
 *         Runtime = "nodejs20",
 *         Entrypoint = new Gcp.AppEngine.Inputs.StandardAppVersionEntrypointArgs
 *         {
 *             Shell = "node ./app.js",
 *         },
 *         Deployment = new Gcp.AppEngine.Inputs.StandardAppVersionDeploymentArgs
 *         {
 *             Zip = new Gcp.AppEngine.Inputs.StandardAppVersionDeploymentZipArgs
 *             {
 *                 SourceUrl = Output.Tuple(bucket.Name, @object.Name).Apply(values =>
 *                 {
 *                     var bucketName = values.Item1;
 *                     var objectName = values.Item2;
 *                     return $"https://storage.googleapis.com/{bucketName}/{objectName}";
 *                 }),
 *             },
 *         },
 *         EnvVariables =
 *         {
 *             { "port", "8080" },
 *         },
 *         AutomaticScaling = new Gcp.AppEngine.Inputs.StandardAppVersionAutomaticScalingArgs
 *         {
 *             MaxConcurrentRequests = 10,
 *             MinIdleInstances = 1,
 *             MaxIdleInstances = 3,
 *             MinPendingLatency = "1s",
 *             MaxPendingLatency = "5s",
 *             StandardSchedulerSettings = new Gcp.AppEngine.Inputs.StandardAppVersionAutomaticScalingStandardSchedulerSettingsArgs
 *             {
 *                 TargetCpuUtilization = 0.5,
 *                 TargetThroughputUtilization = 0.75,
 *                 MinInstances = 2,
 *                 MaxInstances = 10,
 *             },
 *         },
 *         DeleteServiceOnDestroy = true,
 *         ServiceAccount = customServiceAccount.Email,
 *     });
 *     var myappV2 = new Gcp.AppEngine.StandardAppVersion("myapp_v2", new()
 *     {
 *         VersionId = "v2",
 *         Service = "myapp",
 *         Runtime = "nodejs20",
 *         AppEngineApis = true,
 *         Entrypoint = new Gcp.AppEngine.Inputs.StandardAppVersionEntrypointArgs
 *         {
 *             Shell = "node ./app.js",
 *         },
 *         Deployment = new Gcp.AppEngine.Inputs.StandardAppVersionDeploymentArgs
 *         {
 *             Zip = new Gcp.AppEngine.Inputs.StandardAppVersionDeploymentZipArgs
 *             {
 *                 SourceUrl = Output.Tuple(bucket.Name, @object.Name).Apply(values =>
 *                 {
 *                     var bucketName = values.Item1;
 *                     var objectName = values.Item2;
 *                     return $"https://storage.googleapis.com/{bucketName}/{objectName}";
 *                 }),
 *             },
 *         },
 *         EnvVariables =
 *         {
 *             { "port", "8080" },
 *         },
 *         BasicScaling = new Gcp.AppEngine.Inputs.StandardAppVersionBasicScalingArgs
 *         {
 *             MaxInstances = 5,
 *         },
 *         NoopOnDestroy = true,
 *         ServiceAccount = customServiceAccount.Email,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/appengine"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
 * 	"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 {
 * 		customServiceAccount, err := serviceaccount.NewAccount(ctx, "custom_service_account", &serviceaccount.AccountArgs{
 * 			AccountId:   pulumi.String("my-account"),
 * 			DisplayName: pulumi.String("Custom Service Account"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = projects.NewIAMMember(ctx, "gae_api", &projects.IAMMemberArgs{
 * 			Project: customServiceAccount.Project,
 * 			Role:    pulumi.String("roles/compute.networkUser"),
 * 			Member: customServiceAccount.Email.ApplyT(func(email string) (string, error) {
 * 				return fmt.Sprintf("serviceAccount:%v", email), nil
 * 			}).(pulumi.StringOutput),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = projects.NewIAMMember(ctx, "storage_viewer", &projects.IAMMemberArgs{
 * 			Project: customServiceAccount.Project,
 * 			Role:    pulumi.String("roles/storage.objectViewer"),
 * 			Member: customServiceAccount.Email.ApplyT(func(email string) (string, error) {
 * 				return fmt.Sprintf("serviceAccount:%v", email), nil
 * 			}).(pulumi.StringOutput),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
 * 			Name:     pulumi.String("appengine-static-content"),
 * 			Location: pulumi.String("US"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		object, err := storage.NewBucketObject(ctx, "object", &storage.BucketObjectArgs{
 * 			Name:   pulumi.String("hello-world.zip"),
 * 			Bucket: bucket.Name,
 * 			Source: pulumi.NewFileAsset("./test-fixtures/hello-world.zip"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appengine.NewStandardAppVersion(ctx, "myapp_v1", &appengine.StandardAppVersionArgs{
 * 			VersionId: pulumi.String("v1"),
 * 			Service:   pulumi.String("myapp"),
 * 			Runtime:   pulumi.String("nodejs20"),
 * 			Entrypoint: &appengine.StandardAppVersionEntrypointArgs{
 * 				Shell: pulumi.String("node ./app.js"),
 * 			},
 * 			Deployment: &appengine.StandardAppVersionDeploymentArgs{
 * 				Zip: &appengine.StandardAppVersionDeploymentZipArgs{
 * 					SourceUrl: pulumi.All(bucket.Name, object.Name).ApplyT(func(_args []interface{}) (string, error) {
 * 						bucketName := _args[0].(string)
 * 						objectName := _args[1].(string)
 * 						return fmt.Sprintf("https://storage.googleapis.com/%v/%v", bucketName, objectName), nil
 * 					}).(pulumi.StringOutput),
 * 				},
 * 			},
 * 			EnvVariables: pulumi.StringMap{
 * 				"port": pulumi.String("8080"),
 * 			},
 * 			AutomaticScaling: &appengine.StandardAppVersionAutomaticScalingArgs{
 * 				MaxConcurrentRequests: pulumi.Int(10),
 * 				MinIdleInstances:      pulumi.Int(1),
 * 				MaxIdleInstances:      pulumi.Int(3),
 * 				MinPendingLatency:     pulumi.String("1s"),
 * 				MaxPendingLatency:     pulumi.String("5s"),
 * 				StandardSchedulerSettings: &appengine.StandardAppVersionAutomaticScalingStandardSchedulerSettingsArgs{
 * 					TargetCpuUtilization:        pulumi.Float64(0.5),
 * 					TargetThroughputUtilization: pulumi.Float64(0.75),
 * 					MinInstances:                pulumi.Int(2),
 * 					MaxInstances:                pulumi.Int(10),
 * 				},
 * 			},
 * 			DeleteServiceOnDestroy: pulumi.Bool(true),
 * 			ServiceAccount:         customServiceAccount.Email,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appengine.NewStandardAppVersion(ctx, "myapp_v2", &appengine.StandardAppVersionArgs{
 * 			VersionId:     pulumi.String("v2"),
 * 			Service:       pulumi.String("myapp"),
 * 			Runtime:       pulumi.String("nodejs20"),
 * 			AppEngineApis: pulumi.Bool(true),
 * 			Entrypoint: &appengine.StandardAppVersionEntrypointArgs{
 * 				Shell: pulumi.String("node ./app.js"),
 * 			},
 * 			Deployment: &appengine.StandardAppVersionDeploymentArgs{
 * 				Zip: &appengine.StandardAppVersionDeploymentZipArgs{
 * 					SourceUrl: pulumi.All(bucket.Name, object.Name).ApplyT(func(_args []interface{}) (string, error) {
 * 						bucketName := _args[0].(string)
 * 						objectName := _args[1].(string)
 * 						return fmt.Sprintf("https://storage.googleapis.com/%v/%v", bucketName, objectName), nil
 * 					}).(pulumi.StringOutput),
 * 				},
 * 			},
 * 			EnvVariables: pulumi.StringMap{
 * 				"port": pulumi.String("8080"),
 * 			},
 * 			BasicScaling: &appengine.StandardAppVersionBasicScalingArgs{
 * 				MaxInstances: pulumi.Int(5),
 * 			},
 * 			NoopOnDestroy:  pulumi.Bool(true),
 * 			ServiceAccount: customServiceAccount.Email,
 * 		})
 * 		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.serviceaccount.Account;
 * import com.pulumi.gcp.serviceaccount.AccountArgs;
 * import com.pulumi.gcp.projects.IAMMember;
 * import com.pulumi.gcp.projects.IAMMemberArgs;
 * import com.pulumi.gcp.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.storage.BucketObject;
 * import com.pulumi.gcp.storage.BucketObjectArgs;
 * import com.pulumi.gcp.appengine.StandardAppVersion;
 * import com.pulumi.gcp.appengine.StandardAppVersionArgs;
 * import com.pulumi.gcp.appengine.inputs.StandardAppVersionEntrypointArgs;
 * import com.pulumi.gcp.appengine.inputs.StandardAppVersionDeploymentArgs;
 * import com.pulumi.gcp.appengine.inputs.StandardAppVersionDeploymentZipArgs;
 * import com.pulumi.gcp.appengine.inputs.StandardAppVersionAutomaticScalingArgs;
 * import com.pulumi.gcp.appengine.inputs.StandardAppVersionAutomaticScalingStandardSchedulerSettingsArgs;
 * import com.pulumi.gcp.appengine.inputs.StandardAppVersionBasicScalingArgs;
 * import com.pulumi.asset.FileAsset;
 * 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 customServiceAccount = new Account("customServiceAccount", AccountArgs.builder()
 *             .accountId("my-account")
 *             .displayName("Custom Service Account")
 *             .build());
 *         var gaeApi = new IAMMember("gaeApi", IAMMemberArgs.builder()
 *             .project(customServiceAccount.project())
 *             .role("roles/compute.networkUser")
 *             .member(customServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
 *             .build());
 *         var storageViewer = new IAMMember("storageViewer", IAMMemberArgs.builder()
 *             .project(customServiceAccount.project())
 *             .role("roles/storage.objectViewer")
 *             .member(customServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
 *             .build());
 *         var bucket = new Bucket("bucket", BucketArgs.builder()
 *             .name("appengine-static-content")
 *             .location("US")
 *             .build());
 *         var object = new BucketObject("object", BucketObjectArgs.builder()
 *             .name("hello-world.zip")
 *             .bucket(bucket.name())
 *             .source(new FileAsset("./test-fixtures/hello-world.zip"))
 *             .build());
 *         var myappV1 = new StandardAppVersion("myappV1", StandardAppVersionArgs.builder()
 *             .versionId("v1")
 *             .service("myapp")
 *             .runtime("nodejs20")
 *             .entrypoint(StandardAppVersionEntrypointArgs.builder()
 *                 .shell("node ./app.js")
 *                 .build())
 *             .deployment(StandardAppVersionDeploymentArgs.builder()
 *                 .zip(StandardAppVersionDeploymentZipArgs.builder()
 *                     .sourceUrl(Output.tuple(bucket.name(), object.name()).applyValue(values -> {
 *                         var bucketName = values.t1;
 *                         var objectName = values.t2;
 *                         return String.format("https://storage.googleapis.com/%s/%s", bucketName,objectName);
 *                     }))
 *                     .build())
 *                 .build())
 *             .envVariables(Map.of("port", "8080"))
 *             .automaticScaling(StandardAppVersionAutomaticScalingArgs.builder()
 *                 .maxConcurrentRequests(10)
 *                 .minIdleInstances(1)
 *                 .maxIdleInstances(3)
 *                 .minPendingLatency("1s")
 *                 .maxPendingLatency("5s")
 *                 .standardSchedulerSettings(StandardAppVersionAutomaticScalingStandardSchedulerSettingsArgs.builder()
 *                     .targetCpuUtilization(0.5)
 *                     .targetThroughputUtilization(0.75)
 *                     .minInstances(2)
 *                     .maxInstances(10)
 *                     .build())
 *                 .build())
 *             .deleteServiceOnDestroy(true)
 *             .serviceAccount(customServiceAccount.email())
 *             .build());
 *         var myappV2 = new StandardAppVersion("myappV2", StandardAppVersionArgs.builder()
 *             .versionId("v2")
 *             .service("myapp")
 *             .runtime("nodejs20")
 *             .appEngineApis(true)
 *             .entrypoint(StandardAppVersionEntrypointArgs.builder()
 *                 .shell("node ./app.js")
 *                 .build())
 *             .deployment(StandardAppVersionDeploymentArgs.builder()
 *                 .zip(StandardAppVersionDeploymentZipArgs.builder()
 *                     .sourceUrl(Output.tuple(bucket.name(), object.name()).applyValue(values -> {
 *                         var bucketName = values.t1;
 *                         var objectName = values.t2;
 *                         return String.format("https://storage.googleapis.com/%s/%s", bucketName,objectName);
 *                     }))
 *                     .build())
 *                 .build())
 *             .envVariables(Map.of("port", "8080"))
 *             .basicScaling(StandardAppVersionBasicScalingArgs.builder()
 *                 .maxInstances(5)
 *                 .build())
 *             .noopOnDestroy(true)
 *             .serviceAccount(customServiceAccount.email())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   customServiceAccount:
 *     type: gcp:serviceaccount:Account
 *     name: custom_service_account
 *     properties:
 *       accountId: my-account
 *       displayName: Custom Service Account
 *   gaeApi:
 *     type: gcp:projects:IAMMember
 *     name: gae_api
 *     properties:
 *       project: ${customServiceAccount.project}
 *       role: roles/compute.networkUser
 *       member: serviceAccount:${customServiceAccount.email}
 *   storageViewer:
 *     type: gcp:projects:IAMMember
 *     name: storage_viewer
 *     properties:
 *       project: ${customServiceAccount.project}
 *       role: roles/storage.objectViewer
 *       member: serviceAccount:${customServiceAccount.email}
 *   myappV1:
 *     type: gcp:appengine:StandardAppVersion
 *     name: myapp_v1
 *     properties:
 *       versionId: v1
 *       service: myapp
 *       runtime: nodejs20
 *       entrypoint:
 *         shell: node ./app.js
 *       deployment:
 *         zip:
 *           sourceUrl: https://storage.googleapis.com/${bucket.name}/${object.name}
 *       envVariables:
 *         port: '8080'
 *       automaticScaling:
 *         maxConcurrentRequests: 10
 *         minIdleInstances: 1
 *         maxIdleInstances: 3
 *         minPendingLatency: 1s
 *         maxPendingLatency: 5s
 *         standardSchedulerSettings:
 *           targetCpuUtilization: 0.5
 *           targetThroughputUtilization: 0.75
 *           minInstances: 2
 *           maxInstances: 10
 *       deleteServiceOnDestroy: true
 *       serviceAccount: ${customServiceAccount.email}
 *   myappV2:
 *     type: gcp:appengine:StandardAppVersion
 *     name: myapp_v2
 *     properties:
 *       versionId: v2
 *       service: myapp
 *       runtime: nodejs20
 *       appEngineApis: true
 *       entrypoint:
 *         shell: node ./app.js
 *       deployment:
 *         zip:
 *           sourceUrl: https://storage.googleapis.com/${bucket.name}/${object.name}
 *       envVariables:
 *         port: '8080'
 *       basicScaling:
 *         maxInstances: 5
 *       noopOnDestroy: true
 *       serviceAccount: ${customServiceAccount.email}
 *   bucket:
 *     type: gcp:storage:Bucket
 *     properties:
 *       name: appengine-static-content
 *       location: US
 *   object:
 *     type: gcp:storage:BucketObject
 *     properties:
 *       name: hello-world.zip
 *       bucket: ${bucket.name}
 *       source:
 *         fn::FileAsset: ./test-fixtures/hello-world.zip
 * ```
 * 
 * ## Import
 * StandardAppVersion can be imported using any of these accepted formats:
 * * `apps/{{project}}/services/{{service}}/versions/{{version_id}}`
 * * `{{project}}/{{service}}/{{version_id}}`
 * * `{{service}}/{{version_id}}`
 * When using the `pulumi import` command, StandardAppVersion can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default apps/{{project}}/services/{{service}}/versions/{{version_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default {{project}}/{{service}}/{{version_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default {{service}}/{{version_id}}
 * ```
 */
public class StandardAppVersion internal constructor(
    override val javaResource: com.pulumi.gcp.appengine.StandardAppVersion,
) : KotlinCustomResource(javaResource, StandardAppVersionMapper) {
    /**
     * Allows App Engine second generation runtimes to access the legacy bundled services.
     */
    public val appEngineApis: Output?
        get() = javaResource.appEngineApis().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Automatic scaling is based on request rate, response latencies, and other application metrics.
     */
    public val automaticScaling: Output?
        get() = javaResource.automaticScaling().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> standardAppVersionAutomaticScalingToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Basic scaling creates instances when your application receives requests. Each instance will be shut down when the
     * application becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.
     */
    public val basicScaling: Output?
        get() = javaResource.basicScaling().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    standardAppVersionBasicScalingToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * If set to 'true', the service will be deleted if it is the last version.
     */
    public val deleteServiceOnDestroy: Output?
        get() = javaResource.deleteServiceOnDestroy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Code and application artifacts that make up this version.
     * Structure is documented below.
     */
    public val deployment: Output
        get() = javaResource.deployment().applyValue({ args0 ->
            args0.let({ args0 ->
                standardAppVersionDeploymentToKotlin(args0)
            })
        })

    /**
     * The entrypoint for the application.
     * Structure is documented below.
     */
    public val entrypoint: Output
        get() = javaResource.entrypoint().applyValue({ args0 ->
            args0.let({ args0 ->
                standardAppVersionEntrypointToKotlin(args0)
            })
        })

    /**
     * Environment variables available to the application.
     */
    public val envVariables: Output>?
        get() = javaResource.envVariables().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the
     * request and other request handlers are not attempted.
     */
    public val handlers: Output>
        get() = javaResource.handlers().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    standardAppVersionHandlerToKotlin(args0)
                })
            })
        })

    /**
     * A list of the types of messages that this application is able to receive. Possible values: ["INBOUND_SERVICE_MAIL",
     * "INBOUND_SERVICE_MAIL_BOUNCE", "INBOUND_SERVICE_XMPP_ERROR", "INBOUND_SERVICE_XMPP_MESSAGE",
     * "INBOUND_SERVICE_XMPP_SUBSCRIBE", "INBOUND_SERVICE_XMPP_PRESENCE", "INBOUND_SERVICE_CHANNEL_PRESENCE",
     * "INBOUND_SERVICE_WARMUP"]
     */
    public val inboundServices: Output>?
        get() = javaResource.inboundServices().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Instance class that is used to run this version. Valid values are AutomaticScaling: F1, F2, F4, F4_1G BasicScaling or
     * ManualScaling: B1, B2, B4, B4_1G, B8 Defaults to F1 for AutomaticScaling and B2 for ManualScaling and BasicScaling. If
     * no scaling is specified, AutomaticScaling is chosen.
     */
    public val instanceClass: Output
        get() = javaResource.instanceClass().applyValue({ args0 -> args0 })

    /**
     * Configuration for third-party Python runtime libraries that are required by the application.
     */
    public val libraries: Output>?
        get() = javaResource.libraries().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> standardAppVersionLibraryToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
     * its memory over time.
     */
    public val manualScaling: Output?
        get() = javaResource.manualScaling().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> standardAppVersionManualScalingToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Full path to the Version resource in the API. Example, "v1".
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * If set to 'true', the application version will not be deleted.
     */
    public val noopOnDestroy: Output?
        get() = javaResource.noopOnDestroy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * Desired runtime. Example python27.
     */
    public val runtime: Output
        get() = javaResource.runtime().applyValue({ args0 -> args0 })

    /**
     * The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at
     * 'https://cloud.google.com/appengine/docs/standard//config/appref'\ Substitute '' with 'python',
     * 'java', 'php', 'ruby', 'go' or 'nodejs'.
     */
    public val runtimeApiVersion: Output?
        get() = javaResource.runtimeApiVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * AppEngine service resource
     */
    public val service: Output
        get() = javaResource.service().applyValue({ args0 -> args0 })

    /**
     * The identity that the deployed version will run as. Admin API will use the App Engine Appspot service account as default
     * if this field is neither provided in app.yaml file nor through CLI flag.
     */
    public val serviceAccount: Output
        get() = javaResource.serviceAccount().applyValue({ args0 -> args0 })

    /**
     * Whether multiple requests can be dispatched to this version at once.
     */
    public val threadsafe: Output?
        get() = javaResource.threadsafe().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Relative name of the version within the service. For example, 'v1'. Version names can contain only lowercase letters,
     * numbers, or hyphens. Reserved names,"default", "latest", and any name with the prefix "ah-".
     */
    public val versionId: Output?
        get() = javaResource.versionId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Enables VPC connectivity for standard apps.
     */
    public val vpcAccessConnector: Output?
        get() = javaResource.vpcAccessConnector().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> standardAppVersionVpcAccessConnectorToKotlin(args0) })
            }).orElse(null)
        })
}

public object StandardAppVersionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.appengine.StandardAppVersion::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy