Skip to content

Commit 37c0893

Browse files
authored
astra_cdc: minor doc improvements (#462)
1 parent 8f78102 commit 37c0893

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

docs/resources/cdc_v3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ output "streaming_data_topic1" {
115115

116116
### Read-Only
117117

118-
- `data_topics` (Map of Map of String) Map of CDC data topics for each table in each region. Key is the region in the format `<region>`,
118+
- `data_topics` (Map of Map of String) Map of CDC data topics for each table in each region. Use the region as the first key and the keyspace.table as the second key. For example, astra_cdc.mycdc.data_topics['us-east1']['ks1.table1'].
119119

120120
<a id="nestedatt--regions"></a>
121121
### Nested Schema for `regions`

internal/provider/resource_cdc_v3.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ func (r *CDCResource) Schema(_ context.Context, req resource.SchemaRequest, resp
120120
},
121121
"data_topics": schema.MapAttribute{
122122
Description: "Map of CDC data topics for each table in each region. " +
123-
"Key is the region in the format `<region>`, ",
123+
"Use the region as the first key and the keyspace.table as the second key. " +
124+
"For example, astra_cdc.mycdc.data_topics['us-east1']['ks1.table1'].",
124125
Computed: true,
125126
ElementType: types.MapType{
126127
ElemType: types.StringType,
@@ -331,18 +332,14 @@ func (m *CDCResourceModel) setDataTopics() {
331332
dataTopicsMap := map[string]attr.Value{}
332333

333334
for _, region := range m.Regions {
334-
regionName := region.Region.ValueString()
335335
regionDataTopics := make(map[string]attr.Value)
336336

337337
for _, table := range m.Tables {
338338
keyspaceTable := fmt.Sprintf("%s.%s", table.Keyspace.ValueString(), table.Table.ValueString())
339339
topicFQDN := calculateCDCDataTopicName(region.StreamingTenant.ValueString(), m.DatabaseID.ValueString(), table.Keyspace.ValueString(), table.Table.ValueString())
340340
regionDataTopics[keyspaceTable] = types.StringValue(topicFQDN)
341341
}
342-
dataTopicsMap[regionName] = types.MapValueMust(
343-
types.StringType,
344-
regionDataTopics,
345-
)
342+
dataTopicsMap[region.Region.ValueString()] = types.MapValueMust(types.StringType, regionDataTopics)
346343
}
347344

348345
m.DataTopics = types.MapValueMust(types.MapType{ElemType: types.StringType}, dataTopicsMap)

0 commit comments

Comments
 (0)