スキーマ・ドキュメントを使用したコンソール・ページの拡張

リソース・マネージャでTerraform構成で使用されるスキーマ・ドキュメントの要件、サポートされているタイプおよび例を確認します。

リソース・マネージャを使用する場合、Terraform構成にはスキーマ・ドキュメントをお薦めします。スキーマ・ドキュメントを含めると、Oracle Cloud Infrastructureコンソールでページを拡張できます。SSHキー・コントロールを表示し、ネーミング、グループ化、動的に値の事前移入などによって、「スタックの作成」ページで変数エントリを容易にします。作成されたスタックに対して開く「スタックの詳細」ページの「アプリケーション情報」タブでテキストを定義します。

スキーマ・ドキュメントの要件

リソース・マネージャのスキーマ・ドキュメントには次の要件があります。

  • YAML形式。

  • データ型は、関連するTerraform構成と一致している必要があります。

    たとえば、スキーマ内のavailability変数の型numberを宣言したとします。この場合、availabilityは、関連付けられたTerraform構成で同じ宣言型(number)を持つ必要があります。(デフォルトでは、宣言型のない変数はstringを使用します。)

  • リソース・マネージャのTerraform構成のルート・フォルダの下に配置。(デフォルトでは、スキーマ・ドキュメントでは、ルート・フォルダが作業ディレクトリであるとみなされます。)

サポートされているタイプ(動的事前移入および制御)

この項では、リソース・マネージャ動的事前移入およびコントロールに対してサポートされているタイプを示します。

ほとんどのタイプにはコンパートメントOCID (dependsOn: required: compartmentId)が必要です。一部のタイプには、追加の必須項目またはオプション項目があります。タイプに対する必須およびオプションの項目を決定するには、検証用のメタ・スキーマを参照してください。

オプションで、dependsOnを使用して、他の変数によって動的に事前移入されたリストをフィルタします。たとえば、サブネットをVCNでフィルタします。詳細は、動的事前移入を参照してください。

ノート

Terraform構成で定義されている場合、次の変数によって、スタックの作成および編集に使用されるコンソール・ページに値が自動的に事前移入されます。スタックの値は、Terraformアクションの「プラン」「適用」および「破棄」を選択した場合に使用されます。

  • tenancy_ocid (テナンシOCID)
  • compartment_ocid (コンパートメントOCID)
  • region (リージョン)
  • current_user_ocid (現在のユーザーのOCID)
タイプ(特に記載がないかぎり、動的に事前移入されるドロップダウン・フィールドとしてレンダリングされます) リソース識別子 コメント
file -- 1つのファイルを削除または参照して追加するためのコントロールをサーフェスします。このコントロールを表示すると、ユーザーはライセンスキーや証明書などの任意の拡張子のファイルをアップロードできます。詳細は、File controlを参照してください。
oci:apm:domain:id Application Performance Monitoring (APM)ドメインOCID
oci:blockstorage:policies:id ボリューム・バックアップ・ポリシー
oci:container:cluster:id KubernetesクラスタOCID
oci:core:image:id イメージOCID
oci:core:instanceshape:name インスタンス・シェイプ
oci:core:natgateway:id NATゲートウェイのOCID
oci:core:nsg:id ネットワーク・セキュリティ・グループOCID
oci:core:servicegateway:id サービス・ゲートウェイOCID
oci:core:ssh:publickey -- ファイルを削除するかキー値を貼り付けて、1つ以上の公開SSHキーを追加するためのコントロールをサーフェスします。詳細は、SSH key controlを参照してください。
oci:core:subnet:id サブネット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のバージョン
oci:database:database:id ベース・データベース・サービス・データベースまたは専用インフラストラクチャ上のExadata Database ServiceデータベースのデータベースOCID。
oci:database:dbhome:id DBホームOCID (ベース・データベースおよび専用インフラストラクチャ上のExadata Database Serviceに適用されます)
oci:database:dbsystem:id DBシステムOCID (ベース・データベースに適用)
oci:identity:availabilitydomain:name 可用性ドメイン
oci:identity:compartment:id コンパートメントOCID
oci:identity:dynamicgroups:id 動的グループOCID

テナンシOCIDをcompartmentIdとして指定します。ListDynamicGroupsを参照してください。

oci:identity:faultdomain:name フォルト・ドメイン
oci:identity:groups:id グループOCID

テナンシOCIDをcompartmentIdとして指定します。ListGroupsを参照してください。

oci:identity:region:name リージョン
oci:identity:tag:value タグ・ネームスペースからのタグ・キー名TagSummaryを参照してください 定義済みタグとフリーフォーム タグを追加するためのコントロールをサーフェスします。詳細は、タグ付け制御を参照してください。
oci:kms:key:id VaultキーOCID。ListKeysを参照してください
oci:kms:secret:id VaultシークレットOCID。ListSecretsを参照してください
oci:kms:vault:id Vault OCID
oci:kubernetes:versions:id GetClusterOptionsを参照してください。
oci:loadbalancer:loadbalancer:id ロード・バランサOCID
oci:ods:project:id データ・サイエンス・プロジェクトOCID
oci:resourcemanager:privateendpoint:id リソース・マネージャ・プライベート・エンドポイントOCID プライベート・エンドポイントをリストするためのコンパートメント(compartmentId)およびVCN (vcnId)を指定します。例については、このページのプライベート・エンドポイントの宣言例を参照してください

検証用のメタ・スキーマ

次のメタ・スキーマ・ファイルを使用して、スキーマ・ドキュメントでサポートされている変数タイプを使用していることを確認します。

メタ・スキーマ
# Meta JSON Schema.
#
# This is used to validate the Schema file when the package is uploaded/loaded into Resource Manager.
# For marketplace, it is also used to validate the package when the package artifact is created in Partner Portal.
#
# NOTE: additionalProperties are set to true explicitly even though this is the default.  It must be set to true in
# cases where we use the allOf. This is a quirk of JSON Schema.  During validation, allOf means it has to match all of
# the individual definitions separately. It doesn't mean it has to match a Union of the individual definitions. This
# is a known issue with JSON Schema.
title: Schema
type: object
required:
  - variables
  - schemaVersion
additionalProperties: true
properties:
  title:
    type: string
  description:
    type: string
  stackDescription:
    type: string
  packageVersion:
    type: string
  version:
    type: string
  schemaVersion:
    type: string
    enum:
      - 1.0.0
      - 1.1.0
  locale:
    $ref: "#/definitions/locale"
  logoUrl:
    $ref: "#/definitions/url"
  source:
    $ref: "#/definitions/source"
  informationalText:
    type: string
  instructions:
    type: string
  troubleshooting:
    type: string
  allowViewState:
    type: boolean
  variables:
    $ref: "#/definitions/variables"
  # Deprecated - use variableGroups instead
  groupings:
    $ref: "#/definitions/variableGroups"
  variableGroups:
    $ref: "#/definitions/variableGroups"
  outputs:
    $ref: "#/definitions/outputs"
  outputGroups:
    $ref: "#/definitions/outputGroups"
  primaryOutputButton:
    type: string
    format: variablereference

definitions:
  source:
    type: object
    properties:
      type:
        enum:
          - marketplace
          - quickstart
          - web
      reference:
        type:
          - string
          - number
    additionalProperties: false

  variableGroups:
    type: array
    items:
      $ref: "#/definitions/variableGroup"

  variableGroup:
    type: object
    required:
      - title
      - variables
    properties:
      title:
        type: string
      variables:
        type: array
        items:
          type: string
          format: variablereference
      visible:
        $ref: "#/definitions/booleanStatement"
    additionalProperties: true

  locale:
    enum:
      - en
    default: en

  url:
    type: string
    pattern: ^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$

  ocid:
    type: string
    pattern: ^ocid1\.([a-z0-9_-]{1,32})\.([a-z0-9_-]{1,15})\.([a-z0-9]{0,24})\.([a-z0-9]{60})$

  variables:
    type: object
    additionalProperties:
      $ref: "#/definitions/variable"

  variable:
    oneOf:
      - $ref: "#/definitions/staticVariable"
      - $ref: "#/definitions/dynamicVariable"

  baseVariable:
    type: object
    properties:
      title:
        type: string
        minLength: 1
      description:
        type: string
      required:
        type: boolean
        default: false
      visible:
        $ref: "#/definitions/booleanStatement"

  booleanStatement:
    oneOf:
      - type: boolean
      - type: string
      - $ref: "#/definitions/equality"
      - $ref: "#/definitions/greaterThanOrEqual"
      - $ref: "#/definitions/lessThanOrEqual"
      - $ref: "#/definitions/greaterThan"
      - $ref: "#/definitions/lessThan"
      - $ref: "#/definitions/booleanOr"
      - $ref: "#/definitions/booleanAnd"
      - $ref: "#/definitions/booleanNot"

  equality:
    type: object
    properties:
      eq:
        type: array
        items:
          - type: [string, number]
          - type: [string, number]
        additionalItems: false
    additionalProperties: false

  greaterThanOrEqual:
    type: object
    properties:
      ge:
        type: array
        items:
          - type: [string, number]
          - type: [string, number]
        additionalItems: false
    additionalProperties: false

  lessThanOrEqual:
    type: object
    properties:
      le:
        type: array
        items:
          - type: [string, number]
          - type: [string, number]
        additionalItems: false
    additionalProperties: false

  greaterThan:
    type: object
    properties:
      gt:
        type: array
        items:
          - type: [string, number]
          - type: [string, number]
        additionalItems: false
    additionalProperties: false

  lessThan:
    type: object
    properties:
      lt:
        type: array
        items:
          - type: [string, number]
          - type: [string, number]
        additionalItems: false
    additionalProperties: false

  booleanOr:
    type: object
    properties:
      or:
        type: array
        items:
          - $ref: "#/definitions/booleanStatement"
          - $ref: "#/definitions/booleanStatement"
        additionalItems: false
    additionalProperties: false

  booleanAnd:
    type: object
    properties:
      and:
        type: array
        items:
          - $ref: "#/definitions/booleanStatement"
          - $ref: "#/definitions/booleanStatement"
        additionalItems: false
    additionalProperties: false

  booleanNot:
    type: object
    properties:
      not:
        type: array
        items:
          - $ref: "#/definitions/booleanStatement"
        additionalItems: false
    additionalProperties: false

  dependsOnCompartment:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - dependsOn
        properties:
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  staticVariable:
    oneOf:
      - $ref: "#/definitions/arrayVariable"
      - $ref: "#/definitions/booleanVariable"
      - $ref: "#/definitions/enumVariable"
      - $ref: "#/definitions/integerVariable"
      - $ref: "#/definitions/numberVariable"
      - $ref: "#/definitions/stringVariable"
      - $ref: "#/definitions/multilineVariable"
      - $ref: "#/definitions/fileVariable"

      - $ref: "#/definitions/passwordVariable"
      - $ref: "#/definitions/datetimeVariable"

  dynamicVariable:
    oneOf:
      - $ref: "#/definitions/imageVariable"
      - $ref: "#/definitions/instanceShapeVariable"
      - $ref: "#/definitions/subnetVariable"
      - $ref: "#/definitions/vcnVariable"
      - $ref: "#/definitions/availabilityDomainVariable"
      - $ref: "#/definitions/compartmentVariable"
      - $ref: "#/definitions/faultDomainVariable"
      - $ref: "#/definitions/regionVariable"
      - $ref: "#/definitions/dbSystemVariable"
      - $ref: "#/definitions/dbHomeVariable"
      - $ref: "#/definitions/dbHomeVersionVariable"
      - $ref: "#/definitions/databaseVariable"
      - $ref: "#/definitions/autonomousDatabaseVariable"
      - $ref: "#/definitions/autonomousDatabaseVersionVariable"
      - $ref: "#/definitions/autonomousContainerDBVariable"
      - $ref: "#/definitions/kmsVaultVariable"
      - $ref: "#/definitions/containerClusterVariable"
      - $ref: "#/definitions/volumeBackupPoliciesVariable"
      - $ref: "#/definitions/loadBalancerVariable"
      - $ref: "#/definitions/serviceGatewayVariable"
      - $ref: "#/definitions/kubernetesVersionsVariable"
      - $ref: "#/definitions/instanceVariable"
      - $ref: "#/definitions/natGatewayVariable"
      - $ref: "#/definitions/tagVariable"
      - $ref: "#/definitions/nsgVariable"
      - $ref: "#/definitions/mountTargetsVariable"
      - $ref: "#/definitions/kmsKeyVariable"
      - $ref: "#/definitions/kmsSecretVariable"
      - $ref: "#/definitions/odsProjectVariable"
      - $ref: "#/definitions/instanceShapeVariableWithFlex"
      - $ref: "#/definitions/groupsVariable"
      - $ref: "#/definitions/dynamicGroupsVariable"
      - $ref: "#/definitions/logAnalyticsLogGroup"
      - $ref: "#/definitions/logAnalyticsLogEntities"
      - $ref: "#/definitions/logAnalyticsScheduledTasks"
      - $ref: "#/definitions/logAnalyticsEntityTypes"
      - $ref: "#/definitions/managementAgents"
      - $ref: "#/definitions/logAnalyticsSources"
      - $ref: "#/definitions/privateEndpointVariable"
      - $ref: "#/definitions/apmDomainVariable"

  nonNegativeInteger:
    type: integer
    minimum: 0

  nonNegativeIntegerDefault0:
    allOf:
      - $ref: "#/definitions/nonNegativeInteger"
      - default: 0

  arrayVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [array]
          items:
            $ref: "#/definitions/variable"
          maxItems:
            $ref: "#/definitions/nonNegativeInteger"
          minItems:
            $ref: "#/definitions/nonNegativeIntegerDefault0"
          uniqueItems:
            type: boolean
            default: false
          contains:
            $ref: "#/definitions/variable"
        additionalProperties: true

  booleanVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [boolean]
          default:
            $ref: "#/definitions/booleanStatement"
            default: false
        additionalProperties: true

  enumVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [enum]
          enum:
            type: array
            items:
              type: string
          default:
            $ref: "#/definitions/booleanStatement"
          allowMultiple:
            type: boolean
            default: false
        additionalProperties: true

  integerVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [integer]
          default:
            type: integer
          multipleOf:
            type: number
            exclusiveMinimum: 0
          minimum:
            type: number
          maximum:
            type: number
          exclusiveMinimum:
            type: number
          exclusiveMaximum:
            type: number
        additionalProperties: true

  numberVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [number]
          default:
            type: number
          multipleOf:
            type: number
            exclusiveMinimum: 0
          minimum:
            type: number
          maximum:
            type: number
          exclusiveMinimum:
            type: number
          exclusiveMaximum:
            type: number
        additionalProperties: true

  stringVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [string]
          default:
            $ref: "#/definitions/booleanStatement"
          pattern:
            type: string
          maxLength:
            $ref: "#/definitions/nonNegativeInteger"
          minLength:
            $ref: "#/definitions/nonNegativeIntegerDefault0"
        additionalProperties: true

  multilineVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [text]
          default:
            $ref: "#/definitions/booleanStatement"
          pattern:
            type: string
          multiline:
            type: boolean
          maxLength:
            $ref: "#/definitions/nonNegativeInteger"
          minLength:
            $ref: "#/definitions/nonNegativeIntegerDefault0"
        additionalProperties: true

  fileVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [file]
        additionalProperties: true

  passwordVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [password]
          default:
            $ref: "#/definitions/booleanStatement"
          confirmation:
            $ref: "#/definitions/booleanStatement"
        additionalProperties: true

  datetimeVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [datetime]
          default:
            $ref: "#/definitions/booleanStatement"
        additionalProperties: true

  imageVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:image:id]
          pattern:
            type: string
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
              shape:
                type: string
                format: variablereference
              operatingSystem:
                type: string
                format: variablereference
              operatingSystemVersion:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  instanceShapeVariableWithFlex:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:instanceshapewithflex:name]
          pattern:
            type: string
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              imageId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
              availabilityDomain:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  instanceShapeVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:instanceshape:name]
          pattern:
            type: string
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              imageId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
              availabilityDomain:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  natGatewayVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:natgateway:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              vcnId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  instanceVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:instance:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  subnetVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:subnet:id]
          dependsOn:
            type: object
            required:
              - vcnId
              - compartmentId
            properties:
              vcnId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
              hidePublicSubnet:
                $ref: "#/definitions/booleanStatement"
              hidePrivateSubnet:
                $ref: "#/definitions/booleanStatement"
              hideRegionalSubnet:
                $ref: "#/definitions/booleanStatement"
              hideAdSubnet:
                $ref: "#/definitions/booleanStatement"
            additionalProperties: false
        additionalProperties: true

  serviceGatewayVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:servicegateway:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              vcnId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  logAnalyticsLogGroup:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:logan:loggroup:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  logAnalyticsScheduledTasks:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:logan:scheduledtask:id]
          dependsOn:
            type: object
            required:
              - compartmentId
              - taskType
            properties:
              compartmentId:
                type: string
                format: variablereference
              taskType:
                type: string
            additionalProperties: false
        additionalProperties: true

  logAnalyticsLogEntities:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:logan:logentity:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  logAnalyticsEntityTypes:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
        properties:
          type:
            enum: [oci:logan:entitytype:id]
        additionalProperties: true

  managementAgents:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:mgmt:agent:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  logAnalyticsSources:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:logan:source:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  nsgVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:core:nsg:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              vcnId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  vcnVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:core:vcn:id]
        additionalProperties: true

  availabilityDomainVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:identity:availabilitydomain:name]
        additionalProperties: true

  compartmentVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [oci:identity:compartment:id]
          default:
            $ref: "#/definitions/booleanStatement"
        additionalProperties: true

  faultDomainVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:identity:faultdomain:name]
          dependsOn:
            type: object
            required:
              - compartmentId
              - availabilityDomainName
            properties:
              compartmentId:
                type: string
                format: variablereference
              availabilityDomainName:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  regionVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [oci:identity:region:name]
          default:
            $ref: "#/definitions/booleanStatement"
            default: ${session.region}
        additionalProperties: true

  dbSystemVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:database:dbsystem:id]
        additionalProperties: true

  dbHomeVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:database:dbhome:id]
          dependsOn:
            type: object
            required:
              - dbSystemId
              - compartmentId
            properties:
              dbSystemId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  dbHomeVersionVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:database:dbhome:dbversion]
          dependsOn:
            type: object
            required:
              - dbHomeId
            properties:
              dbHomeId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  databaseVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:database:database:id]
          dependsOn:
            type: object
            required:
              - dbHomeId
              - compartmentId
            properties:
              dbHomeId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  autonomousDatabaseVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:database:autonomousdatabase:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
              dbWorkload:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  autonomousDatabaseVersionVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:database:autonomousdatabaseversion:id]
          dependsOn:
            type: object
            properties:
              compartmentId:
                type: string
                format: variablereference
              dbWorkload:
                type: string
                format: variablereference
              additionalProperties: false
        additionalProperties: true

  autonomousContainerDBVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:database:autonomouscontainerdatabase:id]
        additionalProperties: true

  kmsVaultVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:kms:vault:id]
        additionalProperties: true

  kmsKeyVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:kms:key:id]
          dependsOn:
            type: object
            required:
              - compartmentId
              - vaultId
            properties:
              compartmentId:
                type: string
                format: variablereference
              vaultId:
                type: string
                format: variablereference
              protectionMode:
                type: string
                format: variablereference
              algorithm:
                type: string
                format: variablereference
              length:
                type: number
                format: variablereference
              curveId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  kmsSecretVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:kms:secret:id]
          dependsOn:
            type: object
            required:
              - compartmentId
            properties:
              compartmentId:
                type: string
                format: variablereference
              vaultId:
                type: string
                format: variablereference
              name:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  containerClusterVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:container:cluster:id]
        additionalProperties: true

  sshPublicKeyVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [oci:core:ssh:publickey]
        additionalProperties: true

  kubernetesVersionsVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:kubernetes:versions:id]
          dependsOn:
            type: object
            required:
              - clusterOptionId
              - compartmentId
            properties:
              clusterOptionId:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  volumeBackupPoliciesVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [oci:blockstorage:policies:id]
          dependsOn:
            type: object
            properties:
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  groupsVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:identity:groups:id]
        additionalProperties: true

  dynamicGroupsVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:identity:dynamicgroups:id]
        additionalProperties: true

  loadBalancerVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:loadbalancer:loadbalancer:id]
          pattern:
            type: string
        additionalProperties: true

  mountTargetsVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required:
          - type
          - dependsOn
        properties:
          type:
            enum: [oci:mount:target:id]
          dependsOn:
            type: object
            required:
              - compartmentId
              - availabilityDomain
            properties:
              availabilityDomain:
                type: string
                format: variablereference
              compartmentId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  tagVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:identity:tag:value]
        additionalProperties: true

  odsProjectVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:ods:project:id]
        additionalProperties: true

  privateEndpointVariable:
    allOf:
      - $ref: "#/definitions/baseVariable"
      - required: [type]
        properties:
          type:
            enum: [oci:resourcemanager:privateendpoint:id]
          dependsOn:
            type: object
            required:
              - compartmentId
              - vcnId
            properties:
              compartmentId:
                type: string
                format: variablereference
              vcnId:
                type: string
                format: variablereference
            additionalProperties: false
        additionalProperties: true

  apmDomainVariable:
    allOf:
      - $ref: "#/definitions/dependsOnCompartment"
      - required: [type]
        properties:
          type:
            enum: [oci:apm:domain:id]
        additionalProperties: true

  outputs:
    type: object
    additionalProperties:
      $ref: "#/definitions/output"

  output:
    oneOf:
      - $ref: "#/definitions/booleanOutput"
      - $ref: "#/definitions/numberOutput"
      - $ref: "#/definitions/stringOutput"
      - $ref: "#/definitions/copyableStringOutput"
      - $ref: "#/definitions/linkOutput"
      - $ref: "#/definitions/ocidOutput"
      - $ref: "#/definitions/mapOutput"
      - $ref: "#/definitions/jsonOutput"
      - $ref: "#/definitions/listOutput"
      - $ref: "#/definitions/csvOutput"

  outputGroups:
    type: array
    items:
      $ref: "#/definitions/outputGroup"

  outputGroup:
    type: object
    required:
      - title
      - outputs
    properties:
      title:
        type: string
      outputs:
        type: array
        items:
          type: string
    additionalProperties: true

  baseOutput:
    type: object
    properties:
      title:
        type: string
      description:
        type: string
      sensitive:
        type: boolean
        default: false
      format:
        type: string
      visible:
        type: boolean
        default: true
    additionalProperties: true

  booleanOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [boolean]
          value:
            type: boolean
        additionalProperties: true

  numberOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [number]
          value:
            type: number
        additionalProperties: true

  stringOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [string]
          value:
            type: string
        additionalProperties: true

  copyableStringOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [copyableString]
          value:
            type: string
        additionalProperties: true

  mapOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [map]
          value:
            type: object
        additionalProperties: true

  jsonOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [json]
          value:
            type: object
        additionalProperties: true

  listOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [list]
          value:
            type: array
        additionalProperties: true

  csvOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [csv]
          value:
            type: array
        additionalProperties: true

  linkOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [link]
          displayText:
            type: string
            minLength: 3
            maxLength: 45
          value:
            $ref: "#/definitions/url"
        additionalProperties: true

  ocidOutput:
    allOf:
      - $ref: "#/definitions/baseOutput"
      - required: [type]
        properties:
          type:
            enum: [ocid]
          value:
            $ref: "#/definitions/ocid"
        additionalProperties: true

スキーマ・ドキュメントの例

次に、スキーマ・ドキュメントの例を示します。

# Title shown in Application Information tab.
title: Sample input variable schema
# Sub Title shown in Application Information tab.
description: Sample description...
informationalText: Sample informational text to display in tab...
schemaVersion: 1.1.0
version: "20190304"

# URL of Logo Icon used on Application Information tab. Logo must be 130x130 pixels.
# (Optional)
logoUrl: https://cloudmarketplace.oracle.com/marketplace/content?contentId=53066708

# Used in Application Information tab to Hyperlink Title and Logo to the Marketplace
# Listing.
# Also used to link to Listing Usage section for "View Instructions".
# (Optional) If it is missing, Application Information uses the
# "marketplace-listing-id" tag for the same purpose.
source:
  type: marketplace
  reference: 16132843

locale: "en"
variableGroups:
  - title: "Node Configuration"
    variables:
      - targetCompartment
      - ${nodeCount}
      - ${nodeShapes}
      - ${availability}
  - title: "Application Details"
    variables:
      - ${username}
      - ${password}
      - ${dnsServers}
  - title: "Subnet"
    variables:
      - ${vcnCompartment}
      - ${myVcn}
      - ${subnetCompartment}
      - ${mySubnet}
      - ${mySubnetWithFilter}
      - ${hide_public_subnet}
      - ${hide_private_subnet}
      - ${hide_regional_subnet}
      - ${hide_ad_subnet}
  - title: "Network Configuration"
    variables:
      - ${service_gateway}
      - ${nat_gateway}
      - ${load_balancer}
      - ${myNsg}
      - ${Kubernetes_version}
      - ${backup_policies}
      - ${mount_target}
  - title: "Existing Groups"
    variables:
      - ${iam_groups_use_existing}
  - title: "Identity"
    variables:
      - ${iam_groups}
      - ${iam_dynamic_groups}
  - title: "Database"
    variables:
      - ${dbCompartment}
      - ${myDbSystem}
      - ${myDbHome}
      - ${myDb}
      - ${myAutonomousDB}
      - ${myAutonomousDBVersion}
  - title: "Advanced"
    variables:
      - ${myImageId}
      - ${myInstance}
      - ${myShape}
      - ${myCompatibleShape}
      - ${myCompatibleShapeBasedOnAd}
      - ${multilineText}
    visible: true
  - title: "Hidden"
    variables:
      - ${myRegion}
    visible: false
  - title: "Existing Vcn"
    variables:
      - ${myVcn}
    visible:
      or:
        - ${useExistingVcn}
        - and:
            - and:
                - true
                - true
            - not:
                - false
  - title: "Password can't be 'password'!"
    variables:
      - ${password}
  - title: "Complex Conditional Section"
    variables:
      - ${myVcn}
    visible:
      or:
        - ${useExistingVcn}
        - and:
            - and:
                - true
                - true
            - not:
                - false
  - title: "Equality Conditional Section"
    variables:
      - ${myVcn}
    visible:
      eq:
        - ${objectStorageTier}
        - standard
  - title: "Less than Conditional Section"
    variables:
      - ${myVcn}
    visible:
      lt:
        - ${availability}
        - 5
  - title: "Less than or Equal Conditional Section"
    variables:
      - ${myVcn}
    visible:
      le:
        - ${availability}
        - 4
  - title: "Greater than Conditional Section"
    variables:
      - ${myVcn}
    visible:
      gt:
        - ${availability}
        - 5
  - title: "Greater than or Equal Conditional Section"
    variables:
      - ${myVcn}
    visible:
      ge:
        - ${availability}
        - 4
  - title: "Vault section"
    variables:
      - ${myVault}
      - ${myVaultKey}
      - ${mode}
      - ${myCompatibleKey}
      - ${algo}
      - ${myCompatibleKeyBasedOnAlgo}
      - ${mySecret}
      - ${myVaultSecret}
  - title: "DataScience"
    variables:
      - ${ods_project_ocid}
  - title: "Generic File"
    variables:
      - ${generic_file}
  - title: "Resource Tagging"
    variables:
      - ${tag}
  - title: "Resource Manager Section"
    variables:
      - ${private_endpoint_ocid}
  - title: "APM Domain Selection"
    variables:
      - ${apmDomain}

variables:
  # string field
  username:
    type: string
    minLength: 1
    maxLength: 255
    pattern: "^[a-z][a-zA-Z0-9]+$"
    # title is used as the label if present
    title: Username
    # description used as the tooltip if present
    description: Enter your username
    default: admin
    required: true

  # password field
  password:
    description: Really Bad Password Field
    type: password
    pattern: "^[a-zA-z]{1,8}$"
    required: true

  # integer field
  nodeCount:
    type: integer
    description: Number of Nodes
    minimum: 3
    maximum: 12
    multipleOf: 3

  # non-integer number field
  availability:
    type: number
    default: 99.7
    maximum: 100
    minimum: 0

  # string enum
  objectStorageTier:
    type: enum
    enum:
      - archive
      - standard
    allowMultiple: false

  # input a list, each element must be an ip addresses
  dnsServers:
    type: array
    items:
      type: string
      pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
    minItems: 1
    uniqueItems: true
    default: [8.8.8.8, 8.8.4.4]

  # datetime picker
  expireDate:
    type: datetime

  # compartmentId dynamic dropdown, targetCompartment present in input variables
  targetCompartment:
    type: oci:identity:compartment:id

  # ---- subnet picker ---- #

  useExistingVcn:
    type: boolean

  vcnCompartment:
    type: oci:identity:compartment:id
    visible: ${useExistingVcn}

  myVcn:
    type: oci:core:vcn:id
    dependsOn:
      compartmentId: ${vcnCompartment}
    visible:
      or:
        - ${useExistingVcn}
        - and:
            - and:
                - true
                - true
            - not:
                - false

  subnetCompartment:
    type: oci:identity:compartment:id
    visible: ${useExistingVcn}

  mySubnet:
    type: oci:core:subnet:id
    dependsOn:
      compartmentId: ${subnetCompartment}
      vcnId: ${myVcn}
    visible: ${useExistingVcn}

  mySubnetWithFilter:
    type: oci:core:subnet:id
    dependsOn:
      compartmentId: ${subnetCompartment}
      vcnId: ${myVcn}
      hidePublicSubnet: ${hide_public_subnet}
      hidePrivateSubnet: ${hide_private_subnet}
      hideRegionalSubnet: ${hide_regional_subnet}
      hideAdSubnet: ${hide_ad_subnet}
    visible: ${useExistingVcn}

  hide_public_subnet:
    type: boolean
    default: false

  hide_private_subnet:
    type: boolean
    default: false

  hide_regional_subnet:
    type: boolean
    default: false

  hide_ad_subnet:
    type: boolean
    default: false

  load_balancer:
    type: oci:loadbalancer:loadbalancer:id
    pattern: ^(10)Mbps.*$
    title: Existing LBaaS for "Application" Evaluation
    required: true
    dependsOn:
      compartmentId: ${vcnCompartment}

  Kubernetes_version:
    type: oci:kubernetes:versions:id
    title: Kubernetes version
    description: The Oracle cloud kubernetes version for tenancy.
    required: true
    visible: true
    dependsOn:
      compartmentId: ${vcnCompartment}
      clusterOptionId: "all"

  backup_policies:
    type: oci:blockstorage:policies:id
    title: Backup Policy
    description: The Oracle Cloud Backup Policy for tenancy.
    required: true

  mount_target:
    type: oci:mount:target:id
    title: Mount target
    description: The Oracle Cloud mount target
    dependsOn:
      compartmentId: ${targetCompartment}
      availabilityDomain: ${myAvailabilityDomain}

  myNsg:
    type: oci:core:nsg:id
    title: "Network Security Group"
    description: "Network Security Group description"
    dependsOn:
      compartmentId: ${vcnCompartment}

  service_gateway:
    type: oci:core:servicegateway:id
    title: NAT Gateway
    dependsOn:
      compartmentId: ${vcnCompartment}
      vcnId: ${myVcn}

  nat_gateway:
    type: oci:core:servicegateway:id
    title: NAT Gateway
    dependsOn:
      compartmentId: ${vcnCompartment}
      vcnId: ${myVcn}

  iam_groups_use_existing:
    type: boolean
    title: Use existing Groups
    required: true
    default: false

  iam_groups:
    type: oci:identity:groups:id
    title: Group Name
    dependsOn:
      compartmentId: ${targetCompartment}
    visible:
      or:
        - ${iam_groups_use_existing}
        - and:
            - and:
                - true
                - true
            - not:
                - false

  iam_dynamic_groups:
    type: oci:identity:dynamicgroups:id
    title: Dynamic Group Name
    dependsOn:
      compartmentId: ${targetCompartment}
    visible:
      or:
        - ${iam_groups_use_existing}
        - and:
            - and:
                - true
                - true
            - not:
                - false

  myRegion:
    type: oci:identity:region:name
    visible: false

  myImageId:
    type: oci:core:image:id
    dependsOn:
      compartmentId: ${targetCompartment}

  myShape:
    type: oci:core:instanceshape:name
    dependsOn:
      compartmentId: ${targetCompartment}

  myInstance:
    type: oci:core:instance:id
    dependsOn:
      compartmentId: ${targetCompartment}

  myCompatibleShape:
    type: oci:core:instanceshape:name
    dependsOn:
      compartmentId: ${targetCompartment}
      imageId: ${myImageId}
    visible:
      or:
        - ${useExistingVcn}
        - and:
            - and:
                - true
                - true
            - not:
                - false

  myCompatibleShapeBasedOnAd:
    type: oci:core:instanceshape:name
    dependsOn:
      compartmentId: ${targetCompartment}
      availabilityDomain: ${myAvailabilityDomain}
    visible:
      or:
        - ${useExistingVcn}
        - and:
            - and:
                - true
                - true
            - not:
                - false

  myAvailabilityDomain:
    type: oci:identity:availabilitydomain:name
    dependsOn:
      compartmentId: ${targetCompartment}
    visible: complexExpression

  myFaultdomain:
    type: oci:identity:faultdomain:name
    dependsOn:
      compartmentId: ${targetCompartment}
      availabilityDomainName: ${myAvailabilityDomain}

  dbCompartment:
    type: oci:identity:compartment:id

  myDbSystem:
    type: oci:database:dbsystem:id
    dependsOn:
      compartmentId: ${dbCompartment}

  myDbHome:
    type: oci:database:dbhome:id
    dependsOn:
      dbSystemId: ${myDbSystem}
      compartmentId: ${dbCompartment}

  myDbHomeVersion:
    type: oci:database:dbhome:dbversion
    dependsOn:
      dbHomeId: ${myDbHome}

  myDb:
    type: oci:database:database:id
    dependsOn:
      dbHomeId: ${myDbHome}
      compartmentId: ${dbCompartment}

  myAutonomousDB:
    type: oci:database:autonomousdatabase:id
    dependsOn:
      compartmentId: ${dbCompartment}
      dbWorkload: "DW"

  myAutonomousDBVersion:
    type: oci:database:autonomousdatabaseversion:id
    title: AutonomousDatabaseVersionTitle
    description: AutonomousDatabaseVersionDescription
    required: true
    default: "19c"
    dependsOn:
      compartmentId: ${compartment_ocid}
      dbWorkload: "AJD"

  container_cluster_ocid:
    type: oci:container:cluster:id
    required: true
    title: OKE Cluster
    description: Kubernetes cluster managed by OCI Container Engine for Kubernetes
    dependsOn:
      compartmentId: ${compartment_ocid}

  myVault:
    type: oci:kms:vault:id
    title: "vault"
    description: "vault"
    dependsOn:
      compartmentId: ${targetCompartment}

  myVaultKey:
    type: oci:kms:key:id
    title: "key"
    description: "key"
    dependsOn:
      compartmentId: ${targetCompartment}
      vaultId: ${myVault}

  mode:
    type: enum
    enum:
      - Hsm
      - Software
    allowMultiple: false

  myCompatibleKey:
    type: oci:kms:key:id
    title: "key"
    description: "key"
    dependsOn:
      compartmentId: ${targetCompartment}
      vaultId: ${myVault}
      protectionMode: ${mode}

  algo:
    type: enum
    enum:
      - AES
      - RSA
      - ECDSA
    allowMultiple: true

  myCompatibleKeyBasedOnAlgo:
    type: oci:kms:key:id
    title: "key"
    description: "key"
    dependsOn:
      compartmentId: ${targetCompartment}
      vaultId: ${myVault}
      protectionMode: ${mode}
      algorithm: ${algo}

  mySecret:
    type: "oci:kms:secret:id"
    title: "secret"
    description: "secret"
    dependsOn:
      compartmentId: ${targetCompartment}

  myVaultSecret:
    type: "oci:kms:secret:id"
    title: "secret"
    description: "secret"
    dependsOn:
      compartmentId: ${targetCompartment}
      vaultId: ${myVault}

  ods_project_ocid:
    type: oci:ods:project:id
    required: true
    title: odsProject
    description: "Select ods project from list"
    dependsOn:
      compartmentId: ${targetCompartment}

  generic_file:
    type: file
    required: true
    title: GenericFile
    description: "Drop a raw file (stored as base64 string data)"

  tag:
    type: oci:identity:tag:value
    required: true
    title: Tagging
    description: Tag value for resource created
    dependsOn:
      compartmentId: ${targetCompartment}

  private_endpoint_ocid:
    type: oci:resourcemanager:privateendpoint:id
    required: true
    title: privateEndpoint
    description: "Resource Manager Private Endpoint for Private Access"
    dependsOn:
      compartmentId: ${targetCompartment}
      vcnId: ${vcnId}

  multilineText:
    type: text
    required: false
    multiline: true
    title: Multi-line value
    description: Multi-line value
    default: "First line\nSecond line\nThird line"

  apmDomainVariable:
    type: oci:apm:domain:id
    title: "APM Domain"
    description: "APM Domain"
    dependsOn:
      compartmentId: ${targetCompartment}

# Used to present outputs with more refinement on the Application Information tab.
# The Application Information tab is only shown if the schema has a "title",
# "description", and at least one output in this "outputs" section.
#
# type:
#   - boolean
#   - string
#   - number
#   - link - contains url that can be hyperlinked.  If type is not specified and the
#            value is a proper url, this type is assumed.
#   - ocid - contains an OCID.  An attempt is made to hyperlink it to the designated
#            resource in the console.
#   - csv - synonym for list.  Array of values converted to a comma separated list.
#   - json - synonym for map.  Map of key / values converted to JSON.
#   - list - array of values converted to a comma separated list.
#   - map - map of key / values converted to JSON.
#
# displayText: used in links to give text displayed instead of value
# title: friendly label
# visible: if false, this ouptut is not shown in the outputs section of Application Information.
#          It can still be used as the primaryOutputButton.
outputs:
  controlCenterUrl:
    type: link
    title: Control Center
    displayText: Control Center
    visible: false

  schemaRegistryUrl:
    type: link
    title: Schema Registry
    displayText: Schema Registry

  schemaRegistryPublicIps:
    type: csv
    title: Public IPs

  schemaRegistryLoadBalancer:
    type: ocid
    title: Load Balancer

  brokerPublicIps:
    type: csv

  connectUrl:
    type: link
    title: Connect
    displayText: Connect

  connectPublicIps:
    type: csv
    title: Public IPs

  restUrl:
    type: link
    title: Rest API

# primaryOutputButton is a reference to a link output that creates a primary button
# on the Application Information tab.
# (Optional) if not provided, no primary button is shown.  Also if the output
# referenced is not a link output, no button is shown.
primaryOutputButton: ${controlCenterUrl}

# Used to group Outputs.  Any outputs not included in these defined groups, are
# included in a default group labelled "Outputs".
# (Optional) if not groups are given, outputs are not grouped at all.
outputGroups:
  - title: Schema Registry
    outputs:
      - ${schemaRegistryUrl}
      - ${schemaRegistryPublicIps}
      - ${schemaRegistryInstances}
      - ${schemaRegistryLoadBalancer}

  - title: Broker / Connect
    outputs:
      - ${brokerPublicIps}
      - ${brokerInstances}
      - ${connectUrl}
      - ${connectPublicIps}
      - ${restUrl}

コンソール・アイテムを制御する方法

スキーマ・ドキュメントを使用して、コンソールのスタック詳細ページでのスタック変数およびその他のアイテムの表示を制御します。

この表示コントロールは、Terraform構成ファイルから作成されたスタックで使用できます。スキーマ・ドキュメントを使用すると、スタック作成時の変数の外観と動作、および作成されたスタックの「アプリケーション情報」タブに表示されるテキストを定義できます。

次に、スキーマ・ドキュメントで制御されるコンソールの表示項目を示します。 関連する指示および例を表示するには、目的の表示項目を展開します。

フィールド・ラベルおよび説明

変数のフィールド ラベルと説明をレンダリングするには、次の手順に従います。

  • title: <field_label>およびdescription: <field_description>を追加します。

変数フィールドのラベルおよび説明のイメージの例:

「詳細ロギング」フィールドと「拡張ロギング(VCNフロー・ログまたは監査ログ、あるいはその両方)の有効化または無効化」の説明。

変数フィールドのラベルと説明の宣言例:

  advanced_logging_option:
    type: enum
    description: "Enable or disable advanced logging (VCN flow logs and/or audit logs)."
    title: "Advanced logging"
デフォルト値

デフォルト値を使用して変数をレンダリングするには:

  • default: <default-value>を追加します。

デフォルト値を持つ変数のイメージの例:

セキュリティ・ポリシーの変数グループ名のデフォルト値"DataScienceGroup"。

デフォルト値の宣言例:

  ods_group_name:
    type: string
    title: ${Messages.solutionsHub.solutions.dataScience.variables.ods_group_name.title()}
    description: ${Messages.solutionsHub.solutions.dataScience.variables.ods_group_name.description()}
    required: true
  # provide a default value
    default: "DataScienceGroup"
複数行テキスト・フィールド

変数を複数行テキスト・フィールドとしてレンダリングするには:

  • multiline: trueを追加します。

複数の行でデフォルト値を宣言するには:

  • 各行を\nで区切ります。

2行のテキストが入力された複数行のテキスト・フィールドとしてレンダリングされる変数のイメージの例:

2行のテキストが入力された複数行テキスト・フィールド。

複数行のテキスト・フィールドの宣言例:

  otherNames:
    type: text
    required: false
    multiline: true
    title: "Other Names"
    description: "Enter one name per line."
    default: "Name1\nName2"
グループと順序

変数を所定の順序でグループ(ボックス)にレンダリングするには:

  • variableGroupsブロックを追加します。
  • このブロックにtitle行を追加します。
  • variablesブロックをvariableGroupsに追加します。
  • variablesブロックに必要な順序で変数を追加します。

変数のグループのイメージの例:

ユーザー名とパスワードのフィールドを含む変数グループWordPress構成。

規定の順序を持つ変数のグループに対する宣言の例:

variableGroups:
  - title: "WordPress configuration"
    variables:
    - wp_admin_user
    - wp_admin_password
SSHキー制御
変数をSSHキー・コントロールとしてレンダリングするには:
  • type: oci:core:ssh:publickeyを追加します。

SSHキー制御のイメージの例:

SSH鍵制御。

SSHキー・コントロールの宣言の例:

  ssh_public_key:
    title: SSH public key
    description: Public SSH key to be included in the ~/.ssh/authorized_keys file for the default user on the instance
    # renders variable as an SSH key control
    type: oci:core:ssh:publickey
    additionalProps:
      allowMultiple: true
    required: false
    default: [""]
    pattern: "((^(ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)(,((ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)*$"
ファイル制御

変数をファイル・コントロールとしてレンダリングするには:

  • type: fileを追加します。

    ノート

    アップロードされたファイルはBase64形式で格納されます。ファイルを使用するには、出力をデコードします。たとえば、次のコードをTerraform構成のoutputs.tfファイルに追加します。
    output "generic_file_raw" {
      value = base64decode(var.generic_file)
    }

ファイル・コントロールのイメージの例:

ファイル制御。

ファイル制御の宣言例:

  generic_file:
    type: file
    title: generic_file
    description: Drop any file or browse
    required: true
タグ付け制御

変数をタグ付けコントロールとしてレンダリングするには:

  • type: oci:identity:tag:valueを追加します。

    ノート

    コンソールでタグ値を事前移入するには、Terraform構成から値にアクセスします。たとえば、次のコードをTerraform構成のmain.tfファイルに追加します。
    resource "oci_logging_log_group" "sample_log_group" {
      compartment_id = var.compartment_ocid
      display_name   = "sample_log_group"
      description    = "Prepopulated tag values"
      freeform_tags  = var.tag_value.freeformTags
      defined_tags   = var.tag_value.definedTags
    }

タグ付け制御のイメージの例:

タグ制御。

タグ付け制御の宣言例:

  tag_value:
    type: oci:identity:tag:value
    title: Tags
    required: true
動的事前移入

依存関係に基づく値を変数に動的に事前移入するには:

動的に事前移入された変数のイメージの例:

「仮想クラウド・ネットワーク(VCN)」フィールドに事前移入された値。

動的に事前移入される変数の宣言例:

    vcn_ocid:
    "title": "Virtual cloud network (VCN)",
    "description": "The virtual cloud network to use with the compute instance. You can use the subnets template to create a VCN."
    # prepopulates available values for VCN
      type: oci:core:vcn:id
    # determines values for prepopulation from selected compartment
      dependsOn:
        compartmentId: compartment_ocid
      required: true
      default: ""

プライベート・エンドポイントの宣言の例:

  private_endpoint_ocid:
    type: oci:resourcemanager:privateendpoint:id
    required: true
    title: "Resource Manager Private Endpoint"
    description: "Resource Manager Private Endpoint for Private Access"
    dependsOn:
      compartmentId: ${privateEndpointCompartmentOCID}
      vcnId: ${privateEndpointVCNOCID}

コンパートメントに応じたVCNの宣言例(コンパートメントとVCNの両方に応じてサブネットを使用):

  vcnCompartment:
    # prepopulates available values for compartment
    type: oci:identity:compartment:id
 
myVcn:
    # prepopulates available values for VCN
    type: oci:core:vcn:id
    # determines values for VCN prepopulation from selected compartment
    dependsOn:
      compartmentId: ${vcnCompartment}
 
subnetCompartment:
    # prepopulates available values for compartment
    type: oci:identity:compartment:id
 
mySubnet:
    # prepopulates available values for subnet
    type: oci:core:subnet:id
    # determines values for subnet prepopulation from selected compartment and VCN
    dependsOn:
      compartmentId: ${subnetCompartment}
      vcnId: ${myVcn}

イメージのサンプル宣言1。イメージはコンパートメントのみに依存します(1つの必須dependsOnフィールド)。

  instance_image:    
    title: Image    
    description: Image    
    type: oci:core:image:id    
    required: true    
    dependsOn:      
       compartmentId: ${compartment_ocid}

イメージのサンプル宣言2。イメージはコンパートメント、オペレーティング・システム、オペレーティング・システムのバージョンおよびシェイプによって異なります:

  instance_image:    
    title: Image    
    description: Image    
    type: oci:core:image:id    
    required: true    
    dependsOn:      
       compartmentId: ${compartment_ocid}      
       operatingSystem: "Oracle Linux"      
       operatingSystemVersion: "7.8"
       shape: "<shape name>"
列挙値(単一値の選択)

変数の列挙値をレンダリングするには(1つの値を選択できるようにするには):

  • type: enumを追加し、enumブロックを追加します。

単一値を選択できる列挙値を含む変数のイメージの例:

「拡張ロギング」フィールドの列挙値。

列挙値を含む変数の宣言例:

  advanced_logging_option:
    title: "Advanced logging"
    description: "Enable or disable advanced logging (VCN flow logs and/or audit logs)."
    type: enum
    # enumerated values
    enum:
    - AUDIT_LOGS
    - FLOW_LOGS
    - BOTH
    - NONE
    default: NONE
    required: true
列挙値(複数値選択)

変数の列挙値をレンダリングするには(複数の値を選択できるようにするには):

  • type: enumを追加し、enumブロックを追加します。
  • additionalProps:を追加し、allowMultiple:trueブロックを追加します。

複数の値を選択できる列挙値を含む変数のイメージの例:

この図は、複数の値を選択できる列挙値を持つ変数を示しています。

列挙値を含む変数の宣言の例(複数値の選択):

    attachment_type:
      type: enum
      title: "Attachment type"
      additionalProps:
        allowMultiple: true
      default: "iscsi"
      # enumerated values (multiple value selection)
      enum:
        - "iscsi"
        - "paravirtualized"
チェックボックス

変数をチェック・ボックスとしてレンダリングするには:

  • type: booleanを追加します。

チェック・ボックス変数のイメージの例:

ボールト・サポートを有効にする変数のチェック・ボックス・レンダリング。

チェック・ボックス変数の宣言例:

  ods_vcn_use_existing:
    # renders variable as a check box
    type: boolean
    title: "Enable vault support?"
    description: "Use a vault to store secrets and manage encrypted resources."
    required: true
    default: false
表示依存関係
ノート

グループは、グループの構成変数よりも優先度が高くなります。たとえば、表示されないグループ内で変数が表示される場合、グループ全体は表示されません。

サポートされている操作:

  • and
  • eq (等しい)
  • ge (以上)
  • gt (次より大きい)
  • le (以下)
  • lt (より小さい)
  • not
  • or
他の変数に応じて変数または変数グループを非表示または表示するには:
  • visible: <other_variable>を追加します。

変数Use existing vault?の例。その可視性は、変数Enable vault support?のユーザー選択によって異なります:

既存のボールトを使用しますか。これは、「ボールト・サポートの有効化?」が選択されている場合にのみ表示されます。

「ファンクションおよびAPIゲートウェイのプロビジョニング」チェック・ボックス(enable_functions_apigateway)が選択されている場合にのみ、「アプリケーション名」および「APIゲートウェイ名」フィールド(functions_app_nameおよびapigateway_name)を表示する宣言の例:

  enable_vault:
    type: boolean
    title: "Enable vault support?"
    description: "Use a vault to store secrets and manage encrypted resources."
    required: true
    default: false

  ods_use_existing_vault:
    type: boolean
    title: "Use existing vault?"
    description: "Use a pre-existing vault in the current compartment."
    required: true
    default: false
  # show only when enable_vault variable is selected
    visible: enable_vault
パスワード
変数をパスワードとしてレンダリングするには:
  • type: passwordを追加します。
入力したパスワードの確認のために再入力を要求するには:
  • confirmation: trueを追加します。

確認が必要なパスワード変数のイメージの例:

パスワードの確認プロンプト(WordPress管理者パスワード)。

パスワード変数の宣言例。確認が必要です。

  wp_admin_password:
    title: "WordPress administrator password"
    description: "The password must be more than 8 characters and include at least one uppercase letter, one lowercase letter, one number, and one of the following special characters: !@#%^*_+-:?.,[]{}"
    # renders variable as a password field
    type: password
    # renders a second field to re-enter the password for confirmation
    confirmation: true
    pattern: "^(?=.*[!@#%^*_+\\-:?.,\\[\\]\\{\\}])(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?!.*[$\\(\\)]).{8,32}$"
    required: true
必須変数

変数の値を必須にするには:

  • required: trueを追加します。

検証警告を含む必須変数のイメージの例:

移入されなかった必須変数(仮想クラウド・ネットワーク(VCN))の検証警告。

必須変数の宣言例:

    vcn_ocid:
    "title": "Virtual cloud network (VCN)",
    "description": "The virtual cloud network to use with the compute instance. You can use the subnets template to create a VCN."
      type: oci:core:vcn:id
      dependsOn:
        compartmentId: compartment_ocid
    # displays validation warning if no value is selected or entered
      required: true
      default: ""
オプション変数

変数をオプションとしてマークするには:

  • required: falseを追加します。

オプション変数のイメージの例:

変数のタイトルの右側に表示される「オプション」マーキング: プライベートIP。

オプション変数の宣言例:

    private_ip:
      title: "Private IP"
      description: "Private IP address of your choice to assign to the VNICs."
      type: string
      # displays "Optional" marking to right of field label
      required: false
      default: ""
検証パターン

変数に入力された値を正規表現パターンに対して検証するには:

  • pattern: <regular-expression>を追加します。

    <regular-expression>は、検証する値に固有の検証パターンです。

    ハイパーリンク・パターンの例: ^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$

入力した値の検証エラーのイメージの例:

入力した値(WordPress管理者パスワード)の検証エラー。

検証パターンを使用した変数の宣言例:

  wp_admin_password:
    title: "WordPress administrator password"
    description: "The password must be more than 8 characters and include at least one uppercase letter, one lowercase letter, one number, and one of the following special characters: !@#%^*_+-:?.,[]{}"
    type: password
    confirmation: true
    # validate entered value against alphanumeric regular expression
    pattern: "^(?=.*[!@#%^*_+\\-:?.,\\[\\]\\{\\}])(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?!.*[$\\(\\)]).{8,32}$"
    required: true
機密変数(「出力」タブ、「アプリケーション情報」タブ)

機密マーク付き変数の出力は、<sensitive>として「アプリケーション情報」タブの「ロック解除」オプションとともに表示されます。このタブは、「ジョブ詳細」および「スタック詳細」ページに表示されます。

「アプリケーション情報」タブの機密マーク付き変数(生成されたSSH秘密キー)のイメージの例:

「アプリケーション情報」タブの機密マーク付き変数。

Terraform機密引数の詳細は、機密- CLI出力での値の抑制を参照してください。

変数を機密としてマークするには:

  • sensitive: trueを追加します。

機密マーク付き変数の宣言例:

  ssh_private_key:
    title: Generated SSH private key
    # marks variable as sensitive
    sensitive: true
「アプリケーション情報」タブ

Terraform構成から作成されたスタックの「アプリケーション情報」タブを表示するには:

  • スキーマtitleおよびdescriptionの行を追加します。
  • オプションで、青い情報テキスト・ボックスの行を追加します: informationalText
  • 少なくとも1つの出力をoutputsセクションに追加し、オプションでoutputGroupsを使用してグループ化します。
「アプリケーション情報」タブに表示される出力値のコピーを許可するには:
  • タイプを設定します: 行type: copyableStringを追加します。

「アプリケーション情報」タブのイメージの例:

「アプリケーション情報」タブ。

スキーマ・タイトル、説明および出力の宣言例:

# heading under Application Information tab
title: "Deploy a WordPress instance"
# text under heading
description: "Create your own website or blog using WordPress."

...

# output variable groups
outputGroups:
- title: "Service endpoints"
  outputs:
    - wordpress_public_ip
- title: "Generated passwords"
  outputs:
    - generated_ssh_private_key

...

# output variable field names and values
outputs:
  wordpress_public_ip:
    type: link
    title: "Your WordPress website"
  generated_ssh_private_key:
    title: "Generated SSH private key"
    sensitive: true

コンソール・アイテムの操作方法

この項では、Oracle Cloud Infrastructureコンソールのスタック情報のスキーマ制御表示と対話する方法について説明します。

スタック情報は、スタックを作成するためにTerraform構成に含めるスキーマ・ドキュメント(ある場合)の影響を受けます。スキーマ・ドキュメントは、スタック作成時の変数の外観と動作、および作成されたスタックの「アプリケーション情報」タブに表示されるテキストに影響します。

機密変数のロック解除

「アプリケーション情報」タブの「ロック解除」オプションは、機密マーク付き変数を示します。このオプションは、「ロック解除」「ロック」を切り替えます。

  • 値を表示するには、「ロック解除」をクリックします。
  • 値を非表示にするには、「ロック」をクリックします。

「アプリケーション情報」タブの機密マーク付き変数(生成されたSSH秘密キー)のイメージの例:

機密マーク付き変数(生成されたSSH秘密キー)を含む「アプリケーション情報」タブのスクリーンショット。