diff --git a/CHANGELOG.md b/CHANGELOG.md index b2dbca2ff..5e0ca176d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [10.16.5] + +### Added +- Added support for Element84 Sentinel-2 L2A STAC IDs to the `ARIA_AUTORIFT` job spec. + +### Changed +- Do not include cost offsets from EC2 Savings Plans when computing month-to-date spending in scale-cluster lambda. + ## [10.16.4] ### Added diff --git a/apps/scale-cluster/src/scale_cluster.py b/apps/scale-cluster/src/scale_cluster.py index bfb41e28b..18007853b 100644 --- a/apps/scale-cluster/src/scale_cluster.py +++ b/apps/scale-cluster/src/scale_cluster.py @@ -17,10 +17,12 @@ def get_time_period(today: date) -> dict: def get_month_to_date_spending(today: date) -> float: - time_period = get_time_period(today) - granularity = 'MONTHLY' - metrics = ['UnblendedCost'] - response = COST_EXPLORER.get_cost_and_usage(TimePeriod=time_period, Granularity=granularity, Metrics=metrics) + response = COST_EXPLORER.get_cost_and_usage( + TimePeriod=get_time_period(today), + Granularity='MONTHLY', + Metrics=['UnblendedCost'], + Filter={'Not': {'Dimensions': {'Key': 'RECORD_TYPE', 'Values': ['SavingsPlanNegation']}}}, + ) return float(response['ResultsByTime'][0]['Total']['UnblendedCost']['Amount']) diff --git a/job_spec/ARIA_AUTORIFT.yml b/job_spec/ARIA_AUTORIFT.yml index ddbf7667b..221627884 100644 --- a/job_spec/ARIA_AUTORIFT.yml +++ b/job_spec/ARIA_AUTORIFT.yml @@ -36,6 +36,12 @@ AUTORIFT: minLength: 60 maxLength: 60 example: S2A_MSIL1C_20200627T150921_N0209_R025_T22WEB_20200627T170912 + - description: The name of the Sentinel-2 L2A STAC granule to process (Element84 naming convention) + type: string + pattern: "^S2[ABCD]_T[A-Z0-9]{5}_[0-9]{8}T[0-9]{6}_L2A$" + minLength: 30 + maxLength: 30 + example: S2A_T52JFR_20260226T012311_L2A - description: The name of the Landsat 4, 5, 7, 8 or 9 Collection 2 granule to process type: string pattern: "^L([CO]0[89]|E07|T0[45])_L1" @@ -77,6 +83,12 @@ AUTORIFT: minLength: 60 maxLength: 60 example: S2A_MSIL1C_20200627T150921_N0209_R025_T22WEB_20200627T170912 + - description: The name of the Sentinel-2 L2A STAC granule to process (Element84 naming convention) + type: string + pattern: "^S2[ABCD]_T[A-Z0-9]{5}_[0-9]{8}T[0-9]{6}_L2A$" + minLength: 30 + maxLength: 30 + example: S2A_T52JFR_20260226T012311_L2A - description: The name of the Landsat 4, 5, 7, 8 or 9 Collection 2 granule to process type: string pattern: "^L([CO]0[89]|E07|T0[45])_L1" @@ -113,6 +125,12 @@ AUTORIFT: minLength: 60 maxLength: 60 example: S2A_MSIL1C_20200627T150921_N0209_R025_T22WEB_20200627T170912 + - description: The name of the Sentinel-2 L2A STAC granule to process (Element84 naming convention) + type: string + pattern: "^S2[ABCD]_T[A-Z0-9]{5}_[0-9]{8}T[0-9]{6}_L2A$" + minLength: 30 + maxLength: 30 + example: S2A_T52JFR_20260226T012311_L2A - description: The name of the Landsat 4, 5, 7, 8 or 9 Collection 2 granule to process type: string pattern: "^L([CO]0[89]|E07|T0[45])_L1" diff --git a/tests/test_scale_cluster.py b/tests/test_scale_cluster.py index fd91f5a3d..65d6da626 100644 --- a/tests/test_scale_cluster.py +++ b/tests/test_scale_cluster.py @@ -160,6 +160,14 @@ def test_get_month_to_date_spending(cost_explorer_stubber): 'Start': '2022-07-01', 'End': '2022-08-01', }, + 'Filter': { + 'Not': { + 'Dimensions': { + 'Key': 'RECORD_TYPE', + 'Values': ['SavingsPlanNegation'], + }, + }, + }, } mock_service_response = { 'ResultsByTime': [