---
title: "POST /v2/{+parent}/connections"
method: POST
path: "/v2/{+parent}/connections"
tags: ["organizations"]
---

# POST /v2/{+parent}/connections

`POST /v2/{+parent}/connections`

Create a Connection to an external data source.

## Path parameters

- `parent` string, required

## Request body

- GooglePrivacyDlpV2CreateConnectionRequest — Request message for CreateConnection.
  - `connection` GooglePrivacyDlpV2Connection — A data connection to allow the DLP API to profile data in locations that require additional configuration.
    - `name` string — Output only. Name of the connection: `projects/{project}/locations/{location}/connections/{name}`.
    - `state` 'CONNECTION_STATE_UNSPECIFIED' | 'MISSING_CREDENTIALS' | 'AVAILABLE' | 'ERROR' — Required. The connection's state in its lifecycle.
    - `errors` GooglePrivacyDlpV2Error[] — Output only. Set if status == ERROR, to provide additional details. Will store the last 10 errors sorted with the most recent first.
      - `timestamps` string[] — The times the error occurred. List includes the oldest timestamp and the last 9 timestamps.
      - `details` GoogleRpcStatus — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
        - `code` integer — The status code, which should be an enum value of google.rpc.Code.
        - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
        - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
      - `extraInfo` 'ERROR_INFO_UNSPECIFIED' | 'IMAGE_SCAN_UNAVAILABLE_IN_REGION' | 'FILE_STORE_CLUSTER_UNSUPPORTED' — Additional information about the error.
    - `cloudSql` GooglePrivacyDlpV2CloudSqlProperties — Cloud SQL connection properties.
      - `cloudSqlIam` GooglePrivacyDlpV2CloudSqlIamCredential — Use IAM authentication to connect. This requires the Cloud SQL IAM feature to be enabled on the instance, which is not the default for Cloud SQL. See https://cloud.google.com/sql/docs/postgres/authentication and https://cloud.google.com/sql/docs/mysql/authentication.
      - `connectionName` string — Optional. Immutable. The Cloud SQL instance for which the connection is defined. Only one connection per instance is allowed. This can only be set at creation time, and cannot be updated. It is an error to use a connection_name from different project or region than the one that holds the connection. For example, a Connection resource for Cloud SQL connection_name `project-id:us-central1:sql-instance` must be created under the parent `projects/project-id/locations/us-central1`
      - `usernamePassword` GooglePrivacyDlpV2SecretManagerCredential — A credential consisting of a username and password, where the password is stored in a Secret Manager resource. Note: Secret Manager [charges apply](https://cloud.google.com/secret-manager/pricing).
        - `username` string — Required. The username.
        - `passwordSecretVersionName` string — Required. The name of the Secret Manager resource that stores the password, in the form `projects/project-id/secrets/secret-name/versions/version`.
      - `maxConnections` integer — Required. The DLP API will limit its connections to max_connections. Must be 2 or greater.
      - `databaseEngine` 'DATABASE_ENGINE_UNKNOWN' | 'DATABASE_ENGINE_MYSQL' | 'DATABASE_ENGINE_POSTGRES' — Required. The database engine used by the Cloud SQL instance that this connection configures.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/dlp.md) · [All operations](https://skmtc.net/google/apis/dlp/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/dlp/versions/98ced13f7159/schema)
