Skip to content

Latest commit

 

History

History
399 lines (300 loc) · 11.7 KB

datastream_connection_profile.html.markdown

File metadata and controls

399 lines (300 loc) · 11.7 KB
subcategory page_title description
Datastream
Google: google_datastream_connection_profile
A set of reusable connection configurations to be used as a source or destination for a stream.

google_datastream_connection_profile

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 oracle_profile.password, mysql_profile.password, mysql_profile.ssl_config.client_key, mysql_profile.ssl_config.client_certificate, mysql_profile.ssl_config.ca_certificate, postgresql_profile.password, forward_ssh_connectivity.password, and forward_ssh_connectivity.private_key will be stored in the raw state as plain-text. Read more about sensitive data in state.

## Example Usage - Datastream Connection Profile Basic
resource "google_datastream_connection_profile" "default" {
	display_name          = "Connection profile"
	location              = "us-central1"
	connection_profile_id = "my-profile"

	gcs_profile {
		bucket    = "my-bucket"
		root_path = "/path"
	}
}
## Example Usage - Datastream Connection Profile Bigquery
resource "google_datastream_connection_profile" "default" {
	display_name          = "Connection profile"
	location              = "us-central1"
	connection_profile_id = "my-profile"

	bigquery_profile {}
}
## Example Usage - Datastream Connection Profile Full
resource "google_datastream_connection_profile" "default" {
	display_name          = "Connection profile"
	location              = "us-central1"
	connection_profile_id = "my-profile"

	gcs_profile {
		bucket    = "my-bucket"
		root_path = "/path"
	}

	forward_ssh_connectivity {
		hostname = "google.com"
		username = "my-user"
		port     = 8022
		password = "swordfish"
	}
}

Example Usage - Datastream Connection Profile Postgres

resource "google_sql_database_instance" "instance" {
    name             = "my-instance"
    database_version = "POSTGRES_14"
    region           = "us-central1"
    settings {
        tier = "db-f1-micro"

        ip_configuration {

            // Datastream IPs will vary by region.
            authorized_networks {
                value = "34.71.242.81"
            }

            authorized_networks {
                value = "34.72.28.29"
            }

            authorized_networks {
                value = "34.67.6.157"
            }

            authorized_networks {
                value = "34.67.234.134"
            }

            authorized_networks {
                value = "34.72.239.218"
            }
        }
    }

    deletion_protection  = "true"
}

resource "google_sql_database" "db" {
    instance = google_sql_database_instance.instance.name
    name     = "db"
}

resource "random_password" "pwd" {
    length = 16
    special = false
}

resource "google_sql_user" "user" {
    name = "user"
    instance = google_sql_database_instance.instance.name
    password = random_password.pwd.result
}

resource "google_datastream_connection_profile" "default" {
    display_name          = "Connection profile"
    location              = "us-central1"
    connection_profile_id = "my-profile"

    postgresql_profile {
        hostname = google_sql_database_instance.instance.public_ip_address
        username = google_sql_user.user.name
        password = google_sql_user.user.password
        database = google_sql_database.db.name
    }
}

Argument Reference

The following arguments are supported:

  • display_name - (Required) Display name.

  • connection_profile_id - (Required) The connection profile identifier.

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


  • labels - (Optional) Labels.

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

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

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

  • bigquery_profile - (Optional) BigQuery warehouse profile.

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

  • forward_ssh_connectivity - (Optional) Forward SSH tunnel 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 oracle_profile 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.

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

  • connection_attributes - (Optional) Connection string attributes

The gcs_profile block supports:

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

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

The mysql_profile 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.

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

The ssl_config block supports:

  • client_key - (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.

  • client_key_set - Indicates whether the clientKey field is set.

  • client_certificate - (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.

  • client_certificate_set - Indicates whether the clientCertificate field is set.

  • ca_certificate - (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.

  • ca_certificate_set - Indicates whether the clientKey field is set.

The postgresql_profile 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 forward_ssh_connectivity 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.

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

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/{{connection_profile_id}}

  • 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.