Static
Reference for the humanitec/static driver
This passes the inputs it receives as outputs. It is convenient for cases where resources are managed outside of Humanitec but still need to be consumed by workloads.
The driver is a "Universal Driver" which means it can be used for all resource types.
Property | Description |
---|---|
Resource Type | Any |
Account Type | None |
The input schema should match the Resource outputs of the type that is being used with it.
The
context
placeholders can be used in the inputs which can be useful for generating fields that are matched to a particular Environment ID.For example, a namespace could be defined as
${context.env.id}-internal
The outputs will match the inputs.
Here we use the
humanitec/static
driver to allow a MySQL database that is managed outside of Humanitec to be consumed by a workload.curl https://api.humanitec.io/orgs/${HUMANITEC_ORG}/resources/defs \
-H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
-H "Content-Type: application/json" \
--data-binary '{
"id": "static-mysql",
"name": "Static MySQL",
"type": "mysql",
"driver_type": "humanitec/static",
"driver_inputs": {
"values": {
"name": "user_profiles",
"host": "products.mysql.prod.example.com",
"port": 3306
},
"secret": {
"username": "profile_robot",
"password": "5ecr3t-p455w0rd"
}
},
"criteria": [
{
"app_id": "products",
"env_id": "production"
}
]
}'
Last modified 10mo ago