Skip to Content
kosemdocs
ReferenceAPIConnections

Create connection

Creates a connection of a type connected by WORKLOAD_IDENTITY, which then needs the service to trust it. A project's own connection serves the project alone, and is shared with no project. Creating one fails with failed_precondition where a policy enforces connections.projectConnectionsDisabled.

POST
/v1/organizations/{organization}/connections

Creates a connection of a type connected by WORKLOAD_IDENTITY, which then needs the service to trust it.

A project's own connection serves the project alone, and is shared with no project. Creating one fails with failed_precondition where a policy enforces connections.projectConnectionsDisabled.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Query Parameters

validateOnly?boolean

Checks the connection, with its provider too, without Creating it.

Request Body

application/json
  1. body
availability?

The projects the connection is shared with. None, unless set. Setting it also takes connections.connections.setAvailability. Only an organization's connection is shared.

config?

Settings, as the type's configFields describe them: keys of lowercase letters, digits and underscores, values of at most 2048 characters.

Propertiesproperties <= 20
displayName?string

Name shown in user interfaces. Defaults to the type's name.

Lengthlength <= 100
type*string

The connection's type, such as connectionTypes/aws: one connected by WORKLOAD_IDENTITY, as GitHub is connected by StartGitHubConnection.

Match^connectionTypes/[a-z][a-z0-9-]{0,62}$

Response Body

Created

application/json
  1. response
availability*

For an organization's connection: the projects it is shared with. Choosing it for an access profile still takes connections.connections.use. A project's own connection serves that project alone, and is shared with none.

config*

Settings, as the type's configFields describe them.

createTime?string

When the connection was created; unset on one that was only validated.

Formatdate-time
displayName*string

Name shown in user interfaces. Defaults to the type's name.

name*string

Resource name, organizations/{organization_id}/connections/{connection_id}, or projects/{project_id}/connections/{connection_id} for a project's own.

roles?array<>

For AWS, once set up: the IAM roles the connection assumes, its default one first. Each trusts the connection's identity subject.

serviceAccounts?array<>

For Google Cloud, once set up: the service accounts the connection acts as, its default one first. Each trusts the connection's identity, and its roles bound what its tokens can do.

state*string

Whether the service lets kosem act in the account: ACTIVE, it did when it was last verified; NEEDS_ATTENTION, it refused, or the connection isn't set up yet, and stateReason says why.

Value in"ACTIVE""NEEDS_ATTENTION"
stateReason*string

Why the connection needs attention.

trust?

What the service trusts of kosem for this connection, for a type connected by WORKLOAD_IDENTITY.

type*string

The connection's type, such as connectionTypes/github. It never changes.

updateTime?string

When the connection was last updated; unset on one that was only validated.

Formatdate-time
verifyTime*string

When the service last let kosem act in the account, or refused.

Formatdate-time
Example Request
curl -X POST 'https://api.kosem.ai/v1/organizations/string/connections' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "string"
}'
Example Response
{
  "availability": {
    "allProjects": true,
    "projects": [
      "string"
    ]
  },
  "config": {
    "property1": "string",
    "property2": "string"
  },
  "createTime": "2019-08-24T14:15:22Z",
  "displayName": "string",
  "name": "string",
  "roles": [
    {
      "arn": "string",
      "createTime": "2019-08-24T14:15:22Z",
      "default": true,
      "displayName": "string",
      "name": "string",
      "state": "ACTIVE",
      "stateReason": "string",
      "verifyTime": "2019-08-24T14:15:22Z"
    }
  ],
  "serviceAccounts": [
    {
      "createTime": "2019-08-24T14:15:22Z",
      "default": true,
      "displayName": "string",
      "email": "string",
      "state": "ACTIVE",
      "stateReason": "string",
      "verifyTime": "2019-08-24T14:15:22Z"
    }
  ],
  "state": "ACTIVE",
  "stateReason": "string",
  "trust": {
    "attributeCondition": "string",
    "audience": "string",
    "issuer": "string",
    "subject": "string"
  },
  "type": "string",
  "updateTime": "2019-08-24T14:15:22Z",
  "verifyTime": "2019-08-24T14:15:22Z"
}