All Products
Search
Document Center

Resource Orchestration Service:Fn::MarketplaceImage

Last Updated:Jun 17, 2026

Returns the default image ID for a specified Alibaba Cloud Marketplace image commodity code.

Note

When you update a stack or create a change set, a change in this function's return value triggers an update for any resource that references the function. For example, assume that the image ID for an image commodity code in the China (Hangzhou) region (cn-hangzhou) is m-1, and you use a template containing this function to create a stack. If the Alibaba Cloud Marketplace seller later replaces m-1 with m-2, the new image ID triggers an update to resources that reference it, such as ALIYUN::ECS::InstanceGroup.

Function declaration

  • JSON

    {
     "Fn::MarketplaceImage": "ImageProductCode"
    }
  • YAML

    • Full syntax.

      Fn::MarketplaceImage: ImageProductCode
    • Short form.

      !MarketplaceImage : <ImageProductCode>

Parameters

ImageProductCode: Required. String. The commodity code of an Alibaba Cloud Marketplace image, for example, cmjj02****.

The commodity code of an Alibaba Cloud Marketplace product is an identifier that consists of letters (starting with cm) and digits, for example, cmgj017310. You can find the commodity code in the product URL of any Alibaba Cloud Marketplace product.

For example, if the product URL is https://market.aliyun.com/products/52738005/cmfw007705.html?spm=5176.8055458.103.12.WT0F9B#sku=yuncode170500005, "cmfw007705" is the commodity code.

Return value

String. The default image ID that corresponds to the specified Alibaba Cloud Marketplace image commodity code in the current region.

Examples

!MarketplaceImage cmjj02****

Return value: m-2zeeyr9nxxoo5gcg****.