import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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}} * $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion default {{project}}/{{service}}/{{version_id}} * $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion default {{service}}/{{version_id}} * ``` */ export declare 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: string, id: pulumi.Input, state?: FlexibleAppVersionState, opts?: pulumi.CustomResourceOptions): FlexibleAppVersion; /** * 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: any): obj is FlexibleAppVersion; /** * Serving configuration for Google Cloud Endpoints. * Structure is documented below. */ readonly apiConfig: pulumi.Output; /** * Automatic scaling is based on request rate, response latencies, and other application metrics. * Structure is documented below. */ readonly automaticScaling: pulumi.Output; /** * Metadata settings that are supplied to this version to enable beta runtime features. */ readonly betaSettings: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Duration that static files should be cached by web proxies and browsers. * Only applicable if the corresponding StaticFilesHandler does not specify its own expiration time. */ readonly defaultExpiration: pulumi.Output; /** * If set to `true`, the service will be deleted if it is the last version. */ readonly deleteServiceOnDestroy: pulumi.Output; /** * Code and application artifacts that make up this version. * Structure is documented below. */ readonly deployment: pulumi.Output; /** * Code and application artifacts that make up this version. * Structure is documented below. */ readonly endpointsApiService: pulumi.Output; /** * The entrypoint for the application. * Structure is documented below. */ readonly entrypoint: pulumi.Output; /** * Environment variables available to the application. As these are not returned in the API request, the provider will not detect any changes made outside of the config. */ readonly envVariables: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Runtime settings for App Engine flexible environment. * Structure is documented below. */ readonly flexibleRuntimeSettings: pulumi.Output; /** * 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. */ readonly handlers: pulumi.Output; /** * 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`. */ readonly inboundServices: pulumi.Output; /** * Instance class that is used to run this version. Valid values are * AutomaticScaling: F1, F2, F4, F4_1G * ManualScaling: B1, B2, B4, B8, B4_1G * Defaults to F1 for AutomaticScaling and B1 for ManualScaling. */ readonly instanceClass: pulumi.Output; /** * Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. * Structure is documented below. */ readonly livenessCheck: pulumi.Output; /** * 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. */ readonly manualScaling: pulumi.Output; /** * Full path to the Version resource in the API. Example, "v1". */ readonly name: pulumi.Output; /** * Extra network settings * Structure is documented below. */ readonly network: pulumi.Output; /** * Files that match this pattern will not be built into this version. Only applicable for Go runtimes. */ readonly nobuildFilesRegex: pulumi.Output; /** * If set to `true`, the application version will not be deleted. */ readonly noopOnDestroy: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. * Structure is documented below. */ readonly readinessCheck: pulumi.Output; /** * Machine resources for a version. * Structure is documented below. */ readonly resources: pulumi.Output; /** * Desired runtime. Example python27. */ readonly runtime: pulumi.Output; /** * 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//config/appref`\ * Substitute `` with `python`, `java`, `php`, `ruby`, `go` or `nodejs`. */ readonly runtimeApiVersion: pulumi.Output; /** * The channel of the runtime to use. Only available for some runtimes. */ readonly runtimeChannel: pulumi.Output; /** * The path or name of the app's main executable. */ readonly runtimeMainExecutablePath: pulumi.Output; /** * AppEngine service resource. Can contain numbers, letters, and hyphens. */ readonly service: pulumi.Output; /** * 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. */ readonly serviceAccount: pulumi.Output; /** * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed. * Default value is `SERVING`. * Possible values are: `SERVING`, `STOPPED`. */ readonly servingStatus: pulumi.Output; /** * Relative name of the version within the service. For example, `v1`. Version names can contain only lowercase letters, numbers, or hyphens. * Reserved names,"default", "latest", and any name with the prefix "ah-". */ readonly versionId: pulumi.Output; /** * Enables VPC connectivity for standard apps. * Structure is documented below. */ readonly vpcAccessConnector: pulumi.Output; /** * Create a FlexibleAppVersion resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FlexibleAppVersionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FlexibleAppVersion resources. */ export interface FlexibleAppVersionState { /** * Serving configuration for Google Cloud Endpoints. * Structure is documented below. */ apiConfig?: pulumi.Input; /** * Automatic scaling is based on request rate, response latencies, and other application metrics. * Structure is documented below. */ automaticScaling?: pulumi.Input; /** * Metadata settings that are supplied to this version to enable beta runtime features. */ betaSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Duration that static files should be cached by web proxies and browsers. * Only applicable if the corresponding StaticFilesHandler does not specify its own expiration time. */ defaultExpiration?: pulumi.Input; /** * If set to `true`, the service will be deleted if it is the last version. */ deleteServiceOnDestroy?: pulumi.Input; /** * Code and application artifacts that make up this version. * Structure is documented below. */ deployment?: pulumi.Input; /** * Code and application artifacts that make up this version. * Structure is documented below. */ endpointsApiService?: pulumi.Input; /** * The entrypoint for the application. * Structure is documented below. */ entrypoint?: pulumi.Input; /** * Environment variables available to the application. As these are not returned in the API request, the provider will not detect any changes made outside of the config. */ envVariables?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Runtime settings for App Engine flexible environment. * Structure is documented below. */ flexibleRuntimeSettings?: pulumi.Input; /** * 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. */ handlers?: pulumi.Input[]>; /** * 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`. */ inboundServices?: pulumi.Input[]>; /** * Instance class that is used to run this version. Valid values are * AutomaticScaling: F1, F2, F4, F4_1G * ManualScaling: B1, B2, B4, B8, B4_1G * Defaults to F1 for AutomaticScaling and B1 for ManualScaling. */ instanceClass?: pulumi.Input; /** * Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. * Structure is documented below. */ livenessCheck?: pulumi.Input; /** * 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. */ manualScaling?: pulumi.Input; /** * Full path to the Version resource in the API. Example, "v1". */ name?: pulumi.Input; /** * Extra network settings * Structure is documented below. */ network?: pulumi.Input; /** * Files that match this pattern will not be built into this version. Only applicable for Go runtimes. */ nobuildFilesRegex?: pulumi.Input; /** * If set to `true`, the application version will not be deleted. */ noopOnDestroy?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. * Structure is documented below. */ readinessCheck?: pulumi.Input; /** * Machine resources for a version. * Structure is documented below. */ resources?: pulumi.Input; /** * Desired runtime. Example python27. */ runtime?: pulumi.Input; /** * 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//config/appref`\ * Substitute `` with `python`, `java`, `php`, `ruby`, `go` or `nodejs`. */ runtimeApiVersion?: pulumi.Input; /** * The channel of the runtime to use. Only available for some runtimes. */ runtimeChannel?: pulumi.Input; /** * The path or name of the app's main executable. */ runtimeMainExecutablePath?: pulumi.Input; /** * AppEngine service resource. Can contain numbers, letters, and hyphens. */ service?: pulumi.Input; /** * 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. */ serviceAccount?: pulumi.Input; /** * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed. * Default value is `SERVING`. * Possible values are: `SERVING`, `STOPPED`. */ servingStatus?: pulumi.Input; /** * Relative name of the version within the service. For example, `v1`. Version names can contain only lowercase letters, numbers, or hyphens. * Reserved names,"default", "latest", and any name with the prefix "ah-". */ versionId?: pulumi.Input; /** * Enables VPC connectivity for standard apps. * Structure is documented below. */ vpcAccessConnector?: pulumi.Input; } /** * The set of arguments for constructing a FlexibleAppVersion resource. */ export interface FlexibleAppVersionArgs { /** * Serving configuration for Google Cloud Endpoints. * Structure is documented below. */ apiConfig?: pulumi.Input; /** * Automatic scaling is based on request rate, response latencies, and other application metrics. * Structure is documented below. */ automaticScaling?: pulumi.Input; /** * Metadata settings that are supplied to this version to enable beta runtime features. */ betaSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Duration that static files should be cached by web proxies and browsers. * Only applicable if the corresponding StaticFilesHandler does not specify its own expiration time. */ defaultExpiration?: pulumi.Input; /** * If set to `true`, the service will be deleted if it is the last version. */ deleteServiceOnDestroy?: pulumi.Input; /** * Code and application artifacts that make up this version. * Structure is documented below. */ deployment?: pulumi.Input; /** * Code and application artifacts that make up this version. * Structure is documented below. */ endpointsApiService?: pulumi.Input; /** * The entrypoint for the application. * Structure is documented below. */ entrypoint?: pulumi.Input; /** * Environment variables available to the application. As these are not returned in the API request, the provider will not detect any changes made outside of the config. */ envVariables?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Runtime settings for App Engine flexible environment. * Structure is documented below. */ flexibleRuntimeSettings?: pulumi.Input; /** * 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. */ handlers?: pulumi.Input[]>; /** * 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`. */ inboundServices?: pulumi.Input[]>; /** * Instance class that is used to run this version. Valid values are * AutomaticScaling: F1, F2, F4, F4_1G * ManualScaling: B1, B2, B4, B8, B4_1G * Defaults to F1 for AutomaticScaling and B1 for ManualScaling. */ instanceClass?: pulumi.Input; /** * Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. * Structure is documented below. */ livenessCheck: pulumi.Input; /** * 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. */ manualScaling?: pulumi.Input; /** * Extra network settings * Structure is documented below. */ network?: pulumi.Input; /** * Files that match this pattern will not be built into this version. Only applicable for Go runtimes. */ nobuildFilesRegex?: pulumi.Input; /** * If set to `true`, the application version will not be deleted. */ noopOnDestroy?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. * Structure is documented below. */ readinessCheck: pulumi.Input; /** * Machine resources for a version. * Structure is documented below. */ resources?: pulumi.Input; /** * Desired runtime. Example python27. */ runtime: pulumi.Input; /** * 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//config/appref`\ * Substitute `` with `python`, `java`, `php`, `ruby`, `go` or `nodejs`. */ runtimeApiVersion?: pulumi.Input; /** * The channel of the runtime to use. Only available for some runtimes. */ runtimeChannel?: pulumi.Input; /** * The path or name of the app's main executable. */ runtimeMainExecutablePath?: pulumi.Input; /** * AppEngine service resource. Can contain numbers, letters, and hyphens. */ service: pulumi.Input; /** * 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. */ serviceAccount?: pulumi.Input; /** * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed. * Default value is `SERVING`. * Possible values are: `SERVING`, `STOPPED`. */ servingStatus?: pulumi.Input; /** * Relative name of the version within the service. For example, `v1`. Version names can contain only lowercase letters, numbers, or hyphens. * Reserved names,"default", "latest", and any name with the prefix "ah-". */ versionId?: pulumi.Input; /** * Enables VPC connectivity for standard apps. * Structure is documented below. */ vpcAccessConnector?: pulumi.Input; }