curl --request POST \
--url https://app.miget.com/api/v1/vpcs/{uuid}/site_connections \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"remote_cidrs": [
"<string>"
],
"tunnels": [
{
"remote_gateway": "<string>",
"psk": "<string>"
}
],
"peer_asn": 123
}
'import requests
url = "https://app.miget.com/api/v1/vpcs/{uuid}/site_connections"
payload = {
"name": "<string>",
"remote_cidrs": ["<string>"],
"tunnels": [
{
"remote_gateway": "<string>",
"psk": "<string>"
}
],
"peer_asn": 123
}
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({
name: '<string>',
remote_cidrs: ['<string>'],
tunnels: [{remote_gateway: '<string>', psk: '<string>'}],
peer_asn: 123
})
};
fetch('https://app.miget.com/api/v1/vpcs/{uuid}/site_connections', 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://app.miget.com/api/v1/vpcs/{uuid}/site_connections",
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([
'name' => '<string>',
'remote_cidrs' => [
'<string>'
],
'tunnels' => [
[
'remote_gateway' => '<string>',
'psk' => '<string>'
]
],
'peer_asn' => 123
]),
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://app.miget.com/api/v1/vpcs/{uuid}/site_connections"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"remote_cidrs\": [\n \"<string>\"\n ],\n \"tunnels\": [\n {\n \"remote_gateway\": \"<string>\",\n \"psk\": \"<string>\"\n }\n ],\n \"peer_asn\": 123\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://app.miget.com/api/v1/vpcs/{uuid}/site_connections")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"remote_cidrs\": [\n \"<string>\"\n ],\n \"tunnels\": [\n {\n \"remote_gateway\": \"<string>\",\n \"psk\": \"<string>\"\n }\n ],\n \"peer_asn\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/vpcs/{uuid}/site_connections")
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 \"name\": \"<string>\",\n \"remote_cidrs\": [\n \"<string>\"\n ],\n \"tunnels\": [\n {\n \"remote_gateway\": \"<string>\",\n \"psk\": \"<string>\"\n }\n ],\n \"peer_asn\": 123\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"peer_kind": "<string>",
"peer_asn": 123,
"remote_cidrs": [
"<unknown>"
],
"remote_gateways": [
"<unknown>"
],
"status": "<string>",
"public_ip": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Create a site-to-site connection
Brings up an IPsec tunnel between this VPC and a network the customer runs elsewhere — AWS today.
This spends money and takes a scarce address. IPsec needs UDP 500 and 4500, which are fixed, so one public IPv4 carries exactly one peer: each connection is sold an address of its own out of the region’s pool, at $199/mo for as long as it exists. That is why it takes network:manage, and why a region that has run out of addresses refuses with 422 rather than queueing. Confirm the charge with the user before sending it.
The IPsec gateway is created with the first connection and released with the last, so there is no separate call to enable it.
Read public_ip off the response: that is the address to enter on the far side, and the tunnel does not come up until they do.
curl --request POST \
--url https://app.miget.com/api/v1/vpcs/{uuid}/site_connections \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"remote_cidrs": [
"<string>"
],
"tunnels": [
{
"remote_gateway": "<string>",
"psk": "<string>"
}
],
"peer_asn": 123
}
'import requests
url = "https://app.miget.com/api/v1/vpcs/{uuid}/site_connections"
payload = {
"name": "<string>",
"remote_cidrs": ["<string>"],
"tunnels": [
{
"remote_gateway": "<string>",
"psk": "<string>"
}
],
"peer_asn": 123
}
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({
name: '<string>',
remote_cidrs: ['<string>'],
tunnels: [{remote_gateway: '<string>', psk: '<string>'}],
peer_asn: 123
})
};
fetch('https://app.miget.com/api/v1/vpcs/{uuid}/site_connections', 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://app.miget.com/api/v1/vpcs/{uuid}/site_connections",
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([
'name' => '<string>',
'remote_cidrs' => [
'<string>'
],
'tunnels' => [
[
'remote_gateway' => '<string>',
'psk' => '<string>'
]
],
'peer_asn' => 123
]),
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://app.miget.com/api/v1/vpcs/{uuid}/site_connections"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"remote_cidrs\": [\n \"<string>\"\n ],\n \"tunnels\": [\n {\n \"remote_gateway\": \"<string>\",\n \"psk\": \"<string>\"\n }\n ],\n \"peer_asn\": 123\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://app.miget.com/api/v1/vpcs/{uuid}/site_connections")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"remote_cidrs\": [\n \"<string>\"\n ],\n \"tunnels\": [\n {\n \"remote_gateway\": \"<string>\",\n \"psk\": \"<string>\"\n }\n ],\n \"peer_asn\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/vpcs/{uuid}/site_connections")
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 \"name\": \"<string>\",\n \"remote_cidrs\": [\n \"<string>\"\n ],\n \"tunnels\": [\n {\n \"remote_gateway\": \"<string>\",\n \"psk\": \"<string>\"\n }\n ],\n \"peer_asn\": 123\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"name": "<string>",
"peer_kind": "<string>",
"peer_asn": 123,
"remote_cidrs": [
"<unknown>"
],
"remote_gateways": [
"<unknown>"
],
"status": "<string>",
"public_ip": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Authorizations
Body
Create a site-to-site connection
Response
Create a site-to-site connection
Api_V1_Entities_SiteConnection model

