I am making a spot instance request in boto3, the user data is first compressed using bz sompression and then encoded in base64.
base64.b64encode(bz2.compress(user_data, 10)). I get the following error while making the request -
ClientError: An error occurred (InvalidParameterValue) when calling the RequestSpotInstances operation: Invalid BASE64 encoding of user data
I have seen the related question, AWS Boto3 BASE64 encoding error thrown when invoking client.request_spot_instances method. The answer is to decode it to ascii, I am still getting the above error. According to the answer
user_data = user_data.decode("ascii") should work . Is there any other way to pass the user_data?