Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws: allow the user to customize their AMI name
In the frontend a new field is allowing user to setup customized names for their images (see osbuild/image-builder-frontend#1136). In order to allow the customization to effectively take place, this commit is slightly changing how EC2 images are activated. Before, two identical informations where communicated, the `Name` tag and the AMI Name. Both being set to an identical generated value starting with `composer-api-*`. The maintenance service is using the `Name` tag value to filter out which images are generated by composer by looking for the ones starting with `composer-api-*`. However, Tags can't be shared. Which means that no matter what is the value we choose to put int the `Name` tag, the service user won't get access to it. Which means that the custom name only needs to be set in the AMI Name. Meaning that the logic around the `Name` tag stays identical. Therefore eliminating the need to update the maintenance service. AMI Names must be unique. If a user is creating twice the same image with the same name, AWS would refuse the upload. To avoid getting the user blocked by this composer is appending a UUID to the custom name, therefore making it most probably unique. Lastly, tags are set both to the AMI and the snapshot, for consistency, the same tags are sent for both of them.
- Loading branch information