Repository navigation
Conversation
An image built on a Marketplace AMI keeps its product code, so a spoke account needs the license to launch it. Such an image carries the license part of marketplaceMetadata without being a Marketplace import. The share decision now returns a separate license decision, and the AMI sharing state machine runs it at the end of every path: after copy, share or done for a built image, and directly for a straight import. Every path stores the AMI the spoke launches in $.copiedAmi, which the license states read. The seller's regional AMI ids are used only when the image source is MARKETPLACE_PRODUCT, so a built image publishes its own AMI. Promote and restore keep imageSource and marketplaceMetadata.
…ages A recipe version can take an imported Marketplace image as its base through an optional parentImageId. The image has to match the recipe's platform and architecture, have /dev/sda1 as root device and fit in the version's volume size. The version is pinned to the image's AMI in the build region. The built image carries the product code, subscription ownership, grant capability, license configuration and home region of its base, and the image registration events pass them on to publishing. The update event also carries the parent image and volume size from the update instead of the previous ones. Closes awslabs#115
8 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
Lets a recipe version build on a Marketplace image that was imported into the catalog (#200), and makes sure images built that way get their license in the spoke account. It replaces #116, which brought its own Marketplace discovery.
@raphaho, in #200 you said you were happy to review this as a PR against
mainonce #200 was merged, so here it is.Packaging
parentImageId, the id of an imported Marketplace image. The image must match the recipe's platform and architecture, boot from/dev/sda1and fit in the version's volume size. OS version is not checked, since imports take free text and recipes use a fixed list.marketplaceMetadata: product code, ownership,licenseGrantAllowed, license ARN and home region. It does not carryregionalAmiIds, and it has noimageSource. Both image registration events pass the metadata on to publishing.Publishing
licenseDecision. A built image with license metadata is copied or shared like any other image and then licensed. A straight Marketplace import skips copy and share as before.imageSourceisMARKETPLACE_PRODUCT.imageSourceandmarketplaceMetadata. They dropped both before, which also affected straight imports.Type of change
How was this tested?
Unit tests cover the recipe version handlers, the base image validation, image registration, the events and the share decision. The backend
appsuite passes, and so do the web app's type check, tests and lint. The state machine is covered by tests on the synthesised definition.The Step Functions Local tests are updated, with two new cases for built images, but I could not run them locally. I have not run this against real AWS accounts yet.
Checklist
CONTRIBUTING.mdNotes for reviewers
$.copiedAmiand continues to oneLicenseDecisionChoice.PassMarketplaceAmimoved to the start of the Marketplace path andPassLicenseGrantis gone, so the license states read the same field on every path.parentImageId, so an update through it switches a version back to the default base image.Acknowledgment
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.