Skip to content

Commit fcd84b0

Browse files
Updated telemetry file
1 parent ba3a401 commit fcd84b0

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

cloudformation-telemetry/install_python_dependencies.sh

100644100755
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
#!/bin/bash
22

33
# Pull the Amazon Linux image from Docker Hub
4-
docker pull amazonlinux
4+
# aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
5+
docker pull public.ecr.aws/lambda/python:3.13-x86_64
56

67
# Run the Amazon Linux container in detached mode
7-
docker run -d --name telemetry amazonlinux tail -f /dev/null
8+
docker run -d --name telemetry public.ecr.aws/lambda/python:3.13-x86_64 lambda_function.lambda_handler
89

9-
# Install Python, pip, and other dependencies inside the container
10-
docker exec -it telemetry /bin/bash -c "yum update -y && yum install -y python3-pip zip && python3 -m pip install virtualenv"
10+
# Install dependencies inside the container
11+
docker exec -it telemetry /bin/bash -c "dnf install -y zip"
1112

1213
# Create a virtual environment and install dependencies
1314
docker exec -it telemetry /bin/bash -c "python3 -m venv temp-venv && source temp-venv/bin/activate && mkdir telemetry && cd telemetry && pip install crhelper sumologic-appclient-sdk future_fstrings setuptools -t ."
1415

1516
# Copy python file from host to container
16-
docker cp ./lambda_function.py telemetry:/telemetry
17+
docker cp ./lambda_function.py telemetry:/var/task/telemetry
18+
docker cp ./metadata.yaml telemetry:/var/task/telemetry
1719

1820
# Zip the contents of the telemetry directory
1921
docker exec -it telemetry /bin/bash -c "cd telemetry && ls -l && zip -r ../telemetry.zip ."
2022

2123
# Copy the telemetry.zip file from the container to the host
22-
docker cp telemetry:/telemetry.zip ./telemetry.zip
24+
docker cp telemetry:/var/task/telemetry.zip ./telemetry.zip
2325

2426
# Stop and remove the container
2527
docker stop telemetry
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Logging:
2+
LOG_FORMAT: "%(levelname)s | %(asctime)s | %(threadName)s | %(name)s | %(message)s"
3+
ROTATION_TYPE: D
4+
ROTATION_INTERVAL: 10
5+
ENABLE_CONSOLE_LOG: true
6+
ENABLE_LOGFILE: false
7+
LOG_FILEPATH: /tmp/cloudformation-telemetry/telemetry.log
8+
LOG_LEVEL: "DEBUG"
9+
10+
Collection:
11+
MAX_PAYLOAD_BYTESIZE: 500000
12+
MAX_RETRY: 5
13+
BACKOFF_FACTOR: 1
14+
COMPRESSED: true
15+
TIMEOUT: 60
16+
17+
DeployMetaData:
18+
PACKAGENAME: "cloudformation-telemetry"
19+
20+
SumoLogic:
21+
SUMO_ENDPOINT: null
4.09 MB
Binary file not shown.

0 commit comments

Comments
 (0)