confluent_business_metadata
provides a Business Metadata resource that enables creating, editing, and deleting Business Metadata 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_business_metadata" "pii" {
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 = "PII"
description = "PII metadata"
attribute_definition {
name = "team"
}
attribute_definition {
name = "email"
}
lifecycle {
prevent_destroy = true
}
}
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_business_metadata" "pii" {
name = "PII"
description = "PII metadata"
attribute_definition {
name = "team"
}
attribute_definition {
name = "email"
}
lifecycle {
prevent_destroy = true
}
}
The following arguments are supported:
name
- (Required String) The name of the Business Metadata, for example, PII
. The name must not be empty and consist of a letter followed by a sequence of letter, number, space, or _ characters.attribute_definition
- (Optional List) The list of attribute definitions (see Business Metadata for more details):
name
- (Required String) The name of the attribute.is_optional
- (Optional Boolean) An optional flag to control whether the attribute should be optional or required. The default value is false
.default_value
- (Optional String) The default value of this attribute.description
- (Optional String) The description of this attribute.description
- (Optional String) The description of the Business Metadata.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.In addition to the preceding arguments, the following attributes are exported:
id
- (Required String) The ID of the Business Metadata, in the format <Schema Registry cluster ID>/<Business Metadata name>
, for example, lsrc-8wrx70/PII
.version
- (Required Integer) The version of the Business Metadata, for example, 1
.attribute_definition
- (Optional List) The list of attribute definitions (see Business Metadata for more details):
type
- (Required String) The type of the attribute, it always returns string
.options
- (Optional Map) Block for the attribute options:
applicableEntityTypes
- (Optional String) The entity types that the attribute is applicable, it always returns [\"cf_entity\"]
.maxStrLength
- (Optional String) The maximum length of the string value, it always returns 5000
.You can import a Business Metadata by using the Schema Registry cluster ID, Business Metadata name in the format <Schema Registry cluster ID>/<Business Metadata 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_business_metadata.pii lsrc-8wrx70/PII
The following end-to-end example might help to get started with Stream Catalog: