All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ARMS::Prometheus

更新時間:Jul 29, 2024

ALIYUN::ARMS::Prometheus is used to create a Prometheus instance.

Syntax

{
  "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
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ClusterType

String

Yes

No

The type of the Prometheus instance.

Valid values:

  • ManagedKubernetes: Prometheus instance for serverless Kubernetes (ASK) clusters

  • ecs: Prometheus instance for Elastic Compute Service (ECS)

  • vpc-prometheus: Prometheus instance for Virtual Private Cloud (VPC)

  • cloud-product-prometheus: region-level Prometheus instance for cloud services

  • remote-write-prometheus: general-purpose Prometheus instance

  • GlobalViewV2: Prometheus instance for GlobalView V2

  • global-view: Prometheus instance for GlobalView

GrafanaInstanceId

String

Yes

Yes

The ID of the Grafana workspace with which you want to associate the Prometheus instance.

If you use the shared edition of Grafana, you must set the value to free.

PrometheusName

String

Yes

No

The name of the Prometheus instance.

You must specify this property when ClusterType is set to remote-write-prometheus, ecs, or global-view.

If you create a Prometheus instance for ECS, the value of PrometheusName must be in the "name-vpc-id" format, and the value of the "name" field can be up to 24 characters in length. For example, you can set PrometheusName to "mytest1-vpc-xxxxxxxxxxx".

ClusterId

String

No

No

The ID of the ASK cluster.

You must specify this property when ClusterType is set to ManagedKubernetes.

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

SecurityGroupId

String

No

No

The security group to which the VPC belongs.

You must specify this property when ClusterType is set to ecs or ManagedKubernetes.

SubClustersJson

List

No

Yes

The child instances of the Prometheus instance for GlobalView. The value is a JSON string.

You must specify this property when ClusterType is set to global-view.

The information about the instances to be aggregated.

[ { "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-Test", "dataSource":"", "userId":"1672753***********" }, { "headers":{ }, "regionId":"cn-zhangjiakou", "sourceType":"AlibabaPrometheus", "extras":{ }, "clusterId":"c261a4f3200c446***********", "sourceName":"zaifeng-cardinality-01", "dataSource":"", "userId":"1672753***********" } ]

Tags

List

No

Yes

The custom tags.

You can add up to 20 tags.

For more information, see Tags properties.

VpcId

String

No

No

The VPC.

You must specify this property when ClusterType is set to ecs or ManagedKubernetes.

VSwitchId

String

No

No

The vSwitch in the VPC.

You must specify this property when ClusterType is set to ecs or ManagedKubernetes.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Return values

Fn::GetAtt

  • VpcId: the VPC ID of the Prometheus instance.

  • ResourceGroupId: the ID of the resource group to which the Prometheus instance belongs.

  • ClusterId: the ID of the Prometheus instance.

  • UserId: the user ID.

  • SecurityGroupId: the ID of the security group.

  • VSwitchId: the ID of the vSwitch to which the Prometheus instance is connected.

  • PaymentType: the billing method of the Prometheus instance.

  • ClusterType: the type of the Prometheus instance.

  • Tags: the tags that are added to the Prometheus instance.

  • SubClustersJson: the child instances of the Prometheus instance for GlobalView. The value is a JSON string.

  • GrafanaInstanceId: the ID of the Grafana workspace with which the Prometheus instance is associated.

  • PrometheusName: the name of the Prometheus instance.

Examples

YAML format

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 format

{
  "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"
        ]
      }
    }
  }
}