Maas can take a number of different formats for it’s images, the ones that I remember now are squashfs, tgz and dd, probably others. The most common ones are tgz for custom images (because that is what packer-maas likes to generate by default) and squashfs for upstream maas images. You can easily convert between them (unsquashfs then tar, or untar then squashfs it) and it normally works well.
Canonical has a repository with configs suited for generating images for maas. You can start from there, they are here. These configurations start with the standard cloud image and generate a maas image. In the simplest form it will just boot it, do nothing special, run a few steps specific to this transformation, stop it, pack it in tgz format and give you the custom image that you can add to maas. You can intercept that process and run custom scripts while the machine is live to do further customizations.
I’m not sure how this will fit your workflow for the AMI image. I see two options, you try to use it as source instead of the cloud image or you can start with the cloud image and re-do your customizations again.
I would strongly advise to do a custom script that at least clears the systemd’s machine-id, otherwise your golden image will generate installations that will have duplicated macaddresses for bridges and other strange things.
For adding it to maas, you can use something like:
maas root boot-resources create name="custom/myshortname" title="My Descriptive Name" base_image="ubuntu/jammy" architecture="amd64/generic" subarches="generic" filetype="tgz" content@=/path/custom-cloudimg.tar.gz
Hope that helps.