Resource Definitions

Driver

Capability

Resource Type

Redis

This section contains example Resource Definitions using the Echo Driver for Redis.

  • redis-secret-refs.yaml: Shows how to use the Echo Driver and secret references to provision a Redis resource. This format is for use with the Humanitec CLI.

Resource Definitions


redis-secret-refs.yaml (view on GitHub) :

apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: redis-echo
entity:
  name: redis-echo
  type: redis
  driver_type: humanitec/echo
  driver_inputs:
    values:
      host: 0.0.0.0
      port: 6379
    secret_refs:
      password:
        store: my-gsm
        ref: redis-password
      username:
        store: my-gsm
        ref: redis-user
  criteria:
    - {}


redis-secret-refs.tf (view on GitHub) :

resource "humanitec_resource_definition" "redis-echo" {
  driver_type = "humanitec/echo"
  id          = "redis-echo"
  name        = "redis-echo"
  type        = "redis"
  driver_inputs = {
    values_string = jsonencode({
      "host" = "0.0.0.0"
      "port" = 6379
    })
    secret_refs = jsonencode({
      "password" = {
        "store" = "my-gsm"
        "ref"   = "redis-password"
      }
      "username" = {
        "store" = "my-gsm"
        "ref"   = "redis-user"
      }
    })
  }
}

resource "humanitec_resource_definition_criteria" "redis-echo_criteria_0" {
  resource_definition_id = resource.humanitec_resource_definition.redis-echo.id

}

Top