Manages the share permissions on a custom image. You can share your custom images to other Alibaba Cloud accounts or publish the images as community images.
Operation description
Usage notes
Take note of the following items:
- You can share only your own custom images to other Alibaba Cloud accounts.
- You can share a custom image to up to 10 Alibaba Cloud accounts at a time. You can specify up to 10 Alibaba Cloud account IDs by using AddAccount.N or RemoveAccount.N. If you specify more than 10 account IDs, the system processes only the first 10 account IDs. The excess account IDs are ignored.
- You can share a custom image to up to 50 Alibaba Cloud accounts.
- If an Elastic Compute Service (ECS) instance was created ( RunInstances ) from a shared image, you cannot re-initialize the instance ( ReInitDisk ) after the image owner unshares or deletes the image ( DeleteImage ).
When you publish or unpublish a community image, take note of the following items:
- Alibaba Cloud provides only the platform on which community images can be published and managed. The owner of a community image is responsible for the quality and updates of the image. Make sure that you acknowledge and agree to the Community Image Agreement. Otherwise, you cannot publish community images. For more information, see Publish a community image.
- You cannot publish encrypted images as community images.
- Community images are publicly available. A community image is available to all Alibaba Cloud accounts in the region where the image resides.
- You cannot share, export, or copy community images.
- After you unpublish a community image, the image is no longer available to other Alibaba Cloud accounts. If an image is shared to other Alibaba Cloud accounts before it is unpublished, the image remains available to the accounts.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
*Image acs:ecs:{#regionId}:{#accountId}:image/{#imageId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ImageId | string | Yes | The ID of the custom image. | m-bp18ygjuqnwhechc**** |
LaunchPermission | string | No | Note
This parameter is in invitational preview and is not publicly available.
| hide |
AddAccount | array | No | The ID of Alibaba Cloud account N to which you want to share the custom image. Valid values of N: 1 to 10. If you specify more than 10 Alibaba Cloud account IDs, the system processes only the first 10 account IDs. The excess account IDs are ignored. | |
string | No | The ID of Alibaba Cloud account N to which you want to share the custom image. Valid values of N: 1 to 10. If you specify more than 10 Alibaba Cloud account IDs, the system processes only the first 10 account IDs. The excess account IDs are ignored. | 1234567890 | |
RemoveAccount | array | No | The ID of Alibaba Cloud account N from which you want to unshare the custom image. Valid values of N: 1 to 10. If you specify more than 10 Alibaba Cloud account IDs, the system processes only the first 10 account IDs. The excess account IDs are ignored. | |
string | No | The ID of Alibaba Cloud account N from which you want to unshare the custom image. Valid values of N: 1 to 10. If you specify more than 10 Alibaba Cloud account IDs, the system processes only the first 10 account IDs. The excess account IDs are ignored. | 1234567890 | |
IsPublic | boolean | No | Specifies whether to publish or unpublish a community image. Valid values:
Default value: false. | false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
- | |||
- | |||
- | |||
- | |||
- | |||
Before you share encrypted images, make sure that the AliyunECSShareEncryptImageDefaultRole RAM role is attached to your account. | |||
- | |||
- | |||
- | |||
- | |||
The specified image is not published as a community image and cannot be unpublished. | |||
- | |||
The maximum number of custom images that can be shared has been reached. | |||
The maximum number of accounts to which a single image can be shared is exceeded. | |||
The image cannot be shared among users of different carriers. | |||
The specified image contains encrypted snapshots and cannot be shared. | |||
- | |||
You have not signed the Community Image Terms of Service. | |||
The specified parameter IsPublic conflict with another parameter. | |||
The specified image does not exist in this account. Check whether the image ID is correct. | |||
- | |||
You are attempting to share the image to your own account. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
View Change Details | ||
View Change Details | ||
View Change Details | ||
View Change Details |