ALIYUN::APIG::Environment

ALIYUN::APIG::Environment类型用于创建环境。

语法

{
  "Type": "ALIYUN::APIG::Environment",
  "Properties": {
    "EnvironmentName": String,
    "GatewayId": String,
    "Description": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

EnvironmentName

String

环境名称。

GatewayId

String

网关 id。

Description

String

环境的描述信息。

返回值

Fn::GetAtt

  • EnvironmentId:环境 ID。

  • Description:环境的描述信息。

  • EnvironmentName:环境名称。

  • GatewayId:网关 id。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EnvironmentName:
    Type: String
    Description:
      en: The name of the environment.
    Required: true
  GatewayId:
    Type: String
    Description:
      en: Gateway id.
    AssociationProperty: ALIYUN::APIG::Gateway::GatewayId
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::APIG::Environment
    Properties:
      EnvironmentName:
        Ref: EnvironmentName
      GatewayId:
        Ref: GatewayId
Outputs:
  EnvironmentId:
    Description: The ID of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentId
  Description:
    Description: Description of the environment.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  EnvironmentName:
    Description: The name of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvironmentName
  GatewayId:
    Description: The ID of the Gateway.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GatewayId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EnvironmentName": {
      "Type": "String",
      "Description": {
        "en": "The name of the environment."
      },
      "Required": true
    },
    "GatewayId": {
      "Type": "String",
      "Description": {
        "en": "Gateway id."
      },
      "AssociationProperty": "ALIYUN::APIG::Gateway::GatewayId",
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::APIG::Environment",
      "Properties": {
        "EnvironmentName": {
          "Ref": "EnvironmentName"
        },
        "GatewayId": {
          "Ref": "GatewayId"
        }
      }
    }
  },
  "Outputs": {
    "EnvironmentId": {
      "Description": "The ID of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentId"
        ]
      }
    },
    "Description": {
      "Description": "Description of the environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "EnvironmentName": {
      "Description": "The name of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentName"
        ]
      }
    },
    "GatewayId": {
      "Description": "The ID of the Gateway.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GatewayId"
        ]
      }
    }
  }
}