You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Update schema variable to support full Apache Avro specification (#526)
* first commit
* feat: Update schemas variable to support full Apache Avro specification
* feat: Update schemas variable to support full Apache Avro specification
* docs: updated the type file
* addressed feedback
* addressed feedback
* addressed feedback
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,7 @@ You need the following permissions to run this module.
161
161
| <aname="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id)| The resource group ID where the Event Streams instance is created. |`string`| n/a | yes |
162
162
| <aname="input_resource_keys"></a> [resource\_keys](#input\_resource\_keys)| A list of service credential resource keys to be created for the Event Streams instance. | <pre>list(object({<br/> name = string<br/> key_name = optional(string, null)<br/> role = optional(string, "Manager")<br/> endpoint = optional(string, "public")<br/> }))</pre> |`[]`| no |
163
163
| <aname="input_schema_global_rule"></a> [schema\_global\_rule](#input\_schema\_global\_rule)| Schema global compatibility rule. Allowed values are 'NONE', 'FULL', 'FULL\_TRANSITIVE', 'FORWARD', 'FORWARD\_TRANSITIVE', 'BACKWARD', 'BACKWARD\_TRANSITIVE'. |`string`|`null`| no |
164
-
| <aname="input_schemas"></a> [schemas](#input\_schemas)|The list of schema objects. Include the `schema_id` and the `type` and `name` of the schema in the `schema` object. | <pre>list(object(<br/> {<br/> schema_id = string<br/> schema = object({<br/> type = string<br/> name = string<br/> fields = optional(list(object({<br/> name = string<br/> type = string<br/> })))<br/> })<br/> }<br/> ))</pre>|`[]`| no |
164
+
| <aname="input_schemas"></a> [schemas](#input\_schemas)|List of schema objects. Each schema must include `schema_id` and `schema` definition. Supports full Apache Avro specification with nested structures. [Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-ES_schema_registry#ES_apache_avro_data_format). |`any`|`[]`| no |
165
165
| <aname="input_service_endpoints"></a> [service\_endpoints](#input\_service\_endpoints)| The type of service endpoints. Possible values: 'public', 'private', 'public-and-private'. |`string`|`"public"`| no |
166
166
| <aname="input_skip_es_s2s_iam_authorization_policy"></a> [skip\_es\_s2s\_iam\_authorization\_policy](#input\_skip\_es\_s2s\_iam\_authorization\_policy)| Set to true to skip the creation of an IAM authorization policy that will allow all Event Streams instances in the given resource group access to read from the mirror source instance. This policy is required when creating a mirroring instance, and will only be created if a value is passed in the mirroring input. |`bool`|`false`| no |
167
167
| <aname="input_skip_kms_iam_authorization_policy"></a> [skip\_kms\_iam\_authorization\_policy](#input\_skip\_kms\_iam\_authorization\_policy)| Set to true to skip the creation of an IAM authorization policy that permits all Event Streams database instances in the resource group to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the `kms_key_crn` variable. In addition, no policy is created if var.kms\_encryption\_enabled is set to false. |`bool`|`false`| no |
Copy file name to clipboardExpand all lines: examples/fscloud/variables.tf
-26Lines changed: 0 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -28,32 +28,6 @@ variable "resource_tags" {
28
28
default=[]
29
29
}
30
30
31
-
variable"schemas" {
32
-
type=list(object(
33
-
{
34
-
schema_id =string
35
-
schema =object({
36
-
type =string
37
-
name =string
38
-
})
39
-
}
40
-
))
41
-
description="The list of schema object which contains schema id and format of the schema"
42
-
default=[]
43
-
}
44
-
45
-
variable"topics" {
46
-
type=list(object(
47
-
{
48
-
name =string
49
-
partitions =number
50
-
config =map(string)
51
-
}
52
-
))
53
-
description="List of topics. For lite plan only one topic is allowed."
54
-
default=[]
55
-
}
56
-
57
31
variable"kms_key_crn" {
58
32
type=string
59
33
description="The root key CRN of a Hyper Protect Crypto Service (HPCS) that you want to use for disk encryption. See https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs&interface=ui for more information on integrating HPCS with Event Streams instance."
Copy file name to clipboardExpand all lines: modules/fscloud/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ No resources.
41
41
| <aname="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id)| The resource group ID where the Event Streams instance is created. |`string`| n/a | yes |
42
42
| <aname="input_resource_keys"></a> [resource\_keys](#input\_resource\_keys)| A list of service credential resource keys to be created for the Event Streams instance. | <pre>list(object({<br/> name = string<br/> role = optional(string, "Reader")<br/> endpoint = optional(string, "private")<br/> }))</pre> |`[]`| no |
43
43
| <aname="input_schema_global_rule"></a> [schema\_global\_rule](#input\_schema\_global\_rule)| Schema global compatibility rule. Allowed values are 'NONE', 'FULL', 'FULL\_TRANSITIVE', 'FORWARD', 'FORWARD\_TRANSITIVE', 'BACKWARD', 'BACKWARD\_TRANSITIVE'. |`string`|`null`| no |
44
-
| <aname="input_schemas"></a> [schemas](#input\_schemas)|The list of schema objects. Include the `schema_id` and the `type` and `name` of the schema in the `schema` object. | <pre>list(object(<br/> {<br/> schema_id = string<br/> schema = object({<br/> type = string<br/> name = string<br/> fields = optional(list(object({<br/> name = string<br/> type = string<br/> })))<br/> })<br/> }<br/> ))</pre>|`[]`| no |
44
+
| <aname="input_schemas"></a> [schemas](#input\_schemas)|List of schema objects. Each schema must include `schema_id` and `schema` definition. Supports full Apache Avro specification with nested structures. [Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-ES_schema_registry#ES_apache_avro_data_format). |`any`|`[]`| no |
45
45
| <aname="input_skip_es_s2s_iam_authorization_policy"></a> [skip\_es\_s2s\_iam\_authorization\_policy](#input\_skip\_es\_s2s\_iam\_authorization\_policy)| Set to true to skip the creation of an Event Streams s2s IAM authorization policy to provision an Event Streams mirroring instance. This is required to read from the source cluster. This policy is required when creating mirroring instance. |`bool`|`false`| no |
46
46
| <aname="input_skip_kms_iam_authorization_policy"></a> [skip\_kms\_iam\_authorization\_policy](#input\_skip\_kms\_iam\_authorization\_policy)| Set to true to skip the creation of an IAM authorization policy that permits all Event Streams database instances in the resource group to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the kms\_key\_crn variable. In addition, no policy is created if var.kms\_encryption\_enabled is set to false. |`bool`|`false`| no |
47
47
| <aname="input_tags"></a> [tags](#input\_tags)| The list of tags associated with the Event Streams instance. |`list(string)`|`[]`| no |
Copy file name to clipboardExpand all lines: modules/fscloud/variables.tf
+2-15Lines changed: 2 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -29,23 +29,10 @@ variable "region" {
29
29
}
30
30
31
31
variable"schemas" {
32
-
type=list(object(
33
-
{
34
-
schema_id =string
35
-
schema =object({
36
-
type =string
37
-
name =string
38
-
fields =optional(list(object({
39
-
name =string
40
-
type =string
41
-
})))
42
-
})
43
-
}
44
-
))
45
-
description="The list of schema objects. Include the `schema_id` and the `type` and `name` of the schema in the `schema` object."
32
+
type=any
33
+
description="List of schema objects. Each schema must include `schema_id` and `schema` definition. Supports full Apache Avro specification with nested structures. [Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-ES_schema_registry#ES_apache_avro_data_format)."
46
34
default=[]
47
35
}
48
-
49
36
variable"schema_global_rule" {
50
37
type=string
51
38
description="Schema global compatibility rule. Allowed values are 'NONE', 'FULL', 'FULL_TRANSITIVE', 'FORWARD', 'FORWARD_TRANSITIVE', 'BACKWARD', 'BACKWARD_TRANSITIVE'."
Copy file name to clipboardExpand all lines: solutions/security-enforced/DA-schemas-topics-cbr.md
+61-13Lines changed: 61 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,29 +40,77 @@ The following example includes all the configuration options for topics.
40
40
## Options with schemas <aname="options-with-schemas"></a>
41
41
42
42
-`schema_id` (required): The unique ID to be assigned to schema. If this value is not specified, a generated UUID is assigned.
43
-
-`schema` (required): The schema in JSON format. Supported parameters are: `type`, `name` and `fields` (optional).
43
+
-`schema` (required): The schema definition as a JSON-compatible Terraform object. Supports all [Apache Avro](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-ES_schema_registry#ES_apache_avro_data_format) types including nested structures.
44
44
45
45
The following example includes all the configuration options for schemas.
46
46
47
47
```hcl
48
48
[
49
49
{
50
-
schema_id = "my-es-schema_1"
51
-
schema = {
50
+
schema_id = "job_events_cloud_sync_value_v1"
51
+
schema = {
52
+
type = "record"
53
+
name = "job_events_cloud_sync_value_v1"
54
+
namespace = "envelope"
55
+
fields = [
56
+
{ name = "source", type = "string" },
57
+
{ name = "subject", type = "string" },
58
+
{ name = "time", type = "string" },
59
+
{ name = "datacontenttype", type = "string", default = "application/json" },
60
+
{ name = "producer", type = "string" },
61
+
{
62
+
name = "data"
63
+
type = {
64
+
type = "record"
65
+
name = "payload"
66
+
namespace = "payload"
67
+
fields = [
68
+
{ name = "event_type", type = "string" },
69
+
{ name = "job_id", type = "string" },
70
+
{ name = "metadata", type = ["null", "string"], default = null },
71
+
{ name = "monotonic_ns", type = "long" },
72
+
{ name = "source_instance_id", type = "string" },
73
+
{ name = "source_type_id", type = "string" },
74
+
{ name = "sub_job_id", type = ["null", "string"], default = null }
Copy file name to clipboardExpand all lines: solutions/security-enforced/variables.tf
+2-13Lines changed: 2 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -63,22 +63,11 @@ variable "access_tags" {
63
63
}
64
64
65
65
variable"schemas" {
66
-
type=list(object({
67
-
schema_id =string
68
-
schema =object({
69
-
type =string
70
-
name =string
71
-
fields =optional(list(object({
72
-
name =string
73
-
type =string
74
-
})))
75
-
})
76
-
}))
77
-
description="The list of schema objects. Include the `schema_id`, `type` and `name` of the schema in the `schema` object. Learn more: https://github.com/terraform-ibm-modules/terraform-ibm-event-streams/tree/main/solutions/security-enforced/DA-schemas-topics-cbr.md#options-with-schemas."
66
+
type=any
67
+
description="List of schema objects. Each schema must include `schema_id` and `schema` definition. Supports full Apache Avro specification with nested structures. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-event-streams/tree/main/solutions/security-enforced/DA-schemas-topics-cbr.md#options-with-schemas)."
78
68
default=[]
79
69
}
80
70
81
-
82
71
variable"schema_global_rule" {
83
72
type=string
84
73
description="Schema global compatibility rule. Allowed values are 'NONE', 'FULL', 'FULL_TRANSITIVE', 'FORWARD', 'FORWARD_TRANSITIVE', 'BACKWARD', 'BACKWARD_TRANSITIVE'."
description="The list of schema objects. Include the `schema_id` and the `type` and `name` of the schema in the `schema` object."
131
+
type=any
132
+
description="List of schema objects. Each schema must include `schema_id` and `schema` definition. Supports full Apache Avro specification with nested structures. [Learn more](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-ES_schema_registry#ES_apache_avro_data_format)."
145
133
default=[]
134
+
135
+
validation {
136
+
condition=alltrue([
137
+
forsinvar.schemas:s.schema_id!=""&&s.schema!=null
138
+
])
139
+
error_message="Each schema must have a 'schema_id' and a 'schema' definition."
0 commit comments