cloudera.cloud.dw_connector module – Create, update, delete, and test CDP Data Warehouse Database Connectors

Note

This module is part of the cloudera.cloud collection (version 3.3.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cloudera.cloud.

To use it in a playbook, specify: cloudera.cloud.dw_connector.

New in cloudera.cloud 3.4.0

Synopsis

  • Create, update, and delete CDP Data Warehouse Database Connectors.

  • Supports present, absent, and tested states.

  • The tested state implies present and always executes a connector test job, making it analogous to the restarted state found in other Ansible modules.

  • The module supports check_mode.

Parameters

Parameter

Comments

access_key

string

If provided, the Cloudera on cloud API will use this value as its access key.

If not provided, the API will attempt to use the value from the environment variable CDP_ACCESS_KEY_ID.

Required if private_key is provided.

Mutually exclusive with credentials_path.

cluster_id

aliases: id

string / required

The identifier of the Data Warehouse Cluster.

config

dictionary

Connector configuration in key-value format.

connector_id

aliases: connector_identifier

string

The ID of the connector.

When specified, used as the primary lookup key and takes precedence over name.

credentials_path

string

If provided, the Cloudera on cloud API will use this value as its credentials path.

If not provided, the API will attempt to use the value from the environment variable CDP_CREDENTIALS_PATH.

Default: "~/.cdp/credentials"

debug

aliases: debug_endpoints

boolean

If true, the module will capture the Cloudera on cloud HTTP log and return it in the sdk_out and sdk_out_lines fields.

Choices:

  • false ← (default)

  • true

description

string

User-provided description for the connector.

endpoint

aliases: endpoint_url, url

string

The Cloudera on cloud API endpoint to use.

If not provided, the API will attempt to use the value from the environment variable CDP_ENDPOINT_URL.

Mutually exclusive with endpoint_region.

endpoint_region

aliases: cdp_endpoint_region, cdp_region, region

string

Specify the Cloudera on cloud API endpoint region.

See Cloudera Control Plane regions for more information.

If not provided, the API will attempt to use the value from the environment variable CDP_REGION.

default is an alias for the us-west-1 region.

Mutually exclusive with endpoint.

Choices:

  • "default"

  • "us-west-1" ← (default)

  • "eu-1"

  • "ap-1"

endpoint_tls

aliases: verify_endpoint_tls, verify_tls, verify_api_tls

boolean

Verify the TLS certificates for the Cloudera on cloud API endpoint.

Choices:

  • false

  • true ← (default)

http_agent

aliases: agent_header

string

The HTTP user agent to use for Cloudera on cloud API requests.

Default: "cloudera.cloud"

name

string

The display name of the connector.

Required when state is present or tested.

Used as the primary lookup key when connector_id is not specified.

Must contain only alphanumeric characters (A-Z, a-z, 0-9).

private_key

string

If provided, the Cloudera on cloud API will use this value as its private key.

If not provided, the API will attempt to use the value from the environment variable CDP_PRIVATE_KEY.

Required if access_key is provided.

profile

string

If provided, the Cloudera on cloud API will use this value as its profile.

If not provided, the API will attempt to use the value from the environment variable CDP_PROFILE.

Default: "default"

state

string

The declarative state of the connector.

present creates the connector if it does not exist, or updates mutable fields if they differ (idempotent).

absent deletes the connector if it exists (idempotent).

tested implies present and always executes a connector test job, setting changed=True regardless of whether the connector was modified.

Choices:

  • "present" ← (default)

  • "absent"

  • "tested"

strict

aliases: strict_errors

boolean

Legacy CDPy SDK error handling.

Choices:

  • false ← (default)

  • true

template

string

The template of the connector.

Required only when creating a new connector; not needed when updating an existing one.

This field is immutable after creation; the module will fail if the requested template differs from the existing connector’s template. Delete and recreate the connector to change its template.

Examples

# Note: These examples do not set authentication details.

- name: Create a connector
  cloudera.cloud.dw_connector:
    cluster_id: example-cluster-id
    name: my-iceberg-connector
    template: iceberg
    description: "Iceberg connector for production"
    config:
      connector.name: iceberg
      iceberg.catalog.type: hive_metastore

- name: Ensure a connector exists (idempotent)
  cloudera.cloud.dw_connector:
    cluster_id: example-cluster-id
    name: my-hive-connector
    template: hive
    state: present

- name: Run a connectivity test against an existing connector
  cloudera.cloud.dw_connector:
    cluster_id: example-cluster-id
    name: my-iceberg-connector
    template: iceberg
    state: tested
  register: test_result

- name: Use the test job ID
  ansible.builtin.debug:
    msg: "Test job ID: {{ test_result.test_job.jobId }}"

- name: Delete a connector by name
  cloudera.cloud.dw_connector:
    cluster_id: example-cluster-id
    name: my-iceberg-connector
    state: absent

- name: Delete a connector by ID
  cloudera.cloud.dw_connector:
    cluster_id: example-cluster-id
    connector_id: example-connector-id
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

connector

dictionary

The details about the CDP Data Warehouse Database Connector.

Returned: always

config

dictionary

The connector configuration in key-value format.

Returned: when available

createdAt

integer

The timestamp when the connector was created.

Returned: always

createdBy

string

The CRN of the user who created the connector.

Returned: always

crn

string

The CRN of the connector.

Returned: always

description

string

User-provided description.

Returned: when available

id

string

The unique identifier of the connector.

Returned: always

name

string

The display name of the connector.

Returned: always

template

string

The template of the connector.

Returned: always

updatedAt

integer

The timestamp when the connector was last updated.

Returned: always

updatedBy

string

The CRN of the user who last updated the connector.

Returned: always

sdk_out

string

Returns the captured CDP SDK log.

Returned: when debug is true

sdk_out_lines

list / elements=string

Returns a list of each line of the captured CDP SDK log.

Returned: when debug is true

test_job

dictionary

The details of the connector test job.

Only returned when state is tested.

Returned: when state is tested

jobId

string

The ID of the created test job.

Returned: when not in check mode

Authors

  • Webster Mudge (@wmudge)