diff --git a/apps/utils/locust_tests/common/stats/aggregated_stats.py b/apps/utils/locust_tests/common/stats/aggregated_stats.py index 4b90ae805b..c27f9aa92f 100644 --- a/apps/utils/locust_tests/common/stats/aggregated_stats.py +++ b/apps/utils/locust_tests/common/stats/aggregated_stats.py @@ -4,7 +4,7 @@ import hashlib import time from dataclasses import dataclass -from enum import Enum +from enum import StrEnum from typing import Any, Dict, List, Optional, Union from locust.env import Environment @@ -168,7 +168,7 @@ def __get_percentiles_dict(cls, stats_entry: StatsEntry) -> ResponseTimePercenti } -class FinalCompareResult(str, Enum): +class FinalCompareResult(StrEnum): """Enum that indicates the _overall_ result of a given AggregatedStats' comparison with a baseline AggregatedStats. Used to filter out runs that did not pass comparison against a baseline, but may want to be stored for future analysis""" diff --git a/apps/utils/locust_tests/common/stats/stats_compare.py b/apps/utils/locust_tests/common/stats/stats_compare.py index 0791cc6119..06cbfa9287 100644 --- a/apps/utils/locust_tests/common/stats/stats_compare.py +++ b/apps/utils/locust_tests/common/stats/stats_compare.py @@ -6,7 +6,7 @@ import json import logging from dataclasses import asdict, dataclass -from enum import Enum +from enum import StrEnum from typing import Any, Dict, List, Optional, Tuple, Union from locust.env import Environment @@ -16,14 +16,14 @@ from common.stats.stats_loaders import StatsLoader -class StatBetterIf(str, Enum): +class StatBetterIf(StrEnum): """Enum representing whether a given stat is better if its value is smaller or larger""" SMALLER = "SMALLER" LARGER = "LARGER" -class StatCompareResult(str, Enum): +class StatCompareResult(StrEnum): """Enum representing the result of a particular stat comparison""" PASS = "PASS" diff --git a/apps/utils/locust_tests/common/stats/stats_config.py b/apps/utils/locust_tests/common/stats/stats_config.py index 770c432322..0ddb5eb957 100644 --- a/apps/utils/locust_tests/common/stats/stats_config.py +++ b/apps/utils/locust_tests/common/stats/stats_config.py @@ -2,13 +2,13 @@ import re from argparse import Namespace from dataclasses import dataclass, field -from enum import Enum +from enum import StrEnum from typing import Any, Dict, List, Optional from locust.argument_parser import LocustArgumentParser -class StatsStorageType(str, Enum): +class StatsStorageType(StrEnum): """Enumeration for each available type of storage for JSON stats""" FILE = "file" @@ -16,7 +16,7 @@ class StatsStorageType(str, Enum): S3 = "s3" """Indicates that aggregated statistics will be stored to an S3 bucket""" -class StatsComparisonType(str, Enum): +class StatsComparisonType(StrEnum): """Enumeration for each possible type of stats comparison""" PREVIOUS = "previous" diff --git a/apps/utils/locust_tests/common/validation.py b/apps/utils/locust_tests/common/validation.py index 6ecf4d6ec9..df4bfe3d81 100644 --- a/apps/utils/locust_tests/common/validation.py +++ b/apps/utils/locust_tests/common/validation.py @@ -1,7 +1,7 @@ """Validate tests against target SLIs""" import logging import time -from enum import Enum +from enum import StrEnum, Enum from typing import Optional import gevent @@ -14,7 +14,7 @@ """The SLA goals against which to measure the test run's results""" -class ValidationResult(str, Enum): +class ValidationResult(StrEnum): """Enum representing the result of failure ratio and SLA validation""" NOT_APPLICABLE = "NOT_APPLICABLE" diff --git a/apps/utils/locust_tests/lambda/server-regression/app.py b/apps/utils/locust_tests/lambda/server-regression/app.py index 51391ed512..f2231aff39 100644 --- a/apps/utils/locust_tests/lambda/server-regression/app.py +++ b/apps/utils/locust_tests/lambda/server-regression/app.py @@ -3,7 +3,7 @@ import subprocess import urllib.parse from dataclasses import asdict, dataclass -from enum import Enum +from enum import StrEnum from typing import List import boto3 @@ -40,7 +40,7 @@ class PipelineSignalMessage: log_group_name: str -class TestResult(str, Enum): +class TestResult(StrEnum): SUCCESS = "SUCCESS" FAILURE = "FAILURE" diff --git a/apps/utils/locust_tests/requirements.txt b/apps/utils/locust_tests/requirements.txt index 8aa4136510..55fbffd67f 100644 --- a/apps/utils/locust_tests/requirements.txt +++ b/apps/utils/locust_tests/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --allow-unsafe --generate-hashes --output-file=requirements.txt requirements.in @@ -444,10 +444,6 @@ idna==3.7 \ # via # -r requirements.in # requests -importlib-metadata==7.1.0 \ - --hash=sha256:30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570 \ - --hash=sha256:b78938b926ee8d5f020fc4772d487045805a55ddbad2ecf21c6d60938dc7fcd2 - # via flask itsdangerous==2.1.2 \ --hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \ --hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a @@ -809,10 +805,6 @@ werkzeug==3.0.1 \ # -r requirements.in # flask # locust -zipp==3.18.1 \ - --hash=sha256:206f5a15f2af3dbaee80769fb7dc6f249695e940acca08dfb2a4769fe61e538b \ - --hash=sha256:2884ed22e7d8961de1c9a05142eb69a247f120291bc0206a00a7642f09b5b715 - # via importlib-metadata zope-event==5.0 \ --hash=sha256:2832e95014f4db26c47a13fdaef84cef2f4df37e66b59d8f1f4a8f319a632c26 \ --hash=sha256:bac440d8d9891b4068e2b5a2c5e2c9765a9df762944bda6955f96bb9b91e67cd diff --git a/ops/Dockerfile b/ops/Dockerfile index e16e3fbad5..1fe74feef3 100644 --- a/ops/Dockerfile +++ b/ops/Dockerfile @@ -26,7 +26,7 @@ RUN echo flyway.placeholders.type.int4=int4 > /flyway/conf/flyway.conf \ && echo flyway.postgresql.transactional.lock=false >> /flyway/conf/flyway.conf FROM amazonlinux:2 as al2 -ARG PYTHON3_TAR_SOURCE="https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz" +ARG PYTHON3_TAR_SOURCE="https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz" LABEL org.opencontainers.image.source=https://github.com/CMSgov/beneficiary-fhir-data # Getting systemd to run correctly inside Docker is very tricky. Need to @@ -76,8 +76,8 @@ RUN curl -o python3.tgz $PYTHON3_TAR_SOURCE && \ cd $(basename $PYTHON3_TAR_SOURCE .tgz) && \ ./configure && make && make altinstall -RUN ln -fs /usr/local/bin/python3.9 /usr/bin/python3 && \ - ln -fs /usr/local/bin/pip3.9 /usr/bin/pip3 +RUN ln -fs /usr/local/bin/python3.11 /usr/bin/python3 && \ + ln -fs /usr/local/bin/pip3.11 /usr/bin/pip3 RUN /usr/bin/python3 -m pip install --upgrade pip diff --git a/ops/ansible/playbooks-ccs/build_bfd-platinum.yml b/ops/ansible/playbooks-ccs/build_bfd-platinum.yml index 616fa15bf4..3f59ceb261 100644 --- a/ops/ansible/playbooks-ccs/build_bfd-platinum.yml +++ b/ops/ansible/playbooks-ccs/build_bfd-platinum.yml @@ -10,7 +10,7 @@ gather_facts: false vars: ansible_ssh_pipelining: false - python3_version: '3.9.16' + python3_version: '3.11.9' tasks: - name: Apply Platinum Role diff --git a/ops/jenkins/bfd-build-server-load-controller/Dockerfile b/ops/jenkins/bfd-build-server-load-controller/Dockerfile index e3cddd27b1..0b3d750ab8 100644 --- a/ops/jenkins/bfd-build-server-load-controller/Dockerfile +++ b/ops/jenkins/bfd-build-server-load-controller/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim as base +FROM python:3.11-slim as base COPY . /app WORKDIR /app diff --git a/ops/jenkins/bfd-build-server-load-node/Dockerfile b/ops/jenkins/bfd-build-server-load-node/Dockerfile index da7eaa2e9e..562fdb9708 100644 --- a/ops/jenkins/bfd-build-server-load-node/Dockerfile +++ b/ops/jenkins/bfd-build-server-load-node/Dockerfile @@ -1,6 +1,6 @@ -FROM public.ecr.aws/lambda/python:3.9 as base +FROM public.ecr.aws/lambda/python:3.11 as base -FROM public.ecr.aws/lambda/python:3.9 as prereqs +FROM public.ecr.aws/lambda/python:3.11 as prereqs RUN yum install git gcc python3-devel -y # Build required python packages @@ -10,11 +10,11 @@ RUN pip3 install -r requirements.txt # Copy function code FROM base as node -COPY --from=python /var/lang/lib/python3.9/site-packages /var/lang/lib/python3.9/site-packages +COPY --from=python /var/lang/lib/python3.11/site-packages /var/lang/lib/python3.11/site-packages COPY --from=python /var/lang/bin /var/lang/bin COPY . "${LAMBDA_TASK_ROOT}/locust_tests" RUN mv $LAMBDA_TASK_ROOT/locust_tests/services/server-load/* $LAMBDA_TASK_ROOT/ -ENV PATH="/var/lang/lib/python3.9/site-packages:${PATH}" +ENV PATH="/var/lang/lib/python3.11/site-packages:${PATH}" ENV NODE_LOCUST_TESTS_DIR="${LAMBDA_TASK_ROOT}/locust_tests" CMD [ "node/node.handler" ] diff --git a/ops/jenkins/bfd-cbc-build/Dockerfile b/ops/jenkins/bfd-cbc-build/Dockerfile index cb252a0e8e..d2aee5d76f 100644 --- a/ops/jenkins/bfd-cbc-build/Dockerfile +++ b/ops/jenkins/bfd-cbc-build/Dockerfile @@ -28,8 +28,8 @@ RUN curl -o python3.tgz $PYTHON3_TAR_SOURCE && \ cd $(basename $PYTHON3_TAR_SOURCE .tgz) && \ ./configure && make && make altinstall -RUN ln -fs /usr/local/bin/python3.9 /usr/bin/python3 && \ - ln -fs /usr/local/bin/pip3.9 /usr/bin/pip3 +RUN ln -fs /usr/local/bin/python3.11 /usr/bin/python3 && \ + ln -fs /usr/local/bin/pip3.11 /usr/bin/pip3 RUN /usr/bin/python3 -m pip install --upgrade pip diff --git a/ops/jenkins/bfd-cbc-build/build-push.sh b/ops/jenkins/bfd-cbc-build/build-push.sh index 736736c4fa..0c5cc1099b 100755 --- a/ops/jenkins/bfd-cbc-build/build-push.sh +++ b/ops/jenkins/bfd-cbc-build/build-push.sh @@ -16,7 +16,7 @@ docker build "$BUILD_ROOT_DIR" \ --build-arg PACKER_VERSION="${CBC_PACKER_VERSION:-1.6.6}" \ --build-arg TFENV_REPO_HASH="${CBC_TFENV_REPO_HASH:-c05c364}" \ --build-arg TFENV_VERSIONS="${CBC_TFENV_VERSIONS:-1.5.0}" \ - --build-arg PYTHON3_TAR_SOURCE="${CBC_PYTHON3_TAR_SOURCE:-https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz}" \ + --build-arg PYTHON3_TAR_SOURCE="${CBC_PYTHON3_TAR_SOURCE:-https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz}" \ --build-arg KOTLINC_ZIP_SOURCE="${CBC_KOTLINC_ZIP_SOURCE:-https://github.com/JetBrains/kotlin/releases/download/v1.9.10/kotlin-compiler-1.9.10.zip}" \ --build-arg CIPHER_SCRIPT="${CIPHER_SCRIPT}" \ --build-arg YQ_VERSION="${CBC_YQ_VERSION:-4}" \ diff --git a/ops/jenkins/bfd-server-regression-build/Dockerfile b/ops/jenkins/bfd-server-regression-build/Dockerfile index de906c97dd..9d42460400 100644 --- a/ops/jenkins/bfd-server-regression-build/Dockerfile +++ b/ops/jenkins/bfd-server-regression-build/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/lambda/python:3.9 as base +FROM public.ecr.aws/lambda/python:3.11 as base RUN yum install git gcc python3-devel -y FROM base as python @@ -6,7 +6,7 @@ FROM base as python # from your project folder. COPY requirements.txt . RUN pip3 install -r requirements.txt -ENV PATH="/var/lang/lib/python3.9/site-packages:${PATH}" +ENV PATH="/var/lang/lib/python3.11/site-packages:${PATH}" FROM python as app # Copy function code diff --git a/ops/terraform/services/common/modules/bfd_common_cw_alarms_slack_notifier/main.tf b/ops/terraform/services/common/modules/bfd_common_cw_alarms_slack_notifier/main.tf index 3d5edead7f..ebadee8a57 100644 --- a/ops/terraform/services/common/modules/bfd_common_cw_alarms_slack_notifier/main.tf +++ b/ops/terraform/services/common/modules/bfd_common_cw_alarms_slack_notifier/main.tf @@ -170,7 +170,7 @@ resource "aws_lambda_function" "this" { handler = "cw_alarms_slack_notifier.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = local.lambda_timeout_seconds environment { variables = { diff --git a/ops/terraform/services/common/terraform.tf b/ops/terraform/services/common/terraform.tf index 56a10f11cc..f2604a25f1 100644 --- a/ops/terraform/services/common/terraform.tf +++ b/ops/terraform/services/common/terraform.tf @@ -17,7 +17,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.22" + version = "~> 5.53.0" } } } diff --git a/ops/terraform/services/eft/lambda_src/sftp_outbound_transfer/s3.py b/ops/terraform/services/eft/lambda_src/sftp_outbound_transfer/s3.py index 3fa3884968..be5d4c9e69 100644 --- a/ops/terraform/services/eft/lambda_src/sftp_outbound_transfer/s3.py +++ b/ops/terraform/services/eft/lambda_src/sftp_outbound_transfer/s3.py @@ -1,7 +1,7 @@ -from enum import Enum +from enum import StrEnum -class S3EventType(str, Enum): +class S3EventType(StrEnum): """Represents the types of S3 events that this Lambda is invoked by and supports. The value of each Enum is a substring that is matched for on the "eventName" property of an invocation event""" diff --git a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/dev-requirements.txt b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/dev-requirements.txt index eb6dcdb9eb..db2b5a87cd 100644 --- a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/dev-requirements.txt +++ b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/dev-requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --allow-unsafe --constraint=requirements.txt --generate-hashes --output-file=dev-requirements.txt dev-requirements.in @@ -72,23 +72,10 @@ pylint==3.1.0 \ --hash=sha256:507a5b60953874766d8a366e8e8c7af63e058b26345cfcb5f91f89d987fd6b74 \ --hash=sha256:6a69beb4a6f63debebaab0a3477ecd0f559aa726af4954fc948c51f7a2549e23 # via -r dev-requirements.in -tomli==2.0.1 \ - --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ - --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f - # via - # black - # pylint tomlkit==0.12.4 \ --hash=sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b \ --hash=sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3 # via pylint -typing-extensions==4.10.0 \ - --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \ - --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb - # via - # -c requirements.txt - # astroid - # black # The following packages are considered to be unsafe in a requirements file: setuptools==69.1.1 \ diff --git a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/outbound_slack_notifier.py b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/outbound_slack_notifier.py index 51b8356134..601f683d81 100644 --- a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/outbound_slack_notifier.py +++ b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/outbound_slack_notifier.py @@ -1,7 +1,7 @@ import json import os from dataclasses import asdict, dataclass -from enum import Enum +from enum import StrEnum from typing import Any from urllib.request import Request, urlopen @@ -15,7 +15,7 @@ logger = Logger() -class NotificationType(str, Enum): +class NotificationType(StrEnum): FILE_DISCOVERED = "FILE_DISCOVERED" TRANSFER_SUCCESS = "TRANSFER_SUCCESS" TRANSFER_FAILED = "TRANSFER_FAILED" diff --git a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/requirements.txt b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/requirements.txt index 2db3647cf3..78d00680f1 100644 --- a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/requirements.txt +++ b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/lambda_src/outbound_slack_notifier/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --allow-unsafe --generate-hashes --output-file=requirements.txt requirements.in diff --git a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/main.tf b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/main.tf index ed6bb54550..77c3c7ffae 100644 --- a/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/main.tf +++ b/ops/terraform/services/eft/modules/bfd_eft_outbound_o11y/main.tf @@ -142,7 +142,7 @@ resource "aws_lambda_function" "slack_notifier" { handler = "${local.slack_notifier_lambda_src}.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.10" + runtime = "python3.11" timeout = 300 tags = { diff --git a/ops/terraform/services/eft/terraform.tf b/ops/terraform/services/eft/terraform.tf index 47a3c69aae..61f217ac6c 100644 --- a/ops/terraform/services/eft/terraform.tf +++ b/ops/terraform/services/eft/terraform.tf @@ -17,7 +17,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.22" + version = "~> 5.53.0" } } } diff --git a/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/lambda_src/pipeline_scheduler.py b/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/lambda_src/pipeline_scheduler.py index f526227187..85a98e6a6c 100644 --- a/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/lambda_src/pipeline_scheduler.py +++ b/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/lambda_src/pipeline_scheduler.py @@ -6,7 +6,7 @@ import sys from dataclasses import dataclass from datetime import datetime, timedelta -from enum import Enum +from enum import StrEnum from typing import Any, Optional from urllib.parse import unquote @@ -41,7 +41,7 @@ sys.exit(0) -class S3EventType(str, Enum): +class S3EventType(StrEnum): """Represents the types of S3 events that this Lambda is invoked by and supports. The value of each Enum is a substring that is matched for on the "eventName" property of an invocation event""" @@ -50,7 +50,7 @@ class S3EventType(str, Enum): OBJECT_REMOVED = "ObjectRemoved" -class PipelineLoadType(str, Enum): +class PipelineLoadType(StrEnum): """Represents the possible types of data loads: either the data load is non-synthetic, meaning that it contains production data and was placed within the root-level Incoming/Done folders of the ETL bucket, or it is synthetic, meaning that it contains non-production, testing data and @@ -62,7 +62,7 @@ class PipelineLoadType(str, Enum): SYNTHETIC = "Synthetic" -class PipelineDataStatus(str, Enum): +class PipelineDataStatus(StrEnum): """Represents the possible states of data: either data is available to load, or has been loaded by the ETL pipeline. The value of each enum is the parent directory of the incoming file, indicating status""" @@ -75,7 +75,7 @@ def match_str(cls) -> str: return "|".join([e.value for e in cls]) -class RifFileType(str, Enum): +class RifFileType(StrEnum): """Represents all of the possible RIF file types that can be loaded by the BFD ETL Pipeline. The value of each enum is a specific substring that is used to match on each type of file """ diff --git a/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/main.tf b/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/main.tf index 42b47994eb..8d91b1b3c4 100644 --- a/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/main.tf +++ b/ops/terraform/services/pipeline/modules/bfd_pipeline_scheduler/main.tf @@ -42,7 +42,7 @@ resource "aws_lambda_function" "this" { handler = "pipeline_scheduler.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = 300 environment { diff --git a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/common.py b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/common.py index f0225e5415..97b2eaa797 100644 --- a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/common.py +++ b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/common.py @@ -1,11 +1,11 @@ import os from dataclasses import dataclass -from enum import Enum +from enum import StrEnum, Enum METRICS_NAMESPACE = os.environ.get("METRICS_NAMESPACE", "") -class RifFileType(str, Enum): +class RifFileType(StrEnum): """Represents all of the possible RIF file types that can be loaded by the BFD ETL Pipeline. The value of each enum is a specific substring that is used to match on each type of file""" diff --git a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/dev-requirements.txt b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/dev-requirements.txt index 90ba377dfa..69e22698ec 100644 --- a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/dev-requirements.txt +++ b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/dev-requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --allow-unsafe --generate-hashes --output-file=dev-requirements.txt dev-requirements.in @@ -67,10 +67,6 @@ dill==0.3.7 \ --hash=sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e \ --hash=sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03 # via pylint -exceptiongroup==1.2.0 \ - --hash=sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14 \ - --hash=sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68 - # via pytest fastjsonschema==2.19.1 \ --hash=sha256:3672b47bc94178c9f23dbb654bf47440155d4db9df5f7bc47643315f9c405cd0 \ --hash=sha256:e3126a94bdc4623d3de4485f8d468a12f02a67921315ddc87836d6e456dc789d @@ -189,13 +185,6 @@ six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 # via python-dateutil -tomli==2.0.1 \ - --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ - --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f - # via - # black - # pylint - # pytest tomlkit==0.12.3 \ --hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \ --hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba @@ -212,15 +201,12 @@ typing-extensions==4.9.0 \ --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd # via - # astroid # aws-lambda-powertools - # black # boto3-stubs # mypy-boto3-cloudwatch # mypy-boto3-dynamodb # mypy-boto3-s3 # pydantic - # pylint urllib3==1.26.18 \ --hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \ --hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0 diff --git a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/update_pipeline_slis.py b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/update_pipeline_slis.py index 6aeeb06389..c539f1a781 100644 --- a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/update_pipeline_slis.py +++ b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/lambda_src/update_pipeline_slis.py @@ -3,7 +3,7 @@ import os import re from datetime import datetime, timezone -from enum import Enum +from enum import StrEnum from typing import TYPE_CHECKING, Any, Type from urllib.parse import unquote @@ -49,7 +49,7 @@ logger = Logger() -class S3EventType(str, Enum): +class S3EventType(StrEnum): """Represents the types of S3 events that this Lambda is invoked by and supports. The value of each Enum is a substring that is matched for on the "eventName" property of an invocation event""" @@ -66,7 +66,7 @@ def from_event_name(cls, event_name: str) -> "S3EventType": ) from ex -class PipelineDataStatus(str, Enum): +class PipelineDataStatus(StrEnum): """Represents the possible states of data: either data is available to load, or has been loaded by the ETL pipeline. The value of each enum is the parent directory of the incoming file, indicating status""" diff --git a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/main.tf b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/main.tf index 18a5bc1ed1..72d999b8f9 100644 --- a/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/main.tf +++ b/ops/terraform/services/pipeline/modules/bfd_pipeline_slis/main.tf @@ -78,7 +78,7 @@ resource "aws_lambda_function" "this" { handler = "${local.lambdas[local.lambda_update_slis].src}.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" layers = ["arn:aws:lambda:${local.region}:017000801446:layer:AWSLambdaPowertoolsPythonV2:60"] timeout = 300 environment { @@ -206,7 +206,7 @@ resource "aws_lambda_function" "repeater" { handler = "${local.lambdas[local.lambda_repeater].src}.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = 300 environment { variables = { diff --git a/ops/terraform/services/pipeline/terraform.tf b/ops/terraform/services/pipeline/terraform.tf index 07e301caa0..6d1bdd1931 100644 --- a/ops/terraform/services/pipeline/terraform.tf +++ b/ops/terraform/services/pipeline/terraform.tf @@ -17,7 +17,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.22" + version = "~> 5.53.0" } } } diff --git a/ops/terraform/services/server/insights/api-requests/backend.tf b/ops/terraform/services/server/insights/api-requests/backend.tf index 4babb589bd..900b48569b 100644 --- a/ops/terraform/services/server/insights/api-requests/backend.tf +++ b/ops/terraform/services/server/insights/api-requests/backend.tf @@ -12,7 +12,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.12" + version = "~> 5.53.0" } archive = { diff --git a/ops/terraform/services/server/insights/api-requests/firehose.tf b/ops/terraform/services/server/insights/api-requests/firehose.tf index dc2ccad602..7ad3448a84 100644 --- a/ops/terraform/services/server/insights/api-requests/firehose.tf +++ b/ops/terraform/services/server/insights/api-requests/firehose.tf @@ -5,8 +5,8 @@ resource "aws_kinesis_firehose_delivery_stream" "firehose-ingester" { extended_s3_configuration { bucket_arn = data.aws_s3_bucket.bfd-insights-bucket.arn - buffer_interval = 300 - buffer_size = 128 + buffering_interval = 300 + buffering_size = 128 error_output_prefix = "databases/${module.database.name}/${module.glue-table-api-requests.name}_errors/!{firehose:error-output-type}/year=!{timestamp:yyyy}/month=!{timestamp:MM}/" kms_key_arn = data.aws_kms_key.kms_key.arn prefix = "databases/${module.database.name}/${module.glue-table-api-requests.name}/year=!{timestamp:yyyy}/month=!{timestamp:MM}/" diff --git a/ops/terraform/services/server/insights/api-requests/lambda.tf b/ops/terraform/services/server/insights/api-requests/lambda.tf index 26a1ec5e6b..5e312a87b2 100644 --- a/ops/terraform/services/server/insights/api-requests/lambda.tf +++ b/ops/terraform/services/server/insights/api-requests/lambda.tf @@ -19,7 +19,7 @@ resource "aws_lambda_function" "lambda-function-format-firehose-logs" { package_type = "Zip" reserved_concurrent_executions = -1 role = aws_iam_role.iam-role-firehose-lambda.arn - runtime = "python3.8" + runtime = "python3.11" source_code_hash = data.archive_file.zip-archive-format-firehose-logs.output_base64sha256 tags = { "lambda-console:blueprint" = "kinesis-firehose-cloudwatch-logs-processor-python" } @@ -175,7 +175,7 @@ resource "aws_lambda_function" "bfd_insights_error_slack" { handler = "bfd-insights-error-slack.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = local.lambda_timeout_seconds environment { variables = { diff --git a/ops/terraform/services/server/insights/api-requests/modules/trigger_glue_crawler/main.tf b/ops/terraform/services/server/insights/api-requests/modules/trigger_glue_crawler/main.tf index a4efafe246..4babb35c1e 100644 --- a/ops/terraform/services/server/insights/api-requests/modules/trigger_glue_crawler/main.tf +++ b/ops/terraform/services/server/insights/api-requests/modules/trigger_glue_crawler/main.tf @@ -38,7 +38,7 @@ resource "aws_lambda_function" "this" { handler = "trigger_glue_crawler.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = 520 # 520 seconds gives enough time for backoff retries to be attempted environment { variables = { diff --git a/ops/terraform/services/server/modules/bfd_server_disk_alarms/lambda_src/manage_disk_usage_alarms.py b/ops/terraform/services/server/modules/bfd_server_disk_alarms/lambda_src/manage_disk_usage_alarms.py index 4a0838b8d8..f277438a86 100644 --- a/ops/terraform/services/server/modules/bfd_server_disk_alarms/lambda_src/manage_disk_usage_alarms.py +++ b/ops/terraform/services/server/modules/bfd_server_disk_alarms/lambda_src/manage_disk_usage_alarms.py @@ -1,6 +1,6 @@ import json import os -from enum import Enum +from enum import StrEnum import boto3 from botocore.config import Config @@ -33,7 +33,7 @@ autoscaling_client = boto3.client("autoscaling", config=boto_config) -class AutoScalingEvent(str, Enum): +class AutoScalingEvent(StrEnum): """Represents the possible AWS AutoScaling Notifcations events that this Lambda will react to""" INSTANCE_LAUNCH = "autoscaling:EC2_INSTANCE_LAUNCH" diff --git a/ops/terraform/services/server/modules/bfd_server_disk_alarms/main.tf b/ops/terraform/services/server/modules/bfd_server_disk_alarms/main.tf index 0cc9fd366f..44e198fc54 100644 --- a/ops/terraform/services/server/modules/bfd_server_disk_alarms/main.tf +++ b/ops/terraform/services/server/modules/bfd_server_disk_alarms/main.tf @@ -186,7 +186,7 @@ resource "aws_lambda_function" "this" { handler = "manage_disk_usage_alarms.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = local.lambda_timeout_seconds environment { variables = { diff --git a/ops/terraform/services/server/modules/bfd_server_error_alerts/lambda_src/bfd_server_errors_alerter_scheduler.py b/ops/terraform/services/server/modules/bfd_server_error_alerts/lambda_src/bfd_server_errors_alerter_scheduler.py index 45bb686baf..cda00c672f 100644 --- a/ops/terraform/services/server/modules/bfd_server_error_alerts/lambda_src/bfd_server_errors_alerter_scheduler.py +++ b/ops/terraform/services/server/modules/bfd_server_error_alerts/lambda_src/bfd_server_errors_alerter_scheduler.py @@ -5,7 +5,7 @@ import sys from abc import ABC, abstractmethod from datetime import datetime, timedelta -from enum import Enum +from enum import StrEnum from typing import Any, Optional import boto3 @@ -30,7 +30,7 @@ RATE_SCHEDULE_NAME_PREFIX = f"bfd-{BFD_ENVIRONMENT}-run-error-alerter-every-" -class AlarmState(str, Enum): +class AlarmState(StrEnum): ALARMING = "ALARM" OK = "OK" diff --git a/ops/terraform/services/server/modules/bfd_server_error_alerts/main.tf b/ops/terraform/services/server/modules/bfd_server_error_alerts/main.tf index 1434b76c88..b30c882427 100644 --- a/ops/terraform/services/server/modules/bfd_server_error_alerts/main.tf +++ b/ops/terraform/services/server/modules/bfd_server_error_alerts/main.tf @@ -122,7 +122,7 @@ resource "aws_lambda_function" "alert_lambda_scheduler" { handler = "${local.alert_lambda_scheduler_src}.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = 300 environment { @@ -159,7 +159,7 @@ resource "aws_lambda_function" "alerting_lambda" { handler = "${local.alerting_lambda_src}.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = 300 environment { diff --git a/ops/terraform/services/server/server-load/terraform.tf b/ops/terraform/services/server/server-load/terraform.tf index d7a4f8c554..0948f0fa83 100644 --- a/ops/terraform/services/server/server-load/terraform.tf +++ b/ops/terraform/services/server/server-load/terraform.tf @@ -17,7 +17,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.12" + version = "~> 5.53.0" } } } diff --git a/ops/terraform/services/server/server-regression/main.tf b/ops/terraform/services/server/server-regression/main.tf index 2b24fe8b9d..032f7aba1a 100644 --- a/ops/terraform/services/server/server-regression/main.tf +++ b/ops/terraform/services/server/server-regression/main.tf @@ -147,7 +147,7 @@ resource "aws_lambda_function" "glue_trigger" { handler = "glue-trigger.handler" memory_size = 128 package_type = "Zip" - runtime = "python3.9" + runtime = "python3.11" timeout = local.glue_trigger_lambda_timeout_seconds environment { variables = { @@ -166,7 +166,7 @@ resource "aws_lambda_function" "spice_refresh_trigger" { memory_size = 128 package_type = "Zip" role = aws_iam_role.spice_refresh_role.arn - runtime = "python3.9" + runtime = "python3.11" filename = data.archive_file.spice_trigger.output_path source_code_hash = data.archive_file.spice_trigger.output_base64sha256 timeout = 60 diff --git a/ops/terraform/services/server/server-regression/terraform.tf b/ops/terraform/services/server/server-regression/terraform.tf index 74985816c0..7a002efbfd 100644 --- a/ops/terraform/services/server/server-regression/terraform.tf +++ b/ops/terraform/services/server/server-regression/terraform.tf @@ -17,7 +17,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.12" + version = "~> 5.53.0" } archive = { source = "hashicorp/archive" diff --git a/ops/terraform/services/server/terraform.tf b/ops/terraform/services/server/terraform.tf index c61305cac7..f4c4fd3a8a 100644 --- a/ops/terraform/services/server/terraform.tf +++ b/ops/terraform/services/server/terraform.tf @@ -17,7 +17,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.22" + version = "~> 5.53.0" } } }