Resource
dcloud_app
A deploy app. Creating it does not deploy it: a deployment is started from git pushes, the console, the CLI or dcloud deploy.
Example Usage
resource "dcloud_app" "web" {
name = "web"
builder = "image"
image_ref = "docker.io/library/nginx:1.27-alpine"
port = 80
}Schema
Required
name(String) Display name of the app. Up to 64 characters.
Optional
branch(String) Branch the app deploys from; omitted, the repository’s default branch (main for pooled hosting). Up to 255 characters.build_command(String) Replaces the build command the builder would detect. Up to 1024 characters.builder(String) How the app is built: railpack (default) detects the stack, dockerfile uses the repository’s Dockerfile, image runs imageRef, compose runs a compose file One of:railpack,dockerfile,forgejo_actions,image,compose.compose_file(String) Compose apps with composeSource inline: the compose file text, checked when saved. Up to 131072 characters.compose_health_checks(String) Compose apps: health checks for services other than the published one, keyed by service name.compose_path(String) Compose apps with composeSource git: path of the compose file in the repository. Up to 255 characters. Must match^[A-Za-z0-9._/-]+$.compose_port(Number) Compose apps: the container port of composeService that receives traffic; required. From 1 to 65535.compose_service(String) Compose apps: the service published on the app’s domains; required. Up to 63 characters.compose_source(String) Compose apps: inline takes the file text from composeFile, git reads composePath from the connected repository One of:inline,git.database(String) Pooled hosting only: postgres gives the app a Postgres database on its pool host (needs deploy:ManageHostDatabase); none (default) gives it none. An app on its own machines is refused with 400 and binds a managed Postgres instead One of:none,postgres. Changing it replaces the resource.deploy_on_push(Boolean) Deploy each commit pushed to the branch, as the person who pushed it; default true when gitRepositoryId is set (always false for pooled hosting)ecr_repository_id(String) Repository of this organization’s registry the image comes from, so the machines get a pull credential for it; for an inline compose file it is found from the file when omitted. A UUID. Changing it replaces the resource.git_repository_id(String) Git repository the app builds from; required for every builder except image and compose. The app starts with that repository’s tags. A UUID. Changing it replaces the resource.health_check(String) The HTTP check a new container must pass before it gets traffic; null or omitted means GET / on the app port, any status below 500.hosting(String) machine (default): the app runs on its own machines; pooled: a Next.js app on shared hosts that scales to zero, deployed from bundles your CI uploads One of:machine,pooled. Changing it replaces the resource.idle_seconds(Number) Pooled hosting: seconds without a request after which the app’s server is stopped; default 300. From 60 to 3600. Changing it replaces the resource.image_ref(String) Container image the app runs (host/repository:tag or @sha256 digest); required when builder is image. A short Docker Hub name is stored with docker.io/ in front. Up to 512 characters.instance_type(String) Machine size of each machine, an instance type, e.g. performance-2 (the provider’s own names are still accepted, deprecated); default the region’s default size. Up to 32 characters.locations(List of String) Locations the machines are spread over in order, all in one region (e.g. fsn1, nbg1); empty means the region’s own locationmemory_mb(Number) Pooled hosting: memory reserved for the app’s server while it runs, in MB; default 768. From 256 to 2048. Changing it replaces the resource.port(Number) Port the app listens on in its container; default 3000. From 1 to 65535.project(String) The project (its slug) the resource lives in. At create: this, else the provider'sproject, else Default. Changing it moves the resource and its parts; it is never replaced.release_command(String) Command run once per deployment with /bin/sh -c in the new image, before traffic moves to it (e.g. database migrations); null or omitted runs none. Up to 4096 characters.release_service(String) Compose apps: the service whose image and environment run the release command; omitted or null, the published service. Up to 63 characters.release_timeout_sec(Number) Seconds the release command may run before the deployment fails; a new app gets 600. From 10 to 3600.replicas(Number) Number of machines; default 1. More than one puts a load balancer in front. From 1 to 10.root_dir(String) Directory in the repository the app is built from; default the repository root (.). Up to 255 characters. Must match^[A-Za-z0-9._/-]+$.slug(String) Short name used in the app’s default hostname; must be unique in the organization; derived from name when omitted. Up to 63 characters. Must match^[a-z0-9]([a-z0-9-]*[a-z0-9])?$. Changing it replaces the resource.start_command(String) Replaces the command the builder would start the app with. Up to 1024 characters.tags(Map of String) Tags, key → value. Once set here, only these keys are managed; tags Deutsche Cloud adds itself are left alone.
Read-Only
default_url(String) The host the app answers on without a custom domain.id(String) The resource's id.status(String) The app's status.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import dcloud_app.web <app-id>Generated from the provider's schema.
Related