ALIYUN::ApiGateway::VpcAccessConfig类型用于配置VPC授权,以便专有网络的API对外提供服务。
语法
{
  "Type": "ALIYUN::ApiGateway::VpcAccessConfig",
  "Properties": {
    "InstanceId": String,
    "VpcId": String,
    "Name": String,
    "Port": Integer
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| InstanceId | String | 是 | 是 | ECS或SLB的实例ID。 | 必须属于VpcId所指定的专有网络 | 
| Name | String | 是 | 是 | 自定义授权名称。 | 需要保持唯一 | 
| Port | Integer | 是 | 是 | 实例对应的端口号。 | 无 | 
| VpcId | String | 是 | 是 | 专有网络ID。 | 无 | 
返回值
Fn::GetAtt
无。
示例
说明 
请您根据实际情况更改脱敏参数的取值。
YAML格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::InstanceId
  VpcId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
Resources:
  VpcAccesssConfig:
    Type: ALIYUN::ApiGateway::VpcAccessConfig
    Properties:
      VpcId:
        Ref: VpcId
      InstanceId:
        Ref: InstanceId
      Port: 8080
      Name: ros_test_vpc_accessJSON格式
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId"
    },
    "VpcId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    }
  },
  "Resources": {
    "VpcAccesssConfig": {
      "Type": "ALIYUN::ApiGateway::VpcAccessConfig",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "Port": 8080,
        "Name": "ros_test_vpc_ac****"
      }
    }
  }
}该文章对您有帮助吗?