全部产品
Search
文档中心

资源编排:ALIYUN::ARMS::Prometheus

更新时间:Jun 20, 2024

ALIYUN::ARMS::Prometheus类型用于创建Prometheus实例。

语法

{
  "Type": "ALIYUN::ARMS::Prometheus",
  "Properties": {
    "VpcId": String,
    "ResourceGroupId": String,
    "ClusterId": String,
    "SecurityGroupId": String,
    "VSwitchId": String,
    "ClusterType": String,
    "Tags": List,
    "SubClustersJson": List,
    "GrafanaInstanceId": String,
    "PrometheusName": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ClusterType

String

集群类型。

取值:

  • ManagedKubernetes:aliyun-cs的托管版ask容器集群。

  • ecs:Prometheus for ECS集群。

  • vpc-prometheus:Prometheus for VPC集群。

  • cloud-product-prometheus:Region级云服务旧版集群。

  • remote-write-prometheus:通用实例集群。

  • GlobalViewV2:Prometheus for GlobalView V2集群。

  • global-view:Prometheus for GlobalView 集群。

GrafanaInstanceId

String

绑定的Grafana工作区ID。

使用共享版Grafana时,值为"free"。

PrometheusName

String

用户新建集群实例的名称。

当ClusterType为remote-write-prometheus、ecs、global-view时,需要传此参数。

若是ECS类型实例,PrometheusName的命名规则为“name-vpc-id”,且name部分的长度不允许超过24个字符,例如“mytest1-vpc-xxxxxxxxxxx”。

ClusterId

String

用户容器服务集群ID。

当ClusterType 为ManagedKubernetes时,需要传此参数。

ResourceGroupId

String

资源组ID。

SecurityGroupId

String

用户专有网络安全组SecurityGroup。

当ClusterType为ecs或者aliyun-cs的托管版ask容器集群时,需要传此参数。

SubClustersJson

List

globalView实例的子实例JSON串。

当ClusterType为global-view时,需要传此参数。

需要聚合的集群的信息列表。

[ { "headers":{ }, "regionId":"cn-hangzhou", "sourceType":"AlibabaPrometheus", "extras":{ }, "clusterId":"c39a1048921e04f***********", "sourceName":"arms-luyao-test", "dataSource":"", "userId":"1672753***********" }, { "headers":{ }, "regionId":"cn-beijing", "sourceType":"AlibabaPrometheus", "extras":{ }, "clusterId":"c6b6485496d5b40***********", "sourceName":"agent-321-测试", "dataSource":"", "userId":"1672753***********" }, { "headers":{ }, "regionId":"cn-zhangjiakou", "sourceType":"AlibabaPrometheus", "extras":{ }, "clusterId":"c261a4f3200c446***********", "sourceName":"zaifeng-cardinality-01", "dataSource":"", "userId":"1672753***********" } ]

Tags

List

自定义标签。

最多添加20个标签。

更多信息,请参见Tags属性

VpcId

String

用户专有网络VPC。

当ClusterType为ecs或者ManagedKubernetes时,需要传此参数。

VSwitchId

String

用户专有网络交换机VSwitch。

当ClusterType为ecs或者 ManagedKubernetes时,需要传此参数。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

长度为1~128个字符,不能以aliyunacs:开头,不能包含http://https://

Value

String

标签值。

长度为0~128个字符,不能以aliyunacs:开头,不能包含http://https://

返回值

Fn::GetAtt

  • VpcId:集群实例所对应的VPC ID。

  • ResourceGroupId:集群实例所对应的资源组ID。

  • ClusterId:集群实例ID。

  • UserId:用户ID。

  • SecurityGroupId:安全组ID.

  • VSwitchId:集群实例所对应的交换机ID。

  • PaymentType:集群实例付费类型。

  • ClusterType:集群实例类型。

  • Tags:集群实例绑定标签信息。

  • SubClustersJson:globalView实例的子实例JSON串

  • GrafanaInstanceId:绑定的Grafana工作区ID。

  • PrometheusName:集群实例的名称

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterType:
    Type: String
    Description:
      en: Instance type.
    AllowedValues:
      - vpc-prometheus
      - ManagedKubernetes
      - cloud-product-prometheus
      - remote-write-prometheus
      - GlobalViewV2
      - ecs
      - global-view
    Required: true
  GrafanaInstanceId:
    Type: String
    Description:
      en: Grafana workspace ID.
    Required: true
  PrometheusName:
    Type: String
    Description:
      en: The name of the resource.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ARMS::Prometheus
    Properties:
      ClusterType:
        Ref: ClusterType
      GrafanaInstanceId:
        Ref: GrafanaInstanceId
      PrometheusName:
        Ref: PrometheusName
Outputs:
  VpcId:
    Description: 'The ID of the virtual private cloud (VPC). '
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - VpcId
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceGroupId
  ClusterId:
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ClusterId
  UserId:
    Description: User ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UserId
  SecurityGroupId:
    Description: 'The ID of the security group. '
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SecurityGroupId
  VSwitchId:
    Description: 'The ID of the vSwitch. '
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - VSwitchId
  PaymentType:
    Description: Payment Type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PaymentType
  ClusterType:
    Description: Instance type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ClusterType
  Tags:
    Description: The tags of the prometheus.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Tags
  SubClustersJson:
    Description: Subcluster information of globalVeiw cluster.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SubClustersJson
  GrafanaInstanceId:
    Description: Grafana workspace ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GrafanaInstanceId
  PrometheusName:
    Description: The name of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PrometheusName

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterType": {
      "Type": "String",
      "Description": {
        "en": "Instance type."
      },
      "AllowedValues": [
        "vpc-prometheus",
        "ManagedKubernetes",
        "cloud-product-prometheus",
        "remote-write-prometheus",
        "GlobalViewV2",
        "ecs",
        "global-view"
      ],
      "Required": true
    },
    "GrafanaInstanceId": {
      "Type": "String",
      "Description": {
        "en": "Grafana workspace ID."
      },
      "Required": true
    },
    "PrometheusName": {
      "Type": "String",
      "Description": {
        "en": "The name of the resource."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ARMS::Prometheus",
      "Properties": {
        "ClusterType": {
          "Ref": "ClusterType"
        },
        "GrafanaInstanceId": {
          "Ref": "GrafanaInstanceId"
        },
        "PrometheusName": {
          "Ref": "PrometheusName"
        }
      }
    }
  },
  "Outputs": {
    "VpcId": {
      "Description": "The ID of the virtual private cloud (VPC). ",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "VpcId"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceGroupId"
        ]
      }
    },
    "ClusterId": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ClusterId"
        ]
      }
    },
    "UserId": {
      "Description": "User ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserId"
        ]
      }
    },
    "SecurityGroupId": {
      "Description": "The ID of the security group. ",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SecurityGroupId"
        ]
      }
    },
    "VSwitchId": {
      "Description": "The ID of the vSwitch. ",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "VSwitchId"
        ]
      }
    },
    "PaymentType": {
      "Description": "Payment Type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PaymentType"
        ]
      }
    },
    "ClusterType": {
      "Description": "Instance type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ClusterType"
        ]
      }
    },
    "Tags": {
      "Description": "The tags of the prometheus.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Tags"
        ]
      }
    },
    "SubClustersJson": {
      "Description": "Subcluster information of globalVeiw cluster.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SubClustersJson"
        ]
      }
    },
    "GrafanaInstanceId": {
      "Description": "Grafana workspace ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GrafanaInstanceId"
        ]
      }
    },
    "PrometheusName": {
      "Description": "The name of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PrometheusName"
        ]
      }
    }
  }
}