All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ARMS::Environment

更新時間:Oct 24, 2024

ALIYUN::ARMS::Environment is used to create an environment.

Syntax

{
  "Type": "ALIYUN::ARMS::Environment",
  "Properties": {
    "BindResourceId": String,
    "DeletePromInstance": Boolean,
    "EnvironmentSubType": String,
    "EnvironmentType": String,
    "EnvironmentName": String,
    "FeePackage": String,
    "GrafanaWorkspaceId": String,
    "ManagedType": String,
    "PrometheusInstanceId": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

BindResourceId

String

Yes

No

The ID of the resource that you want to associate with the environment.

You can specify the ID of a container instance or the ID of a virtual private cloud (VPC) for this property. For an environment of the Cloud type, you must specify a region ID for this property.

EnvironmentSubType

String

Yes

No

The environment subtype.

Valid values:

  • CS: Container Service for Kubernetes (ACK) or Distributed Cloud Container Platform for Kubernetes (ACK One)

  • ECS: Elastic Compute Service (ECS)

  • Cloud: cloud service

EnvironmentType

String

Yes

No

The environment type.

Valid values:

  • CS: ACK

  • ECS: ECS

  • Cloud: cloud service

EnvironmentName

String

Yes

Yes

The environment name.

None.

DeletePromInstance

Boolean

No

Yes

Specifies whether to delete the related Prometheus instance.

None.

FeePackage

String

No

Yes

The payable resource plan.

Note
  • If EnvironmentType is set to CS, you can set FeePackage to CS_Basic or CS_Pro. CS_Basic is the default value of FeePackage.

  • If EnvironmentType is set to a value other than CS, you must leave FeePackage empty.

GrafanaWorkspaceId

String

No

No

The ID of the Grafana workspace that you want to associate with the environment.

If this property is left empty, the default shared Grafana workspace is used.

ManagedType

String

No

No

The management type.

Valid values:

  • none: unmanaged. This is the default value for ACK clusters.

  • agent: Agents including ksm are managed. This is the default value for serverless Kubernetes (ASK) clusters, Alibaba Cloud Container Compute Service (ACS) clusters, and ACK One clusters.

  • agent-exporter: Agents and exporters are managed. This is the default value for cloud services.

PrometheusInstanceId

String

No

No

The ID of the Prometheus instance that you want to associate with the environment.

If no Prometheus instance is provided, you must call the InitEnvironment operation to initialize a storage instance.

ResourceGroupId

String

No

No

The ID of the resource group.

None.

Tags

List

No

Yes

The tags.

You can add up to 20 tags.

For more information, see the "Tags properties" section of this topic.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

None.

Value

String

No

No

The tag value.

None.

Return values

Fn::GetAtt

  • ManagedType: the management type.

  • EnvironmentId: the environment ID.

  • EnvironmentSubType: the environment subtype.

  • EnvironmentType: the environment type.

  • ResourceGroupId: the ID of the resource group.

  • EnvironmentName: the environment name.

  • GrafanaWorkspaceId: the ID of the Grafana workspace that is associated with the environment.

  • PrometheusInstanceId: the ID of the Prometheus instance that is associated with the environment.

  • FeePackage: the payable resource plan.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EnvironmentSubType:
    Type: String
    Description:
      en: |-
        The subtype of the environment. Valid values:
        One: CS type environment
        ACK: CS type environment
        ECS: ECS type environment
        Cloud: cloud service
    AllowedValues:
      - ACK
      - ECS
      - One
      - Cloud
    Required: true
  EnvironmentType:
    Type: String
    Description:
      en: |-
        The type of the environment. Valid values:
        CS: ACK
        ECS: ECS
        Cloud: cloud service
    AllowedValues:
      - CS
      - ECS
      - Cloud
    Required: true
  EnvironmentName:
    Type: String
    Description:
      en: The name of the environment.
    Required: true
  BindResourceId:
    Type: String
    Description:
      en: The ID of the resource bound to the environment, such as the container ID or VPC ID. For a Cloud environment, specify the region ID.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ARMS::Environment
    Properties:
      EnvironmentSubType:
        Ref: EnvironmentSubType
      EnvironmentType:
        Ref: EnvironmentType
      EnvironmentName:
        Ref: EnvironmentName
      BindResourceId:
        Ref: BindResourceId
Outputs:
  ManagedType:
    Description: Specifies whether agents or exporters are managed.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ManagedType
  EnvironmentId:
    Description: The id of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentId
  EnvironmentSubType:
    Description: The subtype of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentSubType
  EnvironmentType:
    Description: The type of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentType
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ResourceGroupId
  EnvironmentName:
    Description: The name of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentName
  GrafanaWorkspaceId:
    Description: The ID of the grafana workspace bound to the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GrafanaWorkspaceId
  PrometheusInstanceId:
    Description: The ID of the Prometheus instance.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PrometheusInstanceId
  FeePackage:
    Description: The payable resource plan.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - FeePackage

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EnvironmentSubType": {
      "Type": "String",
      "Description": {
        "en": "The subtype of the environment. Valid values:\nOne: CS type environment\nACK: CS type environment\nECS: ECS type environment\nCloud: cloud service"
      },
      "AllowedValues": [
        "ACK",
        "ECS",
        "One",
        "Cloud"
      ],
      "Required": true
    },
    "EnvironmentType": {
      "Type": "String",
      "Description": {
        "en": "The type of the environment. Valid values:\nCS: ACK\nECS: ECS\nCloud: cloud service"
      },
      "AllowedValues": [
        "CS",
        "ECS",
        "Cloud"
      ],
      "Required": true
    },
    "EnvironmentName": {
      "Type": "String",
      "Description": {
        "en": "The name of the environment."
      },
      "Required": true
    },
    "BindResourceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the resource bound to the environment, such as the container ID or VPC ID. For a Cloud environment, specify the region ID."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ARMS::Environment",
      "Properties": {
        "EnvironmentSubType": {
          "Ref": "EnvironmentSubType"
        },
        "EnvironmentType": {
          "Ref": "EnvironmentType"
        },
        "EnvironmentName": {
          "Ref": "EnvironmentName"
        },
        "BindResourceId": {
          "Ref": "BindResourceId"
        }
      }
    }
  },
  "Outputs": {
    "ManagedType": {
      "Description": "Specifies whether agents or exporters are managed.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ManagedType"
        ]
      }
    },
    "EnvironmentId": {
      "Description": "The id of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentId"
        ]
      }
    },
    "EnvironmentSubType": {
      "Description": "The subtype of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentSubType"
        ]
      }
    },
    "EnvironmentType": {
      "Description": "The type of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentType"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ResourceGroupId"
        ]
      }
    },
    "EnvironmentName": {
      "Description": "The name of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentName"
        ]
      }
    },
    "GrafanaWorkspaceId": {
      "Description": "The ID of the grafana workspace bound to the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GrafanaWorkspaceId"
        ]
      }
    },
    "PrometheusInstanceId": {
      "Description": "The ID of the Prometheus instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PrometheusInstanceId"
        ]
      }
    },
    "FeePackage": {
      "Description": "The payable resource plan.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "FeePackage"
        ]
      }
    }
  }
}