Skip to content

Commit 508f226

Browse files
authored
add health_check_latest.json file
1 parent 0946215 commit 508f226

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lambda/lambda_function.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,22 @@ def upload_json_to_s3(json_data, bucket_name, object_name):
177177
# Convert the JSON data to a formatted string with indentation
178178
json_string = json.dumps(json_data, indent=4)
179179

180-
# Upload the JSON string to S3
181-
response = s3_client.put_object(
180+
# Upload the JSON
181+
s3_client.put_object(
182182
Bucket=bucket_name,
183183
Key=object_name,
184184
Body=json_string,
185185
ContentType="application/json",
186186
)
187+
188+
# Also upload the JSON string as the latest file
189+
s3_client.put_object(
190+
Bucket=bucket_name,
191+
Key="health_check_latest.json",
192+
Body=json_string,
193+
ContentType="application/json",
194+
)
195+
187196
return True, "JSON uploaded successfully."
188197
except Exception as e:
189198
# The upload failed; return False and the error

0 commit comments

Comments
 (0)