diff --git a/lb2.py b/lb2.py index 52a5ffd..0bb688b 100644 --- a/lb2.py +++ b/lb2.py @@ -1,4 +1,5 @@ import boto3 +import base64 from USER_DATA import user_data # Configuration variables @@ -169,7 +170,7 @@ def create_launch_template(ec2_client, key_name, security_group_id): 'InstanceType': INSTANCE_TYPE, 'SecurityGroupIds': [security_group_id], 'KeyName': key_name, - 'UserData': user_data + 'UserData': base64.b64encode(user_data.encode('utf-8')).decode('utf-8') } )