Create a network policy.
curl --request POST \
--url https://a.s2.dev/v1/network-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"private_net": {
"aws": {
"vpce_ids": [
"<string>"
]
}
},
"public_net": {
"cidrs": [
"<string>"
]
}
},
"slug": "<string>"
}
'{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"policy": {
"private_net": {
"aws": {
"vpce_ids": [
"<string>"
]
}
},
"public_net": {
"cidrs": [
"<string>"
]
}
},
"slug": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}network policies
Create a network policy.
Create an S2 network policy that restricts access tokens to CIDR blocks or AWS VPC endpoints.
POST
/
network-policies
Create a network policy.
curl --request POST \
--url https://a.s2.dev/v1/network-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"policy": {
"private_net": {
"aws": {
"vpce_ids": [
"<string>"
]
}
},
"public_net": {
"cidrs": [
"<string>"
]
}
},
"slug": "<string>"
}
'{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"policy": {
"private_net": {
"aws": {
"vpce_ids": [
"<string>"
]
}
},
"public_net": {
"cidrs": [
"<string>"
]
}
},
"slug": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Network policy concepts
Review how rules are evaluated, how tokens are bound, and how to debug denied requests.
Policies are immutable. To allow different networks, create a new policy and issue tokens with it.
Authorizations
Body
application/json

