すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ランダム文字列の長さを制御するにはどうすればよいですか?

最終更新日:Jan 16, 2025

Resource Orchestration Service (ROS) で AssociationProperty を AutoCompleteInput に設定すると、ランダム文字列を自動的に生成できます。

テンプレートの Parameters セクションの RandomName パラメーターで AssociationProperty を AutoCompleteInput に設定すると、ランダム文字列を生成できます。次に、AssociationPropertyMetadata で Length、Prefix、CharacterClasses プロパティを指定して、ランダム文字列の長さを制御できます。詳細については、「AssociationProperty and AssociationPropertyMetadata」をご参照ください。

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RandomName": {
      "Type": "String",
      "Label": {
        "en": "Random Name",
        // ランダム名
      },
      "AssociationProperty": "AutoCompleteInput",
      "AssociationPropertyMetadata": {
        "Length": 5,
        "Prefix": "test-ros",
        "CharacterClasses": [
          {
            "Class": "lowercase",
            "min": 1
          }
        ]
      }
    }
  },
  "Outputs": {
    "RandomNameStr": {
      "Value": {
        "Ref": "RandomName"
      }
    }
  }
}

[コンソール UI]

image