jcjorel / ec2-spot-converter

A tool to convert AWS EC2 instances back and forth between On-Demand and Spot billing models.
MIT License
190 stars 20 forks source link

Tag Keys starting with aws: error with reserved word #13

Closed kruule69 closed 2 years ago

kruule69 commented 2 years ago

When instances are created with CloudFormation or Service Catalog, the services will create their own tags on instances. These tags all start with "aws:". When trying to convert, the error comes up that these are reserved tags.....

The tag keys maybe just renamed to something like changing "aws:cloudformation" to "AWScloudformation".

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the RunInstances operation: Tag keys starting with 'aws:' are reserved for internal use

jcjorel commented 2 years ago

Hi, Good catch! It is a side use-case as instances created with IaaC are less likely with the need to use EC2-spot-converter (It will create a configuration drift from a CloudFormation/TerraForm/Pulumi PoV) but it could useful in some case so will add the support. Thanks.

kruule69 commented 2 years ago

Thanks for looking at adding this feature! Kudos on this tool.... worked very well in our (small) test environment!

You are correct, this is probably not an issue for most but when deploying EC2 instances with CloudFormation stacks and AWS Service Catalog this is creating these tags. To your point these instances should be built as spot to begin with, but for us it is not always the case (ie. lift-shift).

jcjorel commented 2 years ago

v0.14.0 released. Enjoy!

jcjorel commented 2 years ago

Jusr detected a small regession. v0.14.1 coming soon...

jcjorel commented 2 years ago

v0.14.1 released. Should be ok this time...