All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::ImageSharePermission

最終更新日:Jan 17, 2024

ALIYUN::ECS::ImageSharePermission is used to manage the share permissions on a custom image.

Syntax

{
  "Type": "ALIYUN::ECS::ImageSharePermission",
  "Properties": {
    "KeepPermission": Boolean,
    "IsPublic": Boolean,
    "ImageId": String,
    "Accounts": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

KeepPermission

Boolean

No

Yes

Specifies whether to retain the original share permissions when you delete resources.

Valid values:

  • true (default)

  • false

    If you specify both KeepPermission and Accounts, the value of Accounts is ignored. If you specify both KeepPermission and IsPublic, the value of IsPublic varies based on the value of KeepPermission.  

IsPublic

Boolean

No

Yes

Specifies whether to publish or unpublish a community image.

Valid values:

  • true: publishes the custom image as a community image.

  • false (default): unpublishes a community image. This value is valid only for community images.

ImageId

String

Yes

No

The ID of the custom image.

None

Accounts

List

No

Yes

The IDs of Alibaba Cloud accounts with which you want to share the custom image.

You can specify up to 10 accounts. If the number of accounts is greater than 10, this property is ignored.

Return values

Fn::GetAtt

ImageId: the ID of the custom image.

Examples

  • YAML format

    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 format

    {
      "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"
            ]
          }
        }
      }
    }