1 Resources

Resources are special types withing the Kumori DSL that represent specific entities managed by the Kumori platform.

2 Volumes

Services, often need to maintain a large amount of state data, more than is reasonable to maintain within main memory. This leads to the need to use secondary memory to hold that state.

Three types of volumes are defined in the Kumori DSL to address this need: * Volatile volumes: used for temporary data that does not need to be preserved. * Persistent volumes: used for data that needs to be preserved while the service is running. * Storage volumes: used for data that needs to be preserved even if the service is removed.

Volatile and persistent volumes are provided automatically by the platform if a service needs them. We call them inline volumes. Storage volumes are explicitly created by the user, who must assign them to a service. We call them referenced volumes.

The type alias that defines volume resources is as follows:

alias Volume        Registered | InlineVolume
alias InlineVolume  NonReplicated | Persisted | Volatile

type Registered     string
type NonReplicated  StorageSized
type Persisted      StorageSized
type Volatile       StorageSized

You can use volume types in your service or component interfaces to declare the volumes your artifacts require:


import "kumori"

service MyService {
    [...]
    resource {
        tempData:   kumori.Volume
        cacheData:  kumori.Volume
        userData:   kumori.InlineVolume
    }
}

In a deployment, you can assign specific volume resources to the volume declarations in your artifact interfaces:

deployment {
    name     "MyDeployment"
    artifact service.MyService

    resource {
        tempData  kumori.Volatile(10G)
        cacheData kumori.Registered("your-volume-identifier")
        userData  kumori.Persisted(1G)
    }
}

3 Domains

Domains are assigned to a HTTP Inbound builtin service instance. They represent the domain names that will be used to access the service over HTTP and must be previously registered in the Kumori platform.

The type that defines domain resources is as follows:

type Domain string

You can use volume types in your service or component interfaces to declare the volumes your artifacts require:


import "kumori"

service MyService {
    [...]
    resource {
        serverdomain:   kumori.Domain
    }
}

In a deployment, you can assign specific volume resources to the volume declarations in your artifact interfaces:

deployment {
    name     "MyDeployment"
    artifact service.MyService

    resource {
        serverdomain  kumori.Domain("your-domain-identifier")
    }
}

4 Ports

Ports are assigned to a TCP Inbound builtin service instance. They represent the network ports that will be used to access the service over TCP protocol and must be previously registered in the Kumori platform.

The type that defines port resources is as follows:

type Port string

You can use port types in your service or component interfaces to declare the ports your artifacts require:

import "kumori"
service MyService {
    [...]
    resource {
        httpPort: kumori.Port
    }
}

In a deployment, you can assign specific port resources to the port declarations in your artifact interfaces:

deployment {
    name     "MyDeployment"
    artifact service.MyService

    resource {
        httpPort  kumori.Port("your-port-identifier")
    }
}

5 Certificates

Certificates are assigned to a HTTP Inbound builtin service instance. They represent the TLS certificates that will be used to secure HTTP connections to the service and must be previously registered in the Kumori platform.

The type that defines certificate resources is as follows:

type Certificate string

You can use certificate types in your service or component interfaces to declare the certificates your artifacts require:

import "kumori"

service MyService {
    [...]
    resource {
        tlsCert: kumori.Certificate
    }
}

In a deployment, you can assign specific certificate resources to the certificate declarations in your artifact interfaces:

deployment {
    name     "MyDeployment"
    artifact service.MyService

    resource {
        tlsCert  kumori.Certificate("your-certificate-identifier")
    }
}

6 CAs (Certificate Authorities)

If mTLS is used, Certificate Authorities (CAs) are assigned to a HTTP Inbound builtin service instance. They represent the CAs that will be used to validate clients and must be previously registered in the Kumori platform.

The type that defines CA resources is as follows:

type CA string

You can use CA types in your service or component interfaces to declare the CAs your artifacts require:

import "kumori"
service MyService {
    [...]
    resource {
        clientCA: kumori.CA
    }
}

In a deployment, you can assign specific CA resources to the CA declarations in your artifact interfaces:

deployment {
    name     "MyDeployment"
    artifact service.MyService

    resource {
        clientCA  kumori.CA("your-ca-identifier")
    }
}

7 Secrets

A secret is essentially, a piece of information that the platform stores securely. Examples of secrets include API keys, passwords, certificates, and other sensitive data that should not be hardcoded into your application code. They can be injected into your component containers, as part of an environment variable. Each secret must be previously registered in the Kumori platform.

The type that defines secret resources is as follows:

type Secret string

You can use secret types in your service or component interfaces to declare the secrets your artifacts require:

import "kumori"
component MyComponent {
    [...]
    env {
        dbPassword: kumori.Secret
    }
}
component MyComponent {
    [...]
    code {
        MyContainer {
            [...]

            env {
                YOUR_ENV_VAR {
                    // Must match the name declared in the interface
                    secret "dbPassword"
                }
            }
        }
    }
}

In a deployment, you can assign specific secret resources to the secret declarations in your artifact interfaces:

deployment {
    name     "MyDeployment"
    artifact component.MyComponent

    resource {
        dbPassword  kumori.Secret("your-secret-identifier")
    }
}