-
Notifications
You must be signed in to change notification settings - Fork 14
Add Azure recipe for the Radius.Data/mySqlDatabases resource type #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrewmatveychuk
wants to merge
42
commits into
radius-project:main
Choose a base branch
from
andrewmatveychuk:feature/mysql-azure-recipe
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+144
−36
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
b7a5ed9
Added recipe for MySQL database
andrewmatveychuk ab860ba
Removed platform-specific properties for better abstraction
andrewmatveychuk 05e5dcb
Removed resource-specific properties from the documentation
andrewmatveychuk 6f8127f
Added sample Radius application using the mySqlDatabases type
andrewmatveychuk 4ae7a70
Moved the sample to proper location
andrewmatveychuk e82725d
Routes Resource Type definition (#42)
zachcasper 3a6e7ce
Add documentation for workflow testing (#44)
sk593 02a732e
Removed the sample Radius application for the mySqlDatabases type
andrewmatveychuk 6fb6817
Updated the API version to the resource contribution month
andrewmatveychuk f37275c
Renamed the user parameter to username
andrewmatveychuk acd666e
Synced parameter descriptions
andrewmatveychuk aae2da3
Removed the root_password property and moved from the container tag t…
andrewmatveychuk ab8251d
Updated type description with sample application
andrewmatveychuk d9a038c
Updated the recipe file name to lowercase
andrewmatveychuk 725f339
Updated the file name to lowercase
andrewmatveychuk d4278c4
Updated the port property description
andrewmatveychuk f000827
Converted the password property to a variable instead of optional par…
andrewmatveychuk fe4342c
Update Data/mySqlDatabases/README.md
andrewmatveychuk a3dd353
Update Data/mySqlDatabases/README.md
andrewmatveychuk 1cf69ee
Update Data/mySqlDatabases/README.md
andrewmatveychuk ced60b8
Updated the recipe with explicit evaluation for optional Bicep parame…
andrewmatveychuk ce9a7c8
Removed WordPress-specific information from the type description for …
andrewmatveychuk 2fb0ce9
Revert "Routes Resource Type definition (#42)"
andrewmatveychuk a757464
Revert "Add documentation for workflow testing (#44)"
andrewmatveychuk b3dae08
Updated parameter validation to use Bicep safe access operator
andrewmatveychuk 86a05cb
Updated type description
andrewmatveychuk 1bde24b
Merge branch 'radius-project:main' into main
andrewmatveychuk 5aa47cf
Merge branch 'radius-project:main' into main
andrewmatveychuk fb020ed
Merge remote-tracking branch 'upstream'
andrewmatveychuk 098a6b9
Added MySQL recipe for Azure Database for MySQL Flexible Server
andrewmatveychuk 9a4e8b3
Added the new optional tags property to the MySQL recipe for Kubernetes
andrewmatveychuk 942cd93
Fixed the tag property definition in the 'Radius.Data/mySqlDatabases'…
andrewmatveychuk 9428816
Fixed tag handling in recipes
andrewmatveychuk 30cc774
Removed special character from MySQL default username and added valid…
andrewmatveychuk 7611c33
Merged the new type version into existing one and added info about p…
andrewmatveychuk 5528e86
Converted the auto-generated password variable to a parameter to over…
andrewmatveychuk 615ec04
Removed double-referencing in the output object
andrewmatveychuk 80e745e
Converted database to nested resource
andrewmatveychuk 479a4c0
Updated resource API version
andrewmatveychuk 87fe77a
Added second factor to make resource name more unique
andrewmatveychuk 93f2ec9
Corrected formatting
andrewmatveychuk 4c7c283
Converted type description to Markdown
andrewmatveychuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
85 changes: 85 additions & 0 deletions
85
Data/mySqlDatabases/recipes/azure-database-for-mysql/bicep/azure-database-for-mysql.bicep
This file contains hidden or 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,85 @@ | ||
| @description('Information about what resource is calling this Recipe. Generated by Radius. For more information visit https://docs.radapp.io/reference/context-schema/ ') | ||
| param context object | ||
|
|
||
| @description('Name of the MySQL database. Defaults to the application name.') | ||
| param database string = context.resource.properties.?database ?? '${context.application.name}' | ||
|
|
||
| @maxLength(32) | ||
| @description('MySQL username. Defaults to <application-name>_user') | ||
| param username string = context.resource.properties.?username ?? '${context.application.name}_user' | ||
|
|
||
| @description('The major MySQL server version in the X.Y format. Defaults to the version 8.4 if not provided.') | ||
| @allowed([ | ||
| '5.7' | ||
| '8.0' | ||
| '8.4' | ||
| ]) | ||
| param version string = context.resource.properties.?version ?? '8.4' | ||
|
|
||
| @description('The user-defined tags that will be applied to the resource. Default is null.') | ||
| param tags object = context.resource.properties.?tags ?? {} | ||
|
|
||
| @description('The Radius specific tags that will be applied to the resource') | ||
| var radiusTags = { | ||
| 'radapp.io-environment': context.environment.id | ||
| 'radapp.io-application': context.application == null ? '' : context.application.id | ||
| 'radapp.io-resource': context.resource.id | ||
| } | ||
|
|
||
| @description('Location to deploy the resources') | ||
| var location string = resourceGroup().location | ||
|
|
||
| @description('Unique name for the MySQL deployment and service.') | ||
| var uniqueName = 'mysql-${uniqueString(context.resource.id, resourceGroup().id)}' | ||
|
|
||
| @description('The port the MySQL server listens on.') | ||
| var port = 3306 | ||
|
|
||
| @description('MySQL server root password.') | ||
| @secure() | ||
| param root_password string = uniqueString(context.resource.id, newGuid()) | ||
|
|
||
| resource mysqlServer 'Microsoft.DBforMySQL/flexibleServers@2024-12-30' = { | ||
| name: uniqueName | ||
| location: location | ||
| tags: union(tags, radiusTags) | ||
| sku: { | ||
| name: 'Standard_B1ms' | ||
| tier: 'Burstable' | ||
| } | ||
| properties: { | ||
| createMode: 'Default' | ||
| version: (version == '8.0') ? '8.0.21' : version | ||
| administratorLogin: username | ||
| administratorLoginPassword: root_password | ||
| databasePort: port | ||
| storage: { | ||
| storageSizeGB: 32 | ||
| } | ||
| network: { | ||
| publicNetworkAccess: 'Enabled' | ||
| } | ||
| } | ||
|
|
||
| resource mysqlDatabase 'databases' = { | ||
| name: database | ||
| properties: { | ||
| charset: 'utf8' | ||
| collation: 'utf8_general_ci' | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| output result object = { | ||
| values: { | ||
| host: mysqlServer.properties.fullyQualifiedDomainName | ||
| port: port | ||
| database: database | ||
| username: username | ||
| } | ||
| secrets: { | ||
| #disable-next-line outputs-should-not-contain-secrets | ||
| password: root_password | ||
| } | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.