Skip to content

Commit

Permalink
still doesn't completely work, seems to need two step creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmservera committed Apr 17, 2024
1 parent 4d7a748 commit ee885de
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 52 deletions.
53 changes: 34 additions & 19 deletions eventgrid/templates/eventgrid.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,24 @@ resource namespace_resource 'Microsoft.EventGrid/namespaces@2023-12-15-preview'
state: 'Enabled'
maximumSessionExpiryInHours: 2
maximumClientSessionsPerAuthenticationName: 2 // to allow for some disconnection test scenarios
}
// routeTopicResourceId: resourceId('Microsoft.EventGrid/namespaces/topics', namespaces_name, custom_topic_name)
routingIdentityInfo: {
type: 'SystemAssigned'
}
}
isZoneRedundant: true
publicNetworkAccess: 'Enabled'
}

resource topics 'topics' = {
name: custom_topic_name
properties: {
publisherType: 'Custom'
inputSchema: 'CloudEventSchemaV1_0'
eventRetentionInDays: 7
}
}

}

// ********************************************************************************************************************
Expand Down Expand Up @@ -109,15 +123,7 @@ resource namespace_devicessubscribe 'Microsoft.EventGrid/namespaces/permissionBi
}
}

resource namespace_test 'Microsoft.EventGrid/namespaces/topics@2023-12-15-preview' = {
parent: namespace_resource
name: custom_topic_name
properties: {
publisherType: 'Custom'
inputSchema: 'CloudEventSchemaV1_0'
eventRetentionInDays: 7
}
}


// ********************************************************************************************************************
// * Create topic spaces
Expand Down Expand Up @@ -147,15 +153,24 @@ resource namespace_topic_spaces_devices 'Microsoft.EventGrid/namespaces/topicSpa
// * Create clients
// ********************************************************************************************************************

module eventgrid_clients 'modules/eventgrid_clients.bicep' = {
name: 'clients'
params: {
namespaces_name: namespaces_name
clients: clients
resource namespaces_name_clients 'Microsoft.EventGrid/namespaces/clients@2023-12-15-preview' = [
for (config, i) in clients: {
parent: namespace_resource
name: config.name
properties: {
authenticationName: '${config.name}-authn-ID'
clientCertificateAuthentication: {
validationScheme: 'ThumbprintMatch'
allowedThumbprints: [
config.thumbprint
]
}
state: 'Enabled'
attributes: {
role: config.role
}
}
}
dependsOn: [
namespace_resource
]
}
]

output namespace_mqtt_hostname string = namespace_resource.properties.topicSpacesConfiguration.hostname
33 changes: 0 additions & 33 deletions eventgrid/templates/modules/eventgrid_clients.bicep

This file was deleted.

4 changes: 4 additions & 0 deletions eventgrid/templates/template.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ module eventhubintegration 'eventhubintegration.bicep' = {
eventhub_name: '${name_base}sink'
topic_name: topic_name
}
dependsOn:[
eventgrid
eventhub
]
}

output namespace_mqtt_hostname string = eventgrid.outputs.namespace_mqtt_hostname

0 comments on commit ee885de

Please sign in to comment.