Skip to content

feat(packaging): let recipe versions build on AWS Marketplace images - #116

Closed
ganhammar wants to merge 4 commits into
awslabs:mainfrom
ganhammar:feat/marketplace-base-image
Closed

ganhammar wants to merge 4 commits into
awslabs:mainfrom
ganhammar:feat/marketplace-base-image

Conversation

@ganhammar

Copy link
Copy Markdown
Contributor

What does this change do?

Lets a recipe version build on a subscribed AWS Marketplace AMI product instead of the default operating system image. Today a recipe can only build on the fixed base images from the system configuration mapping, and publishing only accepts AMIs that VEW built itself. So there's no way to use an AMI delivered through Marketplace, for example one that another VEW deployment publishes there. See #115.

  • GET /projects/{projectId}/marketplace-images lists the AMI products the AMI factory account is subscribed to, taken from its Marketplace agreements. Each product resolves to its latest AMI through the Marketplace AMI alias /aws/service/marketplace/<product-id>/latest, the same kind of SSM lookup the default base images use. Only products with an alias in the region that boot from /dev/sda1 are listed.
  • Create and update recipe version accept an optional parentImageProductId. The product has to be in that list and match the recipe's platform and architecture, and the volume size has to be at least its root volume. Its AMI becomes parentImageUpstreamId, so pipelines, recipe testing and publishing work as before. Automated versions carry the product ID over.
  • The recipe version wizard shows a base image picker when a product matches the recipe.
  • The AMI factory role gets aws-marketplace:SearchAgreements and aws-marketplace:GetProduct, and product contributors get a new Cedar action, GetMarketplaceImages.

It also fixes an existing bug in the recipe version update event, which published the previous parent image and volume size, so a changed base image or size wasn't rebuilt.

Type of change

  • Bug fix
  • New feature
  • Refactor / tech debt
  • Documentation
  • Infrastructure / CI

How was this tested?

Unit tests cover the handlers, the new adapter and the API. The packaging, infra and authorization suites pass, and so do the web app's lint, type check and tests. We also ran it against real Marketplace subscriptions. The listing code returned the subscribed products from the live APIs, and an Image Builder build on a Marketplace product's AMI passed build and test, with the recipe set up the way VEW does it and an encrypted root volume larger than the AMI's. The resulting AMI kept the product code, size and encryption through VEW's copy and share.

Checklist

Notes for reviewers

  • Only /dev/sda1 products are offered, because recipes, recipe testing and the workbench and virtual target templates all map the root volume there.
  • Marketplace doesn't expose an OS version, so that isn't checked against the recipe.
  • Leaving out parentImageProductId on an update switches back to the default image, like the other fields on that PUT.
  • The AMI factory account has to hold the subscription itself; a subscription shared to it through License Manager isn't listed. Every account that launches workbenches from the result needs the subscription too, since the product code carries over.

@ganhammar
ganhammar requested a review from a team September 30, 2026 11:17
A recipe version can name a subscribed AWS Marketplace AMI product as its base image through an optional parentImageProductId. A new GET /projects/{projectId}/marketplace-images lists the products the AMI factory account is subscribed to, resolved to their latest AMI through the Marketplace AMI alias in SSM, so images delivered over Marketplace can be built on like the default base images. The product has to match the recipe's platform and architecture and boot from /dev/sda1, and the volume size has to cover its root volume.

Also fixes the recipe version update event, which published the previous parent image and volume size, so a changed base image or size was never rebuilt.
@ganhammar
ganhammar force-pushed the feat/marketplace-base-image branch from fbe4964 to 1124e9c Compare September 30, 2026 11:25
@ganhammar

Copy link
Copy Markdown
Contributor Author

Closing this in favour of #204, which does the same on top of the image import from #200 instead of bringing its own Marketplace discovery. The recipe version update fix from this PR is in #203.

@ganhammar ganhammar closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Let recipe versions build on AWS Marketplace AMIs

1 participant