Integrations
Connect AWS
Verifies access to the billing export bucket, stores the credentials encrypted and schedules a daily pull. billing_account_id is the payer account id. Send assume_role or access_key to say how CostGraph reads the bucket. enable_recommendations (default true) turns AWS savings recommendations off, and activate_cost_allocation_tags activates the cost allocation tags. Credentials are never returned.
POST
/
api
/
v1
/
integrations
/
aws
/
connect
Connect AWS
curl --request POST \
--url https://api.costgraph.ai/api/v1/integrations/aws/connect \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"billing_account_id": "<string>",
"bucket": "<string>",
"region": "<string>",
"tenant_id": "<string>",
"activate_cost_allocation_tags": true,
"enable_recommendations": true,
"prefix": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/integrations/aws/connect"
payload = {
"billing_account_id": "<string>",
"bucket": "<string>",
"region": "<string>",
"tenant_id": "<string>",
"activate_cost_allocation_tags": True,
"enable_recommendations": True,
"prefix": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
billing_account_id: '<string>',
bucket: '<string>',
region: '<string>',
tenant_id: '<string>',
activate_cost_allocation_tags: true,
enable_recommendations: true,
prefix: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/integrations/aws/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/integrations/aws/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'billing_account_id' => '<string>',
'bucket' => '<string>',
'region' => '<string>',
'tenant_id' => '<string>',
'activate_cost_allocation_tags' => true,
'enable_recommendations' => true,
'prefix' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/integrations/aws/connect"
payload := strings.NewReader("{\n \"billing_account_id\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"tenant_id\": \"<string>\",\n \"activate_cost_allocation_tags\": true,\n \"enable_recommendations\": true,\n \"prefix\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.costgraph.ai/api/v1/integrations/aws/connect")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"billing_account_id\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"tenant_id\": \"<string>\",\n \"activate_cost_allocation_tags\": true,\n \"enable_recommendations\": true,\n \"prefix\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/integrations/aws/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billing_account_id\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"tenant_id\": \"<string>\",\n \"activate_cost_allocation_tags\": true,\n \"enable_recommendations\": true,\n \"prefix\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": "<unknown>"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Body
application/json
AWS connection
BillingAccountID is the payer (management) account id.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Connect AWS
curl --request POST \
--url https://api.costgraph.ai/api/v1/integrations/aws/connect \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"billing_account_id": "<string>",
"bucket": "<string>",
"region": "<string>",
"tenant_id": "<string>",
"activate_cost_allocation_tags": true,
"enable_recommendations": true,
"prefix": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/integrations/aws/connect"
payload = {
"billing_account_id": "<string>",
"bucket": "<string>",
"region": "<string>",
"tenant_id": "<string>",
"activate_cost_allocation_tags": True,
"enable_recommendations": True,
"prefix": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
billing_account_id: '<string>',
bucket: '<string>',
region: '<string>',
tenant_id: '<string>',
activate_cost_allocation_tags: true,
enable_recommendations: true,
prefix: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/integrations/aws/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/integrations/aws/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'billing_account_id' => '<string>',
'bucket' => '<string>',
'region' => '<string>',
'tenant_id' => '<string>',
'activate_cost_allocation_tags' => true,
'enable_recommendations' => true,
'prefix' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/integrations/aws/connect"
payload := strings.NewReader("{\n \"billing_account_id\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"tenant_id\": \"<string>\",\n \"activate_cost_allocation_tags\": true,\n \"enable_recommendations\": true,\n \"prefix\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.costgraph.ai/api/v1/integrations/aws/connect")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"billing_account_id\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"tenant_id\": \"<string>\",\n \"activate_cost_allocation_tags\": true,\n \"enable_recommendations\": true,\n \"prefix\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/integrations/aws/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"billing_account_id\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"tenant_id\": \"<string>\",\n \"activate_cost_allocation_tags\": true,\n \"enable_recommendations\": true,\n \"prefix\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": "<unknown>"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}