Skip to content

Attributes of Resource Meta Section

Following attributes are declared for every instance of a Resource that is deployed in a DataOS context. Some of these attributes/fields need to mandatorily declared, while others are optional.

Resource Section Configuration Syntax

name: ${{myfirstresource}}
version: v1
type: ${{resource-type}}
tags:
  - ${{example-resource}}
  - ${{dataos:workspace:curriculum}}
description: ${{common attributes applicable to all dataos resources}}
owner: ${{iamgroot}}
layer: ${{user}}
<resource-type>:

Resource meta section YAML configuration attributes

Configuration Attributes

name

Description: Declare a name for the Resource

Data Type Requirement Default Value Possible Value
string mandatory none
  • alpha numeric values with the RegEx
    [a-z0-9]([-a-z0-9]*[a-z0-9]); a hyphen/dash is allowed as a special character
  • total length of the string should be less than or equal to 48 characters
  • names of cluster & depot have a different RegEx
    [a-z]([a-z0-9]*); a hyphen/dash is not allowed as a special character

Additional information: two resources in the same workspace cannot have the same name.
Example usage:

name: resourcename


version

Description: The version of the Resource

Data Type Requirement Default Value Possible Value
string mandatory none v1, v1beta, v1alpha, v2alpha

Example usage:

version: v1


type

Description: Provide the value for the Resource-type

Data Type Requirement Default Value Possible Value
string mandatory none cluster, compute, depot, policy,
secret, service, stack or workflow

Example usage:

type: depot


tags

Description: Assign tags to the Resource-instance

Data Type Requirement Default Value Possible Value
mapping mandatory none any string; special characters are allowed

Example usage:

tags: 
  - tag-example
  - dataos:resource:type
  - fordiscoverability


description

Description: Assign description to Resource

Data Type Requirement Default Value Possible Value
string optional none any string

Additional information: the description can be within quotes or without.

YAML supports scalars such as strings, numbers, booleans, and null. A scalar value can be unquoted, within single quotes (') or double quotes ("). When the scalar contains a special character, the value must be declared within quotes.

Example usage:

description: "This is a sample description of a Resource"  


owner

Description: Identification of the user

Data Type Requirement Default Value Possible Value
string optional id of the user applying the Resource any valid dataos user id

Additional information: when no id is provided, or an incorrect id is provided, the system automatically corrects it to the id of the user who applied the Resource on DataOS CLI
Example usage:

owner: iamgroot


layer

Description: Declare the name of the layer in which Resource is going to be deployed

Data Type Requirement Default Value Possible Value
string optional user user/system

Additional information: From a user's perspective, the operating system can be envisaged as working at two levels - user layer & system layer. This is only a logical separation to understand the workings of the system.
Example usage:

layer: user


<resource-type>

Description: Specifies attributes specific to a \<resource-type>

Data Type Requirement Default Value Possible Value
mapping mandatory none
  • key - cluster, compute, depot, policy, secret, service, stack or workflow
  • value - attributes specific for a particular \<resource-type>

By declaring the type of the Resource, say workflow:, followed by a space, we are basically creating a mapping in YAML. To know about the key-value pairs within each mapping, go through the pages of respective DataOS Resources.

Example usage:

cluster:
  {cluster-specific-attributes}
or
workflow:
  {workflow-specific-attributes}
# all resource-types are created in the same manner

The table below summarizes how the values for version, type & layer are declared for different types of Resources.

Resource version type layer <resource-type>
Cluster v1 cluster not required cluster
Compute v1beta compute system compute
Depot v1 depot user depot
Policy v1 policy user/system policy
Secret v1 secret not required secret
Service v1 service not required service
Stack NA NA NA stack
Workflow v1 workflow not required workflow