Reference for App Specification
Validated on 6 Oct 2020 • Last edited on 29 Sep 2022
App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
As an alternative to configuring your app in the control panel, you can define an app specification using YAML. YAML-based app specs are useful for deploying fully-configured apps with the DigitalOcean API or doctl
, the DigitalOcean command-line tool.
App Spec Definition
The application specification, or app spec, is a YAML manifest that declaratively states everything about your App Platform app, including each resource and all of your app’s environment variables and configuration variables.
Example App Spec
This app spec defines a one-service app that builds and deploys a Dockerfile in the root of the linked repo. The app uses a static site generator called Hugo, passing in HUGO_VERSION
as an environment variable. A CORS exception is defined for internal.example-app.com
, and an alert is triggered in the event of deployment failure.
alerts:
- rule: DEPLOYMENT_FAILED
domains:
- domain: example-app.com
type: PRIMARY
features:
- enable-kata-build
name: example-app-name
region: nyc
services:
- cors:
allow_origins:
- prefix: https://internal.example-app.com
dockerfile_path: Dockerfile
envs:
- key: HUGO_VERSION
scope: RUN_AND_BUILD_TIME
value: 0.81.0
github:
branch: main
deploy_on_push: true
repo: example-org/example-repo
http_port: 80
instance_count: 2
instance_size_slug: professional-xs
name: example-service-name
routes:
- path: /
YAML File Structure
This reference covers all possible values that can be defined in an app spec. Whitespace defines hierarchy in YAML files, so this reference uses whitespace to nest child values under parent values. Where the string (array)
appears, you can define more than one of the child values, but you must prefix them with a -
dash as shown, per YAML syntax.
-
jobs (array)
Array of Objects. Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.
-
envs (array)
Array of Objects. A list of environment variables made available to the component.
-
value
String. The value. If the type is SECRET
, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
-
scope
String. The visibility scope
RUN_TIME
: Made available only at run-time
BUILD_TIME
: Made available only at build-time
RUN_AND_BUILD_TIME
: Made available at both build and run-time
-
type
String. The type
GENERAL
: A plain-text environment variable
SECRET
: A secret encrypted environment variable
-
key
String. The name
Must comply with the following regular expression: ^[_A-Za-z][_A-Za-z0-9]*$
-
instance_count
Integer. The amount of instances that this component should be scaled to. Default: 1
-
name
String. The name. Must be unique across all components within the same app.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$
-
image
Object. An image to use as the component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
registry_type
String. The registry type.
DOCR
: The DigitalOcean container registry type.
DOCKER_HUB
: The DockerHub container registry type.
-
registry
String. The registry name. Must be left empty for the DOCR
registry type. Required for the DOCKER_HUB
registry type.
-
repository
String. The repository name.
-
tag
String. The repository tag. Defaults to latest
if not provided.
-
deploy_on_push
Object. Deploy on new image tags. Only for DOCR images.
-
enabled
Boolean. Automatically deploy new images. Only for DOCR images.
-
dockerfile_path
String. The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
-
run_command
String. An optional run command to override the component’s default.
-
source_dir
String. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
-
alerts (array)
Array of Objects. A list of configured alerts which apply to the component.
-
rule
String. The specific type of alert.
CPU_UTILIZATION
: Represents CPU for a given container instance. Only applicable at the component level.
MEM_UTILIZATION
: Represents RAM for a given container instance. Only applicable at the component level.
RESTART_COUNT
: Represents restart count for a given container instance. Only applicable at the component level.
DEPLOYMENT_FAILED
: Represents whether a deployment has failed. Only applicable at the app level.
DEPLOYMENT_LIVE
: Represents whether a deployment has succeeded. Only applicable at the app level.
DOMAIN_FAILED
: Represents whether a domain configuration has failed. Only applicable at the app level.
DOMAIN_LIVE
: Represents whether a domain configuration has succeeded. Only applicable at the app level.
FUNCTIONS_ACTIVATION_COUNT
: Represents an activation count for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_DURATION_MS
: Represents the average duration for function runtimes. Only applicable to functions components.
FUNCTIONS_ERROR_RATE_PER_MINUTE
: Represents an error rate per minute for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_WAIT_TIME_MS
: Represents the average wait time for functions. Only applicable to functions components.
FUNCTIONS_ERROR_COUNT
: Represents an error count for a given functions instance. Only applicable to functions components.
FUNCTIONS_GB_RATE_PER_SECOND
: Represents the rate of memory consumption (GB x seconds) for functions. Only applicable to functions components.
-
disabled
Boolean. Determines whether or not the alert is disabled.
-
operator
String. Can be GREATER_THAN
, or LESS_THAN
-
value
Number. The meaning is dependent upon the rule. It is used in conjunction with the operator and window to
determine when an alert should trigger.
-
window
String. Can be FIVE_MINUTES
, TEN_MINUTES
, THIRTY_MINUTES
, or ONE_HOUR
-
github
Object. A GitHub repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo
String. The name of the repo in the format owner/repo. Example: digitalocean/sample-golang
Must comply with the following regular expression: ^[^/]+/[^/]+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
gitlab
Object. A GitLab repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo
String. The name of the repo in the format owner/repo or owner/subgroup/repo. Example: digitalocean/sample-golang
or digitalocean/subgroup/sample-golang
Must comply with the following regular expression: ^[^/]+(/[^/]+)+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
build_command
String. An optional build command to run while building this component from source.
-
instance_size_slug
String. The instance size to use for this component.
-
log_destinations (array)
Array of Objects. A list of configured log forwarding destinations.
-
name
String. Name of the log destination.
Minimum length: 2. Maximum length: 42.
Must comply with the following regular expression: ^[A-Za-z0-9()\[\]'"][-A-Za-z0-9_. \/()\[\]]{0,40}[A-Za-z0-9()\[\]'"]$
-
papertrail
Object. Papertrail configuration.
-
endpoint
String. Papertrail syslog endpoint.
-
datadog
Object. Datadog configuration.
-
endpoint
String. Datadog HTTP log intake endpoint.
-
api_key
String. Datadog API key.
-
logtail
Object. Logtail configuration.
-
token
String. Logtail token.
-
git
Object. A Git repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo_clone_url
String. The clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
Maximum length: 255
-
branch
String. The name of the branch to use
-
environment_slug
String. An environment slug describing the type of this app. For a full list, please refer to
the product documentation.
-
kind
String. The type of job and when it will be run during the deployment process.
UNSPECIFIED
: Default job type, will auto-complete to POST_DEPLOY kind.
PRE_DEPLOY
: Indicates a job that runs before an app deployment.
POST_DEPLOY
: Indicates a job that runs after an app deployment.
FAILED_DEPLOY
: Indicates a job that runs after a component fails to deploy.
-
functions (array)
Array of Objects. Workloads which expose publicly-accessible HTTP services via Functions Components.
-
name
String. The name. Must be unique across all components within the same app.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$
-
source_dir
String. An optional path to the working directory to use for the build. Must be relative to the root of the repo.
-
alerts (array)
Array of Objects. A list of configured alerts the user has enabled.
-
rule
String. The specific type of alert.
CPU_UTILIZATION
: Represents CPU for a given container instance. Only applicable at the component level.
MEM_UTILIZATION
: Represents RAM for a given container instance. Only applicable at the component level.
RESTART_COUNT
: Represents restart count for a given container instance. Only applicable at the component level.
DEPLOYMENT_FAILED
: Represents whether a deployment has failed. Only applicable at the app level.
DEPLOYMENT_LIVE
: Represents whether a deployment has succeeded. Only applicable at the app level.
DEPLOYMENT_STARTED
: Represents whether a deployment has started. Only applicable at the app level.
DEPLOYMENT_CANCELED
: Represents whether a deployment has been canceled. Only applicable at the app level.
DOMAIN_FAILED
: Represents whether a domain configuration has failed. Only applicable at the app level.
DOMAIN_LIVE
: Represents whether a domain configuration has succeeded. Only applicable at the app level.
FUNCTIONS_ACTIVATION_COUNT
: Represents an activation count for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_DURATION_MS
: Represents the average duration for function runtimes. Only applicable to functions components.
FUNCTIONS_ERROR_RATE_PER_MINUTE
: Represents an error rate per minute for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_WAIT_TIME_MS
: Represents the average wait time for functions. Only applicable to functions components.
FUNCTIONS_ERROR_COUNT
: Represents an error count for a given functions instance. Only applicable to functions components.
FUNCTIONS_GB_RATE_PER_SECOND
: Represents the rate of memory consumption (GB x seconds) for functions. Only applicable to functions components.
-
disabled
Boolean. Determines whether or not the alert is disabled.
-
operator
String. Can be GREATER_THAN
, or LESS_THAN
-
value
Number. The meaning is dependent upon the rule. It is used in conjunction with the operator and window to
determine when an alert should trigger.
-
window
String. Can be FIVE_MINUTES
, TEN_MINUTES
, THIRTY_MINUTES
, or ONE_HOUR
-
log_destinations (array)
Array of Objects. A list of configured log forwarding destinations.
-
name
String. Name of the log destination.
Minimum length: 2. Maximum length: 42.
Must comply with the following regular expression: ^[A-Za-z0-9()\[\]'"][-A-Za-z0-9_. \/()\[\]]{0,40}[A-Za-z0-9()\[\]'"]$
-
papertrail
Object. Papertrail configuration.
-
endpoint
String. Papertrail syslog endpoint.
-
datadog
Object. Datadog configuration.
-
endpoint
String. Datadog HTTP log intake endpoint.
-
api_key
String. Datadog API key.
-
logtail
Object. Logtail configuration.
-
token
String. Logtail token.
-
routes (array)
Array of Objects. A list of HTTP routes that should be routed to this component.
-
path
String. An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
-
preserve_path_prefix
Boolean. An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api
will have requests to /api/list
trimmed to /list
. If this value is true
, the path will remain /api/list
. Note: this is not applicable for Functions Components.
-
cors
Object. A Cross-Origin Resource Sharing policy (CORS).
-
max_age
String. An optional duration specifying how long browsers can cache the results of a preflight request. This configures the Access-Control-Max-Age header. Example: 5h30m
.
-
allow_credentials
Boolean. Whether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include
. This configures the Access-Control-Allow-Credentials header.
-
allow_origins (array)
Array of Objects. The set of allowed CORS origins. This configures the Access-Control-Allow-Origin header.
-
exact
String. Exact string match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
prefix
String. Prefix-based match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
regex
String. RE2 style regex-based match. Only 1 of exact
, prefix
, or regex
must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
Minimum length: 1. Maximum length: 256
-
allow_methods (array)
Array of Strings. The set of allowed HTTP methods. This configures the Access-Control-Allow-Methods header.
-
git
Object. A Git repo to use as component’s source. Only one of git
, github
, or gitlab
must be set.
-
repo_clone_url
String. The clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
Maximum length: 255
-
branch
String. The name of the branch to use
-
github
Object. A GitHub repo to use as component’s source. Only one of git
, github
, or gitlab
must be set.
-
repo
String. The name of the repo in the format owner/repo. Example: digitalocean/sample-golang
Must comply with the following regular expression: ^[^/]+/[^/]+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
gitlab
Object. A GitLab repo to use as component’s source. Only one of git
, github
, or gitlab
must be set.
-
repo
String. The name of the repo in the format owner/repo or owner/subgroup/repo. Example: digitalocean/sample-golang
or digitalocean/subgroup/sample-golang
Must comply with the following regular expression: ^[^/]+(/[^/]+)+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
envs (array)
Array of Objects. A list of environment variables made available to the component.
-
value
String. The value. If the type is SECRET
, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
-
scope
String. The visibility scope
RUN_TIME
: Made available only at run-time
BUILD_TIME
: Made available only at build-time
RUN_AND_BUILD_TIME
: Made available at both build and run-time
-
type
String. The type
GENERAL
: A plain-text environment variable
SECRET
: A secret encrypted environment variable
-
key
String. The name
Must comply with the following regular expression: ^[_A-Za-z][_A-Za-z0-9]*$
-
domains (array)
Array of Objects. A set of hostnames where the application will be available.
-
wildcard
Boolean. Indicates whether the domain includes all sub-domains, in addition to the given domain
-
zone
String. Optional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account.
For example, If the domain you are adding is app.domain.com
, the zone could be domain.com
.
-
minimum_tls_version
String. Optional. The minimum version of TLS a client application can use to access resources for the domain.
Must be one of the following values wrapped within quotations: "1.2"
or "1.3"
.
-
domain
String. The hostname for the domain
Minimum length: 4. Maximum length: 253.
Must comply with the following regular expression: ^([a-zA-Z0-9]+(-+[a-zA-Z0-9]+)*\.)+(xn--)?[a-zA-Z0-9]{2,}\.?$
-
type
String. The domain type, which can be one of the following:
DEFAULT
: The default .ondigitalocean.app
domain assigned to this app
PRIMARY
: The primary domain for this app that is displayed as the default in the control panel, used in bindable environment variables, and any other places that reference an app’s live URL. Only one domain may be set as primary.
ALIAS
: A non-primary domain
-
ingress
Object. Specification for component routing, rewrites, and redirects.
-
rules (array)
Array of Objects. Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.
-
match
Object. The match configuration for the rule
-
path
Object. The path to match on.
-
prefix
String. Prefix-based match. For example, /api
will match /api
, /api/
, and any nested paths such as /api/v1/endpoint
.
Maximum length: 256
-
component
Object. The component to route to. Only one of component
or redirect
may be set.
-
name
String. The name of the component to route to.
-
preserve_path_prefix
Boolean. An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api
will have requests to /api/list
trimmed to /list
. If this value is true
, the path will remain /api/list
. Note: this is not applicable for Functions Components and is mutually exclusive with rewrite
.
-
rewrite
String. An optional field that will rewrite the path of the component to be what is specified here. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api
will have requests to /api/list
trimmed to /list
. If you specified the rewrite to be /v1/
, requests to /api/list
would be rewritten to /v1/list
. Note: this is mutually exclusive with preserve_path_prefix
.
-
redirect
Object. The redirect configuration for the rule. Only one of component
or redirect
may be set.
-
uri
String. An optional URI path to redirect to. Note: if this is specified the whole URI of the original request will be overwritten to this value, irrespective of the original request URI being matched.
-
authority
String. The authority/host to redirect to. This can be a hostname or IP address. Note: use port
to set the port.
-
port
Integer. The port to redirect to.
-
scheme
String. The scheme to redirect to. Supported values are http
or https
. Default: https
.
-
redirect_code
Integer. The redirect code to use. Defaults to 302
. Supported values are 300, 301, 302, 303, 304, 307, 308.
-
cors
Object. The CORS configuration for the rule.
-
max_age
String. An optional duration specifying how long browsers can cache the results of a preflight request. This configures the Access-Control-Max-Age header. Example: 5h30m
.
-
allow_credentials
Boolean. Whether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include
. This configures the Access-Control-Allow-Credentials header.
-
allow_origins (array)
Array of Objects. The set of allowed CORS origins. This configures the Access-Control-Allow-Origin header.
-
exact
String. Exact string match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
prefix
String. Prefix-based match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
regex
String. RE2 style regex-based match. Only 1 of exact
, prefix
, or regex
must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
Minimum length: 1. Maximum length: 256
-
allow_methods (array)
Array of Strings. The set of allowed HTTP methods. This configures the Access-Control-Allow-Methods header.
-
databases (array)
Array of Objects. Database instances which can provide persistence to workloads within the
application.
-
engine
String. The database engine to use
MYSQL
: MySQL
PG
: PostgreSQL
REDIS
: Redis
MONGODB
: MongoDB
-
version
String. The version of the database engine
-
cluster_name
String. The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.
-
db_user
String. The name of the MySQL or PostgreSQL user to configure.
-
name
String. The name. Must be unique across all components within the same app.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$
-
production
Boolean. Whether this is a production or dev database.
-
db_name
String. The name of the MySQL or PostgreSQL database to configure.
-
region
String. The slug form of the geographical origin of the app. Default: nearest available
-
envs (array)
Array of Objects. A list of environment variables made available to all components in the app.
-
value
String. The value. If the type is SECRET
, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
-
scope
String. The visibility scope
RUN_TIME
: Made available only at run-time
BUILD_TIME
: Made available only at build-time
RUN_AND_BUILD_TIME
: Made available at both build and run-time
-
type
String. The type
GENERAL
: A plain-text environment variable
SECRET
: A secret encrypted environment variable
-
key
String. The name
Must comply with the following regular expression: ^[_A-Za-z][_A-Za-z0-9]*$
-
alerts (array)
Array of Objects. A list of alerts which apply to the app.
-
rule
String. The specific type of alert.
CPU_UTILIZATION
: Represents CPU for a given container instance. Only applicable at the component level.
MEM_UTILIZATION
: Represents RAM for a given container instance. Only applicable at the component level.
RESTART_COUNT
: Represents restart count for a given container instance. Only applicable at the component level.
DEPLOYMENT_FAILED
: Represents whether a deployment has failed. Only applicable at the app level.
DEPLOYMENT_LIVE
: Represents whether a deployment has succeeded. Only applicable at the app level.
DEPLOYMENT_STARTED
: Represents whether a deployment has started. Only applicable at the app level.
DEPLOYMENT_CANCELED
: Represents whether a deployment has been canceled. Only applicable at the app level.
DOMAIN_FAILED
: Represents whether a domain configuration has failed. Only applicable at the app level.
DOMAIN_LIVE
: Represents whether a domain configuration has succeeded. Only applicable at the app level.
FUNCTIONS_ACTIVATION_COUNT
: Represents an activation count for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_DURATION_MS
: Represents the average duration for function runtimes. Only applicable to functions components.
FUNCTIONS_ERROR_RATE_PER_MINUTE
: Represents an error rate per minute for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_WAIT_TIME_MS
: Represents the average wait time for functions. Only applicable to functions components.
FUNCTIONS_ERROR_COUNT
: Represents an error count for a given functions instance. Only applicable to functions components.
FUNCTIONS_GB_RATE_PER_SECOND
: Represents the rate of memory consumption (GB x seconds) for functions. Only applicable to functions components.
-
disabled
Boolean. Determines whether or not the alert is disabled.
-
operator
String. Can be GREATER_THAN
, or LESS_THAN
-
value
Number. The meaning is dependent upon the rule. It is used in conjunction with the operator and window to
determine when an alert should trigger.
-
window
String. Can be FIVE_MINUTES
, TEN_MINUTES
, THIRTY_MINUTES
, or ONE_HOUR
-
name
String. The name of the app. Must be unique across all apps in the same account.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$
-
services (array)
Array of Objects. Workloads which expose publicly-accessible HTTP services.
-
health_check
Object. A health check to determine the availability of this component.
-
period_seconds
Integer. The number of seconds to wait between health checks. Default: 10 seconds.
-
timeout_seconds
Integer. The number of seconds after which the check times out. Default: 1 second.
-
success_threshold
Integer. The number of successful health checks before considered healthy. Default: 1.
-
failure_threshold
Integer. The number of failed health checks before considered unhealthy. Default: 9.
-
http_path
String. The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
-
port
Integer. The port on which the health check will be performed. If not set, the health check will be performed on the component’s http_port.
-
initial_delay_seconds
Integer. The number of seconds to wait before beginning health checks. Default: 0 seconds; start health checks as soon as the service starts.
-
cors
Object. A Cross-Origin Resource Sharing policy (CORS).
-
max_age
String. An optional duration specifying how long browsers can cache the results of a preflight request. This configures the Access-Control-Max-Age header. Example: 5h30m
.
-
allow_credentials
Boolean. Whether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include
. This configures the Access-Control-Allow-Credentials header.
-
allow_origins (array)
Array of Objects. The set of allowed CORS origins. This configures the Access-Control-Allow-Origin header.
-
exact
String. Exact string match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
prefix
String. Prefix-based match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
regex
String. RE2 style regex-based match. Only 1 of exact
, prefix
, or regex
must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
Minimum length: 1. Maximum length: 256
-
allow_methods (array)
Array of Strings. The set of allowed HTTP methods. This configures the Access-Control-Allow-Methods header.
-
log_destinations (array)
Array of Objects. A list of configured log forwarding destinations.
-
name
String. Name of the log destination.
Minimum length: 2. Maximum length: 42.
Must comply with the following regular expression: ^[A-Za-z0-9()\[\]'"][-A-Za-z0-9_. \/()\[\]]{0,40}[A-Za-z0-9()\[\]'"]$
-
papertrail
Object. Papertrail configuration.
-
endpoint
String. Papertrail syslog endpoint.
-
datadog
Object. Datadog configuration.
-
endpoint
String. Datadog HTTP log intake endpoint.
-
api_key
String. Datadog API key.
-
logtail
Object. Logtail configuration.
-
token
String. Logtail token.
-
git
Object. A Git repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo_clone_url
String. The clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
Maximum length: 255
-
branch
String. The name of the branch to use
-
github
Object. A GitHub repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo
String. The name of the repo in the format owner/repo. Example: digitalocean/sample-golang
Must comply with the following regular expression: ^[^/]+/[^/]+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
build_command
String. An optional build command to run while building this component from source.
-
envs (array)
Array of Objects. A list of environment variables made available to the component.
-
value
String. The value. If the type is SECRET
, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
-
scope
String. The visibility scope
RUN_TIME
: Made available only at run-time
BUILD_TIME
: Made available only at build-time
RUN_AND_BUILD_TIME
: Made available at both build and run-time
-
type
String. The type
GENERAL
: A plain-text environment variable
SECRET
: A secret encrypted environment variable
-
key
String. The name
Must comply with the following regular expression: ^[_A-Za-z][_A-Za-z0-9]*$
-
source_dir
String. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
-
instance_size_slug
String. The instance size to use for this component. Default: basic-xxs
-
http_port
Integer. The internal port on which this service’s run command will listen. Default: 8080
If there is not an environment variable with the name PORT
, one will be automatically added with its value set to the value of this field.
-
routes (array)
Array of Objects. A list of HTTP routes that should be routed to this component.
-
path
String. An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
-
preserve_path_prefix
Boolean. An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api
will have requests to /api/list
trimmed to /list
. If this value is true
, the path will remain /api/list
. Note: this is not applicable for Functions Components.
-
internal_ports (array)
Array of Int64s. The ports on which this service will listen for internal traffic.
-
gitlab
Object. A GitLab repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo
String. The name of the repo in the format owner/repo or owner/subgroup/repo. Example: digitalocean/sample-golang
or digitalocean/subgroup/sample-golang
Must comply with the following regular expression: ^[^/]+(/[^/]+)+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
alerts (array)
Array of Objects. A list of configured alerts which apply to the component.
-
rule
String. The specific type of alert.
CPU_UTILIZATION
: Represents CPU for a given container instance. Only applicable at the component level.
MEM_UTILIZATION
: Represents RAM for a given container instance. Only applicable at the component level.
RESTART_COUNT
: Represents restart count for a given container instance. Only applicable at the component level.
DEPLOYMENT_FAILED
: Represents whether a deployment has failed. Only applicable at the app level.
DEPLOYMENT_LIVE
: Represents whether a deployment has succeeded. Only applicable at the app level.
DOMAIN_FAILED
: Represents whether a domain configuration has failed. Only applicable at the app level.
DOMAIN_LIVE
: Represents whether a domain configuration has succeeded. Only applicable at the app level.
FUNCTIONS_ACTIVATION_COUNT
: Represents an activation count for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_DURATION_MS
: Represents the average duration for function runtimes. Only applicable to functions components.
FUNCTIONS_ERROR_RATE_PER_MINUTE
: Represents an error rate per minute for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_WAIT_TIME_MS
: Represents the average wait time for functions. Only applicable to functions components.
FUNCTIONS_ERROR_COUNT
: Represents an error count for a given functions instance. Only applicable to functions components.
FUNCTIONS_GB_RATE_PER_SECOND
: Represents the rate of memory consumption (GB x seconds) for functions. Only applicable to functions components.
-
disabled
Boolean. Determines whether or not the alert is disabled.
-
operator
String. Can be GREATER_THAN
, or LESS_THAN
-
value
Number. The meaning is dependent upon the rule. It is used in conjunction with the operator and window to
determine when an alert should trigger.
-
window
String. Can be FIVE_MINUTES
, TEN_MINUTES
, THIRTY_MINUTES
, or ONE_HOUR
-
instance_count
Integer. The amount of instances that this component should be scaled to.
-
name
String. The name. Must be unique across all components within the same app.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$
-
image
Object. An image to use as the component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
registry_type
String. The registry type.
DOCR
: The DigitalOcean container registry type.
DOCKER_HUB
: The DockerHub container registry type.
-
registry
String. The registry name. Must be left empty for the DOCR
registry type. Required for the DOCKER_HUB
registry type.
-
repository
String. The repository name.
-
tag
String. The repository tag. Defaults to latest
if not provided.
-
deploy_on_push
Object. Deploy on new image tags. Only for DOCR images.
-
enabled
Boolean. Automatically deploy new images. Only for DOCR images.
-
dockerfile_path
String. The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
-
run_command
String. An optional run command to override the component’s default.
-
environment_slug
String. An environment slug describing the type of this app. For a full list, please refer to
the product documentation.
-
static_sites (array)
Array of Objects. Content which can be rendered to static web assets.
-
cors
Object. A Cross-Origin Resource Sharing policy (CORS).
-
max_age
String. An optional duration specifying how long browsers can cache the results of a preflight request. This configures the Access-Control-Max-Age header. Example: 5h30m
.
-
allow_credentials
Boolean. Whether browsers should expose the response to the client-side JavaScript code when the request’s credentials mode is include
. This configures the Access-Control-Allow-Credentials header.
-
allow_origins (array)
Array of Objects. The set of allowed CORS origins. This configures the Access-Control-Allow-Origin header.
-
exact
String. Exact string match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
prefix
String. Prefix-based match. Only 1 of exact
, prefix
, or regex
must be set.
Minimum length: 1. Maximum length: 256
-
regex
String. RE2 style regex-based match. Only 1 of exact
, prefix
, or regex
must be set. For more information about RE2 syntax, see: https://github.com/google/re2/wiki/Syntax
Minimum length: 1. Maximum length: 256
-
allow_methods (array)
Array of Strings. The set of allowed HTTP methods. This configures the Access-Control-Allow-Methods header.
-
catchall_document
String. The name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of catchall_document
or error_document
can be set.
-
index_document
String. The name of the index document to use when serving this static site. Default: index.html
-
gitlab
Object. A GitLab repo to use as component’s source. Only one of git
, github
, or gitlab
must be set.
-
repo
String. The name of the repo in the format owner/repo or owner/subgroup/repo. Example: digitalocean/sample-golang
or digitalocean/subgroup/sample-golang
Must comply with the following regular expression: ^[^/]+(/[^/]+)+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
build_command
String. An optional build command to run while building this component from source.
-
output_dir
String. An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: _static
, dist
, public
, build
.
-
github
Object. A GitHub repo to use as component’s source. Only one of git
, github
, or gitlab
must be set.
-
repo
String. The name of the repo in the format owner/repo. Example: digitalocean/sample-golang
Must comply with the following regular expression: ^[^/]+/[^/]+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
environment_slug
String. An environment slug describing the type of this app. For a full list, please refer to
the product documentation.
-
error_document
String. The name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.
-
git
Object. A Git repo to use as component’s source. Only one of git
, github
, or gitlab
must be set.
-
repo_clone_url
String. The clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
Maximum length: 255
-
branch
String. The name of the branch to use
-
dockerfile_path
String. The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
-
source_dir
String. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
-
envs (array)
Array of Objects. A list of environment variables made available to the component.
-
value
String. The value. If the type is SECRET
, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
-
scope
String. The visibility scope
RUN_TIME
: Made available only at run-time
BUILD_TIME
: Made available only at build-time
RUN_AND_BUILD_TIME
: Made available at both build and run-time
-
type
String. The type
GENERAL
: A plain-text environment variable
SECRET
: A secret encrypted environment variable
-
key
String. The name
Must comply with the following regular expression: ^[_A-Za-z][_A-Za-z0-9]*$
-
routes (array)
Array of Objects. A list of HTTP routes that should be routed to this component.
-
path
String. An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
-
preserve_path_prefix
Boolean. An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with path=/api
will have requests to /api/list
trimmed to /list
. If this value is true
, the path will remain /api/list
. Note: this is not applicable for Functions Components.
-
name
String. The name. Must be unique across all components within the same app.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$
-
workers (array)
Array of Objects. Workloads which do not expose publicly-accessible HTTP services.
-
git
Object. A Git repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo_clone_url
String. The clone URL of the repo. Example: https://github.com/digitalocean/sample-golang.git
Maximum length: 255
-
branch
String. The name of the branch to use
-
github
Object. A GitHub repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo
String. The name of the repo in the format owner/repo. Example: digitalocean/sample-golang
Must comply with the following regular expression: ^[^/]+/[^/]+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
run_command
String. An optional run command to override the component’s default.
-
source_dir
String. An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.
-
image
Object. An image to use as the component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
registry_type
String. The registry type.
DOCR
: The DigitalOcean container registry type.
DOCKER_HUB
: The DockerHub container registry type.
-
registry
String. The registry name. Must be left empty for the DOCR
registry type. Required for the DOCKER_HUB
registry type.
-
repository
String. The repository name.
-
tag
String. The repository tag. Defaults to latest
if not provided.
-
deploy_on_push
Object. Deploy on new image tags. Only for DOCR images.
-
enabled
Boolean. Automatically deploy new images. Only for DOCR images.
-
environment_slug
String. An environment slug describing the type of this app. For a full list, please refer to
the product documentation.
-
instance_size_slug
String. The instance size to use for this component.
-
log_destinations (array)
Array of Objects. A list of configured log forwarding destinations.
-
name
String. Name of the log destination.
Minimum length: 2. Maximum length: 42.
Must comply with the following regular expression: ^[A-Za-z0-9()\[\]'"][-A-Za-z0-9_. \/()\[\]]{0,40}[A-Za-z0-9()\[\]'"]$
-
papertrail
Object. Papertrail configuration.
-
endpoint
String. Papertrail syslog endpoint.
-
datadog
Object. Datadog configuration.
-
endpoint
String. Datadog HTTP log intake endpoint.
-
api_key
String. Datadog API key.
-
logtail
Object. Logtail configuration.
-
token
String. Logtail token.
-
gitlab
Object. A GitLab repo to use as component’s source. Only one of git
, github
, gitlab
, or image
must be set.
-
repo
String. The name of the repo in the format owner/repo or owner/subgroup/repo. Example: digitalocean/sample-golang
or digitalocean/subgroup/sample-golang
Must comply with the following regular expression: ^[^/]+(/[^/]+)+$
-
branch
String. The name of the branch to use
-
deploy_on_push
Boolean. Whether to automatically deploy new commits made to the repo
-
dockerfile_path
String. The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.
-
build_command
String. An optional build command to run while building this component from source.
-
envs (array)
Array of Objects. A list of environment variables made available to the component.
-
value
String. The value. If the type is SECRET
, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.
-
scope
String. The visibility scope
RUN_TIME
: Made available only at run-time
BUILD_TIME
: Made available only at build-time
RUN_AND_BUILD_TIME
: Made available at both build and run-time
-
type
String. The type
GENERAL
: A plain-text environment variable
SECRET
: A secret encrypted environment variable
-
key
String. The name
Must comply with the following regular expression: ^[_A-Za-z][_A-Za-z0-9]*$
-
instance_count
Integer. The amount of instances that this component should be scaled to. Default: 1
-
alerts (array)
Array of Objects. A list of configured alerts which apply to the component.
-
rule
String. The specific type of alert.
CPU_UTILIZATION
: Represents CPU for a given container instance. Only applicable at the component level.
MEM_UTILIZATION
: Represents RAM for a given container instance. Only applicable at the component level.
RESTART_COUNT
: Represents restart count for a given container instance. Only applicable at the component level.
DEPLOYMENT_FAILED
: Represents whether a deployment has failed. Only applicable at the app level.
DEPLOYMENT_LIVE
: Represents whether a deployment has succeeded. Only applicable at the app level.
DOMAIN_FAILED
: Represents whether a domain configuration has failed. Only applicable at the app level.
DOMAIN_LIVE
: Represents whether a domain configuration has succeeded. Only applicable at the app level.
FUNCTIONS_ACTIVATION_COUNT
: Represents an activation count for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_DURATION_MS
: Represents the average duration for function runtimes. Only applicable to functions components.
FUNCTIONS_ERROR_RATE_PER_MINUTE
: Represents an error rate per minute for a given functions instance. Only applicable to functions components.
FUNCTIONS_AVERAGE_WAIT_TIME_MS
: Represents the average wait time for functions. Only applicable to functions components.
FUNCTIONS_ERROR_COUNT
: Represents an error count for a given functions instance. Only applicable to functions components.
FUNCTIONS_GB_RATE_PER_SECOND
: Represents the rate of memory consumption (GB x seconds) for functions. Only applicable to functions components.
-
disabled
Boolean. Determines whether or not the alert is disabled.
-
operator
String. Can be GREATER_THAN
, or LESS_THAN
-
value
Number. The meaning is dependent upon the rule. It is used in conjunction with the operator and window to
determine when an alert should trigger.
-
window
String. Can be FIVE_MINUTES
, TEN_MINUTES
, THIRTY_MINUTES
, or ONE_HOUR
-
name
String. The name. Must be unique across all components within the same app.
Minimum length: 2. Maximum length: 32.
Must comply with the following regular expression: ^[a-z][a-z0-9-]{0,30}[a-z0-9]$