阅读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__资源列表_资源编排-阿里云