Code Monkey home page Code Monkey logo

aws-cost-cli's Introduction

๐Ÿ

Hey, I am an Engineering Leader and a Fullstack Developer based in UK.

I have over 10 years of experience working mostly with startups and scaleups. I am a seasoned leader, having led teams of all sizes and shapes with a strong focus on building high-performing teams and delivering high-quality products.

I am also a Google Developer Expert and a GitHub Star. I am a huge fan of open-source and have built projects used by millions.

More about me โ†’

aws-cost-cli's People

Contributors

aavileli avatar kamranahmedse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-cost-cli's Issues

Inaccessible host: `ce.ap-southeast-1.amazonaws.com` at port `undefined`

Current Behavior

aws-cost --profile NAME

Expected Behavior

Display the cost of the profile NAME

Debug log

Getting pricing data/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/event_listeners.js:611
        this.response.error = AWS.util.error(new Error(message), {
                                             ^

UnknownEndpoint: Inaccessible host: `ce.ap-southeast-1.amazonaws.com' at port `undefined'. This service may not be available in the `ap-southeast-1' region.
    at Request.ENOTFOUND_ERROR (/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/event_listeners.js:611:46)
    at Request.callListeners (/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/request.js:686:14)
    at error (/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/event_listeners.js:443:22)
    at ClientRequest.<anonymous> (/opt/homebrew/lib/node_modules/aws-cost-cli/node_modules/aws-sdk/lib/http/node.js:99:9)
    at ClientRequest.emit (node:events:513:28)
    at ClientRequest.emit (node:domain:489:12)
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28) {
  code: 'UnknownEndpoint',
  region: 'ap-southeast-1',
  hostname: 'ce.ap-southeast-1.amazonaws.com',
  retryable: true,
  originalError: Error: getaddrinfo ENOTFOUND ce.ap-southeast-1.amazonaws.com
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
    errno: -3008,
    code: 'NetworkingError',
    syscall: 'getaddrinfo',
    hostname: 'ce.ap-southeast-1.amazonaws.com',
    region: 'ap-southeast-1',
    retryable: true,
    time: 2023-01-23T02:18:55.422Z
  },
  time: 2023-01-23T02:18:55.422Z
}

Node.js v18.11.0

AWS SDK for Javascript v3 Upgrade

Feature Request

Is your feature request related to a problem? Please describe.
There is a warning when running aws-cost that AWS SDK for Javascript v2 will be entering maintenance mode in 2023.

Describe the solution you'd like
Upgrade to AWS SDK for Javascript v3. Having a quick look through the codebase this shouldn't be a massive undertaking but does depend on experience with v3, especially in Typescript given it's a lot more modular now. This may also help to resolve #5 and #6 as I believe v3 has better support for using environment variables to load AWS credentials.

Describe alternatives you've considered
N/A

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

I may well have the time at some point so I may try and get a PR up at some point but not committing to anything just now.

npm package is not the same version as source and returns an error

Source is tagged with v0.2.5
Package is tagged with v0.2.4

When running the package (from npm install -g aws-cost-cli) I get a credential error:

InvalidClientTokenId: The security token included in the request is invalid

Running aws sts get-caller-identity is successful, so my credentials are valid.

However, if I build from source and then run locally:

npm run build
node ./bin/index.js

The tool works and I get my account costs.

I published a test package to npm using the latest source code and it worked, so seems to me the fix is to push the changes in v0.2.5 to npm.

Support environment variables

Feature Request

Please make a support of env vars as many other software:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Support authentication from IAM Roles

Feature Request

Is your feature request related to a problem? Please describe.

aws-cost is unable to run on accounts that authenticate via IAM Role-based authentication.

For example:

[profile marketingadmin]
role_arn = arn:aws:iam::123456789012:role/marketingadminrole
source_profile = user1

Describe the solution you'd like

aws-cost is able to run with IAM Role based authentication.

Describe alternatives you've considered

I've tried setting the AWS AUTH ENV Vars which I get post-authenticating from the IAM Role but it still doesn't work

AWS_PROFILE=
AWS_REGION=
AWS_SECRET_ACCESS_KEY=
AWS_ACCESS_KEY_ID=
AWS_SESSION_TOKEN=

It gives the same error

    Error:
    
    Could not find the AWS credentials in the following files for the profile "marketingadmin":
      ~/.aws/credentials
      ~/.aws/config

    If the config files exist at different locations, set the following environment variables:
      AWS_SHARED_CREDENTIALS_FILE
      AWS_CONFIG_FILE

    You can also configure the credentials via the following command:
      aws configure --profile superdev

    You can also provide the credentials via the following options:
      --access-key
      --secret-key
      --region
    

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Add support to SSO login

Feature Request

Is your feature request related to a problem? Please describe.

I want to use SSO login instead of configuring ~/.aws/credentials and ~/.aws/config

Describe the solution you'd like

Add support for SSO login

Describe alternatives you've considered

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Add support for aws organizations

Feature Request

Is your feature request related to a problem? Please describe.

Not Really

Describe the solution you'd like

Would like to be able to get a cost summary of all of the accounts within our AWS Organization account posted into slack each day.

Describe alternatives you've considered

Not looked into other options

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.