From 71eacad04fcc1fb5e9ae0cb627faf5152095dbad Mon Sep 17 00:00:00 2001 From: Marijn Kampf Date: Mon, 15 Apr 2024 15:01:01 +0100 Subject: [PATCH] Rename AWS_* keys to DEFAULT_AWS_* to avoid conflicts with DBT migration environment. --- config/settings.py | 4 ++-- .../management/commands/process_monitoring_data.py | 6 +++++- pytest.ini | 4 ++-- sample_env | 4 ++-- sample_env.docker | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/config/settings.py b/config/settings.py index bef44274..d5fd3f0b 100644 --- a/config/settings.py +++ b/config/settings.py @@ -171,8 +171,8 @@ DNB_MONITORING_S3_BUCKET = env('DNB_S3_MONITORING_BUCKET') DNB_ARCHIVE_PROCESSED_FILES = env.bool('DNB_ARCHIVE_PROCESSED_FILES') DNB_ARCHIVE_PATH = env('DNB_ARCHIVE_PATH', default='archive/') -AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID') -AWS_SECRET_ACCESS_KEY = env('AWS_SECRET_ACCESS_KEY') +DEFAULT_AWS_ACCESS_KEY_ID = env('DEFAULT_AWS_ACCESS_KEY_ID') +DEFAULT_AWS_SECRET_ACCESS_KEY = env('DEFAULT_AWS_SECRET_ACCESS_KEY') # Redis diff --git a/dnb_direct_plus/management/commands/process_monitoring_data.py b/dnb_direct_plus/management/commands/process_monitoring_data.py index cbe4f9f4..08181b61 100644 --- a/dnb_direct_plus/management/commands/process_monitoring_data.py +++ b/dnb_direct_plus/management/commands/process_monitoring_data.py @@ -18,7 +18,11 @@ class Command(BaseCommand): s3_client = None def __init__(self): - self.s3_client = client('s3') + self.s3_client = client( + 's3', + aws_access_key_id=settings.DEFAULT_AWS_ACCESS_KEY_ID, + aws_secret_access_key=settings.DEFAULT_AWS_SECRET_ACCESS_KEY, + ) super().__init__() diff --git a/pytest.ini b/pytest.ini index ba7f5bda..fce5e388 100644 --- a/pytest.ini +++ b/pytest.ini @@ -20,8 +20,8 @@ env = DNB_S3_MONITORING_BUCKET=dummy-bucket DNB_ARCHIVE_PROCESSED_FILES=False DNB_ARCHIVE_PATH='archive/' - AWS_ACCESS_KEY_ID=fake-access-key - AWS_SECRET_ACCESS_KEY=fake-access-key-secret + DEFAULT_AWS_ACCESS_KEY_ID=fake-access-key + DEFAULT_AWS_SECRET_ACCESS_KEY=fake-access-key-secret GOVUK_NOTIFICATIONS_API_KEY=ainaidahNgaeteghei3yooshaiyeeShi8heSie3Ba9AGhoos8eicie5lei2nahue9DaiBait5Ba4ajeiMee6Photh4alegh4Eez8Quopaith5B CHANGE_REQUESTS_RECIPIENTS=foo@example.net,bar@example.net ELASTIC_APM_SECRET_TOKEN= diff --git a/sample_env b/sample_env index 0b0312dc..04c309db 100644 --- a/sample_env +++ b/sample_env @@ -10,8 +10,8 @@ ALLOWED_ADMIN_IPS=127.0.0.1 ALLOWED_ADMIN_IP_RANGES= ALLOWED_IPS= IP_RESTRICT= -AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE -AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY +DEFAULT_AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE +DEFAULT_AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY REDIS_URL=redis://localhost:6379 SENTRY_DSN= SENTRY_ENVIRONMENT= diff --git a/sample_env.docker b/sample_env.docker index 285e691d..154d1ab1 100644 --- a/sample_env.docker +++ b/sample_env.docker @@ -10,8 +10,8 @@ ALLOWED_ADMIN_IPS=127.0.0.1 ALLOWED_ADMIN_IP_RANGES= ALLOWED_IPS= IP_RESTRICT= -AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE -AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY +DEFAULT_AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE +DEFAULT_AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY REDIS_URL=redis://redis:6379 SENTRY_DSN= SENTRY_ENVIRONMENT=