Skip to content

Import security groups from AWS

POST
/api/v1/security-group/import
curl --request POST \
--url https://console.cloudlogics.com/api/v1/security-group/import \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "SecurityGroups": [ { "Description": "example", "GroupName": "example", "IpPermissions": [ { "FromPort": 1, "IpProtocol": "example", "IpRanges": [ { "CidrIp": "example", "Description": "example" } ], "Ipv6Ranges": [ { "CidrIpv6": "example", "Description": "example" } ], "PrefixListIds": [ { "Description": "example", "PrefixListId": "example" } ], "ToPort": 1, "UserIdGroupPairs": [ { "Description": "example", "GroupId": "example" } ] } ], "IpPermissionsEgress": [ { "FromPort": 1, "IpProtocol": "example", "IpRanges": [ { "CidrIp": "example", "Description": "example" } ], "Ipv6Ranges": [ { "CidrIpv6": "example", "Description": "example" } ], "PrefixListIds": [ { "Description": "example", "PrefixListId": "example" } ], "ToPort": 1, "UserIdGroupPairs": [ { "Description": "example", "GroupId": "example" } ] } ] } ] }'

Import security groups from the raw output of aws ec2 describe-security-groups --output json into the authenticated user’s project. AWS rule fields are translated to OpenStack rules; sources that cannot be represented (prefix lists, peer security-group references, ICMP type/code, AWS’s default egress allow-all) are skipped and reported. Import is best-effort across groups: one group failing does not block the others, but each group’s rules are created atomically — if any rule fails, that whole group is rolled back.

Raw aws ec2 describe-security-groups JSON

Media typeapplication/json
object
SecurityGroups
Array<object>
object
Description
string
GroupName
string
IpPermissions

Ingress

Array<object>
object
FromPort
integer
IpProtocol
string
IpRanges
Array<object>
object
CidrIp
string
Description
string
Ipv6Ranges
Array<object>
object
CidrIpv6
string
Description
string
PrefixListIds
Array<object>
object
Description
string
PrefixListId
string
ToPort
integer
UserIdGroupPairs
Array<object>
object
Description
string
GroupId
string
IpPermissionsEgress

Egress

Array<object>
object
FromPort
integer
IpProtocol
string
IpRanges
Array<object>
object
CidrIp
string
Description
string
Ipv6Ranges
Array<object>
object
CidrIpv6
string
Description
string
PrefixListIds
Array<object>
object
Description
string
PrefixListId
string
ToPort
integer
UserIdGroupPairs
Array<object>
object
Description
string
GroupId
string
Examplegenerated
{
"SecurityGroups": [
{
"Description": "example",
"GroupName": "example",
"IpPermissions": [
{
"FromPort": 1,
"IpProtocol": "example",
"IpRanges": [
{
"CidrIp": "example",
"Description": "example"
}
],
"Ipv6Ranges": [
{
"CidrIpv6": "example",
"Description": "example"
}
],
"PrefixListIds": [
{
"Description": "example",
"PrefixListId": "example"
}
],
"ToPort": 1,
"UserIdGroupPairs": [
{
"Description": "example",
"GroupId": "example"
}
]
}
],
"IpPermissionsEgress": [
{
"FromPort": 1,
"IpProtocol": "example",
"IpRanges": [
{
"CidrIp": "example",
"Description": "example"
}
],
"Ipv6Ranges": [
{
"CidrIpv6": "example",
"Description": "example"
}
],
"PrefixListIds": [
{
"Description": "example",
"PrefixListId": "example"
}
],
"ToPort": 1,
"UserIdGroupPairs": [
{
"Description": "example",
"GroupId": "example"
}
]
}
]
}
]
}

Per-group import report

Media typeapplication/json
object
failed
integer
groups
Array<object>
object
error
string
id
string
name
string
rules_created
integer
skipped
Array<string>
status

“created” | “failed”

string
imported
integer
Examplegenerated
{
"failed": 1,
"groups": [
{
"error": "example",
"id": "example",
"name": "example",
"rules_created": 1,
"skipped": [
"example"
],
"status": "example"
}
],
"imported": 1
}

Invalid request or missing project

Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{
"data": "example",
"error": {
"code": 1,
"message": "example"
},
"page": {
"next": "example",
"prev": "example",
"total_size": 1
}
}

Internal server error

Media typeapplication/json
object
data
error
object
code
integer
message
string
page
object
next
string
prev
string
total_size
integer
Examplegenerated
{
"data": "example",
"error": {
"code": 1,
"message": "example"
},
"page": {
"next": "example",
"prev": "example",
"total_size": 1
}
}