Package com.pulumi.gcp.appengine
Class FlexibleAppVersion
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.appengine.FlexibleAppVersion
-
public class FlexibleAppVersion extends com.pulumi.resources.CustomResource
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 ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.Project; import com.pulumi.gcp.organizations.ProjectArgs; import com.pulumi.gcp.appengine.Application; import com.pulumi.gcp.appengine.ApplicationArgs; import com.pulumi.gcp.projects.Service; import com.pulumi.gcp.projects.ServiceArgs; import com.pulumi.gcp.serviceaccount.Account; import com.pulumi.gcp.serviceaccount.AccountArgs; import com.pulumi.gcp.projects.IAMMember; import com.pulumi.gcp.projects.IAMMemberArgs; import com.pulumi.gcp.storage.Bucket; import com.pulumi.gcp.storage.BucketArgs; import com.pulumi.gcp.storage.BucketObject; import com.pulumi.gcp.storage.BucketObjectArgs; import com.pulumi.gcp.appengine.FlexibleAppVersion; import com.pulumi.gcp.appengine.FlexibleAppVersionArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionEntrypointArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionDeploymentArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionDeploymentZipArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionLivenessCheckArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionReadinessCheckArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionHandlerArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionHandlerStaticFilesArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionAutomaticScalingArgs; import com.pulumi.gcp.appengine.inputs.FlexibleAppVersionAutomaticScalingCpuUtilizationArgs; import com.pulumi.asset.FileAsset; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var myProject = new Project("myProject", ProjectArgs.builder() .projectId("appeng-flex") .orgId("123456789") .billingAccount("000000-0000000-0000000-000000") .build()); var app = new Application("app", ApplicationArgs.builder() .project(myProject.projectId()) .locationId("us-central") .build()); var service = new Service("service", ServiceArgs.builder() .project(myProject.projectId()) .service("appengineflex.googleapis.com") .disableDependentServices(false) .build()); var customServiceAccount = new Account("customServiceAccount", AccountArgs.builder() .project(service.project()) .accountId("my-account") .displayName("Custom Service Account") .build()); var gaeApi = new IAMMember("gaeApi", IAMMemberArgs.builder() .project(service.project()) .role("roles/compute.networkUser") .member(customServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email))) .build()); var logsWriter = new IAMMember("logsWriter", IAMMemberArgs.builder() .project(service.project()) .role("roles/logging.logWriter") .member(customServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email))) .build()); var storageViewer = new IAMMember("storageViewer", IAMMemberArgs.builder() .project(service.project()) .role("roles/storage.objectViewer") .member(customServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email))) .build()); var bucket = new Bucket("bucket", BucketArgs.builder() .project(myProject.projectId()) .location("US") .build()); var object = new BucketObject("object", BucketObjectArgs.builder() .bucket(bucket.name()) .source(new FileAsset("./test-fixtures/hello-world.zip")) .build()); var myappV1 = new FlexibleAppVersion("myappV1", FlexibleAppVersionArgs.builder() .versionId("v1") .project(gaeApi.project()) .service("default") .runtime("nodejs") .entrypoint(FlexibleAppVersionEntrypointArgs.builder() .shell("node ./app.js") .build()) .deployment(FlexibleAppVersionDeploymentArgs.builder() .zip(FlexibleAppVersionDeploymentZipArgs.builder() .sourceUrl(Output.tuple(bucket.name(), object.name()).applyValue(values -> { var bucketName = values.t1; var objectName = values.t2; return String.format("https://storage.googleapis.com/%s/%s", bucketName,objectName); })) .build()) .build()) .livenessCheck(FlexibleAppVersionLivenessCheckArgs.builder() .path("/") .build()) .readinessCheck(FlexibleAppVersionReadinessCheckArgs.builder() .path("/") .build()) .envVariables(Map.of("port", "8080")) .handlers(FlexibleAppVersionHandlerArgs.builder() .urlRegex(".*\\/my-path\\/*") .securityLevel("SECURE_ALWAYS") .login("LOGIN_REQUIRED") .authFailAction("AUTH_FAIL_ACTION_REDIRECT") .staticFiles(FlexibleAppVersionHandlerStaticFilesArgs.builder() .path("my-other-path") .uploadPathRegex(".*\\/my-path\\/*") .build()) .build()) .automaticScaling(FlexibleAppVersionAutomaticScalingArgs.builder() .coolDownPeriod("120s") .cpuUtilization(FlexibleAppVersionAutomaticScalingCpuUtilizationArgs.builder() .targetUtilization(0.5) .build()) .build()) .noopOnDestroy(true) .serviceAccount(customServiceAccount.email()) .build()); } } ``` ## 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}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import FlexibleAppVersion using one of the formats above. For exampletf import { id = "apps/{{project}}/services/{{service}}/versions/{{version_id}}" to = google_app_engine_flexible_app_version.default } ```sh $ pulumi import gcp:appengine/flexibleAppVersion:FlexibleAppVersion When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} ```
-
-
Constructor Summary
Constructors Constructor Description FlexibleAppVersion(java.lang.String name)
FlexibleAppVersion(java.lang.String name, FlexibleAppVersionArgs args)
FlexibleAppVersion(java.lang.String name, FlexibleAppVersionArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionApiConfig>>
apiConfig()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionAutomaticScaling>>
automaticScaling()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>
betaSettings()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
defaultExpiration()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
deleteServiceOnDestroy()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionDeployment>>
deployment()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionEndpointsApiService>>
endpointsApiService()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionEntrypoint>>
entrypoint()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>
envVariables()
static FlexibleAppVersion
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FlexibleAppVersionState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.List<FlexibleAppVersionHandler>>
handlers()
com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>
inboundServices()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
instanceClass()
com.pulumi.core.Output<FlexibleAppVersionLivenessCheck>
livenessCheck()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionManualScaling>>
manualScaling()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionNetwork>>
network()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
nobuildFilesRegex()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
noopOnDestroy()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<FlexibleAppVersionReadinessCheck>
readinessCheck()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionResources>>
resources()
com.pulumi.core.Output<java.lang.String>
runtime()
com.pulumi.core.Output<java.lang.String>
runtimeApiVersion()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
runtimeChannel()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
runtimeMainExecutablePath()
com.pulumi.core.Output<java.lang.String>
service()
com.pulumi.core.Output<java.lang.String>
serviceAccount()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
servingStatus()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
versionId()
com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionVpcAccessConnector>>
vpcAccessConnector()
-
-
-
Constructor Detail
-
FlexibleAppVersion
public FlexibleAppVersion(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
FlexibleAppVersion
public FlexibleAppVersion(java.lang.String name, FlexibleAppVersionArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
FlexibleAppVersion
public FlexibleAppVersion(java.lang.String name, FlexibleAppVersionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
apiConfig
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionApiConfig>> apiConfig()
- Returns:
- Serving configuration for Google Cloud Endpoints. Structure is documented below.
-
automaticScaling
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionAutomaticScaling>> automaticScaling()
- Returns:
- Automatic scaling is based on request rate, response latencies, and other application metrics. Structure is documented below.
-
betaSettings
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> betaSettings()
- Returns:
- Metadata settings that are supplied to this version to enable beta runtime features.
-
defaultExpiration
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> defaultExpiration()
- Returns:
- 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.
-
deleteServiceOnDestroy
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> deleteServiceOnDestroy()
- Returns:
- If set to `true`, the service will be deleted if it is the last version.
-
deployment
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionDeployment>> deployment()
- Returns:
- Code and application artifacts that make up this version. Structure is documented below.
-
endpointsApiService
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionEndpointsApiService>> endpointsApiService()
- Returns:
- Code and application artifacts that make up this version. Structure is documented below.
-
entrypoint
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionEntrypoint>> entrypoint()
- Returns:
- The entrypoint for the application. Structure is documented below.
-
envVariables
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> envVariables()
- Returns:
- 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.
-
handlers
public com.pulumi.core.Output<java.util.List<FlexibleAppVersionHandler>> handlers()
- Returns:
- 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.
-
inboundServices
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> inboundServices()
- Returns:
- 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`.
-
instanceClass
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> instanceClass()
- Returns:
- 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.
-
livenessCheck
public com.pulumi.core.Output<FlexibleAppVersionLivenessCheck> livenessCheck()
- Returns:
- Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Structure is documented below.
-
manualScaling
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionManualScaling>> manualScaling()
- Returns:
- 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.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Endpoints service name which is the name of the "service" resource in the Service Management API. For example "myapi.endpoints.myproject.cloud.goog"
-
network
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionNetwork>> network()
- Returns:
- Extra network settings Structure is documented below.
-
nobuildFilesRegex
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> nobuildFilesRegex()
- Returns:
- Files that match this pattern will not be built into this version. Only applicable for Go runtimes.
-
noopOnDestroy
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noopOnDestroy()
- Returns:
- If set to `true`, the application version will not be deleted.
-
project
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
-
readinessCheck
public com.pulumi.core.Output<FlexibleAppVersionReadinessCheck> readinessCheck()
- Returns:
- Configures readiness health checking for instances. Unhealthy instances are not put into the backend traffic rotation. Structure is documented below.
-
resources
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionResources>> resources()
- Returns:
- Machine resources for a version. Structure is documented below.
-
runtime
public com.pulumi.core.Output<java.lang.String> runtime()
- Returns:
- Desired runtime. Example python27.
-
runtimeApiVersion
public com.pulumi.core.Output<java.lang.String> runtimeApiVersion()
- Returns:
- 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`.
-
runtimeChannel
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> runtimeChannel()
- Returns:
- The channel of the runtime to use. Only available for some runtimes.
-
runtimeMainExecutablePath
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> runtimeMainExecutablePath()
- Returns:
- The path or name of the app's main executable.
-
service
public com.pulumi.core.Output<java.lang.String> service()
- Returns:
- AppEngine service resource. Can contain numbers, letters, and hyphens.
-
serviceAccount
public com.pulumi.core.Output<java.lang.String> serviceAccount()
- Returns:
- 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.
-
servingStatus
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> servingStatus()
- Returns:
- 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`.
-
versionId
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> versionId()
- Returns:
- 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-".
-
vpcAccessConnector
public com.pulumi.core.Output<java.util.Optional<FlexibleAppVersionVpcAccessConnector>> vpcAccessConnector()
- Returns:
- Enables VPC connectivity for standard apps. Structure is documented below.
-
get
public static FlexibleAppVersion get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable FlexibleAppVersionState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-