Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions apps/scale-cluster/src/scale_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])


Expand Down
18 changes: 18 additions & 0 deletions job_spec/ARIA_AUTORIFT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions tests/test_scale_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down
Loading