mirror of
https://github.com/floci-io/floci.git
synced 2026-11-29 08:31:53 -05:00
* fix(ec2): reject tag writes on missing, malformed or absent resources CreateTags and DeleteTags stored tags for any id. Both now answer MissingParameter when no resource is named and InvalidID for an id that is not a known EC2 prefix followed by hex digits. CreateTags also checks each resource exists in the request region and answers with that type's own NotFound error, as moto does; a well-formed id of a type Floci does not model is still tagged. CreateTags enforces the documented limits: at most 50 user tags per resource (aws: tags do not count) with TagLimitExceeded, and keys up to 128 and values up to 256 Unicode characters with InvalidParameterValue. Every resource and limit is checked before any tag is written. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(ec2): match tag targets in full and resolve them by their prefix A tag target id is now matched in full with an 8 or 17 hex suffix, and an id Floci seeds without hex digits (a default VPC resource, a catalog AMI alias) passes only when the region holds it. The resource type comes from the matched prefix, so eni-attach-, vpce-svc- and the cidr-assoc ids reach the unmodelled arm, and an AMI is checked against the catalog and the region's registered images instead of DescribeImages, which answers an unknown id with a launchable fallback. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(ec2): accept fleet and IPAM tag targets and check the tag limit under the write's locks EC2 Fleet and Spot Fleet request ids are UUIDs and an IPAM pool allocation id has 33 hex digits, so a tag target id now takes 8 or more hex digits or a UUID, and the ipam, ipam-scope, ipam-pool and ipam-pool-alloc prefixes are known. The 50-tag check ran before the write took its resource locks, so concurrent CreateTags requests at 49 tags could all pass it; the check and the write now run holding every named resource's lock, taken in stripe order after the topology lock. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com>