confluent_schema_exporter
provides a Schema Exporter resource that enables creating, editing, and deleting Schema Exporters on Confluent Cloud.
provider "confluent" {
cloud_api_key = var.confluent_cloud_api_key # optionally use CONFLUENT_CLOUD_API_KEY env var
cloud_api_secret = var.confluent_cloud_api_secret # optionally use CONFLUENT_CLOUD_API_SECRET env var
}
resource "confluent_schema_exporter" "main" {
schema_registry_cluster {
id = confluent_schema_registry_cluster.essentials.id
}
rest_endpoint = confluent_schema_registry_cluster.essentials.rest_endpoint
credentials {
key = "<Schema Registry API Key for confluent_schema_registry_cluster.essentials>"
secret = "<Schema Registry API Secret for confluent_schema_registry_cluster.essentials>"
}
name = "test-exporter"
subjects = ["foo"]
destination_schema_registry_cluster {
rest_endpoint = confluent_schema_registry_cluster.destination.rest_endpoint
credentials {
key = "<Schema Registry API Key for confluent_schema_registry_cluster.destination>"
secret = "<Schema Registry API Secret for confluent_schema_registry_cluster.destination>"
}
}
}
provider "confluent" {
schema_registry_id = var.schema_registry_id # optionally use SCHEMA_REGISTRY_ID env var
schema_registry_rest_endpoint = var.schema_registry_rest_endpoint # optionally use SCHEMA_REGISTRY_REST_ENDPOINT env var
schema_registry_api_key = var.schema_registry_api_key # optionally use SCHEMA_REGISTRY_API_KEY env var
schema_registry_api_secret = var.schema_registry_api_secret # optionally use SCHEMA_REGISTRY_API_SECRET env var
}
resource "confluent_schema_exporter" "main" {
name = "test-exporter"
subjects = ["foo"]
destination_schema_registry_cluster {
rest_endpoint = confluent_schema_registry_cluster.destination.rest_endpoint
credentials {
key = "<Schema Registry API Key for confluent_schema_registry_cluster.destination>"
secret = "<Schema Registry API Secret for confluent_schema_registry_cluster.destination>"
}
}
}
The following arguments are supported:
schema_registry_cluster
- (Optional Configuration Block) supports the following:
id
- (Required String) The ID of the Schema Registry cluster, for example, lsrc-abc123
.rest_endpoint
- (Optional String) The REST endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-central1.gcp.confluent.cloud:443
).credentials
(Optional Configuration Block) supports the following:
key
- (Required String) The Schema Registry API Key.secret
- (Required String, Sensitive) The Schema Registry API Secret.name
- (Required String) Name of the Schema Exporter.context_type
- (Optional String) Context type of the exporter. Accepted values are: CUSTOM
, NONE
or AUTO
. Defaults to AUTO
.context
- (Optional String) Customized context of the exporter if context_type
is set to CUSTOM
.subject_rename_format
- (Optional String) Format string for the subject name in the destination cluster, which may contain ${subject}
as a placeholder for the originating subject name. For example, dc_${subject}
for the subject orders will map to the destination subject name dc_orders
.subjects
- (Optional List of Strings) Name of each exporter subject.destination_schema_registry_cluster
- (Required Configuration Block) supports the following:
rest_endpoint
- (Required String) The REST endpoint of the destination Schema Registry cluster, for example, https://pkc-00000.us-central1.gcp.confluent.cloud:443
).credentials
(Required Configuration Block) supports the following:key
- (Required String) The Schema Registry API Key.secret
- (Required String, Sensitive) The Schema Registry API Secret.config
- (Optional Map) Block for custom nonsensitive configuration properties:
name
- (Required String) The configuration setting name.value
- (Required String) The configuration setting value.status
- (Optional String) The status of the schema exporter. Accepted values are: RUNNING
and PAUSED
.reset_on_update
- (Optional Boolean) The flag to control whether to reset the exporter when updating configs. Defaults to false
.In addition to the preceding arguments, the following attributes are exported:
id
- (Required String) The ID of the Schema Exporter, in the format <Schema Registry cluster ID>/<Schema Exporter name>
, for example, lsrc-8wrx70/exporter1
.You can import a Schema Exporter by using the Schema Registry cluster ID, Schema Exporter name in the format <Schema Registry cluster ID>/<Schema Exporter name>
, for example:
$ export IMPORT_SCHEMA_REGISTRY_API_KEY="<schema_registry_api_key>"
$ export IMPORT_SCHEMA_REGISTRY_API_SECRET="<schema_registry_api_secret>"
$ export IMPORT_SCHEMA_REGISTRY_REST_ENDPOINT="<schema_registry_rest_endpoint>"
$ terraform import confluent_schema_exporter.main lsrc-8wrx70/test-exporter