StandardAppVersion

class StandardAppVersion : KotlinCustomResource

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:

Example Usage

App Engine Standard App Version

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()
.location("US")
.build());
var object = new BucketObject("object", BucketObjectArgs.builder()
.bucket(bucket.name())
.source(new FileAsset("./test-fixtures/hello-world.zip"))
.build());
var myappV1 = new StandardAppVersion("myappV1", StandardAppVersionArgs.builder()
.versionId("v1")
.service("myapp")
.runtime("nodejs10")
.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("nodejs10")
.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());
}
}

Import

StandardAppVersion can be imported using any of these accepted formats

$ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default apps/{{project}}/services/{{service}}/versions/{{version_id}}
$ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default {{project}}/{{service}}/{{version_id}}
$ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default {{service}}/{{version_id}}

Properties

Link copied to clipboard
val appEngineApis: Output<Boolean>?

Allows App Engine second generation runtimes to access the legacy bundled services.

Link copied to clipboard

Automatic scaling is based on request rate, response latencies, and other application metrics. Structure is documented below.

Link copied to clipboard

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. Structure is documented below.

Link copied to clipboard

If set to true, the service will be deleted if it is the last version.

Link copied to clipboard

Code and application artifacts that make up this version. Structure is documented below.

Link copied to clipboard

The entrypoint for the application. Structure is documented below.

Link copied to clipboard
val envVariables: Output<Map<String, String>>?

Environment variables available to the application.

Link copied to clipboard

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. Structure is documented below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val inboundServices: Output<List<String>>?

A list of the types of messages that this application is able to receive. Each value may be one of: 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.

Link copied to clipboard
val instanceClass: Output<String>

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.

Link copied to clipboard

Configuration for third-party Python runtime libraries that are required by the application. Structure is documented below.

Link copied to clipboard

A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. Structure is documented below.

Link copied to clipboard
val name: Output<String>

The identifier for this object. Format specified above.

Link copied to clipboard
val noopOnDestroy: Output<Boolean>?

If set to true, the application version will not be deleted.

Link copied to clipboard
val project: Output<String>

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val runtime: Output<String>

Desired runtime. Example python27.

Link copied to clipboard

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/<language>/config/appref
Substitute <language> with python, java, php, ruby, go or nodejs.

Link copied to clipboard
val service: Output<String>

AppEngine service resource

Link copied to clipboard
val serviceAccount: Output<String>

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.

Link copied to clipboard
val threadsafe: Output<Boolean>?

Whether multiple requests can be dispatched to this version at once.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val versionId: Output<String>?

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-".

Link copied to clipboard

Enables VPC connectivity for standard apps. Structure is documented below.