GithubHelp home page GithubHelp logo

aws-samples / aws-cost-explorer-report Goto Github PK

View Code? Open in Web Editor NEW
428.0 27.0 163.0 841 KB

Python SAM Lambda module for generating an Excel cost report with graphs, including month on month cost changes. Uses the AWS Cost Explorer API for data.

License: MIT No Attribution

Shell 8.99% Python 89.84% Dockerfile 1.17%

aws-cost-explorer-report's Introduction

AWS Cost Explorer Report Generator

Python SAM Lambda module for generating an Excel cost report with graphs, including month on month cost changes. Uses the AWS Cost Explorer API for data.

screenshot

License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.

AWS Costs

Prerequisites

Docker (optional for building the lambda python package with updated https://pypi.python.org/ third-party libraries)

Easy Deploy (us-east-1 only)

If you do not need to modify the code, just deploy the included easy_deploy.yaml using AWS Cloudformation via the console.

Deploying (SAM / Script)

Update the values in deploy.sh for your AWS account details.

Variable Description
S3_BUCKET S3 Bucket to use
SES_SEND Email list to send to (comma separated)
SES_FROM SES Verified Sender Email
SES_REGION SES Region
COST_TAGS List Of Cost Tag Keys (comma separated)
CURRENT_MONTH true / false for if report does current partial month
DAY_MONTH When to schedule a run. 6, for the 6th by default
TAG_KEY Provide tag key e.g. Name
TAG_VALUE_FILTER Provide tag value to filter e.g. Prod*
LAST_MONTH_ONLY Specify true if you wish to generate for only last month

And then run sh deploy.sh

Deploy Manually (Lambda Console)

  1. Create a lambda function (python 3.8 runtime), and update the code to the contents of src/lambda.py
  2. Create a lambda IAM execution role with ce:, ses:, s3:, organizations:ListAccounts
  3. Configure the dependency layer: arn:aws:lambda:us-east-1:749981256976:layer:CostExplorerReportLayer:1
  4. Update ENV Variables in Lambda console
    • Details in table above.
  5. Create a trigger (CloudWatch Event)

Running / Testing

Once the Lambda is created, find it in the AWS Lambda console. You can create ANY test event (as the event content is ignored), and hit the test button for a manual run.

https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-test-function.html

Building the Lambda Layer (Optional, for if you want to build your own AWS Lambda layer for use with the script)

Run build.sh to build a new AWS lambda layer with the required Python libraries. This requires Docker, as it builds the package in an Amazon Linux container.

sh build.sh

Customise the report

Edit the main_handler segment of src/lambda.py

def main_handler(event=None, context=None): 
    costexplorer = CostExplorer(CurrentMonth=False)
    #Default addReport has filter to remove Support / Credits / Refunds / UpfrontRI
    #Overall Billing Reports
    costexplorer.addReport(Name="Total", GroupBy=[],Style='Total',IncSupport=True)
    costexplorer.addReport(Name="TotalChange", GroupBy=[],Style='Change')
    costexplorer.addReport(Name="TotalInclCredits", GroupBy=[],Style='Total',NoCredits=False,IncSupport=True)
    costexplorer.addReport(Name="TotalInclCreditsChange", GroupBy=[],Style='Change',NoCredits=False)
    costexplorer.addReport(Name="Credits", GroupBy=[],Style='Total',CreditsOnly=True)
    costexplorer.addReport(Name="Refunds", GroupBy=[],Style='Total',RefundOnly=True)
    costexplorer.addReport(Name="RIUpfront", GroupBy=[],Style='Total',UpfrontOnly=True)
    #GroupBy Reports
    costexplorer.addReport(Name="Services", GroupBy=[{"Type": "DIMENSION","Key": "SERVICE"}],Style='Total',IncSupport=True)
    costexplorer.addReport(Name="ServicesChange", GroupBy=[{"Type": "DIMENSION","Key": "SERVICE"}],Style='Change')
    costexplorer.addReport(Name="Accounts", GroupBy=[{"Type": "DIMENSION","Key": "LINKED_ACCOUNT"}],Style='Total')
    costexplorer.addReport(Name="AccountsChange", GroupBy=[{"Type": "DIMENSION","Key": "LINKED_ACCOUNT"}],Style='Change')
    costexplorer.addReport(Name="Regions", GroupBy=[{"Type": "DIMENSION","Key": "REGION"}],Style='Total')
    costexplorer.addReport(Name="RegionsChange", GroupBy=[{"Type": "DIMENSION","Key": "REGION"}],Style='Change')
    if os.environ.get('COST_TAGS'): #Support for multiple/different Cost Allocation tags
        for tagkey in os.environ.get('COST_TAGS').split(','):
            tabname = tagkey.replace(":",".") #Remove special chars from Excel tabname
            costexplorer.addReport(Name="{}".format(tabname)[:31], GroupBy=[{"Type": "TAG","Key": tagkey}],Style='Total')
            costexplorer.addReport(Name="Change-{}".format(tabname)[:31], GroupBy=[{"Type": "TAG","Key": tagkey}],Style='Change')
    #RI Reports
    costexplorer.addRiReport(Name="RICoverage")
    costexplorer.addRiReport(Name="RIUtilization")
    costexplorer.addRiReport(Name="RIUtilizationSavings", Savings=True)
    costexplorer.addRiReport(Name="RIRecommendation")
    costexplorer.generateExcel()
    return "Report Generated"

aws-cost-explorer-report's People

Contributors

ashishgore avatar davfaulk avatar grusy avatar jpeddicord avatar klapcsik 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-cost-explorer-report's Issues

Version 1.1.1 of urllib3 no longer supported error

I tried to run this today and got the following error:

{
  "errorMessage": "Unable to import module 'lambda': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips  26 Jan 2017'. See: https://github.com/urllib3/urllib3/issues/2168",
  "errorType": "Runtime.ImportModuleError",
  "stackTrace": []
}

I would assume this is happening to anyone using this repo (which is great, by the way), because this is no longer supported (from: urllib3/urllib3#2168):

  • Version 1.1.1 will be supported until 2023-09-11 (LTS)

List all services by User created Resource Tags

Hey @davfaulk can you also tell me how to list all services by resource tags?
I'm getting this error:
botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the GetTagValues operation: User: arn:aws:sts::678258727640:assumed-role/aws-cost-explorer-report-CostExplorerReportLambdaI-129HLOI5OJI1V/CostExplorerReportLambda is not authorized to perform: tag:GetTagValuesTotal chart

Wrote this piece of code:
def getResourcetags(self): tags = {} restag = boto3.client('resourcegroupstaggingapi', region_name='ap-south-1') response = restag.get_tag_values( PaginationToken='string', Key='string' ) # while 'PaginationToken' in response and response['PaginationToken']: # token = response['PaginationToken'] # response = restag.get_resources(ResourcesPerPage=50, PaginationToken=token) for response in response_iterator: for res in response['tags']: tags[res['Values']] = res return tags

Unable to set the start date older than +3

I am getting the below error

<' not supported between instances of 'str' and 'float': TypeError
Traceback (most recent call last):
File "/var/task/lambda.py", line 528, in main_handler
Style='Total', IncSupport=True)
File "/var/task/lambda.py", line 435, in addReportservice
df = df.sort_values(sort, ascending=False)
File "/var/task/./vendored/pandas/core/frame.py", line 5014, in sort_values
k, kind=kind, ascending=ascending, na_position=na_position
File "/var/task/./vendored/pandas/core/sorting.py", line 260, in nargsort
indexer = non_nan_idx[non_nans.argsort(kind=kind)]
TypeError: '<' not supported between instances of 'str' and 'float'

I am setting the start date to

self.start = (datetime.date.today() - relativedelta(months=+4)).replace(day=1)

if i make it +3 the report gets generated , wanted to know how to fix the error

issue easy deploy

I always received this message (us-east-1):

"Your access has been denied by S3, please make sure your request credentials have permission to GetObject for aws-cost-explorer-report-bin/lambda.zip. S3 Error Code: AccessDenied. S3 Error Message: Access Denied (Service: AWSLambdaInternal; Status Code: 403; Error Code: AccessDeniedException; Request ID: 87e94822-4462-4241-a082-dabe4f05cb70; Proxy: null)"

Did I have to create previosly an S3 with specific permission?

deploy.sh does not work

The original file does not work if the bin folder does not exist (bin folder is not in the repo).

xxx:aws-cost-explorer-report javy$ ./deploy.sh
lambda.zip not found! Downloading one we prepared earlier
wget: bin/lambda.zip: No such file or directory

Solution would be to use curl instead:

curl https://s3.amazonaws.com/aws-cost-explorer-report-bin/lambda.zip --create-dirs -o bin/lambda.zip

Also L21-L23: https://github.com/aws-samples/aws-cost-explorer-report/blob/master/deploy.sh#L21-L23 can be omitted. The lambda.py is already in the deployment package it's added during build

ValidationException when calling the GetCostAndUsage operation

Hi Team

I am getting below Validation exception error while running this lambda function (Python 3.6 runtime).
Please advise how can fix the same?

Function logs:
START RequestId: d2bbaa3a-3be2-4be6-9f32-db63a5c0b5ea Version: $LATEST
An error occurred (ValidationException) when calling the GetCostAndUsage operation: And expression must have at least 2 operands: ClientError
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 428, in main_handler
costexplorer.addReport(Name="Total", GroupBy=[],Style='Total',IncSupport=True)
File "/var/task/lambda_function.py", line 305, in addReport
Filter=Filter
File "/var/runtime/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/runtime/botocore/client.py", line 635, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetCostAndUsage operation: And expression must have at least 2 operands

Regards

Numpy

lambda using your arn causes numpy issue.

Doesn't work when run from linked accounts

First of all, thanks for the code. I am looking for a cost & usage report for my linked account, I know aws doesn't support such reports for linked accounts, that is why I am looking for some kind of in house python code. I thought of working out the getAccounts module to change it use only my account ID. But doesn't seem to work.

Install private repo from git

build.sh does not work, in case requirements.txt has referenced a private repo from git.
In this case, we need to add git credentials or ssh, in order for this to work.

deploy.sh script expects artifacts from author's local machine

line 21 of deploy.sh expects something that is local to the computer that belongs to the author of this utility. I think it's easy to fix but noting here before I get into debugging. Likely will follow up with a PR.

update There is also the AWS account ID of @davfaulk which was added on 2019-06-13 and not removed. It appears the ARN of the dependency layer doesn't have public readable permissions. I'm getting a 403 for arn:aws:lambda:us-east-1:749981256976:layer:aws-cost-explorer-report:1

Default reports for last day of previous month from run date

At present the default behaviour is for the reports using the last day of current month,

Billing is generally finalised around the 5th of the month however we should not need the current partial month when generating the reports as this will always show as a cost delta reduction

we will need to offset the data culation in lambda.py to be last month to give a more accurate representation

Error running docker `build.sh` script

I am getting ModuleNotFoundError: No module named 'numpy' even though it's mentioned in requirements.txt

[+] Building 3.8s (9/10)                                                                                                     
 => [internal] load build definition from Dockerfile                                                                    0.0s
 => => transferring dockerfile: 311B                                                                                    0.0s
 => [internal] load .dockerignore                                                                                       0.0s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load metadata for docker.io/library/amazonlinux:2                                                        0.3s
 => [1/6] FROM docker.io/library/amazonlinux:2@sha256:05c170879b6dec01ee51dd380d4d63cfb9ba59e738a03531c7ab5923515af3b4  0.0s
 => [internal] load build context                                                                                       0.0s
 => => transferring context: 213B                                                                                       0.0s
 => CACHED [2/6] RUN yum install -y amazon-linux-extras && amazon-linux-extras enable python3.8                         0.0s
 => CACHED [3/6] RUN yum install -y python3.8 zip && yum clean all                                                      0.0s
 => [4/6] COPY src /build                                                                                               0.0s
 => ERROR [5/6] RUN pip3.8 install -r /build/requirements.txt -t /build/python/                                         3.4s
------                                                                                                                       
 > [5/6] RUN pip3.8 install -r /build/requirements.txt -t /build/python/:                                                    
#8 0.500 WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3.8 install --user` instead.
#8 0.510 Collecting requests (from -r /build/requirements.txt (line 1))                                                      
#8 1.112   Downloading https://files.pythonhosted.org/packages/92/96/144f70b972a9c0eabbd4391ef93ccd49d0f2747f4f6a2a2738e99e5adc65/requests-2.26.0-py2.py3-none-any.whl (62kB)                                                                             
#8 1.155 Collecting xlsxwriter (from -r /build/requirements.txt (line 2))
#8 1.361   Downloading https://files.pythonhosted.org/packages/cd/84/c239b08592a431f7ad8773f7869470255b5f1ad860d7b40a9e7ed3f01bde/XlsxWriter-3.0.2-py3-none-any.whl (149kB)
#8 1.401 Collecting pandas (from -r /build/requirements.txt (line 3))
#8 1.901   Downloading https://files.pythonhosted.org/packages/58/58/b729eda34f78060e14cb430c91d4f7ba3cf1e34797976877a3a1125ea5b2/pandas-1.3.4.tar.gz (4.7MB)
#8 3.298     Complete output from command python setup.py egg_info:
#8 3.298     Traceback (most recent call last):
#8 3.298       File "<string>", line 1, in <module>
#8 3.298       File "/tmp/pip-build-jup9pyuz/pandas/setup.py", line 18, in <module>
#8 3.298         import numpy
#8 3.298     ModuleNotFoundError: No module named 'numpy'
#8 3.298     
#8 3.298     ----------------------------------------
#8 3.349 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jup9pyuz/pandas/
------
executor failed running [/bin/sh -c pip3.8 install -r /build/requirements.txt -t /build/python/]: exit code: 1
Unable to find image 'ce-report-build:latest' locally
docker: Error response from daemon: pull access denied for ce-report-build, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.```

Alternate zip storage?

Would it be possible to shove the zip file into something that isn't git (say, an S3 bucket / git-lfs / etc)? Right now the repo is 61MB and growing with every new zip file regeneration.

AWS account aliases

Is it possible to have the report created using the account aliases rather than the account name? I've tried working this in the paginator but whenever I make a change in there the report will just return the account ID.

Excel Charts only support up to 255 series

User report of: "/var/task/./vendored/xlsxwriter/chart.py:134: UserWarning: The maximum number of series that can be added to an Excel Chart is 255
warn("The maximum number of series that can be added to an "

Need to look at combining 255th + rows into "Others" potentially. Or better ordering of data to not lose key series.

Prerequisites to run this tool

Thank you for sharing this useful tool.

I tried this tool on my new account and works great. But I had 2 minor issues while running on lambda for the first time.
So just for sharing. It would be great if it mentioned at 'prerequisite' section.

  1. AWS organizations should be enabled.
  2. Cost explorer should be enabled.

--
[ERROR] 2018-09-20T01:45:55.499Z Getting Account names failed
Traceback (most recent call last):
File "/var/task/lambda.py", line 89, in init
self.accounts = self.getAccounts()
File "/var/task/lambda.py", line 99, in getAccounts
for response in response_iterator:
File "/var/runtime/botocore/paginate.py", line 255, in iter
response = self._make_request(current_kwargs)
File "/var/runtime/botocore/paginate.py", line 332, in _make_request
return self._method(**current_kwargs)
File "/var/runtime/botocore/client.py", line 314, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/runtime/botocore/client.py", line 612, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.AWSOrganizationsNotInUseException: An error occurred (AWSOrganizationsNotInUseException) when calling the ListAccounts operation: Your account is not a member of an organization.

An error occurred (AccessDeniedException) when calling the GetCostAndUsage operation: User not enabled for cost explorer access: ClientError
Traceback (most recent call last):
File "/var/task/lambda.py", line 394, in main_handler
costexplorer.addReport(Name="Total", GroupBy=[],Style='Total',IncSupport=True)
File "/var/task/lambda.py", line 272, in addReport
Filter=Filter
File "/var/runtime/botocore/client.py", line 314, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/var/runtime/botocore/client.py", line 612, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the GetCostAndUsage operation: User not enabled for cost explorer access

Cost Tags not separating

With Cost tags in the deploy file, tabs are generated but show the full cost for all of the services, not just the tagged resources.

How to deploy the aws-cost-explorer-report on AWS?

Description

I create the lambda function on the Python 3.6 platform and the IAM for the cost-explorer-report lambda functions. I also tag the services for cost-explorer-report lambda functions.
I hope I can obtain all of regions cost explorer.

Deploying steps:

  1. Create an IAM policy and role.
  2. Create a lambda function and copy lambda.py source code on my lambda function.
  3. Try to do a lambda function test.

Result: Step 3 shows the error messages that are "Can't find out the pandas."

Question part:

Q1. Did you import the pandas library of the python on lambda functions?
Q2. Could you tell me the deploying cost-explorer-report lambda guide?
(I hope it has more detail information. I don't want to use the cloudformation to build.)

IAM policy

IAM policy:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "sns:Publish", "aws-portal:ViewPaymentMethods", "aws-portal:ViewAccount", "aws-portal:ViewBilling", "aws-portal:ViewUsage" ], "Resource": "*" }, { "Sid": "VisualEditor1", "Effect": "Allow", "Action": "logs:*", "Resource": "arn:aws:logs:*:*:*" } ] }

Data Shaping to Tall and Skinny

This project is fantastic, thank you!

I prefer to work with pandas dataframes over Excel. Cost Explorer itself - and this project - use a wide data format. I prefer to work with relational data, with ("Index", "TimePeriod","CostAmount") as the column headers, and the rows containing tuples such as [(0, "2019-01-01", 272.11022), (1, "2019-02-01", 271.292)].

Currently I have to "melt" the dataframe to transpose (unpivot) it from wide and shallow to tall and skinny.

Have you considered using a data-science friendly data shape? Would you like a PR submitted or is this on a roadmap?

SES configuration

I tried to use SES configuration to report. Even if it gives us 200 response code inside the lambda function for sending email part I could not receive any email. In the aws "ses" part my email address is also verified. Are there any extra configuration for using sending email?

Runtime.ImportModuleError Unable to import module

Hello SAM + Python + LAMBDA users,

On running :

sam build --use-container
sam local start-api --env-vars test/sample/integration_test/environment.json

and

curl http://127.0.0.1:3000/sample

Getting below error

START RequestId: 156a4eec-0ec1-182f-d06e-04bfce652b1f Version: $LATEST
[ERROR] Runtime.ImportModuleError: Unable to import module 'list_handler': No module named 'src'
END RequestId: 156a4eec-0ec1-182f-d06e-04bfce652b1f
REPORT RequestId: 156a4eec-0ec1-182f-d06e-04bfce652b1f  Init Duration: 537.49 ms    Duration: 4.27 ms   Billed Duration: 100 ms Memory Size: 1024 MB    Max Memory Used: 32 MB  
Lambda returned empty body!
Invalid API Gateway Response Keys: {'errorType', 'errorMessage'} in {'errorType': 'Runtime.ImportModuleError', 'errorMessage': "Unable to import module 'list_handler': No module named 'src'"}
<class 'samcli.local.apigw.local_apigw_service.LambdaResponseParseException'>

This is my project structure

.
├── README.md
├── api-event.json
├── environment.json
├── events
│   └── event.json
├── src
│   └── sample
│       ├── handler
│       │   ├── create_handler.py
│       │   ├── get_handler.py
│       │   ├── list_handler.py
│       │   ├── requirements.txt
│       └── helper
│           ├── dynamodb_helper.py
│           └── logging_helper.py
├── template.yaml
└── test
    └── sample
        ├── integration_test
        │   ├── api_tests.py
        │   └── environment.json
        ├── test_helper.py
        └── unit_test

This is my template.yaml

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
sample-sam-app

  SAM Template for sample-sam-app

Globals:
  Function:
    Timeout: 20
    MemorySize: 1024
    Environment:
      Variables:
        TABLE_NAME: !Ref SampleTable
        APPLICATION_NAME: "SAMPLE"

Resources:
  CreateFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: src/sample/handler
      Handler: create_handler.lambda_handler
      Runtime: python3.7
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref SampleTable
      Events:
        Create:
          Type: Api 
          Properties:
            Path: /sample
            Method: post

  GetFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: src/sample/handler
      Handler: get_handler.lambda_handler
      Runtime: python3.7
      Policies:
        - DynamoDBReadPolicy:
            TableName: !Ref SampleTable
      Events:
        Get:
          Type: Api 
          Properties:
            Path: /sample/{data_id}
            Method: get

  ListFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: src/sample/handler
      Handler: list_handler.lambda_handler
      Runtime: python3.7
      Policies:
        - DynamoDBReadPolicy:
            TableName: !Ref SampleTable
      Events:
        Get:
          Type: Api 
          Properties:
            Path: /sample
            Method: get

  SampleTable:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: sample
      AttributeDefinitions:
        - AttributeName: user_id
          AttributeType: S
        - AttributeName: data_id
          AttributeType: S
      KeySchema:
        - AttributeName: user_id
          KeyType: HASH
        - AttributeName: data_id
          KeyType: RANGE
      BillingMode: PAY_PER_REQUEST 

Outputs:
    CreateFunction:
      Description: "Create Lambda Function ARN"
      Value: !GetAtt CreateFunction.Arn

    GetFunction:
      Description: "Get Lambda Function ARN"
      Value: !GetAtt GetFunction.Arn

    ListFunction:
      Description: "List Lambda Function ARN"
      Value: !GetAtt ListFunction.Arn

Also my docker doesnt show sam-app

docker ps

CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                    NAMES
2e45a561d2ab        amazon/dynamodb-local   "java -jar DynamoDBL…"   19 minutes ago      Up 19 minutes       0.0.0.0:8000->8000/tcp   romantic_mahavira

Build.sh doesn't seem to work

Hi after downloading your repo and running ./build.sh i was presented with the following errors.

Sending build context to Docker daemon  609.8kB
Step 1/6 : FROM amazonlinux
latest: Pulling from library/amazonlinux
638b75f800bf: Pull complete 
Digest: sha256:802212e258f7b67b5754c795f17395937918b29629dd72af615b768f0fcb6cf3
Status: Downloaded newer image for amazonlinux:latest
 ---> 585cc50169e6
Step 2/6 : RUN yum install -y python36-pip zip && yum clean all
 ---> Running in f83176ed44d5
Loaded plugins: ovl, priorities
No package python36-pip available.
Resolving Dependencies
--> Running transaction check
---> Package zip.x86_64 0:3.0-11.amzn2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch            Version                 Repository           Size
================================================================================
Installing:
 zip          x86_64          3.0-11.amzn2            amzn2-core          263 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 263 k
Installed size: 800 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : zip-3.0-11.amzn2.x86_64                                      1/1 
  Verifying  : zip-3.0-11.amzn2.x86_64                                      1/1 

Installed:
  zip.x86_64 0:3.0-11.amzn2                                                     

Complete!
Loaded plugins: ovl, priorities
Cleaning repos: amzn2-core
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Removing intermediate container f83176ed44d5
 ---> 3ce0e68b9ae6
Step 3/6 : COPY src /build
 ---> 8175ab46b1fb
Step 4/6 : RUN pip-3.6 install -r /build/requirements.txt -t /build/vendored/
 ---> Running in cf755abf5869
/bin/sh: pip-3.6: command not found
The command '/bin/sh -c pip-3.6 install -r /build/requirements.txt -t /build/vendored/' returned a non-zero code: 127
Unable to find image 'ce-report-build:latest' locally
docker: Error response from daemon: pull access denied for ce-report-build, repository does not exist or may require 'docker login'.
See 'docker run --help'.

You'll notice that in there are two main errors

No package python36-pip available.

and

/bin/sh: pip-3.6: command not found

Hope its an easy resolution

Need Windows friendly deployment method

Current deploy method options are:

  1. deploy.sh
  2. Manually change SAM template and use from AWS CLI
  3. Manually deploy the lambda

A more friendly Windows deployment method is desirable.

Formatting for currency

The formatting seems to be just number fields in the end results instead of currency which can make it more difficult to read. This would be great to have the monetary fields updated with the currency format. Looks like ultimately just the Total field would need this.

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.