ALIYUN::ECS::ImageSharePermission类型用于管理镜像共享权限。
语法
{
"Type": "ALIYUN::ECS::ImageSharePermission",
"Properties": {
"KeepPermission": Boolean,
"IsPublic": Boolean,
"ImageId": String,
"Accounts": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
KeepPermission | Boolean | 否 | 是 | 删除资源时是否保留原有的共享权限。 | 取值:
|
IsPublic | Boolean | 否 | 是 | 是否发布或下架社区镜像。 | 取值:
|
ImageId | String | 是 | 否 | 被共享的自定义镜像ID。 | 无 |
Accounts | List | 否 | 是 | 授权共享镜像的阿里云账号ID。 | 最多支持10个账号,超过10系统会忽略该参数。 |
返回值
Fn::GetAtt
ImageId:被共享的自定义镜像ID。
示例
YAML
格式ROSTemplateFormatVersion: '2015-09-01' Parameters: Accounts: AssociationProperty: List[Parameter] AssociationPropertyMetadata: Parameter: Description: en: Alibaba Cloud account ID authorized to share the image. Required: false Type: String Description: en: Alibaba Cloud account IDs authorized to share the image. MaxLength: 10 MinLength: 0 Required: false Type: Json ImageId: Description: en: The shared custom image ID. Required: true Type: String IsPublic: Description: en: "Whether to publish or remove community mirrors. \nIf this property is not\ \ set, no changes will be made to the community image" Required: false Type: Boolean KeepPermission: Default: true Description: en: Whether to keep the original sharing permissions when resource is deleted, default is true.If set to false, Accounts will be removed if Accounts is set and IsPublic will be changed if IsPublic is set. Required: false Type: Boolean Resources: ImageSharePermission: Properties: Accounts: Ref: Accounts ImageId: Ref: ImageId IsPublic: Ref: IsPublic KeepPermission: Ref: KeepPermission Type: ALIYUN::ECS::ImageSharePermission Outputs: ImageId: Description: The shared custom image ID. Value: Fn::GetAtt: - ImageSharePermission - ImageId
JSON
格式{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "KeepPermission": { "Type": "Boolean", "Description": { "en": "Whether to keep the original sharing permissions when resource is deleted, default is true.If set to false, Accounts will be removed if Accounts is set and IsPublic will be changed if IsPublic is set." }, "Required": false, "Default": true }, "IsPublic": { "Type": "Boolean", "Description": { "en": "Whether to publish or remove community mirrors. \nIf this property is not set, no changes will be made to the community image" }, "Required": false }, "ImageId": { "Type": "String", "Description": { "en": "The shared custom image ID." }, "Required": true }, "Accounts": { "AssociationPropertyMetadata": { "Parameter": { "Type": "String", "Description": { "en": "Alibaba Cloud account ID authorized to share the image." }, "Required": false } }, "AssociationProperty": "List[Parameter]", "Type": "Json", "Description": { "en": "Alibaba Cloud account IDs authorized to share the image." }, "Required": false, "MinLength": 0, "MaxLength": 10 } }, "Resources": { "ImageSharePermission": { "Type": "ALIYUN::ECS::ImageSharePermission", "Properties": { "KeepPermission": { "Ref": "KeepPermission" }, "IsPublic": { "Ref": "IsPublic" }, "ImageId": { "Ref": "ImageId" }, "Accounts": { "Ref": "Accounts" } } } }, "Outputs": { "ImageId": { "Description": "The shared custom image ID.", "Value": { "Fn::GetAtt": [ "ImageSharePermission", "ImageId" ] } } } }