This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separating infra and application deployments
- Loading branch information
Showing
6 changed files
with
113 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
targetScope = 'subscription' | ||
|
||
param environment string | ||
|
||
resource resourceGroup 'Microsoft.Resources/resourceGroups@2024-07-01' = { | ||
name: 'rg-strapi-playground-${environment}' | ||
location: deployment().location | ||
} | ||
|
||
module cmsIdentity '../modules/identity.bicep' = { | ||
scope: resourceGroup | ||
name: 'deployCmsIdentity' | ||
params: { | ||
identityName: 'id-cms' | ||
} | ||
} | ||
|
||
module keyVault '../modules/keyVault.bicep' = { | ||
scope: resourceGroup | ||
name: 'deployCmsKeyVault' | ||
params: { | ||
keyVaultName: 'kv-cms' | ||
cmsIdentityPrincipalId: cmsIdentity.outputs.principalId | ||
} | ||
} | ||
|
||
module containerRegistry '../modules/registry.bicep' = { | ||
scope: resourceGroup | ||
name: 'deployContainerRegistry' | ||
} | ||
|
||
module logAnalyticsWorkspace '../modules/logAnalytics.bicep' = { | ||
scope: resourceGroup | ||
name: 'deployLogAnalytics' | ||
} | ||
|
||
module mysql '../modules/sql.bicep' = { | ||
scope: resourceGroup | ||
name: 'deployMysql' | ||
params: { | ||
cmsIdentityPrincipalId: cmsIdentity.outputs.principalId | ||
cmsIdentityResourceId: cmsIdentity.outputs.resourceId | ||
cmsIdentityTenantId: cmsIdentity.outputs.tenantId | ||
cmsIdentityName: cmsIdentity.outputs.resourceName | ||
} | ||
} | ||
|
||
output resourceGroupName string = resourceGroup.name | ||
output resourceLocation string = resourceGroup.location | ||
output containerRegistryName string = containerRegistry.outputs.registryName | ||
output logAnalyticsWorkspaceName string = logAnalyticsWorkspace.outputs.resourceName | ||
output keyVaultName string = keyVault.outputs.resourceName | ||
output identityResourceId string = cmsIdentity.outputs.resourceId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { appendHash } from '../utilities.bicep' | ||
|
||
param databaseClient string | ||
param logAnalyticsWorkspaceName string | ||
param keyVaultName string | ||
param identityResourceId string | ||
|
||
module cmsContainerApp '../modules/containerApp.bicep' = { | ||
name: 'deployCmsContainer' | ||
params: { | ||
containerAppEnvironmentName: 'cae-cms' | ||
containerAppName: 'ca-cms' | ||
imageName: 'nginx:latest' | ||
logAnalyicsWorkspaceName: logAnalyticsWorkspaceName | ||
keyVaultName: keyVaultName | ||
targetPort: 1337 | ||
cmsIdentityResourceId: identityResourceId | ||
environmentVariables: [ | ||
{ | ||
name: 'DATABASE_CLIENT' | ||
value: databaseClient | ||
} | ||
] | ||
secrets: [ | ||
'APP_KEYS' | ||
'API_TOKEN_SALT' | ||
'ADMIN_JWT_SECRET' | ||
'TRANSFER_TOKEN_SALT' | ||
'JWT_SECRET' | ||
'DATABASE_USERNAME' | ||
'DATABASE_PASSWORD' | ||
] | ||
} | ||
} | ||
|
||
output containerAppEnvironmentName string = cmsContainerApp.outputs.containerAppEnvironmentName | ||
output containerAppName string = cmsContainerApp.outputs.containerAppName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters