Skip to content

Commit

Permalink
Merge pull request #23804 from bschaatsbergen/add-zookeeper-connect-s…
Browse files Browse the repository at this point in the history
…tring-tls-to-cluster-d

Add `zookeeper_connect_string_tls` to MSK cluster data source
  • Loading branch information
ewbankkit authored Mar 22, 2022
2 parents 4083f34 + 93d274a commit f3d05ab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/23804.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/aws_msk_cluster: Add `zookeeper_connect_string_tls` attribute
```
5 changes: 5 additions & 0 deletions internal/service/kafka/cluster_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func DataSourceCluster() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"zookeeper_connect_string_tls": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -116,6 +120,7 @@ func dataSourceClusterRead(d *schema.ResourceData, meta interface{}) error {
}

d.Set("zookeeper_connect_string", SortEndpointsString(aws.StringValue(cluster.ZookeeperConnectString)))
d.Set("zookeeper_connect_string_tls", SortEndpointsString(aws.StringValue(cluster.ZookeeperConnectStringTls)))

d.SetId(aws.StringValue(cluster.ClusterArn))

Expand Down
1 change: 1 addition & 0 deletions internal/service/kafka/cluster_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestAccKafkaClusterDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "number_of_broker_nodes", resourceName, "number_of_broker_nodes"),
resource.TestCheckResourceAttrPair(dataSourceName, "tags.%", resourceName, "tags.%"),
resource.TestCheckResourceAttrPair(dataSourceName, "zookeeper_connect_string", resourceName, "zookeeper_connect_string"),
resource.TestCheckResourceAttrPair(dataSourceName, "zookeeper_connect_string_tls", resourceName, "zookeeper_connect_string_tls"),
),
},
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/msk_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ In addition to all arguments above, the following attributes are exported:
* `number_of_broker_nodes` - Number of broker nodes in the cluster.
* `tags` - Map of key-value pairs assigned to the cluster.
* `zookeeper_connect_string` - A comma separated list of one or more hostname:port pairs to use to connect to the Apache Zookeeper cluster. The returned values are sorted alphbetically. The AWS API may not return all endpoints, so this value is not guaranteed to be stable across applies.
* `zookeeper_connect_string_tls` - A comma separated list of one or more hostname:port pairs to use to connect to the Apache Zookeeper cluster via TLS. The returned values are sorted alphabetically. The AWS API may not return all endpoints, so this value is not guaranteed to be stable across applies.

0 comments on commit f3d05ab

Please sign in to comment.