ALIYUN::APIG::Consumer类型用于创建消费者。
语法
{
"Type": "ALIYUN::APIG::Consumer",
"Properties": {
"ApikeyIdentityConfig": Map,
"AkSkIdentityConfigs": List,
"Description": String,
"Enable": Boolean,
"GatewayType": String,
"JwtIdentityConfig": Map,
"Name": String
}
}
属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
AkSkIdentityConfigs |
List |
否 |
是 |
AK/SK身份配置列表。 |
更多信息,请参考AkSkIdentityConfigs属性。 |
|
ApikeyIdentityConfig |
Map |
否 |
是 |
API密钥身份配置。 |
更多信息,请参考ApikeyIdentityConfig属性。 |
|
Description |
String |
否 |
是 |
消费者的描述。 |
无 |
|
Enable |
Boolean |
否 |
是 |
是否启用消费者。 |
无 |
|
GatewayType |
String |
否 |
否 |
网关类型。 |
无 |
|
JwtIdentityConfig |
Map |
否 |
是 |
JWT身份配置。 |
更多信息,请参考JwtIdentityConfig属性。 |
|
Name |
String |
否 |
否 |
消费者名称。 |
无 |
JwtIdentityConfig语法
"JwtIdentityConfig": {
"Type": String,
"SecretType": String,
"Jwks": String,
"JwtPayloadConfig": Map,
"JwtTokenConfig": Map
}
JwtIdentityConfig属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Jwks |
String |
否 |
是 |
JWKS配置。 |
无 |
|
JwtPayloadConfig |
Map |
否 |
是 |
JWT Payload配置。 |
更多信息,请参考JwtPayloadConfig属性。 |
|
JwtTokenConfig |
Map |
否 |
是 |
JWT Token配置。 |
更多信息,请参考JwtTokenConfig属性。 |
|
SecretType |
String |
否 |
是 |
密钥类型。 |
取值:
|
|
Type |
String |
否 |
是 |
身份配置类型。 |
取值:
|
JwtPayloadConfig语法
"JwtPayloadConfig": {
"PayloadKeyName": String,
"PayloadKeyValue": String
}
JwtPayloadConfig属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
PayloadKeyName |
String |
否 |
是 |
JWT Payload的键名。 |
无 |
|
PayloadKeyValue |
String |
否 |
是 |
JWT Payload的值。 |
无 |
JwtTokenConfig语法
"JwtTokenConfig": {
"Pass": Boolean,
"Position": String,
"Prefix": String,
"Key": String
}
JwtTokenConfig属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Key |
String |
否 |
是 |
JWT的键名。 |
无 |
|
Pass |
Boolean |
否 |
是 |
是否透传JWT。 |
无 |
|
Position |
String |
否 |
是 |
JWT存储位置。取值:HEADER,QUERY。 |
无 |
|
Prefix |
String |
否 |
是 |
JWT Token的前缀。 |
无 |
ApikeyIdentityConfig语法
"ApikeyIdentityConfig": {
"ApikeySource": Map,
"Type": String,
"Credentials": List
}
ApikeyIdentityConfig属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
ApikeySource |
Map |
否 |
是 |
API密钥来源配置。 |
无 |
|
Credentials |
List |
否 |
是 |
凭证列表。 |
无 |
|
Type |
String |
否 |
是 |
身份配置类型。 |
取值:
|
ApikeySource语法
"ApikeySource": {
"Value": String,
"Source": String
}
ApikeySource属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Source |
String |
是 |
是 |
API密钥来源。取值:Header,QueryString,Default。 |
取值:
|
|
Value |
String |
是 |
是 |
API密钥来源的值。 |
无 |
Credentials语法
"Credentials": [
{
"Apikey": String,
"GenerateMode": String
}
]
Credentials属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
GenerateMode |
String |
是 |
是 |
生成模式。 |
取值:
|
|
Apikey |
String |
否 |
是 |
API密钥值。 |
无 |
AkSkIdentityConfigs语法
"AkSkIdentityConfigs": [
{
"Type": String,
"Sk": String,
"Ak": String,
"GenerateMode": String
}
]
AkSkIdentityConfigs属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Ak |
String |
否 |
是 |
Access Key。 |
无 |
|
GenerateMode |
String |
否 |
是 |
生成模式。 |
取值:
|
|
Sk |
String |
否 |
是 |
Secret Key。 |
无 |
|
Type |
String |
否 |
是 |
身份配置类型。 |
取值:
|
返回值
Fn::GetAtt
ConsumerId:消费者ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Name:
Type: String
Description:
en: The name of the consumer.
Default: Null
Required: false
Description:
Type: String
Description:
en: The description of the consumer.
AssociationProperty: TextArea
Default: Null
Required: false
JwtIdentityConfig:
Description:
en: JWT identity configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Type:
Type: String
Description:
en: 'The type of the identity configuration. Valid values: Jwt.'
AllowedValues:
- Jwt
Default: Null
Required: false
SecretType:
Type: String
Description:
en: 'The secret type. Valid values: Asymmetry (asymmetric encryption), Symmetry (symmetric encryption).'
Default: Null
Required: false
Jwks:
Type: String
Description:
en: The JWKS configuration.
Default: Null
Required: false
JwtTokenConfig:
Description:
en: The JWT token configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Position:
Type: String
Description:
en: 'The position where JWT is stored. Valid values: HEADER, QUERY.'
Default: Null
Required: false
Key:
Type: String
Description:
en: The key name for JWT.
Default: Null
Required: false
Prefix:
Type: String
Description:
en: The prefix for JWT token.
Default: Null
Required: false
Pass:
Type: Boolean
Description:
en: Whether to pass through the JWT.
Default: Null
Required: false
JwtPayloadConfig:
Description:
en: The JWT payload configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
PayloadKeyName:
Type: String
Description:
en: The key name of the JWT payload.
Default: Null
Required: false
PayloadKeyValue:
Type: String
Description:
en: The value of the JWT payload.
Default: Null
Required: false
AkSkIdentityConfigs:
Description:
en: List of AK/SK identity configurations.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
Type:
Type: String
Description:
en: 'The type of the identity configuration. Valid values: AkSk.'
AllowedValues:
- AkSk
Default: Null
Required: false
GenerateMode:
Type: String
Description:
en: 'The generation mode. Valid values: Custom, System.'
AllowedValues:
- Custom
- System
Default: Null
Required: false
Ak:
Type: String
Description:
en: The Access Key.
Default: Null
Required: false
Sk:
Type: String
Description:
en: The Secret Key.
Default: Null
Required: false
ApikeyIdentityConfig:
Description:
en: API key identity configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Type:
Type: String
Description:
en: 'The type of the identity configuration. Valid values: Apikey.'
AllowedValues:
- Apikey
Default: Null
Required: false
ApikeySource:
Description:
en: The API key source configuration.
Required: false
Default: Null
Type: Json
AssociationPropertyMetadata:
Parameters:
Source:
Type: String
Description:
en: 'The source of the API key. Valid values: Header, QueryString, Default.'
AllowedValues:
- Header
- QueryString
- Default
Required: true
Value:
Type: String
Description:
en: The value for the API key source.
Required: true
Credentials:
Description:
en: The list of credentials.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
Parameters:
GenerateMode:
Type: String
Description:
en: 'The generation mode. Valid values: Custom, System.'
AllowedValues:
- Custom
- System
Required: true
Apikey:
Type: String
Description:
en: The API key value.
Default: Null
Required: false
Enable:
Type: Boolean
Description:
en: Whether to enable the consumer.
Default: Null
Required: false
GatewayType:
Type: String
Description:
en: The type of the gateway.
Default: Null
Required: false
Resources:
Consumer:
Type: ALIYUN::APIG::Consumer
Properties:
Name:
Ref: Name
Description:
Ref: Description
JwtIdentityConfig:
Ref: JwtIdentityConfig
AkSkIdentityConfigs:
Ref: AkSkIdentityConfigs
ApikeyIdentityConfig:
Ref: ApikeyIdentityConfig
Enable:
Ref: Enable
GatewayType:
Ref: GatewayType
Outputs:
ConsumerId:
Value:
Fn::GetAtt:
- Consumer
- ConsumerId
Description: The ID of the consumer.
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"Name": {
"Type": "String",
"Description": {
"en": "The name of the consumer."
},
"Default": null,
"Required": false
},
"Description": {
"Type": "String",
"Description": {
"en": "The description of the consumer."
},
"AssociationProperty": "TextArea",
"Default": null,
"Required": false
},
"JwtIdentityConfig": {
"Description": {
"en": "JWT identity configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Type": {
"Type": "String",
"Description": {
"en": "The type of the identity configuration. Valid values: Jwt."
},
"AllowedValues": [
"Jwt"
],
"Default": null,
"Required": false
},
"SecretType": {
"Type": "String",
"Description": {
"en": "The secret type. Valid values: Asymmetry (asymmetric encryption), Symmetry (symmetric encryption)."
},
"Default": null,
"Required": false
},
"Jwks": {
"Type": "String",
"Description": {
"en": "The JWKS configuration."
},
"Default": null,
"Required": false
},
"JwtTokenConfig": {
"Description": {
"en": "The JWT token configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Position": {
"Type": "String",
"Description": {
"en": "The position where JWT is stored. Valid values: HEADER, QUERY."
},
"Default": null,
"Required": false
},
"Key": {
"Type": "String",
"Description": {
"en": "The key name for JWT."
},
"Default": null,
"Required": false
},
"Prefix": {
"Type": "String",
"Description": {
"en": "The prefix for JWT token."
},
"Default": null,
"Required": false
},
"Pass": {
"Type": "Boolean",
"Description": {
"en": "Whether to pass through the JWT."
},
"Default": null,
"Required": false
}
}
}
},
"JwtPayloadConfig": {
"Description": {
"en": "The JWT payload configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"PayloadKeyName": {
"Type": "String",
"Description": {
"en": "The key name of the JWT payload."
},
"Default": null,
"Required": false
},
"PayloadKeyValue": {
"Type": "String",
"Description": {
"en": "The value of the JWT payload."
},
"Default": null,
"Required": false
}
}
}
}
}
}
},
"AkSkIdentityConfigs": {
"Description": {
"en": "List of AK/SK identity configurations."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"Type": {
"Type": "String",
"Description": {
"en": "The type of the identity configuration. Valid values: AkSk."
},
"AllowedValues": [
"AkSk"
],
"Default": null,
"Required": false
},
"GenerateMode": {
"Type": "String",
"Description": {
"en": "The generation mode. Valid values: Custom, System."
},
"AllowedValues": [
"Custom",
"System"
],
"Default": null,
"Required": false
},
"Ak": {
"Type": "String",
"Description": {
"en": "The Access Key."
},
"Default": null,
"Required": false
},
"Sk": {
"Type": "String",
"Description": {
"en": "The Secret Key."
},
"Default": null,
"Required": false
}
}
}
},
"ApikeyIdentityConfig": {
"Description": {
"en": "API key identity configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Type": {
"Type": "String",
"Description": {
"en": "The type of the identity configuration. Valid values: Apikey."
},
"AllowedValues": [
"Apikey"
],
"Default": null,
"Required": false
},
"ApikeySource": {
"Description": {
"en": "The API key source configuration."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"Source": {
"Type": "String",
"Description": {
"en": "The source of the API key. Valid values: Header, QueryString, Default."
},
"AllowedValues": [
"Header",
"QueryString",
"Default"
],
"Required": true
},
"Value": {
"Type": "String",
"Description": {
"en": "The value for the API key source."
},
"Required": true
}
}
}
},
"Credentials": {
"Description": {
"en": "The list of credentials."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"Parameters": {
"GenerateMode": {
"Type": "String",
"Description": {
"en": "The generation mode. Valid values: Custom, System."
},
"AllowedValues": [
"Custom",
"System"
],
"Required": true
},
"Apikey": {
"Type": "String",
"Description": {
"en": "The API key value."
},
"Default": null,
"Required": false
}
}
}
}
}
}
},
"Enable": {
"Type": "Boolean",
"Description": {
"en": "Whether to enable the consumer."
},
"Default": null,
"Required": false
},
"GatewayType": {
"Type": "String",
"Description": {
"en": "The type of the gateway."
},
"Default": null,
"Required": false
}
},
"Resources": {
"Consumer": {
"Type": "ALIYUN::APIG::Consumer",
"Properties": {
"Name": {
"Ref": "Name"
},
"Description": {
"Ref": "Description"
},
"JwtIdentityConfig": {
"Ref": "JwtIdentityConfig"
},
"AkSkIdentityConfigs": {
"Ref": "AkSkIdentityConfigs"
},
"ApikeyIdentityConfig": {
"Ref": "ApikeyIdentityConfig"
},
"Enable": {
"Ref": "Enable"
},
"GatewayType": {
"Ref": "GatewayType"
}
}
}
},
"Outputs": {
"ConsumerId": {
"Value": {
"Fn::GetAtt": [
"Consumer",
"ConsumerId"
]
},
"Description": "The ID of the consumer."
}
}
}