@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
261 lines • 13.1 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.FlexibleAppVersion = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Flexible App Version resource to create a new version of flexible GAE Application. Based on Google Compute Engine,
* the App Engine flexible environment automatically scales your app up and down while also balancing the load.
* Learn about the differences between the standard environment and the flexible environment
* at https://cloud.google.com/appengine/docs/the-appengine-environments.
*
* > **Note:** The App Engine flexible environment service account uses the member ID `service-[YOUR_PROJECT_NUMBER]@gae-api-prod.google.com.iam.gserviceaccount.com`
* It should have the App Engine Flexible Environment Service Agent role, which will be applied when the `appengineflex.googleapis.com` service is enabled.
*
* To get more information about FlexibleAppVersion, 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/flexible)
*
* ## Example Usage
*
* ### App Engine Flexible App Version
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myProject = new gcp.organizations.Project("my_project", {
* name: "appeng-flex",
* projectId: "appeng-flex",
* orgId: "123456789",
* billingAccount: "000000-0000000-0000000-000000",
* deletionPolicy: "DELETE",
* });
* const app = new gcp.appengine.Application("app", {
* project: myProject.projectId,
* locationId: "us-central",
* });
* const service = new gcp.projects.Service("service", {
* project: myProject.projectId,
* service: "appengineflex.googleapis.com",
* disableDependentServices: false,
* });
* const customServiceAccount = new gcp.serviceaccount.Account("custom_service_account", {
* project: service.project,
* accountId: "my-account",
* displayName: "Custom Service Account",
* });
* const gaeApi = new gcp.projects.IAMMember("gae_api", {
* project: service.project,
* role: "roles/compute.networkUser",
* member: pulumi.interpolate`serviceAccount:${customServiceAccount.email}`,
* });
* const logsWriter = new gcp.projects.IAMMember("logs_writer", {
* project: service.project,
* role: "roles/logging.logWriter",
* member: pulumi.interpolate`serviceAccount:${customServiceAccount.email}`,
* });
* const storageViewer = new gcp.projects.IAMMember("storage_viewer", {
* project: service.project,
* role: "roles/storage.objectViewer",
* member: pulumi.interpolate`serviceAccount:${customServiceAccount.email}`,
* });
* const bucket = new gcp.storage.Bucket("bucket", {
* project: myProject.projectId,
* 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.FlexibleAppVersion("myapp_v1", {
* versionId: "v1",
* project: gaeApi.project,
* service: "default",
* runtime: "nodejs",
* flexibleRuntimeSettings: {
* operatingSystem: "ubuntu22",
* runtimeVersion: "20",
* },
* entrypoint: {
* shell: "node ./app.js",
* },
* deployment: {
* zip: {
* sourceUrl: pulumi.interpolate`https://storage.googleapis.com/${bucket.name}/${object.name}`,
* },
* },
* livenessCheck: {
* path: "/",
* },
* readinessCheck: {
* path: "/",
* },
* envVariables: {
* port: "8080",
* },
* handlers: [{
* urlRegex: ".*\\/my-path\\/*",
* securityLevel: "SECURE_ALWAYS",
* login: "LOGIN_REQUIRED",
* authFailAction: "AUTH_FAIL_ACTION_REDIRECT",
* staticFiles: {
* path: "my-other-path",
* uploadPathRegex: ".*\\/my-path\\/*",
* },
* }],
* automaticScaling: {
* coolDownPeriod: "120s",
* cpuUtilization: {
* targetUtilization: 0.5,
* },
* },
* noopOnDestroy: true,
* serviceAccount: customServiceAccount.email,
* });
* ```
*
* ## Import
*
* FlexibleAppVersion 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, FlexibleAppVersion can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion default apps/{{project}}/services/{{service}}/versions/{{version_id}}
* ```
*
* ```sh
* $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion default {{project}}/{{service}}/{{version_id}}
* ```
*
* ```sh
* $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion default {{service}}/{{version_id}}
* ```
*/
class FlexibleAppVersion extends pulumi.CustomResource {
/**
* Get an existing FlexibleAppVersion 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 FlexibleAppVersion(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FlexibleAppVersion. 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'] === FlexibleAppVersion.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["apiConfig"] = state ? state.apiConfig : undefined;
resourceInputs["automaticScaling"] = state ? state.automaticScaling : undefined;
resourceInputs["betaSettings"] = state ? state.betaSettings : undefined;
resourceInputs["defaultExpiration"] = state ? state.defaultExpiration : undefined;
resourceInputs["deleteServiceOnDestroy"] = state ? state.deleteServiceOnDestroy : undefined;
resourceInputs["deployment"] = state ? state.deployment : undefined;
resourceInputs["endpointsApiService"] = state ? state.endpointsApiService : undefined;
resourceInputs["entrypoint"] = state ? state.entrypoint : undefined;
resourceInputs["envVariables"] = state ? state.envVariables : undefined;
resourceInputs["flexibleRuntimeSettings"] = state ? state.flexibleRuntimeSettings : undefined;
resourceInputs["handlers"] = state ? state.handlers : undefined;
resourceInputs["inboundServices"] = state ? state.inboundServices : undefined;
resourceInputs["instanceClass"] = state ? state.instanceClass : undefined;
resourceInputs["livenessCheck"] = state ? state.livenessCheck : undefined;
resourceInputs["manualScaling"] = state ? state.manualScaling : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["nobuildFilesRegex"] = state ? state.nobuildFilesRegex : undefined;
resourceInputs["noopOnDestroy"] = state ? state.noopOnDestroy : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["readinessCheck"] = state ? state.readinessCheck : undefined;
resourceInputs["resources"] = state ? state.resources : undefined;
resourceInputs["runtime"] = state ? state.runtime : undefined;
resourceInputs["runtimeApiVersion"] = state ? state.runtimeApiVersion : undefined;
resourceInputs["runtimeChannel"] = state ? state.runtimeChannel : undefined;
resourceInputs["runtimeMainExecutablePath"] = state ? state.runtimeMainExecutablePath : undefined;
resourceInputs["service"] = state ? state.service : undefined;
resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined;
resourceInputs["servingStatus"] = state ? state.servingStatus : undefined;
resourceInputs["versionId"] = state ? state.versionId : undefined;
resourceInputs["vpcAccessConnector"] = state ? state.vpcAccessConnector : undefined;
}
else {
const args = argsOrState;
if ((!args || args.livenessCheck === undefined) && !opts.urn) {
throw new Error("Missing required property 'livenessCheck'");
}
if ((!args || args.readinessCheck === undefined) && !opts.urn) {
throw new Error("Missing required property 'readinessCheck'");
}
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["apiConfig"] = args ? args.apiConfig : undefined;
resourceInputs["automaticScaling"] = args ? args.automaticScaling : undefined;
resourceInputs["betaSettings"] = args ? args.betaSettings : undefined;
resourceInputs["defaultExpiration"] = args ? args.defaultExpiration : undefined;
resourceInputs["deleteServiceOnDestroy"] = args ? args.deleteServiceOnDestroy : undefined;
resourceInputs["deployment"] = args ? args.deployment : undefined;
resourceInputs["endpointsApiService"] = args ? args.endpointsApiService : undefined;
resourceInputs["entrypoint"] = args ? args.entrypoint : undefined;
resourceInputs["envVariables"] = args ? args.envVariables : undefined;
resourceInputs["flexibleRuntimeSettings"] = args ? args.flexibleRuntimeSettings : undefined;
resourceInputs["handlers"] = args ? args.handlers : undefined;
resourceInputs["inboundServices"] = args ? args.inboundServices : undefined;
resourceInputs["instanceClass"] = args ? args.instanceClass : undefined;
resourceInputs["livenessCheck"] = args ? args.livenessCheck : undefined;
resourceInputs["manualScaling"] = args ? args.manualScaling : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["nobuildFilesRegex"] = args ? args.nobuildFilesRegex : undefined;
resourceInputs["noopOnDestroy"] = args ? args.noopOnDestroy : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["readinessCheck"] = args ? args.readinessCheck : undefined;
resourceInputs["resources"] = args ? args.resources : undefined;
resourceInputs["runtime"] = args ? args.runtime : undefined;
resourceInputs["runtimeApiVersion"] = args ? args.runtimeApiVersion : undefined;
resourceInputs["runtimeChannel"] = args ? args.runtimeChannel : undefined;
resourceInputs["runtimeMainExecutablePath"] = args ? args.runtimeMainExecutablePath : undefined;
resourceInputs["service"] = args ? args.service : undefined;
resourceInputs["serviceAccount"] = args ? args.serviceAccount : undefined;
resourceInputs["servingStatus"] = args ? args.servingStatus : undefined;
resourceInputs["versionId"] = args ? args.versionId : undefined;
resourceInputs["vpcAccessConnector"] = args ? args.vpcAccessConnector : undefined;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FlexibleAppVersion.__pulumiType, name, resourceInputs, opts);
}
}
exports.FlexibleAppVersion = FlexibleAppVersion;
/** @internal */
FlexibleAppVersion.__pulumiType = 'gcp:appengine/flexibleAppVersion:FlexibleAppVersion';
//# sourceMappingURL=flexibleAppVersion.js.map