Skip to content

Commit

Permalink
Merge pull request #50 from humio/py3.12
Browse files Browse the repository at this point in the history
Updating runtime to python 3.12
  • Loading branch information
gumbasek authored Jun 19, 2024
2 parents 9c3b9d4 + 22d827c commit 6d268c5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.0
current_version = 2.1.0
commit = True
tag = True
message = Bump version: {current_version} → {new_version}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ target:
mkdir -p target

copy:
cp src/* target
cp -r src/* target

dependencies:
pip3 install -r requirements.txt -t target

target/cloudwatch2logscale.zip:
(cd target/ && zip -r ../target/v2.0.0_cloudwatch2logscale.zip * )
(cd target/ && zip -r ../target/v2.1.0_cloudwatch2logscale.zip * )

clean:
rm -rf target
Expand Down
16 changes: 8 additions & 8 deletions cloudformation.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
},
"S3KeyOfTheDeploymentPackageContainingLambdaCodeFiles" : {
"Type" : "String",
"Description" : "The name of the S3 key in the S3 bucket containing the lambda code files used for the integration. Change this if you have named the deployment package containing the code files something other than the default 'v2.0.0_cloudwatch2logscale.zip'.",
"Default" : "v2.0.0_cloudwatch2logscale.zip"
"Description" : "The name of the S3 key in the S3 bucket containing the lambda code files used for the integration. Change this if you have named the deployment package containing the code files something other than the default 'v2.1.0_cloudwatch2logscale.zip'.",
"Default" : "v2.1.0_cloudwatch2logscale.zip"
}
},
"Conditions" : {
Expand Down Expand Up @@ -263,7 +263,7 @@
"Properties": {
"Description" : "Copies objects from a S3 bucket to a destination.",
"Handler" : "index.handler",
"Runtime" : "python3.8",
"Runtime" : "python3.12",
"Timeout" : "300",
"Role" : { "Fn::GetAtt": [ "LogScaleCloudWatchRole", "Arn" ] },
"Code" : {
Expand Down Expand Up @@ -314,7 +314,7 @@
"Role" : {
"Fn::GetAtt" : [ "LogScaleCloudWatchRole", "Arn" ]
},
"Runtime" : "python3.8",
"Runtime" : "python3.12",
"Timeout" : "300"
}
},
Expand Down Expand Up @@ -361,7 +361,7 @@
"Role" : {
"Fn::GetAtt" : [ "LogScaleCloudWatchRole", "Arn" ]
},
"Runtime" : "python3.8",
"Runtime" : "python3.12",
"Timeout" : "300"
}
},
Expand Down Expand Up @@ -412,7 +412,7 @@
"Role" : {
"Fn::GetAtt" : [ "LogScaleCloudWatchRole", "Arn" ]
},
"Runtime" : "python3.8",
"Runtime" : "python3.12",
"Timeout" : "300"
}
},
Expand Down Expand Up @@ -563,7 +563,7 @@
"Role" : {
"Fn::GetAtt" : [ "LogScaleCloudWatchRole", "Arn" ]
},
"Runtime" : "python3.8",
"Runtime" : "python3.12",
"Timeout" : "300"
}
},
Expand Down Expand Up @@ -612,7 +612,7 @@
"Role" : {
"Fn::GetAtt" : [ "LogScaleCloudWatchRole", "Arn" ]
},
"Runtime" : "python3.8",
"Runtime" : "python3.12",
"Timeout" : "300"
}
},
Expand Down
2 changes: 1 addition & 1 deletion deploy-using-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cat cloudformation.json | jq
make build

aws s3 cp --acl public-read cloudformation.json s3://logscale-public-us-east-1/ --region us-east-1 --profile cloudwatch
aws s3 cp --acl public-read target/v2.0.0_cloudwatch2logscale.zip s3://logscale-public-us-east-1/ --region us-east-1 --profile cloudwatch
aws s3 cp --acl public-read target/v2.1.0_cloudwatch2logscale.zip s3://logscale-public-us-east-1/ --region us-east-1 --profile cloudwatch
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cat cloudformation.json | jq
make build

aws s3 cp --acl public-read cloudformation.json s3://logscale-public-us-east-1/ --region us-east-1
aws s3 cp --acl public-read target/v2.0.0_cloudwatch2logscale.zip s3://logscale-public-us-east-1/ --region us-east-1
aws s3 cp --acl public-read target/v2.1.0_cloudwatch2logscale.zip s3://logscale-public-us-east-1/ --region us-east-1
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requests
requests
urllib3==1.26.6
18 changes: 9 additions & 9 deletions src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,21 @@ def parse_message(message):

# Standard out from Lambdas.
std_matcher = re.compile(
"\d\d\d\d-\d\d-\d\d\S+\s+(?P<request_id>\S+)"
r"\d\d\d\d-\d\d-\d\d\S+\s+(?P<request_id>\S+)"
)


# END RequestId: b3be449c-8bd7-11e7-bb30-4f271af95c46
end_matcher = re.compile(
"END RequestId:\s+(?P<request_id>\S+)"
r"END RequestId:\s+(?P<request_id>\S+)"
)


# START RequestId: b3be449c-8bd7-11e7-bb30-4f271af95c46
# Version: $LATEST
start_matcher = re.compile(
"START RequestId:\s+(?P<request_id>\S+)\s+"
"Version: (?P<version>\S+)"
r"START RequestId:\s+(?P<request_id>\S+)\s+"
r"Version: (?P<version>\S+)"
)


Expand All @@ -212,9 +212,9 @@ def parse_message(message):
# Memory Size: 128 MB
# Max Memory Used: 20 MB
report_matcher = re.compile(
"REPORT RequestId:\s+(?P<request_id>\S+)\s+"
"Duration: (?P<duration>\S+) ms\s+"
"Billed Duration: (?P<billed_duration>\S+) ms\s+"
"Memory Size: (?P<memory_size>\S+) MB\s+"
"Max Memory Used: (?P<max_memory>\S+) MB"
r"REPORT RequestId:\s+(?P<request_id>\S+)\s+"
r"Duration: (?P<duration>\S+) ms\s+"
r"Billed Duration: (?P<billed_duration>\S+) ms\s+"
r"Memory Size: (?P<memory_size>\S+) MB\s+"
r"Max Memory Used: (?P<max_memory>\S+) MB"
)

0 comments on commit 6d268c5

Please sign in to comment.