UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

583 lines (582 loc) • 25.2 kB
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}} * ``` * * ```sh * $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion default {{project}}/{{service}}/{{version_id}} * ``` * * ```sh * $ 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<pulumi.ID>, 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. */ readonly apiConfig: pulumi.Output<outputs.appengine.FlexibleAppVersionApiConfig | undefined>; /** * Automatic scaling is based on request rate, response latencies, and other application metrics. */ readonly automaticScaling: pulumi.Output<outputs.appengine.FlexibleAppVersionAutomaticScaling | undefined>; /** * 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<string | undefined>; /** * If set to 'true', the service will be deleted if it is the last version. */ readonly deleteServiceOnDestroy: pulumi.Output<boolean | undefined>; /** * Code and application artifacts that make up this version. */ readonly deployment: pulumi.Output<outputs.appengine.FlexibleAppVersionDeployment | undefined>; /** * Code and application artifacts that make up this version. */ readonly endpointsApiService: pulumi.Output<outputs.appengine.FlexibleAppVersionEndpointsApiService | undefined>; /** * The entrypoint for the application. */ readonly entrypoint: pulumi.Output<outputs.appengine.FlexibleAppVersionEntrypoint | undefined>; readonly envVariables: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Runtime settings for App Engine flexible environment. */ readonly flexibleRuntimeSettings: pulumi.Output<outputs.appengine.FlexibleAppVersionFlexibleRuntimeSettings | undefined>; /** * 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. */ readonly handlers: pulumi.Output<outputs.appengine.FlexibleAppVersionHandler[]>; /** * A list of the types of messages that this application is able to receive. Possible values: ["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<string[] | undefined>; /** * 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<string | undefined>; /** * Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. * Structure is documented below. */ readonly livenessCheck: pulumi.Output<outputs.appengine.FlexibleAppVersionLivenessCheck>; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of * its memory over time. */ readonly manualScaling: pulumi.Output<outputs.appengine.FlexibleAppVersionManualScaling | undefined>; /** * Full path to the Version resource in the API. Example, "v1". */ readonly name: pulumi.Output<string>; /** * Extra network settings */ readonly network: pulumi.Output<outputs.appengine.FlexibleAppVersionNetwork | undefined>; /** * Files that match this pattern will not be built into this version. Only applicable for Go runtimes. */ readonly nobuildFilesRegex: pulumi.Output<string | undefined>; /** * If set to 'true', the application version will not be deleted. */ readonly noopOnDestroy: pulumi.Output<boolean | undefined>; readonly project: pulumi.Output<string>; /** * Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. * Structure is documented below. */ readonly readinessCheck: pulumi.Output<outputs.appengine.FlexibleAppVersionReadinessCheck>; /** * Machine resources for a version. */ readonly resources: pulumi.Output<outputs.appengine.FlexibleAppVersionResources | undefined>; /** * Desired runtime. Example python27. */ readonly runtime: pulumi.Output<string>; /** * 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/<language>/config/appref'\ Substitute '<language>' with 'python', * 'java', 'php', 'ruby', 'go' or 'nodejs'. */ readonly runtimeApiVersion: pulumi.Output<string>; /** * The channel of the runtime to use. Only available for some runtimes. */ readonly runtimeChannel: pulumi.Output<string | undefined>; /** * The path or name of the app's main executable. */ readonly runtimeMainExecutablePath: pulumi.Output<string | undefined>; /** * AppEngine service resource. Can contain numbers, letters, and hyphens. */ readonly service: pulumi.Output<string>; /** * 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<string>; /** * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed. * Default value: "SERVING" Possible values: ["SERVING", "STOPPED"] */ readonly servingStatus: pulumi.Output<string | undefined>; /** * 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<string | undefined>; /** * Enables VPC connectivity for standard apps. */ readonly vpcAccessConnector: pulumi.Output<outputs.appengine.FlexibleAppVersionVpcAccessConnector | undefined>; /** * 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. */ apiConfig?: pulumi.Input<inputs.appengine.FlexibleAppVersionApiConfig>; /** * Automatic scaling is based on request rate, response latencies, and other application metrics. */ automaticScaling?: pulumi.Input<inputs.appengine.FlexibleAppVersionAutomaticScaling>; /** * Metadata settings that are supplied to this version to enable beta runtime features. */ betaSettings?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * 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<string>; /** * If set to 'true', the service will be deleted if it is the last version. */ deleteServiceOnDestroy?: pulumi.Input<boolean>; /** * Code and application artifacts that make up this version. */ deployment?: pulumi.Input<inputs.appengine.FlexibleAppVersionDeployment>; /** * Code and application artifacts that make up this version. */ endpointsApiService?: pulumi.Input<inputs.appengine.FlexibleAppVersionEndpointsApiService>; /** * The entrypoint for the application. */ entrypoint?: pulumi.Input<inputs.appengine.FlexibleAppVersionEntrypoint>; envVariables?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Runtime settings for App Engine flexible environment. */ flexibleRuntimeSettings?: pulumi.Input<inputs.appengine.FlexibleAppVersionFlexibleRuntimeSettings>; /** * 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. */ handlers?: pulumi.Input<pulumi.Input<inputs.appengine.FlexibleAppVersionHandler>[]>; /** * A list of the types of messages that this application is able to receive. Possible values: ["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<pulumi.Input<string>[]>; /** * 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<string>; /** * Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. * Structure is documented below. */ livenessCheck?: pulumi.Input<inputs.appengine.FlexibleAppVersionLivenessCheck>; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of * its memory over time. */ manualScaling?: pulumi.Input<inputs.appengine.FlexibleAppVersionManualScaling>; /** * Full path to the Version resource in the API. Example, "v1". */ name?: pulumi.Input<string>; /** * Extra network settings */ network?: pulumi.Input<inputs.appengine.FlexibleAppVersionNetwork>; /** * Files that match this pattern will not be built into this version. Only applicable for Go runtimes. */ nobuildFilesRegex?: pulumi.Input<string>; /** * If set to 'true', the application version will not be deleted. */ noopOnDestroy?: pulumi.Input<boolean>; project?: pulumi.Input<string>; /** * Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. * Structure is documented below. */ readinessCheck?: pulumi.Input<inputs.appengine.FlexibleAppVersionReadinessCheck>; /** * Machine resources for a version. */ resources?: pulumi.Input<inputs.appengine.FlexibleAppVersionResources>; /** * Desired runtime. Example python27. */ runtime?: pulumi.Input<string>; /** * 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/<language>/config/appref'\ Substitute '<language>' with 'python', * 'java', 'php', 'ruby', 'go' or 'nodejs'. */ runtimeApiVersion?: pulumi.Input<string>; /** * The channel of the runtime to use. Only available for some runtimes. */ runtimeChannel?: pulumi.Input<string>; /** * The path or name of the app's main executable. */ runtimeMainExecutablePath?: pulumi.Input<string>; /** * AppEngine service resource. Can contain numbers, letters, and hyphens. */ service?: pulumi.Input<string>; /** * 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<string>; /** * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed. * Default value: "SERVING" Possible values: ["SERVING", "STOPPED"] */ servingStatus?: pulumi.Input<string>; /** * 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<string>; /** * Enables VPC connectivity for standard apps. */ vpcAccessConnector?: pulumi.Input<inputs.appengine.FlexibleAppVersionVpcAccessConnector>; } /** * The set of arguments for constructing a FlexibleAppVersion resource. */ export interface FlexibleAppVersionArgs { /** * Serving configuration for Google Cloud Endpoints. */ apiConfig?: pulumi.Input<inputs.appengine.FlexibleAppVersionApiConfig>; /** * Automatic scaling is based on request rate, response latencies, and other application metrics. */ automaticScaling?: pulumi.Input<inputs.appengine.FlexibleAppVersionAutomaticScaling>; /** * Metadata settings that are supplied to this version to enable beta runtime features. */ betaSettings?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * 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<string>; /** * If set to 'true', the service will be deleted if it is the last version. */ deleteServiceOnDestroy?: pulumi.Input<boolean>; /** * Code and application artifacts that make up this version. */ deployment?: pulumi.Input<inputs.appengine.FlexibleAppVersionDeployment>; /** * Code and application artifacts that make up this version. */ endpointsApiService?: pulumi.Input<inputs.appengine.FlexibleAppVersionEndpointsApiService>; /** * The entrypoint for the application. */ entrypoint?: pulumi.Input<inputs.appengine.FlexibleAppVersionEntrypoint>; envVariables?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Runtime settings for App Engine flexible environment. */ flexibleRuntimeSettings?: pulumi.Input<inputs.appengine.FlexibleAppVersionFlexibleRuntimeSettings>; /** * 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. */ handlers?: pulumi.Input<pulumi.Input<inputs.appengine.FlexibleAppVersionHandler>[]>; /** * A list of the types of messages that this application is able to receive. Possible values: ["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<pulumi.Input<string>[]>; /** * 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<string>; /** * Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. * Structure is documented below. */ livenessCheck: pulumi.Input<inputs.appengine.FlexibleAppVersionLivenessCheck>; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of * its memory over time. */ manualScaling?: pulumi.Input<inputs.appengine.FlexibleAppVersionManualScaling>; /** * Extra network settings */ network?: pulumi.Input<inputs.appengine.FlexibleAppVersionNetwork>; /** * Files that match this pattern will not be built into this version. Only applicable for Go runtimes. */ nobuildFilesRegex?: pulumi.Input<string>; /** * If set to 'true', the application version will not be deleted. */ noopOnDestroy?: pulumi.Input<boolean>; project?: pulumi.Input<string>; /** * Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. * Structure is documented below. */ readinessCheck: pulumi.Input<inputs.appengine.FlexibleAppVersionReadinessCheck>; /** * Machine resources for a version. */ resources?: pulumi.Input<inputs.appengine.FlexibleAppVersionResources>; /** * Desired runtime. Example python27. */ runtime: pulumi.Input<string>; /** * 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/<language>/config/appref'\ Substitute '<language>' with 'python', * 'java', 'php', 'ruby', 'go' or 'nodejs'. */ runtimeApiVersion?: pulumi.Input<string>; /** * The channel of the runtime to use. Only available for some runtimes. */ runtimeChannel?: pulumi.Input<string>; /** * The path or name of the app's main executable. */ runtimeMainExecutablePath?: pulumi.Input<string>; /** * AppEngine service resource. Can contain numbers, letters, and hyphens. */ service: pulumi.Input<string>; /** * 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<string>; /** * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed. * Default value: "SERVING" Possible values: ["SERVING", "STOPPED"] */ servingStatus?: pulumi.Input<string>; /** * 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<string>; /** * Enables VPC connectivity for standard apps. */ vpcAccessConnector?: pulumi.Input<inputs.appengine.FlexibleAppVersionVpcAccessConnector>; }