Skip to content

googleDatastreamConnectionProfile

A set of reusable connection configurations to be used as a source or destination for a stream.

To get more information about ConnectionProfile, see:

\~> Warning: All arguments including oracleProfilePassword, mysqlProfilePassword, mysqlProfileSslConfigClientKey, mysqlProfileSslConfigClientCertificate, mysqlProfileSslConfigCaCertificate, postgresqlProfilePassword, forwardSshConnectivityPassword, and forwardSshConnectivityPrivateKey will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage - Datastream Connection Profile Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.datastreamConnectionProfile.DatastreamConnectionProfile(
  this,
  "default",
  {
    connection_profile_id: "my-profile",
    display_name: "Connection profile",
    gcs_profile: [
      {
        bucket: "my-bucket",
        root_path: "/path",
      },
    ],
    location: "us-central1",
  }
);

Example Usage - Datastream Connection Profile Bigquery Private Connection

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleComputeNetworkDefault = new google.computeNetwork.ComputeNetwork(
  this,
  "default",
  {
    name: "my-network",
  }
);
const googleDatastreamPrivateConnectionPrivateConnection =
  new google.datastreamPrivateConnection.DatastreamPrivateConnection(
    this,
    "private_connection",
    {
      display_name: "Connection profile",
      labels: [
        {
          key: "value",
        },
      ],
      location: "us-central1",
      private_connection_id: "my-connection",
      vpc_peering_config: [
        {
          subnet: "10.0.0.0/29",
          vpc: googleComputeNetworkDefault.id,
        },
      ],
    }
  );
const googleDatastreamConnectionProfileDefault =
  new google.datastreamConnectionProfile.DatastreamConnectionProfile(
    this,
    "default_2",
    {
      bigquery_profile: [{}],
      connection_profile_id: "my-profile",
      display_name: "Connection profile",
      location: "us-central1",
      private_connectivity: [
        {
          private_connection:
            googleDatastreamPrivateConnectionPrivateConnection.id,
        },
      ],
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleDatastreamConnectionProfileDefault.overrideLogicalId("default");

Example Usage - Datastream Connection Profile Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.datastreamConnectionProfile.DatastreamConnectionProfile(
  this,
  "default",
  {
    connection_profile_id: "my-profile",
    display_name: "Connection profile",
    forward_ssh_connectivity: [
      {
        hostname: "google.com",
        password: "swordfish",
        port: 8022,
        username: "my-user",
      },
    ],
    gcs_profile: [
      {
        bucket: "my-bucket",
        root_path: "/path",
      },
    ],
    labels: [
      {
        key: "value",
      },
    ],
    location: "us-central1",
  }
);

Example Usage - Datastream Connection Profile Postgres

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
import * as random from "./.gen/providers/random";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google, random.
For a more precise conversion please use the --provider flag in convert.*/
const googleSqlDatabaseInstanceInstance =
  new google.sqlDatabaseInstance.SqlDatabaseInstance(this, "instance", {
    database_version: "POSTGRES_14",
    deletion_protection: "true",
    name: "my-instance",
    region: "us-central1",
    settings: [
      {
        ip_configuration: [
          {
            authorized_networks: [
              {
                value: "34.71.242.81",
              },
              {
                value: "34.72.28.29",
              },
              {
                value: "34.67.6.157",
              },
              {
                value: "34.67.234.134",
              },
              {
                value: "34.72.239.218",
              },
            ],
          },
        ],
        tier: "db-f1-micro",
      },
    ],
  });
const randomPasswordPwd = new random.password.Password(this, "pwd", {
  length: 16,
  special: false,
});
const googleSqlDatabaseDb = new google.sqlDatabase.SqlDatabase(this, "db", {
  instance: googleSqlDatabaseInstanceInstance.name,
  name: "db",
});
const googleSqlUserUser = new google.sqlUser.SqlUser(this, "user", {
  instance: googleSqlDatabaseInstanceInstance.name,
  name: "user",
  password: randomPasswordPwd.result,
});
new google.datastreamConnectionProfile.DatastreamConnectionProfile(
  this,
  "default",
  {
    connection_profile_id: "my-profile",
    display_name: "Connection profile",
    location: "us-central1",
    postgresql_profile: [
      {
        database: googleSqlDatabaseDb.name,
        hostname: googleSqlDatabaseInstanceInstance.publicIpAddress,
        password: googleSqlUserUser.password,
        username: googleSqlUserUser.name,
      },
    ],
  }
);

Argument Reference

The following arguments are supported:

  • displayName - (Required) Display name.

  • connectionProfileId - (Required) The connection profile identifier.

  • location - (Required) The name of the location this connection profile is located in.


  • labels - (Optional) Labels.

  • oracleProfile - (Optional) Oracle database profile. Structure is documented below.

  • gcsProfile - (Optional) Cloud Storage bucket profile. Structure is documented below.

  • mysqlProfile - (Optional) MySQL database profile. Structure is documented below.

  • bigqueryProfile - (Optional) BigQuery warehouse profile.

  • postgresqlProfile - (Optional) PostgreSQL database profile. Structure is documented below.

  • forwardSshConnectivity - (Optional) Forward SSH tunnel connectivity. Structure is documented below.

  • privateConnectivity - (Optional) Private connectivity. Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The oracleProfile block supports:

  • hostname - (Required) Hostname for the Oracle connection.

  • port - (Optional) Port for the Oracle connection.

  • username - (Required) Username for the Oracle connection.

  • password - (Required) Password for the Oracle connection. Note: This property is sensitive and will not be displayed in the plan.

  • databaseService - (Required) Database for the Oracle connection.

  • connectionAttributes - (Optional) Connection string attributes

The gcsProfile block supports:

  • bucket - (Required) The Cloud Storage bucket name.

  • rootPath - (Optional) The root path inside the Cloud Storage bucket.

The mysqlProfile block supports:

  • hostname - (Required) Hostname for the MySQL connection.

  • port - (Optional) Port for the MySQL connection.

  • username - (Required) Username for the MySQL connection.

  • password - (Required) Password for the MySQL connection. Note: This property is sensitive and will not be displayed in the plan.

  • sslConfig - (Optional) SSL configuration for the MySQL connection. Structure is documented below.

The sslConfig block supports:

  • clientKey - (Optional) PEM-encoded private key associated with the Client Certificate. If this field is used then the 'client_certificate' and the 'ca_certificate' fields are mandatory. Note: This property is sensitive and will not be displayed in the plan.

  • clientKeySet - (Output) Indicates whether the clientKey field is set.

  • clientCertificate - (Optional) PEM-encoded certificate that will be used by the replica to authenticate against the source database server. If this field is used then the 'clientKey' and the 'caCertificate' fields are mandatory. Note: This property is sensitive and will not be displayed in the plan.

  • clientCertificateSet - (Output) Indicates whether the clientCertificate field is set.

  • caCertificate - (Optional) PEM-encoded certificate of the CA that signed the source database server's certificate. Note: This property is sensitive and will not be displayed in the plan.

  • caCertificateSet - (Output) Indicates whether the clientKey field is set.

The postgresqlProfile block supports:

  • hostname - (Required) Hostname for the PostgreSQL connection.

  • port - (Optional) Port for the PostgreSQL connection.

  • username - (Required) Username for the PostgreSQL connection.

  • password - (Required) Password for the PostgreSQL connection. Note: This property is sensitive and will not be displayed in the plan.

  • database - (Required) Database for the PostgreSQL connection.

The forwardSshConnectivity block supports:

  • hostname - (Required) Hostname for the SSH tunnel.

  • username - (Required) Username for the SSH tunnel.

  • port - (Optional) Port for the SSH tunnel.

  • password - (Optional) SSH password. Note: This property is sensitive and will not be displayed in the plan.

  • privateKey - (Optional) SSH private key. Note: This property is sensitive and will not be displayed in the plan.

The privateConnectivity block supports:

  • privateConnection - (Required) A reference to a private connection resource. Format: projects/{project}/locations/{location}/privateConnections/{name}

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/connectionProfiles/{{connectionProfileId}}

  • name - The resource's name.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

ConnectionProfile can be imported using any of these accepted formats:

$ terraform import google_datastream_connection_profile.default projects/{{project}}/locations/{{location}}/connectionProfiles/{{connection_profile_id}}
$ terraform import google_datastream_connection_profile.default {{project}}/{{location}}/{{connection_profile_id}}
$ terraform import google_datastream_connection_profile.default {{location}}/{{connection_profile_id}}

User Project Overrides

This resource supports User Project Overrides.