@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
225 lines • 10.5 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.StandardAppVersion = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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,
* });
* ```
*
* ## 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}}
* ```
*/
class StandardAppVersion extends pulumi.CustomResource {
/**
* Get an existing StandardAppVersion resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new StandardAppVersion(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of StandardAppVersion. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === StandardAppVersion.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appEngineApis"] = state ? state.appEngineApis : undefined;
resourceInputs["automaticScaling"] = state ? state.automaticScaling : undefined;
resourceInputs["basicScaling"] = state ? state.basicScaling : undefined;
resourceInputs["deleteServiceOnDestroy"] = state ? state.deleteServiceOnDestroy : undefined;
resourceInputs["deployment"] = state ? state.deployment : undefined;
resourceInputs["entrypoint"] = state ? state.entrypoint : undefined;
resourceInputs["envVariables"] = state ? state.envVariables : undefined;
resourceInputs["handlers"] = state ? state.handlers : undefined;
resourceInputs["inboundServices"] = state ? state.inboundServices : undefined;
resourceInputs["instanceClass"] = state ? state.instanceClass : undefined;
resourceInputs["libraries"] = state ? state.libraries : undefined;
resourceInputs["manualScaling"] = state ? state.manualScaling : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["noopOnDestroy"] = state ? state.noopOnDestroy : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["runtime"] = state ? state.runtime : undefined;
resourceInputs["runtimeApiVersion"] = state ? state.runtimeApiVersion : undefined;
resourceInputs["service"] = state ? state.service : undefined;
resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined;
resourceInputs["threadsafe"] = state ? state.threadsafe : undefined;
resourceInputs["versionId"] = state ? state.versionId : undefined;
resourceInputs["vpcAccessConnector"] = state ? state.vpcAccessConnector : undefined;
}
else {
const args = argsOrState;
if ((!args || args.deployment === undefined) && !opts.urn) {
throw new Error("Missing required property 'deployment'");
}
if ((!args || args.entrypoint === undefined) && !opts.urn) {
throw new Error("Missing required property 'entrypoint'");
}
if ((!args || args.runtime === undefined) && !opts.urn) {
throw new Error("Missing required property 'runtime'");
}
if ((!args || args.service === undefined) && !opts.urn) {
throw new Error("Missing required property 'service'");
}
resourceInputs["appEngineApis"] = args ? args.appEngineApis : undefined;
resourceInputs["automaticScaling"] = args ? args.automaticScaling : undefined;
resourceInputs["basicScaling"] = args ? args.basicScaling : undefined;
resourceInputs["deleteServiceOnDestroy"] = args ? args.deleteServiceOnDestroy : undefined;
resourceInputs["deployment"] = args ? args.deployment : undefined;
resourceInputs["entrypoint"] = args ? args.entrypoint : undefined;
resourceInputs["envVariables"] = args ? args.envVariables : undefined;
resourceInputs["handlers"] = args ? args.handlers : undefined;
resourceInputs["inboundServices"] = args ? args.inboundServices : undefined;
resourceInputs["instanceClass"] = args ? args.instanceClass : undefined;
resourceInputs["libraries"] = args ? args.libraries : undefined;
resourceInputs["manualScaling"] = args ? args.manualScaling : undefined;
resourceInputs["noopOnDestroy"] = args ? args.noopOnDestroy : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["runtime"] = args ? args.runtime : undefined;
resourceInputs["runtimeApiVersion"] = args ? args.runtimeApiVersion : undefined;
resourceInputs["service"] = args ? args.service : undefined;
resourceInputs["serviceAccount"] = args ? args.serviceAccount : undefined;
resourceInputs["threadsafe"] = args ? args.threadsafe : undefined;
resourceInputs["versionId"] = args ? args.versionId : undefined;
resourceInputs["vpcAccessConnector"] = args ? args.vpcAccessConnector : undefined;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StandardAppVersion.__pulumiType, name, resourceInputs, opts);
}
}
exports.StandardAppVersion = StandardAppVersion;
/** @internal */
StandardAppVersion.__pulumiType = 'gcp:appengine/standardAppVersion:StandardAppVersion';
//# sourceMappingURL=standardAppVersion.js.map