From 2aa45a2d6146e85e304eac287393cbc6b753b0b9 Mon Sep 17 00:00:00 2001 From: dzikafoczka Date: Fri, 20 Dec 2024 21:08:10 +0100 Subject: [PATCH] lb2 --- lb2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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') } )