Extend Console Pages Using Schema Documents

Review requirements, supported types, and examples for schema documents used with Terraform configurations in Resource Manager.

Schema documents are recommended for Terraform configurations when using Resource Manager. Including a schema document allows you to extend pages in the Oracle Cloud Infrastructure Console. Facilitate variable entry in the Create stack page by surfacing SSH key controls and by naming, grouping, dynamically prepopulating values, and more. Define text in the Application Information tab of the Stack details page that opens for a created stack.

Requirements for Schema Documents

Schema documents for Resource Manager have the following requirements:

  • YAML format.

  • Data types must be consistent with the associated Terraform configuration.

    For example, let's say that you declare the type number for the availability variable in the schema. In this situation, availability must have the same declared type (number) in the associated Terraform configuration. (By default, variables with no declared type use string.)

  • Placement under the root folder of the Resource Manager Terraform configuration. (By default, the schema document assumes that the root folder is the working directory.)

Supported Types (Dynamic Prepopulation and Controls)

This section lists the types supported by Resource Manager for dynamic prepopulation and controls.

Most types require the compartment OCID (dependsOn: required: compartmentId). Some types have additional required or optional items. To determine required and optional items for a type, see Meta Schema for Validation.

Optionally filter dynamically prepopulated lists by other variables using dependsOn. For example, filter subnets by VCN. For more information, see Dynamic prepopulation.

Note

Descriptions in schema.yaml files are HTML encoded in the output.

When defined in the Terraform configuration, the following variables automatically prepopulate with values on the Console pages used to create and edit the stack. The stack's values are used when you select the Terraform actions Plan, Apply, and Destroy.

  • tenancy_ocid (tenancy OCID)
  • compartment_ocid (compartment OCID)
  • region (region)
  • current_user_ocid (OCID of the current user)
Type (rendered as a dynamically prepopulated dropdown field unless otherwise noted) Resource identifier Comments
file -- Surfaces a control for adding a single file by dropping or browsing. When this control is surfaced, a user can upload a file of any extension, such as a license key or certificate. For more information, see File control.
oci:apm:domain:id Application Performance Monitoring (APM) domain OCID
oci:blockstorage:policies:id Volume backup policy
oci:container:cluster:id Kubernetes Clusters OCID
oci:core:image:id Image OCID
oci:core:instanceshape:name Instance shape name
oci:core:natgateway:id NAT gateway OCID
oci:core:nsg:id Network security group OCID
oci:core:servicegateway:id Service gateway OCID
oci:core:ssh:publickey -- Surfaces a control for adding one or more public SSH keys by dropping files or pasting key values. For more information, see SSH key control.
oci:core:subnet:id Subnet OCID
oci:core:vcn:id VCN OCID
oci:database:autonomouscontainerdatabase:id Autonomous Container Database OCID
oci:database:autonomousdatabase:id Autonomous Database OCID
oci:database:autonomousdatabaseversion:id Autonomous Database version
oci:database:database:id Database OCID for a Base Database service database, or an Exadata Database Service on Dedicated Infrastructure database.
oci:database:dbhome:id DB home OCID (applies to Base Database and Exadata Database Service on Dedicated Infrastructure)
oci:database:dbsystem:id DB system OCID (applies to Base Database)
oci:identity:availabilitydomain:name Availability domain name
oci:identity:compartment:id Compartment OCID
oci:identity:domains:id Identity domain OCID

Specify the tenancy OCID as compartmentId. See ListDomains.

oci:identity:dynamicgroups:id Dynamic group OCID

Specify the tenancy OCID as compartmentId. See ListDynamicGroups.

oci:identity:faultdomain:name Fault domain name
oci:identity:groups:id Group OCID

Specify the tenancy OCID as compartmentId. See ListGroups.

oci:identity:region:name Region name
oci:identity:tag:value Tag key name from tag namespace; see TagSummary Surfaces a control for adding defined and freeform tags. For more information, see Tagging control.
oci:kms:key:id Vault key OCID; see ListKeys
oci:kms:secret:id Vault secret OCID; see ListSecrets
oci:kms:vault:id Vault OCID
oci:kubernetes:versions:id See GetClusterOptions
oci:loadbalancer:loadbalancer:id load balancer OCID
oci:ods:project:id Data Science project OCID
oci:resourcemanager:privateendpoint:id Resource Manager private endpoint OCID Specify a compartment (compartmentId) and a VCN (vcnId) for listing private endpoints. For an example, see Example declaration for private endpoints on this page.

Meta Schema for Validation

Use the following meta schema file to confirm that your schema document is using supported variable types.

Example Schema Document

Following is an example schema document.

How to Control Console Items

Use a schema document to control the display of stack variables and other items on stack details pages in the Console.

This display control is available for stacks created from a Terraform configuration file. Using a schema document, you can define how variables look and behave during stack creation and what text is displayed in the Application information tab for a created stack.

Following are Console display items that the schema document controls. To see relevant instructions and examples, expand a display item that you're interested in.

How to Interact with Console Items

This section describes how to interact with schema-controlled display of stack information in the Oracle Cloud Infrastructure Console.

Stack information is affected by the schema document (if any) that you include in the Terraform configuration for creating the stack. The schema document affects how variables look and behave during stack creation and what text is displayed in the Application Information tab for a created stack.