Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Sep 20, 2023
1 parent 57d591c commit a9566da
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 302 deletions.
52 changes: 0 additions & 52 deletions reference-apps/eshop/iac/eshop.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ module basket 'services/basket.bicep' = {
AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
gatewayName: networking.outputs.gateway
identityHttpName: networking.outputs.identityHttp
basketHttpName: networking.outputs.basketHttp
basketGrpcName: networking.outputs.basketGrpc
rabbitmqName: links.outputs.rabbitmq
redisBasketName: links.outputs.redisBasket
TAG: TAG
Expand All @@ -145,8 +142,6 @@ module catalog 'services/catalog.bicep' = {
APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY
AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED
AZURESTORAGEENABLED: AZURESTORAGEENABLED
catalogGrpcName: networking.outputs.catalogGrpc
catalogHttpName: networking.outputs.catalogHttp
gatewayName: networking.outputs.gateway
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
rabbitmqName: links.outputs.rabbitmq
Expand All @@ -161,18 +156,11 @@ module identity 'services/identity.bicep' = {
params: {
application: eshop.id
APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY
basketHttpName: networking.outputs.basketHttp
ENABLEDEVSPACES: ENABLEDEVSPACES
gatewayName: networking.outputs.gateway
identityHttpName: networking.outputs.identityHttp
orderingHttpName: networking.outputs.orderingHttp
redisKeystoreName: links.outputs.redisKeystore
sqlIdentityDbName: links.outputs.sqlIdentityDb
TAG: TAG
webhooksclientHttpName: networking.outputs.webhooksclientHttp
webhooksHttpName: networking.outputs.webhooksHttp
webmvcHttpName: networking.outputs.webmvcHttp
webshoppingaggHttpName: networking.outputs.webshoppingaggHttp
}
}

Expand All @@ -182,15 +170,8 @@ module ordering 'services/ordering.bicep' = {
application: eshop.id
APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY
AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED
basketHttpName: networking.outputs.basketHttp
catalogHttpName: networking.outputs.catalogHttp
gatewayName: networking.outputs.gateway
identityHttpName: networking.outputs.identityHttp
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
orderbgtasksHttpName: networking.outputs.orderbgtasksHttp
orderingGrpcName: networking.outputs.orderingGrpc
orderingHttpName: networking.outputs.orderingHttp
orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp
rabbitmqName: links.outputs.rabbitmq
redisKeystoreName: links.outputs.redisKeystore
sqlOrderingDbName: links.outputs.sqlOrderingDb
Expand All @@ -206,7 +187,6 @@ module payment 'services/payment.bicep' = {
APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY
AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
paymentHttpName: networking.outputs.paymentHttp
rabbitmqName: links.outputs.rabbitmq
TAG: TAG
serviceBusConnectionString: (AZURESERVICEBUSENABLED == 'True') ? azure.outputs.serviceBusAuthConnectionString : ''
Expand All @@ -217,7 +197,6 @@ module seq 'services/seq.bicep' = {
name: 'seq'
params: {
application: eshop.id
seqHttpName: networking.outputs.seqHttp
}
}

Expand All @@ -227,15 +206,9 @@ module web 'services/web.bicep' = {
application: eshop.id
APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY
gatewayName: networking.outputs.gateway
identityHttpName: networking.outputs.identityHttp
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp
redisKeystoreName: links.outputs.redisKeystore
TAG: TAG
webmvcHttpName: networking.outputs.webmvcHttp
webshoppingaggHttpName: networking.outputs.webshoppingaggHttp
webshoppingapigwHttpName: networking.outputs.webshoppingapigwHttp
webspaHttpName: networking.outputs.webspaHttp
}
}

Expand All @@ -245,13 +218,10 @@ module webhooks 'services/webhooks.bicep' = {
application: eshop.id
AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED
gatewayName: networking.outputs.gateway
identityHttpName: networking.outputs.identityHttp
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
rabbitmqName: links.outputs.rabbitmq
sqlWebhooksDbName: links.outputs.sqlWebhooksDb
TAG: TAG
webhooksclientHttpName: networking.outputs.webhooksclientHttp
webhooksHttpName: networking.outputs.webhooksHttp
serviceBusConnectionString: (AZURESERVICEBUSENABLED == 'True') ? azure.outputs.serviceBusAuthConnectionString : ''
}
}
Expand All @@ -260,21 +230,10 @@ module webshopping 'services/webshopping.bicep' = {
name: 'webshopping'
params: {
application: eshop.id
basketGrpcName: networking.outputs.basketGrpc
basketHttpName: networking.outputs.basketHttp
catalogGrpcName: networking.outputs.catalogGrpc
catalogHttpName: networking.outputs.catalogHttp
gatewayName: networking.outputs.gateway
identityHttpName: networking.outputs.identityHttp
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
orderingGrpcName: networking.outputs.orderingGrpc
orderingHttpName: networking.outputs.basketHttp
paymentHttpName: networking.outputs.paymentHttp
rabbitmqName: links.outputs.rabbitmq
TAG: TAG
webshoppingaggHttpName: networking.outputs.webshoppingaggHttp
webshoppingapigwHttp2Name: networking.outputs.webshoppingapigwHttp2
webshoppingapigwHttpName: networking.outputs.webshoppingapigwHttp
}
}

Expand All @@ -283,18 +242,7 @@ module webstatus 'services/webstatus.bicep' = {
params: {
application: eshop.id
APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY
basketHttpName: networking.outputs.basketHttp
catalogHttpName: networking.outputs.catalogHttp
identityHttpName: networking.outputs.identityHttp
ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE
orderbgtasksHttpName: networking.outputs.orderbgtasksHttp
orderingHttpName: networking.outputs.orderingHttp
orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp
paymentHttpName: networking.outputs.paymentHttp
TAG: TAG
webmvcHttpName: networking.outputs.webmvcHttp
webshoppingaggHttpName: networking.outputs.webshoppingaggHttp
webspaHttpName: networking.outputs.webspaHttp
webstatusHttpName: networking.outputs.webstatusHttp
}
}
3 changes: 2 additions & 1 deletion reference-apps/eshop/iac/infra/aws.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privateprevi
ports: {
rabbitmq: {
containerPort: 5672
port: 5672
}
}
}
Expand Down Expand Up @@ -287,7 +288,7 @@ resource rabbitmq 'Applications.Messaging/rabbitMQQueues@2022-03-15-privateprevi
resourceProvisioning: 'manual'
queue: 'eshop-event-bus'
host: rabbitmqContainer.name
port: rabbitmqContainer.port
port: rabbitmqContainer.properties.container.ports.rabbitmq.port
username: 'guest'
secrets: {
password: 'guest'
Expand Down
26 changes: 13 additions & 13 deletions reference-apps/eshop/iac/infra/containers.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ resource rabbitmq 'Applications.Messaging/rabbitMQQueues@2022-03-15-privateprevi
resourceProvisioning: 'manual'
queue: 'eshop-event-bus'
host: rabbitmqContainer.name
port: rrabbitmqContainer.port
port: rabbitmqContainer.properties.container.ports.rabbitmq.port
username: 'guest'
secrets: {
password: 'guest'
Expand All @@ -168,11 +168,11 @@ resource sqlIdentityDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatep
resourceProvisioning: 'manual'
server: sqlIdentityContainer.name
database: 'IdentityDb'
port: sqlIdentityContainer.port
port: sqlIdentityContainer.properties.container.ports.sql.port
username: adminUsername
secrets: {
password: adminPassword
connectionString: 'Server=tcp:${sqlIdentityContainer.name},${sqlIdentityContainer.port};Initial Catalog=IdentityDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
connectionString: 'Server=tcp:${sqlIdentityContainer.name},${sqlIdentityContainer.properties.container.ports.sql.port};Initial Catalog=IdentityDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
}
}
}
Expand All @@ -185,11 +185,11 @@ resource sqlCatalogDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepr
resourceProvisioning: 'manual'
server: sqlCatalogContainer.name
database: 'CatalogDb'
port: sqlCatalogContainer.port
port: sqlCatalogContainer.properties.container.ports.sql.port
username: adminUsername
secrets: {
password: adminPassword
connectionString: 'Server=tcp:${sqlCatalogContainer.name},${sqlCatalogContainer.port};Initial Catalog=CatalogDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
connectionString: 'Server=tcp:${sqlCatalogContainer.name},${sqlCatalogContainer.properties.container.ports.sql.port};Initial Catalog=CatalogDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
}
}
}
Expand All @@ -202,11 +202,11 @@ resource sqlOrderingDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatep
resourceProvisioning: 'manual'
server: sqlOrderingContainer.name
database: 'OrderingDb'
port: sqlOrderingContainer.port
port: sqlOrderingContainer.properties.container.ports.sql.port
username: adminUsername
secrets: {
password: adminPassword
connectionString: 'Server=tcp:${sqlOrderingContainer.name},${sqlOrderingContainer.port};Initial Catalog=OrderingDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
connectionString: 'Server=tcp:${sqlOrderingContainer.name},${sqlOrderingContainer.properties.container.ports.sql.port};Initial Catalog=OrderingDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
}
}
}
Expand All @@ -219,11 +219,11 @@ resource sqlWebhooksDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatep
resourceProvisioning: 'manual'
server: sqlWebhooksContainer.name
database: 'WebhooksDb'
port: sqlWebhooksContainer.port
port: sqlWebhooksContainer.properties.container.ports.sql.port
username: adminUsername
secrets: {
password: adminPassword
connectionString: 'Server=tcp:${sqlWebhooksContainer.name},${sqlWebhooksContainer.port};Initial Catalog=WebhooksDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
connectionString: 'Server=tcp:${sqlWebhooksContainer.name},${sqlWebhooksContainer.properties.container.ports.sql.port};Initial Catalog=WebhooksDb;User Id=${adminUsername};Password=${adminPassword};Encrypt=false'
}
}
}
Expand All @@ -235,9 +235,9 @@ resource redisBasket 'Applications.Datastores/redisCaches@2022-03-15-privateprev
environment: environment
resourceProvisioning: 'manual'
host: redisBasketContainer.name
port: redisBasketContainer.port
port: redisBasketContainer.properties.container.ports.redis.port
secrets: {
connectionString: '${redisBasketContainer.name}:${redisBasketContainer.port},abortConnect=False'
connectionString: '${redisBasketContainer.name}:${redisBasketContainer.properties.container.ports.redis.port},abortConnect=False'
}
}
}
Expand All @@ -249,9 +249,9 @@ resource redisKeystore 'Applications.Datastores/redisCaches@2022-03-15-privatepr
environment: environment
resourceProvisioning: 'manual'
host: redisKeystoreContainer.name
port:redisKeystoreContainer.port
port:redisKeystoreContainer.properties.container.ports.redis.port
secrets: {
connectionString: '${redisKeystoreContainer.name}:${redisKeystoreContainer.port},abortConnect=False'
connectionString: '${redisKeystoreContainer.name}:${redisKeystoreContainer.properties.container.ports.redis.port},abortConnect=False'
}
}
}
Expand Down
67 changes: 13 additions & 54 deletions reference-apps/eshop/iac/services/identity.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ param TAG string
@description('Name of the Gateway')
param gatewayName string

@description('Name of the Basket Container')
param basketHttpName string

@description('Name of the Ordering Container')
param orderingHttpName string

@description('Name of the WebShoppingAgg Container')
param webshoppingaggHttpName string

@description('Name of the Webhooks Container')
param webhooksHttpName string

@description('Name of the WebhooksClient Container')
param webhooksclientHttpName string

@description('Name of the WebMVC Container')
param webmvcHttpName string

@description('Name of the Identity SQL Database portable resource')
param sqlIdentityDbName string

Expand All @@ -65,13 +47,13 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = {
XamarinCallback: ''
EnableDevspaces: ENABLEDEVSPACES
ConnectionString: sqlIdentityDb.connectionString()
MvcClient: '${gateway.properties.url}/${webmvcHttp.name}'
MvcClient: '${gateway.properties.url}/webmvc'
SpaClient: gateway.properties.url
BasketApiClient: '${gateway.properties.url}/${basketHttp.name}'
OrderingApiClient: '${gateway.properties.url}/${orderingHttp.name}'
WebShoppingAggClient: '${gateway.properties.url}/${webshoppingaggHttp.name}'
WebhooksApiClient: '${gateway.properties.url}/${webhooksHttp.name}'
WebhooksWebClient: '${gateway.properties.url}/${webhooksclientHttp.name}'
BasketApiClient: '${gateway.properties.url}/basket-api'
OrderingApiClient: '${gateway.properties.url}/ordering-api'
WebShoppingAggClient: '${gateway.properties.url}/webshoppingagg'
WebhooksApiClient: '${gateway.properties.url}/webhooks-api'
WebhooksWebClient: '${gateway.properties.url}/webhooks-client'
}
ports: {
http: {
Expand All @@ -90,27 +72,27 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = {
disableDefaultEnvVars: true
}
webmvc: {
source: webmvcHttp.id
source: 'http://webmvc:5100'
disableDefaultEnvVars: true
}
basket: {
source: basketHttp.id
source: 'http://basket-api:5103'
disableDefaultEnvVars: true
}
ordering: {
source: orderingHttp.id
source: 'http://ordering-api:5102'
disableDefaultEnvVars: true
}
webshoppingagg: {
source: webshoppingaggHttp.id
source: 'http://webshoppingagg:5121'
disableDefaultEnvVars: true
}
webhooks: {
source: webhooksHttp.id
source: 'http://webhooks-api:5113'
disableDefaultEnvVars: true
}
webhoolsclient: {
source: webhooksclientHttp.id
webhooksclient: {
source: 'http://webhooks-client:5114'
disableDefaultEnvVars: true
}
}
Expand All @@ -123,29 +105,6 @@ resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing
name: gatewayName
}

resource basketHttp 'Applications.Core/containers@2022-03-15-privatepreview' existing = {
name: basketHttpName
}

resource orderingHttp 'Applications.Core/containers@2022-03-15-privatepreview' existing = {
name: orderingHttpName
}

resource webshoppingaggHttp 'Applications.Core/containers@2022-03-15-privatepreview' existing = {
name: webshoppingaggHttpName
}

resource webhooksHttp 'Applications.Core/containers@2022-03-15-privatepreview' existing = {
name: webhooksHttpName
}

resource webhooksclientHttp 'Applications.Core/containers@2022-03-15-privatepreview' existing = {
name: webhooksclientHttpName
}

resource webmvcHttp 'Applications.Core/containers@2022-03-15-privatepreview' existing = {
name: webmvcHttpName
}

// PORTABLE RESOURCES -----------------------------------------------------------

Expand Down
Loading

0 comments on commit a9566da

Please sign in to comment.