Skip to content

Commit

Permalink
remote httproutes
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Sep 18, 2023
1 parent b304a1c commit 4c63b7d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 131 deletions.
10 changes: 1 addition & 9 deletions quickstarts/dapr/dapr-azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
ports: {
ui: {
containerPort: 80
provides: frontendRoute.id
}
}
}
Expand All @@ -62,21 +61,14 @@ resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
}
}

resource frontendRoute 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = {
name: 'frontend-route'
properties: {
application: app.id
}
}

resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = {
name: 'gateway'
properties: {
application: app.id
routes: [
{
path: '/'
destination: frontendRoute.id
destination: `http://frontend:80'
}
]
}
Expand Down
10 changes: 1 addition & 9 deletions quickstarts/dapr/dapr.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
ports: {
ui: {
containerPort: 80
provides: frontendRoute.id
}
}
}
Expand All @@ -65,21 +64,14 @@ resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
}
}

resource frontendRoute 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = {
name: 'frontend-route'
properties: {
application: app.id
}
}

resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = {
name: 'gateway'
properties: {
application: app.id
routes: [
{
path: '/'
destination: frontendRoute.id
destination: 'http://frontend:80'
}
]
}
Expand Down
11 changes: 2 additions & 9 deletions reference-apps/container-app-store/iac/app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,14 @@ resource go_app 'Applications.Core/containers@2022-03-15-privatepreview' = {
}
}

resource node_app_route 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = {
name: 'node-app-route'
properties: {
application: app.id
}
}

resource node_app_gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = {
name: 'node-app-gateway'
properties: {
application: app.id
routes: [
{
path: '/'
destination: node_app_route.id
destination: 'http://nodeapp:80'
}
]
}
Expand All @@ -63,7 +56,7 @@ resource node_app 'Applications.Core/containers@2022-03-15-privatepreview' = {
ports: {
web: {
containerPort: 3000
provides: node_app_route.id
port: 80
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions reference-apps/container-app-store/iac/infra-selfhosted.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,12 @@ resource redisContainer 'Applications.Core/containers@2022-03-15-privatepreview'
ports: {
redis: {
containerPort: 6379
provides: redisRoute.id
}
}
}
}
}

resource redisRoute 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = {
name: 'redis-route'
properties: {
application: applicationId
port: 6379
}
}

resource statestore 'Applications.Dapr/stateStores@2022-03-15-privatepreview' = {
name: 'orders'
properties: {
Expand All @@ -38,7 +29,7 @@ resource statestore 'Applications.Dapr/stateStores@2022-03-15-privatepreview' =
version: 'v1'
metadata: {
// redisHost: '${service.metadata.name}.${namespace}.svc.cluster.local:${service.spec.ports[0].port}'
redisHost: '${redisRoute.properties.hostname}:${redisRoute.properties.port}'
redisHost: '${redisContainer.name}:${redisContainer.containerPort}'
redisPassword: ''
}
}
Expand Down
13 changes: 2 additions & 11 deletions reference-apps/eshop/iac/infra/aws.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,12 @@ resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privateprevi
ports: {
rabbitmq: {
containerPort: 5672
provides: rabbitmqRoute.id
}
}
}
}
}

resource rabbitmqRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = {
name: 'rabbitmq-route-eshop-event-bus'
properties: {
application: application
port: 5672
}
}

// Portable Resources ----------------------------------------------------------------------------
// TODO: Move the portable resource definitions into the application and use Recipes instead

Expand Down Expand Up @@ -295,8 +286,8 @@ resource rabbitmq 'Applications.Messaging/rabbitMQQueues@2022-03-15-privateprevi
environment: environment
resourceProvisioning: 'manual'
queue: 'eshop-event-bus'
host: rabbitmqRoute.properties.hostname
port: rabbitmqRoute.properties.port
host: rabbitmqContainer.name
port: rabbitmqContainer.port
username: 'guest'
secrets: {
password: 'guest'
Expand Down
Loading

0 comments on commit 4c63b7d

Please sign in to comment.