From 0b69ffd67c0ef24af3f40cfb1560adf7130fa8cc Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 16 May 2025 13:39:29 -0500 Subject: [PATCH] Switch to cognito user/password authentication. Major code refactor - Fix 4 --- destroy.sh | 2 +- infrastructure/stack.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/destroy.sh b/destroy.sh index bcf2ca0..bde6947 100755 --- a/destroy.sh +++ b/destroy.sh @@ -1,4 +1,4 @@ #!/bin/bash # Destroy infrastructure -cdk destroy \ No newline at end of file +cdk destroy --force \ No newline at end of file diff --git a/infrastructure/stack.py b/infrastructure/stack.py index 468bbe5..38983a5 100644 --- a/infrastructure/stack.py +++ b/infrastructure/stack.py @@ -1,6 +1,7 @@ import os from aws_cdk import ( Duration, + RemovalPolicy, Stack, aws_ec2 as ec2, aws_iam as iam, @@ -114,7 +115,8 @@ class IptvUpdaterStack(Stack): require_symbols=True, require_uppercase=True ), - account_recovery=cognito.AccountRecovery.EMAIL_ONLY + account_recovery=cognito.AccountRecovery.EMAIL_ONLY, + removal_policy=RemovalPolicy.DESTROY ) # Add App Client with the correct callback URL @@ -153,7 +155,7 @@ class IptvUpdaterStack(Stack): userdata.add_commands( f'echo "COGNITO_USER_POOL_ID={user_pool.user_pool_id}" >> /etc/environment', f'echo "COGNITO_CLIENT_ID={client.user_pool_client_id}" >> /etc/environment', - f'echo "COGNITO_CLIENT_SECRET={client.user_pool_client_secret.plain_text}" >> /etc/environment' + f'echo "COGNITO_CLIENT_SECRET={client.user_pool_client_secret.to_string()}" >> /etc/environment' ) userdata.add_commands(str(userdata_file, 'utf-8'))