diff --git a/src/auth-authorizer/lambda_function.py b/src/auth-authorizer/lambda_function.py index c798d84..dfaea40 100644 --- a/src/auth-authorizer/lambda_function.py +++ b/src/auth-authorizer/lambda_function.py @@ -5,11 +5,11 @@ from urllib.request import urlopen -AWS_REGION = os.environ.get('REGION') +REGION = os.environ.get('REGION') USER_POOL_ID = os.environ.get('USER_POOL_ID') APP_CLIENT_ID = os.environ.get('CLIENT_ID') -KEYS_URL = f'https://cognito-idp.{AWS_REGION}.amazonaws.com/{USER_POOL_ID}/.well-known/jwks.json' +KEYS_URL = f'https://cognito-idp.{REGION}.amazonaws.com/{USER_POOL_ID}/.well-known/jwks.json' KEYS = requests.get(KEYS_URL).json()['keys'] def lambda_handler(event, context): diff --git a/terraform/main.tf b/terraform/main.tf index 23d520c..612f0f3 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -199,7 +199,7 @@ module "lambda_auth_authorizer" { source_path = "../src/auth-authorizer" environment_variables = { - AWS_REGION = var.region + REGION = var.region USER_POOL_ID = aws_cognito_user_pool.user_pool.id CLIENT_ID = aws_cognito_user_pool_client.client.id }