---
sourceDocument: Xanadu IT Operations Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/it-operations-management

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# AllowedPattern プロパティを使用したパラメーター値の検証

# AllowedPattern プロパティを使用したパラメーター値の検証 {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2026年06月24日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：3分

Azure Resource Manager (ARM) および CloudFormation (CF) テンプレートの AllowedPattern プロパティは、プロビジョニング要求を送信する前に入力検証を実行します。

## 始める前に

必要なロール：sn.cmp.cloud_service_designer

## このタスクについて

プロビジョニング要求をクラウドに送信する前にパラメーター値を検証するルールを指定できます。検証が失敗した場合にエラーメッセージで通知を受けるには、テンプレートの ConstraintDescription プロパティを指定します。ConstraintDescription プロパティのエラーメッセージをカスタマイズして、メッセージを明確かつ明示的にできます。通常、CF テンプレートには、AllowedPattern および ConstraintDescription プロパティが既に存在しています。これらのプロパティが存在しない場合は、次の手順で説明するように追加できます。

## 手順

1. クラウドアドミンポータル で Design (デザイン)クラウドテンプレート.
2. テンプレートを選択するか、\[新規\] をクリックして新しいクラウドテンプレートを作成します。  
   既存のテンプレートを選択した場合は、テンプレートの名前を変更します。
3. \[本文\] テキストボックスで、ARM テンプレートと CF テンプレートに次の変更を行います。
   1. ARM テンプレートで、次の変更を行います。  
      * パラメーターのメタデータセクションで、「SNC::Parameter::Metadata」を入力します。
      * AllowedPattern キーを追加し、有効な値の範囲を入力します。
      * ConstraintDescription キーを追加し、エラーメッセージを入力します。

      {#validate-param-allowedpattern__ul_w2m_rvb_tbb}

          "parameters": {
                   "newStorageAccountName": {
                       "type": "string",
                        "metadata": {
                            "description": "Unique DNS Name for the Storage Account where the Virtual Machine's disks will be placed.",
                             "SNC::Parameter::Metadata": {
                                 "allowedPattern": "[0-9a-z]{1,11}",
                                  "ConstraintDescription": "must be an alphanumeric "
                                                        
                                     }}} 
                 
              
   2. CF テンプレートで、次の変更を行います。  
      * AllowedPattern キーを追加し、有効な値の範囲を入力します。
      * ConstraintDescription キーを追加し、エラーメッセージを入力します。

      {#validate-param-allowedpattern__ul_cnn_xvb_tbb}

          "Parameters" : {
                          "SSHLocation" : {
                          "Description" : "The IP address range that can be used to SSH to the EC2 instances",
                          "Type": "String",
                          "MinLength": "9",
                          "MaxLength": "18",
                          "Default": "0.0.0.0/0",
                           "AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
                           "ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."

              } 
            }

   {#validate-param-allowedpattern__substeps_cd5_kvb_tbb}
4. \[送信\] をクリックします。

