# Update a cloud provider connection

`PATCH /apis/cra.diagrid.io/v1beta1/cloudproviderconnections/{CloudProviderConnectionId}`

Partially update an existing cloud provider connection.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `CloudProviderConnectionId` | string | Yes | Unique identifier of the cloud provider connection. |

### Request body

The cloud provider connection fields to update.

`application/json`

- `apiVersion` (string)
- `kind` (string)
- `metadata` (object)
  - `name` (string)
  - `uid` (string)
  - `resourceVersion` (integer)
  - `createdAt` (string)
  - `updatedAt` (string)
  - `deletedAt` (string)
  - `labels` (object<string, string>)
  - `annotations` (object)
- `spec` (object) — CloudProviderConnectionSpec represents the spec for a CloudProviderConnection. Only the fields belonging to the connection's own provider may be set. Nothing stored here is a secret, on either cloud. AWS records a role ARN that Diagrid's own identity assumes; Azure records the coordinates of an app registration that trusts Diagrid's identity. There is no credential to rotate or leak. The per-cloud fields are flat rather than nested under an `aws`/`azure` object, following PrivateLinkSpec: nesting would move the already-published roleArn and break every connection that exists. They are all optional, because a connection is created blank and the identifier recorded once the customer has built the identity - so "which fields go together" cannot be expressed in the schema and is enforced by validateCloudProviderConnectionSpec.
  - `provider` (string) — Required. Immutable. Provider is the cloud provider this connection targets. One of: `aws`, `azure`.
  - `roleArn` (string) — RoleARN is the IAM role in the customer's AWS account that Diagrid assumes to provision infrastructure. It may be left empty at creation time and set once the role has been created in the customer's account. AWS only.
  - `externalId` (string) — Read-only. ExternalID is the value Diagrid sends as sts:ExternalId when it assumes roleArn. The role's trust policy must require it with a StringEquals condition on sts:ExternalId. Diagrid generates it when the connection is created; any value sent on create or update is ignored. AWS only.
  - `tenantId` (string) — TenantID is the Microsoft Entra tenant that owns the customer's subscription and the app registration below. Azure only.
  - `subscriptionId` (string) — SubscriptionID is the customer's Azure subscription that dedicated regions are provisioned into. Azure only.
  - `clientId` (string) — ClientID is the application (client) ID of the app registration the customer created for Diagrid. Its federated credentials trust the Diagrid management cluster's OIDC issuer, which is what lets Diagrid act as it without ever holding a secret - the Azure analogue of assuming a role. Like roleArn, it may be empty until the customer has created it. Azure only.
- `status` (object) — CloudProviderConnectionStatus mirrors the CloudProviderConnection status.
  - `status` (string) — Status is the current processing status of the resource.
  - `updatedAt` (string) — UpdatedAt is the time of the last status update.
  - `messages` (object[]) — Messages contains any status messages, such as error details.
    - `message` (string)

`application/vnd.api+json`

JSONAPI.org specification cloud provider connection response wrapper for UI.

- `data` (object) — Required.
  - `type` (string) — Type of the resource object.
  - `id` (string) — Unique identifier of the resource object.
  - `attributes` (object)
    - `apiVersion` (string)
    - `kind` (string)
    - `metadata` (object)
      - `name` (string)
      - `uid` (string)
      - `resourceVersion` (integer)
      - `createdAt` (string)
      - `updatedAt` (string)
      - `deletedAt` (string)
      - `labels` (object<string, string>)
      - `annotations` (object)
    - `spec` (object) — CloudProviderConnectionSpec represents the spec for a CloudProviderConnection. Only the fields belonging to the connection's own provider may be set. Nothing stored here is a secret, on either cloud. AWS records a role ARN that Diagrid's own identity assumes; Azure records the coordinates of an app registration that trusts Diagrid's identity. There is no credential to rotate or leak. The per-cloud fields are flat rather than nested under an `aws`/`azure` object, following PrivateLinkSpec: nesting would move the already-published roleArn and break every connection that exists. They are all optional, because a connection is created blank and the identifier recorded once the customer has built the identity - so "which fields go together" cannot be expressed in the schema and is enforced by validateCloudProviderConnectionSpec.
      - `provider` (string) — Required. Immutable. Provider is the cloud provider this connection targets. One of: `aws`, `azure`.
      - `roleArn` (string) — RoleARN is the IAM role in the customer's AWS account that Diagrid assumes to provision infrastructure. It may be left empty at creation time and set once the role has been created in the customer's account. AWS only.
      - `externalId` (string) — Read-only. ExternalID is the value Diagrid sends as sts:ExternalId when it assumes roleArn. The role's trust policy must require it with a StringEquals condition on sts:ExternalId. Diagrid generates it when the connection is created; any value sent on create or update is ignored. AWS only.
      - `tenantId` (string) — TenantID is the Microsoft Entra tenant that owns the customer's subscription and the app registration below. Azure only.
      - `subscriptionId` (string) — SubscriptionID is the customer's Azure subscription that dedicated regions are provisioned into. Azure only.
      - `clientId` (string) — ClientID is the application (client) ID of the app registration the customer created for Diagrid. Its federated credentials trust the Diagrid management cluster's OIDC issuer, which is what lets Diagrid act as it without ever holding a secret - the Azure analogue of assuming a role. Like roleArn, it may be empty until the customer has created it. Azure only.
    - `status` (object) — CloudProviderConnectionStatus mirrors the CloudProviderConnection status.
      - `status` (string) — Status is the current processing status of the resource.
      - `updatedAt` (string) — UpdatedAt is the time of the last status update.
      - `messages` (object[]) — Messages contains any status messages, such as error details.
        - `message` (string)
  - `relationships` (object<string, object>) — Members of the relationships object represent references from the resource object in which it's defined to other resource objects.
    - Any of:
      - **option 1**
      - **option 2**
      - **option 3**
  - `links` (object<string, object>) — Link members related to the primary data.
    - One of:
      - **string (uri-reference)** — A string containing the link's URL.
      - **object**
        - `href` (string (uri-reference)) — Required. A string containing the link's URL.
        - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
  - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

## Responses

### 202 — Accepted for asynchronous processing.

### 403 — You are not authorized to perform this action.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### 404 — The cloud provider connection was not found.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### 409 — The request conflicts with the current state of the cloud provider connection.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.

### default — Unexpected error.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
