Skip to content
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

Add recipes required for eshop #24

Merged
merged 9 commits into from
Aug 10, 2023
Prev Previous commit
Updating specs
  • Loading branch information
willdavsmith committed Aug 8, 2023
commit 61a394346062840f7a42558336c29ea28c510b64
18 changes: 15 additions & 3 deletions aws/rediscaches.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ param eksClusterName string
@description('List of subnetIds for the subnet group')
param subnetIds array = []

// MemoryDB Cluster configuration
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-memorydb-cluster.html

@description('Node type for the MemoryDB cluster')
param nodeType string = 'db.t4g.small'

@description('ACL name for the MemoryDB cluster')
param aclName string = 'open-access'

@description('Number of replicas per shard for the MemoryDB cluster')
param numReplicasPerShard int = 0

resource eksCluster 'AWS.EKS/Cluster@default' existing = {
alias: eksClusterName
properties: {
Expand All @@ -46,11 +58,11 @@ resource memoryDBCluster 'AWS.MemoryDB/Cluster@default' = {
alias: memoryDBClusterName
properties: {
ClusterName: memoryDBClusterName
NodeType: 'db.t4g.small'
ACLName: 'open-access'
NodeType: nodeType
ACLName: aclName
SecurityGroupIds: [eksCluster.properties.ClusterSecurityGroupId]
SubnetGroupName: subnetGroup.name
NumReplicasPerShard: 0
NumReplicasPerShard: numReplicasPerShard
}
}

Expand Down
38 changes: 27 additions & 11 deletions aws/sqldatabases.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ param adminPassword string
@description('Name of the SQL database. Defaults to the name of the Radius SQL resource.')
param database string = context.resource.name

// RDS DBInstance configuration
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbinstance.html

@description('Database engine type')
param engine string = 'sqlserver-ex'

@description('Database engine version')
param engineVersion string = '15.00.4153.1.v1'

@description('Database instance class')
param dbInstanceClass string = 'db.t3.small'

@description('Database storage size in GB')
param allocatedStorage string = '20'

@description('Database license model')
param licenseModel string = 'license-included'

@description('Database port')
param port string = '1433'

resource eksCluster 'AWS.EKS/Cluster@default' existing = {
alias: eksClusterName
properties: {
Expand All @@ -54,27 +75,22 @@ resource rdsDBInstance 'AWS.RDS/DBInstance@default' = {
alias: rdsDBInstanceName
properties: {
DBInstanceIdentifier: rdsDBInstanceName
Engine: 'sqlserver-ex'
EngineVersion: '15.00.4153.1.v1'
DBInstanceClass: 'db.t3.small'
AllocatedStorage: '20'
MaxAllocatedStorage: 30
Engine: engine
EngineVersion: engineVersion
DBInstanceClass: dbInstanceClass
AllocatedStorage: allocatedStorage
MasterUsername: adminLogin
MasterUserPassword: adminPassword
DBSubnetGroupName: rdsDBSubnetGroup.properties.DBSubnetGroupName
VPCSecurityGroups: [eksCluster.properties.ClusterSecurityGroupId]
PreferredMaintenanceWindow: 'Mon:00:00-Mon:03:00'
PreferredBackupWindow: '03:00-06:00'
LicenseModel: 'license-included'
Timezone: 'GMT Standard Time'
CharacterSetName: 'Latin1_General_CI_AS'
LicenseModel: licenseModel
}
}

output result object = {
values: {
server: rdsDBInstance.properties.Endpoint.Address
port: 1433
port: port
database: database
username: adminLogin
}
Expand Down
30 changes: 26 additions & 4 deletions azure/servicebus.bicep → azure/extender-servicebus.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,40 @@ param topicName string
@description('The list of subscriptions to create')
param subscriptions array = []

// Service Bus configuration
// https://learn.microsoft.com/en-us/azure/templates/microsoft.servicebus/namespaces?pivots=deployment-language-bicep

@description('The SKU of the Service Bus Namespace. Valid values: (Basic, Standard, Premium)')
@allowed([
'Basic'
'Standard'
'Premium'
])
param skuName string = 'Standard'

@description('The tier of the Service Bus Namespace. Valid values: (Basic, Standard, Premium)')
@allowed([
'Basic'
'Standard'
'Premium'
])
param skuTier string = 'Standard'

@description('ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.')
param defaultMessageTimeToLive string = 'P14D'

resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = {
name: 'servicebus-namespace-${uniqueString(context.resource.id, resourceGroup().id)}'
location: location
sku: {
name: 'Standard'
tier: 'Standard'
name: skuName
tier: skuTier
}

resource topic 'topics' = {
name: topicName
properties: {
defaultMessageTimeToLive: 'P14D'
defaultMessageTimeToLive: defaultMessageTimeToLive
maxSizeInMegabytes: 1024
requiresDuplicateDetection: false
enableBatchedOperations: true
Expand All @@ -61,7 +83,7 @@ resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = {
name: subscriptionName
properties: {
requiresSession: false
defaultMessageTimeToLive: 'P14D'
defaultMessageTimeToLive: defaultMessageTimeToLive
deadLetteringOnMessageExpiration: true
deadLetteringOnFilterEvaluationExceptions: true
maxDeliveryCount: 10
Expand Down