DATASOURCE::APIG::Environment类型用于查询环境。
语法
{
  "Type": "DATASOURCE::APIG::Environment",
  "Properties": {
    "EnvironmentId": String,
    "RefreshOptions": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| EnvironmentId | String | 是 | 是 | 环境 id。 | 无 | 
| RefreshOptions | String | 否 | 是 | 当资源栈更新时,数据源资源的刷新策略。 | 有效值: 
 | 
返回值
Fn::GetAtt
- EnvironmentId:环境 id。 
- Description:环境描述信息。 
- ResourceGroupId:资源组 ID。 
- EnvironmentName:环境名称。 
- GatewayId:网关 id。 
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EnvironmentId:
    Type: String
    Description:
      en: The ID of the Environment.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::APIG::Environment
    Properties:
      EnvironmentId:
        Ref: EnvironmentId
Outputs:
  EnvironmentId:
    Description: The ID of the Environment.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - EnvironmentId
  Description:
    Description: The description of the Environment.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Description
  ResourceGroupId:
    Description: The ID of the resource group.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - ResourceGroupId
  EnvironmentName:
    Description: The name of the Environment.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - EnvironmentName
  GatewayId:
    Description: Cloud-native API Gateway ID.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - GatewayId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EnvironmentId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the Environment."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::APIG::Environment",
      "Properties": {
        "EnvironmentId": {
          "Ref": "EnvironmentId"
        }
      }
    }
  },
  "Outputs": {
    "EnvironmentId": {
      "Description": "The ID of the Environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "EnvironmentId"
        ]
      }
    },
    "Description": {
      "Description": "The description of the Environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Description"
        ]
      }
    },
    "ResourceGroupId": {
      "Description": "The ID of the resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ResourceGroupId"
        ]
      }
    },
    "EnvironmentName": {
      "Description": "The name of the Environment.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "EnvironmentName"
        ]
      }
    },
    "GatewayId": {
      "Description": "Cloud-native API Gateway ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "GatewayId"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?