ALIYUN::APIG::ConsumerAuthorizationRule类型用于创建消费者授权规则。
语法
{
"Type": "ALIYUN::APIG::ConsumerAuthorizationRule",
"Properties": {
"ConsumerId": String,
"ResourceIdentifier": Map,
"ResourceType": String,
"ExpireTimestamp": Integer,
"ExpireMode": String
}
}属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ConsumerId | String | 是 | 否 | 消费者ID。 | 无 |
ResourceIdentifier | Map | 是 | 是 | 非标准代码来源的资源标识符。 | 更多信息,请参考ResourceIdentifier属性 |
ResourceType | String | 是 | 否 | 资源类型。 | 无 |
ExpireMode | String | 否 | 否 | 过期模式。 | 取值:
|
ExpireTimestamp | Integer | 否 | 否 | 过期时间戳。 | 单位:毫秒。 |
ResourceIdentifier语法
"ResourceIdentifier": {
"EnvironmentId": String,
"ParentResourceId": String,
"ResourceId": String,
"Resources": List
}ResourceIdentifier属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
EnvironmentId | String | 是 | 否 | 环境ID。 | 无 |
ResourceId | String | 是 | 否 | 资源ID。 | 无 |
ParentResourceId | String | 否 | 否 | 父资源ID。 | 无 |
Resources | List | 否 | 否 | 资源信息列表。 | 无 |
返回值
Fn::GetAtt
ConsumerAuthorizationRuleId:消费者授权规则ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
ConsumerId:
Type: String
Description:
en: The consumer ID.
Required: true
ResourceType:
Type: String
Description:
en: The resource type.
Required: true
ResourceIdentifier:
Description:
en: Resource identifier for non-standard code sources.
Required: true
Type: Json
AssociationPropertyMetadata:
Parameters:
ResourceId:
Type: String
Description:
en: The resource ID.
Required: true
EnvironmentId:
Type: String
Description:
en: The environment ID.
Required: true
ParentResourceId:
Type: String
Description:
en: The parent resource ID.
Default: Null
Required: false
Resources:
Description:
en: The resource infos.
Required: false
Default: Null
Type: Json
AssociationProperty: List[Parameter]
AssociationPropertyMetadata:
Parameter:
Type: String
Default: Null
Required: false
ExpireMode:
Type: String
Description:
en: 'The expire mode. Valid values: LongTerm, ShortTerm.'
AllowedValues:
- LongTerm
- ShortTerm
Default: Null
Required: false
ExpireTimestamp:
Type: Number
Description:
en: The expire timestamp in milliseconds.
Default: Null
Required: false
Resources:
ConsumerAuthorizationRule:
Type: ALIYUN::APIG::ConsumerAuthorizationRule
Properties:
ConsumerId:
Ref: ConsumerId
ResourceType:
Ref: ResourceType
ResourceIdentifier:
Ref: ResourceIdentifier
ExpireMode:
Ref: ExpireMode
ExpireTimestamp:
Ref: ExpireTimestamp
Outputs:
ConsumerAuthorizationRuleId:
Value:
Fn::GetAtt:
- ConsumerAuthorizationRule
- ConsumerAuthorizationRuleId
Description: The ID of the consumer authorization rule.
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"ConsumerId": {
"Type": "String",
"Description": {
"en": "The consumer ID."
},
"Required": true
},
"ResourceType": {
"Type": "String",
"Description": {
"en": "The resource type."
},
"Required": true
},
"ResourceIdentifier": {
"Description": {
"en": "Resource identifier for non-standard code sources."
},
"Required": true,
"Type": "Json",
"AssociationPropertyMetadata": {
"Parameters": {
"ResourceId": {
"Type": "String",
"Description": {
"en": "The resource ID."
},
"Required": true
},
"EnvironmentId": {
"Type": "String",
"Description": {
"en": "The environment ID."
},
"Required": true
},
"ParentResourceId": {
"Type": "String",
"Description": {
"en": "The parent resource ID."
},
"Default": null,
"Required": false
},
"Resources": {
"Description": {
"en": "The resource infos."
},
"Required": false,
"Default": null,
"Type": "Json",
"AssociationProperty": "List[Parameter]",
"AssociationPropertyMetadata": {
"Parameter": {
"Type": "String",
"Default": null,
"Required": false
}
}
}
}
}
},
"ExpireMode": {
"Type": "String",
"Description": {
"en": "The expire mode. Valid values: LongTerm, ShortTerm."
},
"AllowedValues": [
"LongTerm",
"ShortTerm"
],
"Default": null,
"Required": false
},
"ExpireTimestamp": {
"Type": "Number",
"Description": {
"en": "The expire timestamp in milliseconds."
},
"Default": null,
"Required": false
}
},
"Resources": {
"ConsumerAuthorizationRule": {
"Type": "ALIYUN::APIG::ConsumerAuthorizationRule",
"Properties": {
"ConsumerId": {
"Ref": "ConsumerId"
},
"ResourceType": {
"Ref": "ResourceType"
},
"ResourceIdentifier": {
"Ref": "ResourceIdentifier"
},
"ExpireMode": {
"Ref": "ExpireMode"
},
"ExpireTimestamp": {
"Ref": "ExpireTimestamp"
}
}
}
},
"Outputs": {
"ConsumerAuthorizationRuleId": {
"Value": {
"Fn::GetAtt": [
"ConsumerAuthorizationRule",
"ConsumerAuthorizationRuleId"
]
},
"Description": "The ID of the consumer authorization rule."
}
}
}该文章对您有帮助吗?