@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
242 lines • 10.7 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StandardAppVersion = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(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}}
* $ pulumi import gcp:appengine/standardAppVersion:StandardAppVersion default {{project}}/{{service}}/{{version_id}}
* $ 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, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:appengine/standardAppVersion:StandardAppVersion';
/**
* 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?.appEngineApis;
resourceInputs["automaticScaling"] = state?.automaticScaling;
resourceInputs["basicScaling"] = state?.basicScaling;
resourceInputs["deleteServiceOnDestroy"] = state?.deleteServiceOnDestroy;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["deployment"] = state?.deployment;
resourceInputs["entrypoint"] = state?.entrypoint;
resourceInputs["envVariables"] = state?.envVariables;
resourceInputs["handlers"] = state?.handlers;
resourceInputs["inboundServices"] = state?.inboundServices;
resourceInputs["instanceClass"] = state?.instanceClass;
resourceInputs["libraries"] = state?.libraries;
resourceInputs["manualScaling"] = state?.manualScaling;
resourceInputs["name"] = state?.name;
resourceInputs["noopOnDestroy"] = state?.noopOnDestroy;
resourceInputs["project"] = state?.project;
resourceInputs["runtime"] = state?.runtime;
resourceInputs["runtimeApiVersion"] = state?.runtimeApiVersion;
resourceInputs["service"] = state?.service;
resourceInputs["serviceAccount"] = state?.serviceAccount;
resourceInputs["threadsafe"] = state?.threadsafe;
resourceInputs["versionId"] = state?.versionId;
resourceInputs["vpcAccessConnector"] = state?.vpcAccessConnector;
}
else {
const args = argsOrState;
if (args?.deployment === undefined && !opts.urn) {
throw new Error("Missing required property 'deployment'");
}
if (args?.entrypoint === undefined && !opts.urn) {
throw new Error("Missing required property 'entrypoint'");
}
if (args?.runtime === undefined && !opts.urn) {
throw new Error("Missing required property 'runtime'");
}
if (args?.service === undefined && !opts.urn) {
throw new Error("Missing required property 'service'");
}
resourceInputs["appEngineApis"] = args?.appEngineApis;
resourceInputs["automaticScaling"] = args?.automaticScaling;
resourceInputs["basicScaling"] = args?.basicScaling;
resourceInputs["deleteServiceOnDestroy"] = args?.deleteServiceOnDestroy;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["deployment"] = args?.deployment;
resourceInputs["entrypoint"] = args?.entrypoint;
resourceInputs["envVariables"] = args?.envVariables;
resourceInputs["handlers"] = args?.handlers;
resourceInputs["inboundServices"] = args?.inboundServices;
resourceInputs["instanceClass"] = args?.instanceClass;
resourceInputs["libraries"] = args?.libraries;
resourceInputs["manualScaling"] = args?.manualScaling;
resourceInputs["noopOnDestroy"] = args?.noopOnDestroy;
resourceInputs["project"] = args?.project;
resourceInputs["runtime"] = args?.runtime;
resourceInputs["runtimeApiVersion"] = args?.runtimeApiVersion;
resourceInputs["service"] = args?.service;
resourceInputs["serviceAccount"] = args?.serviceAccount;
resourceInputs["threadsafe"] = args?.threadsafe;
resourceInputs["versionId"] = args?.versionId;
resourceInputs["vpcAccessConnector"] = args?.vpcAccessConnector;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StandardAppVersion.__pulumiType, name, resourceInputs, opts);
}
}
exports.StandardAppVersion = StandardAppVersion;
//# sourceMappingURL=standardAppVersion.js.map