Block API Schema
Let's define the schema for our custom resource and set up the required variables.
-
Define the custom resource schema in
src/values.schema.json:{"type": "object","required": [ "spec" ],"properties": {"spec": {"type": "object","required": [ "queueName" ],"properties": {"queueName": {"type": "string","description": "The name of the queue"},"timeout": {"type": "number","description": "Queue timeout in seconds"}}}}} -
Add the corresponding variables to the
src/variables.tffile:variable "queueName" {type = stringdescription = "The name of the queue"}variable "timeout" {type = numberdescription = "Queue timeout in seconds"default = null}
Now that we have our schema defined, let's move on to writing the infrastructure code.