page_title | subcategory | description |
---|---|---|
dokku Provider |
Interact with dokku |
Interact with dokku
terraform {
required_providers {
dokku = {
source = "registry.terraform.io/aliksend/dokku"
}
}
}
# simple configuration
provider "dokku" {
ssh_host = "127.0.0.1"
}
# custom certificate
# raw certificate can be provided
variable "ssh_cert" {
type = string
description = "SSH cert"
default = "~/.ssh/id_rsa"
}
provider "dokku" {
ssh_host = "127.0.0.1"
ssh_port = 2222
ssh_cert = var.ssh_cert
ssh_host_key = "127.0.0.1 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCql...Dq+Nnpue8="
}
ssh_host
(String) Host to connect to
-
log_ssh_commands
(Boolean) Print SSH commands with ERROR level -
ssh_cert
(String) Certificate (private key) to use. Default: ~/.ssh/id_rsaSupported formats:
file:/a
or/a
or./a
or~/a
- use provided value as path to certificate fileenv:ABCD
or$ABCD
- use env var ABCDraw:----...
or----...
- use provided value as raw certificate
-
ssh_host_key
(String) Host public key to use. By default key from ~/.ssh/known_hosts will be used. To get public keys for your ssh_host, runssh-keyscan <ssh_host>
. Must be set for usage within Terraform Cloud. -
ssh_port
(Number) Port to connect to. Default: 22 -
ssh_skip_host_key_check
(Boolean) Skip the host key check. Insecure, should not be used in production. Default: false -
ssh_user
(String) Username to use. Default: dokku -
upload_app_name
(String) This attribute is used to upload local files to remote server using storage.local_directory attribute. App name to use for local file synchronization. Default: storage-syncSince dokku don't allow to upload files directly, workaround is used. Algorithm is:
- Create helper dokku application, using name provided in this attribute plus random string to prevent conflicts with simultaneous uploads
- Mount desired remote directory as /mnt
- Deploy "busybox" docker image to app
- [on host side] Create tar archive for local_directory and encode it using base64
- Connect to app using "dokku enter" and use a bunch of echo-s to make file "tmp.tar.base64"
- When file is completely uploaded - decode and un-tar it to /mnt
- Delete helper dokku application
See details in description to "upload_app_name" attribute.
-
upload_split_bytes
(Number) This attribute is used to upload local files to remote server using storage.local_directory attribute. Number of bytes to split uploaded base64-encoded tar archive. See details in description to "upload_app_name" attribute. Default: 256Due to limited length of commands we can't use one echo to copy entire file. So we need to split file into parts no larger than upload_split_bytes. Don't use big values because if length of command exceed the limit all operation will hang out.