Skip to content

Commit

Permalink
feat: add azure pricing poller
Browse files Browse the repository at this point in the history
  • Loading branch information
Kav91 committed Apr 27, 2023
1 parent d73fde4 commit 9da503c
Show file tree
Hide file tree
Showing 7 changed files with 1,763 additions and 1 deletion.
12 changes: 12 additions & 0 deletions backend/processor/entities/HOST.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ exports.run = (
if (cloud === 'google') {
const regionSplit = region.split('-');
adjustedRegion = `${regionSplit[0]}-${regionSplit[1]}`;
} else if (cloud === 'azure') {
adjustedRegion = region.toLowerCase();
}

return fetchPricing(
Expand Down Expand Up @@ -429,6 +431,16 @@ exports.run = (
for (let z = 0; z < cloudPrices.length; z++) {
if (selectedType && cloudPrices[z].type === selectedType) {
e.matches.exact.push(simplifyProduct(cloudPrices[z]));
} else if (selectedType && e.cloud === 'azure') {
const { tier, instanceName } = cloudPrices[z].attributes;
if (
selectedType.toLowerCase() ===
`${tier}_${instanceName
.replaceAll(' ', '_')
.toLowerCase()}`
) {
e.matches.exact.push(simplifyProduct(cloudPrices[z]));
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: ${file(./package.json):name}

provider:
name: aws
runtime: nodejs14.x
runtime: nodejs16.x
memorySize: 256
region: us-east-1
stage: ${opt:stage, 'dev'}
Expand Down

0 comments on commit 9da503c

Please sign in to comment.