Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for v0.2.6 #17

Closed
wants to merge 48 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5665752
Add `LICENSE` authoring [`@kamranahmedse`](https://github.com/kamrana…
Rindrics Jun 10, 2024
421b67c
Specify `ROUTE06, Inc.` as an author of this forked version
Rindrics Jun 10, 2024
aae13a6
Abolish PR template which does not fit our operation
Rindrics Jun 10, 2024
e333618
Merge pull request #10 from route06/issue-1-update-license
Rindrics Jun 11, 2024
17d39e5
Merge pull request #11 from route06/issue-2-abolish-pr_template
Rindrics Jun 11, 2024
236ebc7
Use jest as dev dependency to test package
Rindrics May 30, 2024
a9ed0b8
Transpile dependent packages under `node_modules/`
Rindrics May 30, 2024
92b3748
Test output of `printPlainSummary()` to confirm jest works
Rindrics May 30, 2024
cf07401
Run CI on pull request
Rindrics May 30, 2024
8ac9365
Run CI on push to `main`
Rindrics May 31, 2024
0e8c441
Separate workflow for check to use it also from CD workflow
Rindrics May 31, 2024
68953f6
Use `tagpr` to automate tagging when push to `main`
Rindrics May 31, 2024
d923671
Configure `prettier` to follow style of the fork origin
Rindrics May 31, 2024
8cbb692
Format codes with `prettier`
Rindrics May 31, 2024
4693d21
Introduce `ESLint`
Rindrics Jun 1, 2024
b975410
Lint codes
Rindrics Jun 1, 2024
c706a78
Lint & format on CI
Rindrics Jun 1, 2024
539f902
Return credentials early if they are found in file
Rindrics Feb 26, 2024
1358f08
Remove unnecessary `if` block
Rindrics Feb 26, 2024
cf064c4
Authorize using temporal credential generated from IAM role
Rindrics Feb 26, 2024
7be9167
Add dev targets to `Makefile`
Rindrics Jun 2, 2024
a814394
Pin runtime at `22.3` to reduce risk in compatibility
Rindrics Jun 13, 2024
a8e9029
Remove unnecessary comment line
Rindrics Jun 13, 2024
1b72947
Merge pull request #12 from route06/issue-3-enable-test
Rindrics Jun 13, 2024
986bd03
Merge pull request #13 from route06/issue-4-automate-release
Rindrics Jun 13, 2024
053e643
Merge pull request #15 from route06/issue-14-lint-format
Rindrics Jun 13, 2024
fcb59cc
Merge pull request #16 from route06/issue-6-add-rbac
Rindrics Jun 13, 2024
2d5cee2
Accept raw account ID to support account that has no account alias
Rindrics Mar 1, 2024
78d75ed
Fix typo
Rindrics Jun 3, 2024
0061817
Express unexpected cost by failing test
Rindrics Jun 3, 2024
bb84491
Correct boundary conditions to correct cost values
Rindrics Jun 3, 2024
2d9a375
Format code
Rindrics Jun 3, 2024
e01424d
Move function for generating mocked cost data to `testUtils.ts`
Rindrics Jun 3, 2024
115a2b2
Rename `mockPricingData` to `mockedPricingData`
Rindrics Jun 3, 2024
11674a8
Format codes
Rindrics Jun 3, 2024
38b8624
Express 'specific-period summary' function as test
Rindrics Jun 4, 2024
cbbdadb
Add 'specific-period summary' function
Rindrics Jun 4, 2024
152ee56
Use 'specific-period summary' function with default (='yesterday')
Rindrics Jun 4, 2024
a21584f
Add period notation to notify message header
Rindrics Jun 4, 2024
a376d43
Remove indent from `readme.md`
Rindrics Jun 4, 2024
87083ae
Unify parens into curly braces
Rindrics Jun 4, 2024
7a4949f
Map `-a` for `--role-arn`
Rindrics Jun 4, 2024
0eb8cb7
Map `-T` for `--target-account`
Rindrics Jun 4, 2024
f73e734
Merge pull request #20 from route06/issue-7-specify-accounts
Rindrics Jun 14, 2024
38dc2f3
Merge pull request #21 from route06/issue-8-fix-cost-aggregation-logic
Rindrics Jun 14, 2024
fdff859
Merge pull request #22 from route06/issue-9-aggregation-unit
Rindrics Jun 14, 2024
28eca71
[tagpr] prepare for the next release
github-actions[bot] Jun 14, 2024
d5d7e4d
[tagpr] update CHANGELOG.md
github-actions[bot] Jun 14, 2024
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
Prev Previous commit
Next Next commit
Return credentials early if they are found in file
to prepare for feature addition:
  want to generate temporal credentials in `else` block
Rindrics committed Jun 11, 2024
commit 539f90246027504faf17c90d65e5428d32d57366
58 changes: 30 additions & 28 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -71,34 +71,36 @@ async function loadAwsCredentials(
// https://github.com/kamranahmedse/aws-cost-cli/issues/1
// const configFile = configFiles.configFile;
// const region: string = configFile?.[profile]?.region;
if (accessKey && secretKey) {
return {
accessKeyId: accessKey,
secretAccessKey: secretKey,
sessionToken: sessionToken,
};
} else {
// todo: obtain temporary credentials
if (!accessKey || !secretKey) {
const sharedCredentialsFile =
process.env.AWS_SHARED_CREDENTIALS_FILE || '~/.aws/credentials';
const sharedConfigFile = process.env.AWS_CONFIG_FILE || '~/.aws/config';

if (!accessKey || !secretKey) {
const sharedCredentialsFile =
process.env.AWS_SHARED_CREDENTIALS_FILE || '~/.aws/credentials';
const sharedConfigFile = process.env.AWS_CONFIG_FILE || '~/.aws/config';

printFatalError(`
Could not find the AWS credentials in the following files for the profile "${profile}":
${chalk.bold(sharedCredentialsFile)}
${chalk.bold(sharedConfigFile)}

If the config files exist at different locations, set the following environment variables:
${chalk.bold(`AWS_SHARED_CREDENTIALS_FILE`)}
${chalk.bold(`AWS_CONFIG_FILE`)}

You can also configure the credentials via the following command:
${chalk.bold(`aws configure --profile ${profile}`)}

You can also provide the credentials via the following options:
${chalk.bold(`--access-key`)}
${chalk.bold(`--secret-key`)}
${chalk.bold(`--region`)}
`);
printFatalError(`
Could not find the AWS credentials in the following files for the profile "${profile}":
${chalk.bold(sharedCredentialsFile)}
${chalk.bold(sharedConfigFile)}

If the config files exist at different locations, set the following environment variables:
${chalk.bold(`AWS_SHARED_CREDENTIALS_FILE`)}
${chalk.bold(`AWS_CONFIG_FILE`)}

You can also configure the credentials via the following command:
${chalk.bold(`aws configure --profile ${profile}`)}

You can also provide the credentials via the following options:
${chalk.bold(`--access-key`)}
${chalk.bold(`--secret-key`)}
${chalk.bold(`--region`)}
`);
}
}

return {
accessKeyId: accessKey,
secretAccessKey: secretKey,
sessionToken: sessionToken,
};
}