閱讀285 返回首頁    go 阿裏雲 go 技術社區[雲棲]


ALIYUN::CS::App__資源列表_資源編排-阿裏雲

ALIYUN::CS::App 類型可用於創建基於 ALIYUN::CS::Cluster 的應用

語法

  1. {
  2. "Type" : "ALIYUN::CS::App",
  3. "Properties" : {
  4. "Name" : String,
  5. "Ca" : String,
  6. "ClusterId" : String,
  7. "Environment" : Map,
  8. "Cert" : String,
  9. "Version" : String,
  10. "MasterUrl" : String,
  11. "Key" : String,
  12. "Template" : String,
  13. "Description" : String
  14. }
  15. }

屬性

屬性名稱 類型 必須 描述 約束
Name string 指定應用的名稱
ClusterId string 指定集群的 ID
MasterUrl string 指定集群的主 URL 地址
Ca string 指定集群的 CA 證書
Environment map 指定環境變量
Cert string 指定集群的客戶端證書
Version string 指定應用的版本號
Key string 指定集群的客戶端主鍵
Template string 指定部署 Docker 應用的模版
Description string 指定應用的描述 長度為2-256個字符,默認為空

返回值

Fn::GetAtt

  • Endpoints 訪問應用的域名

示例

  1. {
  2. "ROSTemplateFormatVersion": "2015-09-01",
  3. "Resources": {
  4. "App": {
  5. "Properties": {
  6. "Ca": {
  7. "Fn::GetAtt": [
  8. "MyCluster",
  9. "Ca"
  10. ]
  11. },
  12. "Cert": {
  13. "Fn::GetAtt": [
  14. "MyCluster",
  15. "Cert"
  16. ]
  17. },
  18. "ClusterId": {
  19. "Fn::GetAtt": [
  20. "MyCluster",
  21. "ClusterId"
  22. ]
  23. },
  24. "Key": {
  25. "Fn::GetAtt": [
  26. "MyCluster",
  27. "Key"
  28. ]
  29. },
  30. "MasterUrl": {
  31. "Fn::GetAtt": [
  32. "MyCluster",
  33. "MasterUrl"
  34. ]
  35. },
  36. "Name": "ngix",
  37. "Template": {"Fn::Join": ["\n", [
  38. "mysql:",
  39. " environment:",
  40. " - MYSQL_MAJOR=5.6",
  41. " - MYSQL_ROOT_PASSWORD=password",
  42. " expose:",
  43. " - 3306/tcp",
  44. " image: 'registry.aliyuncs.com/acs-sample/mysql:5.6'",
  45. " labels:",
  46. " aliyun.routing.port_3306: nnn;https://nn.abc.com",
  47. " aliyun.scale: '3'",
  48. " restart: always",
  49. " volumes:",
  50. " - /var/lib/mysql"
  51. ]]}
  52. },
  53. "Type": "ALIYUN::CS::App"
  54. },
  55. "MyCluster": {
  56. "Properties": {
  57. "InstanceType": "ecs.s1.small",
  58. "Name": "mysqlcluster",
  59. "Password": "Test1234",
  60. "Size": 3
  61. },
  62. "Type": "ALIYUN::CS::Cluster"
  63. }
  64. },
  65. "Outputs": {
  66. "Endpoints": {
  67. "Description": "Endpoints of the app.",
  68. "Value": {
  69. "Fn::GetAtt": [
  70. "App",
  71. "Endpoints"
  72. ]
  73. }
  74. }
  75. }
  76. }

最後更新:2016-12-20 17:12:51

  上一篇:go ALIYUN::ECS::VSwitch__資源列表_資源編排-阿裏雲
  下一篇:go ALIYUN::CS::Cluster__資源列表_資源編排-阿裏雲