"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** 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, { ...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?.apiConfig;
            resourceInputs["automaticScaling"] = state?.automaticScaling;
            resourceInputs["betaSettings"] = state?.betaSettings;
            resourceInputs["defaultExpiration"] = state?.defaultExpiration;
            resourceInputs["deleteServiceOnDestroy"] = state?.deleteServiceOnDestroy;
            resourceInputs["deployment"] = state?.deployment;
            resourceInputs["endpointsApiService"] = state?.endpointsApiService;
            resourceInputs["entrypoint"] = state?.entrypoint;
            resourceInputs["envVariables"] = state?.envVariables;
            resourceInputs["flexibleRuntimeSettings"] = state?.flexibleRuntimeSettings;
            resourceInputs["handlers"] = state?.handlers;
            resourceInputs["inboundServices"] = state?.inboundServices;
            resourceInputs["instanceClass"] = state?.instanceClass;
            resourceInputs["livenessCheck"] = state?.livenessCheck;
            resourceInputs["manualScaling"] = state?.manualScaling;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["nobuildFilesRegex"] = state?.nobuildFilesRegex;
            resourceInputs["noopOnDestroy"] = state?.noopOnDestroy;
            resourceInputs["project"] = state?.project;
            resourceInputs["readinessCheck"] = state?.readinessCheck;
            resourceInputs["resources"] = state?.resources;
            resourceInputs["runtime"] = state?.runtime;
            resourceInputs["runtimeApiVersion"] = state?.runtimeApiVersion;
            resourceInputs["runtimeChannel"] = state?.runtimeChannel;
            resourceInputs["runtimeMainExecutablePath"] = state?.runtimeMainExecutablePath;
            resourceInputs["service"] = state?.service;
            resourceInputs["serviceAccount"] = state?.serviceAccount;
            resourceInputs["servingStatus"] = state?.servingStatus;
            resourceInputs["versionId"] = state?.versionId;
            resourceInputs["vpcAccessConnector"] = state?.vpcAccessConnector;
        }
        else {
            const args = argsOrState;
            if (args?.livenessCheck === undefined && !opts.urn) {
                throw new Error("Missing required property 'livenessCheck'");
            }
            if (args?.readinessCheck === undefined && !opts.urn) {
                throw new Error("Missing required property 'readinessCheck'");
            }
            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["apiConfig"] = args?.apiConfig;
            resourceInputs["automaticScaling"] = args?.automaticScaling;
            resourceInputs["betaSettings"] = args?.betaSettings;
            resourceInputs["defaultExpiration"] = args?.defaultExpiration;
            resourceInputs["deleteServiceOnDestroy"] = args?.deleteServiceOnDestroy;
            resourceInputs["deployment"] = args?.deployment;
            resourceInputs["endpointsApiService"] = args?.endpointsApiService;
            resourceInputs["entrypoint"] = args?.entrypoint;
            resourceInputs["envVariables"] = args?.envVariables;
            resourceInputs["flexibleRuntimeSettings"] = args?.flexibleRuntimeSettings;
            resourceInputs["handlers"] = args?.handlers;
            resourceInputs["inboundServices"] = args?.inboundServices;
            resourceInputs["instanceClass"] = args?.instanceClass;
            resourceInputs["livenessCheck"] = args?.livenessCheck;
            resourceInputs["manualScaling"] = args?.manualScaling;
            resourceInputs["network"] = args?.network;
            resourceInputs["nobuildFilesRegex"] = args?.nobuildFilesRegex;
            resourceInputs["noopOnDestroy"] = args?.noopOnDestroy;
            resourceInputs["project"] = args?.project;
            resourceInputs["readinessCheck"] = args?.readinessCheck;
            resourceInputs["resources"] = args?.resources;
            resourceInputs["runtime"] = args?.runtime;
            resourceInputs["runtimeApiVersion"] = args?.runtimeApiVersion;
            resourceInputs["runtimeChannel"] = args?.runtimeChannel;
            resourceInputs["runtimeMainExecutablePath"] = args?.runtimeMainExecutablePath;
            resourceInputs["service"] = args?.service;
            resourceInputs["serviceAccount"] = args?.serviceAccount;
            resourceInputs["servingStatus"] = args?.servingStatus;
            resourceInputs["versionId"] = args?.versionId;
            resourceInputs["vpcAccessConnector"] = args?.vpcAccessConnector;
            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