update issue cert

This commit is contained in:
2025-08-29 13:03:57 -03:00
parent a98af3dca5
commit 50ce152880
3 changed files with 16 additions and 33 deletions

View File

@@ -4,7 +4,7 @@ from aws_lambda_powertools.utilities.data_classes import (
event_source,
)
from aws_lambda_powertools.utilities.typing import LambdaContext
from layercake.dynamodb import DynamoDBPersistenceLayer, SortKey, TransactKey
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
from boto3clients import dynamodb_client
from config import (
@@ -19,10 +19,11 @@ enrollment_layer = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
@logger.inject_lambda_context
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
new_image = event.detail['new_image']
enrollment = enrollment_layer.collection.get_items(
TransactKey(pk=new_image['id'])
+ SortKey('METADATA#DEDUPLICATION_WINDOW', rename_key='deduplication_window')
+ SortKey('METADATA#COURSE', rename_key='course'),
course_metadata = enrollment_layer.collection.get_item(
KeyPair(
pk=new_image['id'],
sk='METADATA#COURSE',
),
)
return True

View File

@@ -45,7 +45,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
'email': user['email'],
'course': course_name,
'created_at': now_,
'ttl': ttl(days=3, start_dt=now_),
'ttl': ttl(start_dt=now_, days=3),
},
)
@@ -63,7 +63,6 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
'ttl': ttl(start_dt=now_, days=access_period),
},
)
print(access_period)
transact.put(
item={
'id': enrollment_id,