Stream Analytics - Event hub Input can't use custom Shared Access Policy

Good Day

I’m quite new to Terraform for Azure and I’ve been struggling for a while to get a Stream Analytics Event hub input to reference a custom Share Access Policy . created for the Event Hub.

When creating the resource “azurerm_stream_analytics_stream_input_eventhub” i am presented the option to select the shared_access_policy_name as an attribute of the resource, however, the only option I am presented with when declaring the shared_access_policy_key is the default primary or secondary keys which relate to the “RootManageSharedAccessKey” created by default when an event hub is created.

Sample code below (all other modules and variables removed)

resource “azurerm_stream_analytics_stream_input_eventhub” “eventhubInput” {
name = “test”
stream_analytics_job_name = “stranalyticstest”
resource_group_name = “testRG”
eventhub_name = “EventHub1”
servicebus_namespace = “EventHubNameSpace1”
shared_access_policy_key = data.azurerm_eventhub_namespace.eventhub-ns.default_primary_key This is the part I’m unsure about
shared_access_policy_name = “SendAndListen”

serialization {
type = “JSON”
encoding = “UTF8”

Any help would be greatly appreciated