/*
  Target scope can be set using the following values:
    - resourceGroup (default)
    - subscription
    - managementGroup
    - tenant
*/
targetScope = 'subscription' // To create a resource group

@description('The Azure region to create the resources in.')
param location string

var suffix = uniqueString(subscription().subscriptionId, 'my-project')

var someTags = [
  {
    key: 'location'
    value: location
  }
  {
    key: 'isTest'
    value: true
  }
]

// Create a resource group
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
  name: 'rg-${suffix}'
  location: location

  tags: toObject(someTags, tag => tag.key, tag => tag.?value)
}
