> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.iot.telia.lt/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.iot.telia.lt/_mcp/server.

# Create a Cloud Connect attachment via Transit Gateway

POST https://iot.telia.lt/api/v1/cnc/breakout/tgw
Content-Type: application/json

Creates a Transit Gateway breakout towards the customer AWS account.

After the creation the following steps have to be made from the customer's AWS account:

1. Accept the resource share about the 'CloudConnect' TransitGateway
2. Create a Transit Gateway Attachment to the own VPC with the services to connect to

More Information about this can be found on the Cloud Connect Knowledge Base article.


Reference: https://docs.iot.telia.lt/developers/api/cloud-connect/create-cloud-connect-attachment-tgw

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Body (application/json)

This endpoint expects an object.

- `type` (enum, required)
  - Allowed values: `1`
- `name` (string, required)
- `vpc_cidr` (list of string, required)
- `region` (string, required) — the region that this attachment should be established to
- `aws_account_id` (string, required) — 12-digit identifier of the own AWS Account
- `description` (string, optional)

## Response

### 201

Response to a POST that results in a creation, usually will return a Location header pointing to the location of the new resource

## Errors

### 400 Bad Request Error

The request is malformed, e.g. the body cannot be parsed

- `any`

### 403 Forbidden Error

Authentication token is valid, but user has no access permissions to the request resource

- `any`

## Examples

**Request**

```json
{
  "type": 1,
  "name": "connectivity test",
  "vpc_cidr": [
    "10.0.0.0/24"
  ],
  "region": "eu-west-1",
  "aws_account_id": "394759813210"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Create a Cloud Connect Transit Gateway Attachment
import requests

url = "https://iot.telia.lt/api/v1/cnc/breakout/tgw"

payload = {
    "type": 1,
    "name": "connectivity test",
    "vpc_cidr": ["10.0.0.0/24"],
    "region": "eu-west-1",
    "aws_account_id": "394759813210"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create a Cloud Connect Transit Gateway Attachment
const url = 'https://iot.telia.lt/api/v1/cnc/breakout/tgw';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":1,"name":"connectivity test","vpc_cidr":["10.0.0.0/24"],"region":"eu-west-1","aws_account_id":"394759813210"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create a Cloud Connect Transit Gateway Attachment
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://iot.telia.lt/api/v1/cnc/breakout/tgw"

	payload := strings.NewReader("{\n  \"type\": 1,\n  \"name\": \"connectivity test\",\n  \"vpc_cidr\": [\n    \"10.0.0.0/24\"\n  ],\n  \"region\": \"eu-west-1\",\n  \"aws_account_id\": \"394759813210\"\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(res)
	fmt.Println(string(body))

}
```

```ruby Create a Cloud Connect Transit Gateway Attachment
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/cnc/breakout/tgw")

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  \"type\": 1,\n  \"name\": \"connectivity test\",\n  \"vpc_cidr\": [\n    \"10.0.0.0/24\"\n  ],\n  \"region\": \"eu-west-1\",\n  \"aws_account_id\": \"394759813210\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create a Cloud Connect Transit Gateway Attachment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://iot.telia.lt/api/v1/cnc/breakout/tgw")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": 1,\n  \"name\": \"connectivity test\",\n  \"vpc_cidr\": [\n    \"10.0.0.0/24\"\n  ],\n  \"region\": \"eu-west-1\",\n  \"aws_account_id\": \"394759813210\"\n}")
  .asString();
```

```php Create a Cloud Connect Transit Gateway Attachment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://iot.telia.lt/api/v1/cnc/breakout/tgw', [
  'body' => '{
  "type": 1,
  "name": "connectivity test",
  "vpc_cidr": [
    "10.0.0.0/24"
  ],
  "region": "eu-west-1",
  "aws_account_id": "394759813210"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create a Cloud Connect Transit Gateway Attachment
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/cnc/breakout/tgw");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": 1,\n  \"name\": \"connectivity test\",\n  \"vpc_cidr\": [\n    \"10.0.0.0/24\"\n  ],\n  \"region\": \"eu-west-1\",\n  \"aws_account_id\": \"394759813210\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a Cloud Connect Transit Gateway Attachment
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": 1,
  "name": "connectivity test",
  "vpc_cidr": ["10.0.0.0/24"],
  "region": "eu-west-1",
  "aws_account_id": "394759813210"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/cnc/breakout/tgw")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```