Skip to content

Commit b31b1f2

Browse files
author
Yuriy Bezsonov
committed
chore(infra): refactor CloudFormation templates and Lambda functions
- Remove sensitive data from Lambda function logs (database-setup.py, password-exporter.py) - Replace f-string logging with generic success messages for security compliance - Reorganize CDK nag suppression rules in base-stack.yaml for consistency - Reorder suppression rule format to use id-first structure across all CloudFormation templates - Consolidate and standardize metadata configuration in java-on-amazon-eks-stack.yaml - Update java-on-aws-immersion-day-stack.yaml metadata structure - Update java-spring-ai-agents-stack.yaml metadata structure - Improve generate.sh script for CloudFormation generation - Enhance security posture by preventing accidental exposure of ARNs and secret names in logs
1 parent 46d69b4 commit b31b1f2

7 files changed

Lines changed: 8632 additions & 8629 deletions

File tree

infra/cdk/src/main/resources/lambda/database-setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def lambda_handler(event, context):
9292
SecretId=secret_name
9393
)
9494
secret_arn = secret_details['ARN']
95-
print(f"Secret ARN: {secret_arn}")
95+
print("Secret ARN retrieved successfully.")
9696
except ClientError as e:
9797
print(f"Error retrieving secret details: {str(e)}")
9898
raise
@@ -115,7 +115,7 @@ def lambda_handler(event, context):
115115
region,
116116
account_id
117117
)
118-
print(f"Cluster ARN: {cluster_arn}")
118+
print("Cluster ARN resolved successfully.")
119119

120120
# Initialize RDS Data API client
121121
rds_data = boto3.client('rds-data')

infra/cdk/src/main/resources/lambda/password-exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def lambda_handler(event, context):
2323
props = event['ResourceProperties']
2424
password_name = props['PasswordName']
2525

26-
print(f'Retrieving password from secret: {password_name}')
26+
print('Retrieving password from secret in Secrets Manager')
2727

2828
response = secretsmanager.get_secret_value(SecretId=password_name)
2929
secret_data = json.loads(response['SecretString'])

0 commit comments

Comments
 (0)