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"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?