Set region
curl --request PUT \
--url https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vpcId": "vpc-0a1b2c3d4e5f67890",
"subnetId": "subnet-0a1b2c3d4e5f67890",
"securityGroupId": "sg-0a1b2c3d4e5f67890",
"queueUrl": "https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123",
"maxInstanceLimit": 10,
"templateVersion": "v3"
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}"
payload = {
"vpcId": "vpc-0a1b2c3d4e5f67890",
"subnetId": "subnet-0a1b2c3d4e5f67890",
"securityGroupId": "sg-0a1b2c3d4e5f67890",
"queueUrl": "https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123",
"maxInstanceLimit": 10,
"templateVersion": "v3"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vpcId: 'vpc-0a1b2c3d4e5f67890',
subnetId: 'subnet-0a1b2c3d4e5f67890',
securityGroupId: 'sg-0a1b2c3d4e5f67890',
queueUrl: 'https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123',
maxInstanceLimit: 10,
templateVersion: 'v3'
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}', 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://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'vpcId' => 'vpc-0a1b2c3d4e5f67890',
'subnetId' => 'subnet-0a1b2c3d4e5f67890',
'securityGroupId' => 'sg-0a1b2c3d4e5f67890',
'queueUrl' => 'https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123',
'maxInstanceLimit' => 10,
'templateVersion' => 'v3'
]),
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://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}"
payload := strings.NewReader("{\n \"vpcId\": \"vpc-0a1b2c3d4e5f67890\",\n \"subnetId\": \"subnet-0a1b2c3d4e5f67890\",\n \"securityGroupId\": \"sg-0a1b2c3d4e5f67890\",\n \"queueUrl\": \"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123\",\n \"maxInstanceLimit\": 10,\n \"templateVersion\": \"v3\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vpcId\": \"vpc-0a1b2c3d4e5f67890\",\n \"subnetId\": \"subnet-0a1b2c3d4e5f67890\",\n \"securityGroupId\": \"sg-0a1b2c3d4e5f67890\",\n \"queueUrl\": \"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123\",\n \"maxInstanceLimit\": 10,\n \"templateVersion\": \"v3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vpcId\": \"vpc-0a1b2c3d4e5f67890\",\n \"subnetId\": \"subnet-0a1b2c3d4e5f67890\",\n \"securityGroupId\": \"sg-0a1b2c3d4e5f67890\",\n \"queueUrl\": \"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123\",\n \"maxInstanceLimit\": 10,\n \"templateVersion\": \"v3\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accountId": "210987654321",
"region": "ap-southeast-2",
"vpcId": "vpc-0a1b2c3d4e5f67890",
"subnetId": "subnet-0a1b2c3d4e5f67890",
"securityGroupId": "sg-0a1b2c3d4e5f67890",
"queueUrl": "https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123",
"maxInstanceLimit": 10,
"enabled": true,
"templateVersion": "v3"
}
}{
"errors": [
{
"code": "InvalidQueueUrl",
"message": "queueUrl must be the appliance scan queue in account 210987654321 and region ap-southeast-2, which starts https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-."
}
]
}{
"message": "Forbidden"
}{
"errors": [
{
"code": "NotFound",
"message": "Service account not found"
}
]
}{
"errors": [
{
"code": "RegionResourcesNotVerified",
"message": "VPC vpc-0a1b2c3d4e5f67890 is not tagged PlerionTenantId=5c8e1f2a-6b3d-4a9e-8f70-1d2c3b4a5e6f. Apply the current Plerion region template, which adds the tag."
}
]
}{
"errors": [
{
"code": "RoleNotAssumable",
"message": "Plerion could not assume arn:aws:iam::210987654321:role/PlerionControlPlaneRole. The role needs the tag RolePurpose with the value PlerionAccess. A new role can also take a minute or two before it can be assumed."
}
]
}{
"errors": [
{
"code": "AccountMismatch",
"message": "instanceProfileArn must be an instance profile in account 123456789012, the account roleArn is in.",
"field": "<string>"
}
]
}Set a service account's network in one region
Creates or replaces the network a service account’s scanners use in one region. Plerion assumes the service account’s control-plane role and checks that the VPC is tagged PlerionTenantId with the tenant’s ID, that the subnet and security group are in that VPC, and that the queue is the appliance scan queue in this account and region. A new region is turned on; an existing region keeps whether it is on or off.
Requires ServiceAccount:Modify.
PUT
/
v1
/
tenant
/
service-accounts
/
aws
/
{accountId}
/
regions
/
{region}
Set region
curl --request PUT \
--url https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vpcId": "vpc-0a1b2c3d4e5f67890",
"subnetId": "subnet-0a1b2c3d4e5f67890",
"securityGroupId": "sg-0a1b2c3d4e5f67890",
"queueUrl": "https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123",
"maxInstanceLimit": 10,
"templateVersion": "v3"
}
'import requests
url = "https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}"
payload = {
"vpcId": "vpc-0a1b2c3d4e5f67890",
"subnetId": "subnet-0a1b2c3d4e5f67890",
"securityGroupId": "sg-0a1b2c3d4e5f67890",
"queueUrl": "https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123",
"maxInstanceLimit": 10,
"templateVersion": "v3"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vpcId: 'vpc-0a1b2c3d4e5f67890',
subnetId: 'subnet-0a1b2c3d4e5f67890',
securityGroupId: 'sg-0a1b2c3d4e5f67890',
queueUrl: 'https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123',
maxInstanceLimit: 10,
templateVersion: 'v3'
})
};
fetch('https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}', 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://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'vpcId' => 'vpc-0a1b2c3d4e5f67890',
'subnetId' => 'subnet-0a1b2c3d4e5f67890',
'securityGroupId' => 'sg-0a1b2c3d4e5f67890',
'queueUrl' => 'https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123',
'maxInstanceLimit' => 10,
'templateVersion' => 'v3'
]),
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://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}"
payload := strings.NewReader("{\n \"vpcId\": \"vpc-0a1b2c3d4e5f67890\",\n \"subnetId\": \"subnet-0a1b2c3d4e5f67890\",\n \"securityGroupId\": \"sg-0a1b2c3d4e5f67890\",\n \"queueUrl\": \"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123\",\n \"maxInstanceLimit\": 10,\n \"templateVersion\": \"v3\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vpcId\": \"vpc-0a1b2c3d4e5f67890\",\n \"subnetId\": \"subnet-0a1b2c3d4e5f67890\",\n \"securityGroupId\": \"sg-0a1b2c3d4e5f67890\",\n \"queueUrl\": \"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123\",\n \"maxInstanceLimit\": 10,\n \"templateVersion\": \"v3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/service-accounts/aws/{accountId}/regions/{region}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"vpcId\": \"vpc-0a1b2c3d4e5f67890\",\n \"subnetId\": \"subnet-0a1b2c3d4e5f67890\",\n \"securityGroupId\": \"sg-0a1b2c3d4e5f67890\",\n \"queueUrl\": \"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123\",\n \"maxInstanceLimit\": 10,\n \"templateVersion\": \"v3\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accountId": "210987654321",
"region": "ap-southeast-2",
"vpcId": "vpc-0a1b2c3d4e5f67890",
"subnetId": "subnet-0a1b2c3d4e5f67890",
"securityGroupId": "sg-0a1b2c3d4e5f67890",
"queueUrl": "https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123",
"maxInstanceLimit": 10,
"enabled": true,
"templateVersion": "v3"
}
}{
"errors": [
{
"code": "InvalidQueueUrl",
"message": "queueUrl must be the appliance scan queue in account 210987654321 and region ap-southeast-2, which starts https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-."
}
]
}{
"message": "Forbidden"
}{
"errors": [
{
"code": "NotFound",
"message": "Service account not found"
}
]
}{
"errors": [
{
"code": "RegionResourcesNotVerified",
"message": "VPC vpc-0a1b2c3d4e5f67890 is not tagged PlerionTenantId=5c8e1f2a-6b3d-4a9e-8f70-1d2c3b4a5e6f. Apply the current Plerion region template, which adds the tag."
}
]
}{
"errors": [
{
"code": "RoleNotAssumable",
"message": "Plerion could not assume arn:aws:iam::210987654321:role/PlerionControlPlaneRole. The role needs the tag RolePurpose with the value PlerionAccess. A new role can also take a minute or two before it can be assumed."
}
]
}{
"errors": [
{
"code": "AccountMismatch",
"message": "instanceProfileArn must be an instance profile in account 123456789012, the account roleArn is in.",
"field": "<string>"
}
]
}Authorizations
Headers
Path Parameters
Body
application/json
The URL of the appliance scan queue in this account and region. Its name starts plerion-appliance-scan-queue-.
Pattern:
^https://sqs\.[a-z]{2}-[a-z]{4,9}-[1-9]\.amazonaws\.com/[0-9]{12}/[a-zA-Z0-9_-]{1,200}$Example:
"https://sqs.ap-southeast-2.amazonaws.com/210987654321/plerion-appliance-scan-queue-abc123"
Was this page helpful?