Standard App Version Args
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:
How-to Guides
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}}
Constructors
Properties
Allows App Engine second generation runtimes to access the legacy bundled services.
Automatic scaling is based on request rate, response latencies, and other application metrics. Structure is documented below.
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.
If set to true
, the service will be deleted if it is the last version.
Code and application artifacts that make up this version. Structure is documented below.
The entrypoint for the application. Structure is documented below.
Environment variables available to the application.
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.
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
.
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.
Configuration for third-party Python runtime libraries that are required by the application. Structure is documented below.
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.
If set to true
, the application version will not be deleted.
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
.
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.
Whether multiple requests can be dispatched to this version at once.
Enables VPC connectivity for standard apps. Structure is documented below.