Create an AWS CloudFormation template for automatic integration
curl --request POST \
--url https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "MANAGEMENT_ACCOUNT",
"workspaceId": "<string>"
}
'import requests
url = "https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation"
payload = {
"mode": "MANAGEMENT_ACCOUNT",
"workspaceId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: 'MANAGEMENT_ACCOUNT', workspaceId: '<string>'})
};
fetch('https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation', 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.pelanor.io/v2/integrations/collectors/aws-cloudformation",
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([
'mode' => 'MANAGEMENT_ACCOUNT',
'workspaceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.pelanor.io/v2/integrations/collectors/aws-cloudformation"
payload := strings.NewReader("{\n \"mode\": \"MANAGEMENT_ACCOUNT\",\n \"workspaceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.pelanor.io/v2/integrations/collectors/aws-cloudformation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"MANAGEMENT_ACCOUNT\",\n \"workspaceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"MANAGEMENT_ACCOUNT\",\n \"workspaceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contentType": "<string>",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"extensions": [
{
"@type": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Integrations
Create AWS Integration
POST
/
v2
/
integrations
/
collectors
/
aws-cloudformation
Create an AWS CloudFormation template for automatic integration
curl --request POST \
--url https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "MANAGEMENT_ACCOUNT",
"workspaceId": "<string>"
}
'import requests
url = "https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation"
payload = {
"mode": "MANAGEMENT_ACCOUNT",
"workspaceId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: 'MANAGEMENT_ACCOUNT', workspaceId: '<string>'})
};
fetch('https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation', 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.pelanor.io/v2/integrations/collectors/aws-cloudformation",
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([
'mode' => 'MANAGEMENT_ACCOUNT',
'workspaceId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.pelanor.io/v2/integrations/collectors/aws-cloudformation"
payload := strings.NewReader("{\n \"mode\": \"MANAGEMENT_ACCOUNT\",\n \"workspaceId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.pelanor.io/v2/integrations/collectors/aws-cloudformation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"MANAGEMENT_ACCOUNT\",\n \"workspaceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pelanor.io/v2/integrations/collectors/aws-cloudformation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"MANAGEMENT_ACCOUNT\",\n \"workspaceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"contentType": "<string>",
"data": "aSDinaTvuI8gbWludGxpZnk=",
"extensions": [
{
"@type": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}This endpoint allows you to create an automatic integration by generating CloudFormation templates that are executed on the client Billing (Management) and Subaccounts.
Refer to the AWS Integration documentation for more information on how this type of integration works.
Typical Workflow:
1
Generate Management CloudFormation Template
Call this endpoint with the appropriate parameter, to generate the management / billing account CloudFormation template with your Pelanor organization credentials.
2
Run Management CF
Run the generated template in
us-east-1.3
Generate Subaccount CF
Call this endpoint with the subaccount CloudFormation parameter, to get the StackSet file to run in order to collect subaccount-related information. Note the Include Subaccount Bucket option.
4
Run Subaccount CF
Run the generated template in
us-east-1.The AWS Integration will only appear in the Pelanor platform (and in the List Integrations API) once Pelanor receives data from your AWS integration. This can take up to 48 hours to propagate.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
A successful response.
The CloudFormation template as a string.
The HTTP Content-Type header value specifying the content type of the body.
The HTTP request/response body as raw binary.
Pattern:
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$Application specific response metadata. Must be set in the first response for streaming APIs.
Show child attributes
Show child attributes