confluent_schema_registry_cluster
provides a Schema Registry cluster resource that enables creating, editing, and deleting Schema Registry clusters on Confluent Cloud.
resource "confluent_environment" "development" {
display_name = "Development"
lifecycle {
prevent_destroy = true
}
}
data "confluent_schema_registry_region" "example" {
cloud = "AWS"
region = "us-east-2"
package = "ESSENTIALS"
}
resource "confluent_schema_registry_cluster" "essentials" {
package = data.confluent_schema_registry_region.example.package
environment {
id = confluent_environment.development.id
}
region {
# See https://docs.confluent.io/cloud/current/stream-governance/packages.html#stream-governance-regions
# Schema Registry and Kafka clusters can be in different regions as well as different cloud providers,
# but you should to place both in the same cloud and region to restrict the fault isolation boundary.
id = data.confluent_schema_registry_region.example.id
}
lifecycle {
prevent_destroy = true
}
}
The following arguments are supported:
package
- (Required String) The type of the billing package. Accepted values are: ESSENTIALS
and ADVANCED
.environment
(Required Configuration Block) supports the following:
id
- (Required String) The ID of the Environment that the Schema Registry cluster belongs to, for example, env-abc123
.region
(Required Configuration Block) supports the following:
id
- (Required String) The ID of the Schema Registry region that the Schema Registry cluster belongs to, for example, sgreg-1
. See Schema Registry Regions to find a corresponding region ID based on desired cloud provider region and types of the billing package.In addition to the preceding arguments, the following attributes are exported:
id
- (Required String) The ID of the Schema Registry cluster, for example, lsrc-abc123
.api_version
- (Required String) An API Version of the schema version of the Schema Registry cluster, for example, srcm/v2
.kind
- (Required String) A kind of the Schema Registry cluster, for example, Cluster
.rest_endpoint
- (Required String) The HTTP endpoint of the Schema Registry cluster, for example, https://psrc-00000.us-west-2.aws.confluent.cloud
.display_name
- (Required String) The name of the Schema Registry cluster, for example, Stream Governance Package
.resource_name
- (Required String) The Confluent Resource Name of the Schema Registry cluster, for example, crn://confluent.cloud/organization=1111aaaa-11aa-11aa-11aa-111111aaaaaa/environment=env-abc123/schema-registry=lsrc-abc123
.You can import a Schema Registry cluster by using Environment ID and Schema Registry cluster ID, in the format <Environment ID>/<Schema Registry cluster ID>
, for example:
$ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>"
$ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>"
$ terraform import confluent_schema_registry_cluster.example env-abc123/lsrc-abc123