Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mpcloud authored Apr 8, 2020
1 parent ed2cd80 commit 5fa5830
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
AWS Billing Report API:

1. Configurar reporte de billing con Athena:
1. Setup billing integration with Athena:
a. https://aws.amazon.com/blogs/aws-cost-management/querying-your-aws-cost-and-usage-report-using-amazon-athena/
2. Definir, si se quiere, que ajustes a meses previos se reflejen:
2. Define, if required, previous month adjustments:
a. ![](images/1.png)
3. Configurar el envío a Athena:
3. Configure how we will send data to Athena:
a. ![](images/2.jpg)
b. Referencia https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/athena.html.
4. Crear una función lambda con el contenido siguiente: https://github.com/mpcloud/code/aws-billing-api/blob/master/athena_billing.py
a. Ejemplo: https://docs.aws.amazon.com/es_es/toolkit-for-eclipse/v1/user-guide/lambda-tutorial.html.
5. Asignar los valores requeridos:
b. Reference https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/athena.html.
4. Create a lambda fuction using the sample code: https://github.com/mpcloud/code/aws-billing-api/blob/master/athena_billing.py
a. Example on hot to create lambda: https://docs.aws.amazon.com/es_es/toolkit-for-eclipse/v1/user-guide/lambda-tutorial.html.
5. Assign the required values:
a. ![](images/3.png)
6. Es necesario contar con el role de IAM previamente creado con el acceso a athena y S3.
7. Cear un api en api Gateway y relacionarla con la función lambda previamente creada que pasara los siguientes parámetros:
6. You need to have a role previously created with access to S3 ans to query Athena.
7. Create a ner API in API Gateway and associate the lambda you currently created mapping the parameters to the lambda input:
a. ![](images/4.png)
8. Creamos un método y recurso:
8. Create a resource and a Methos in API Gateway:
a. ![](images/5.png)
9. Configuraremos cada parte para mapear los parámetros que pasaremos en la URL:
9. Setup the example parameters wou will use in the GET Request to the URL:
a. ![](images/6.png)
b. Method Request
![](images/7.png)
Expand All @@ -27,5 +27,5 @@ d. Integration Response
![](images/10.png)
e. Method Response
![](images/11.png)
Los parámetros los recibe de la siguiente manera, por ejemplo: AccountID=Your-Account-ID&Month=12&Year=2018, podemos ir a test y validarlo, por ejemplo la url se vería de la siguiente manera: https://your-url.execute-api.us-east-1.amazonaws.com/Prod/test?AccountID=360616938971&Month=12&Year=2018
The parameters we defined will be used like this: AccountID=Your-Account-ID&Month=12&Year=2018, we can go to test to validate before deploying, this is an example of how your URL would look like with this example: https://your-url.execute-api.us-east-1.amazonaws.com/Prod/test?AccountID=360616938971&Month=12&Year=2018

0 comments on commit 5fa5830

Please sign in to comment.