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

Allow custom resource names via parameters for Microsoft Azure provider #211

Open
jamesbjackson opened this issue Apr 3, 2017 · 0 comments

Comments

@jamesbjackson
Copy link

jamesbjackson commented Apr 3, 2017

The reason for this request is that Microsoft has some best practise for Azure resource naming convention which can be seen here https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions - So we trying to best follow this approach to naming our resources.

The issue is we can't over-ride the name currently as SparkleFormation always uses the generated name of the resource while if we use native JSON then it possible.

An example of what I am trying to archive is below. Any help to gain this functionality would be greatly appreciated, I been looking through the ruby code but not sure where best to add this functionality so could submit a PR.

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "vnetName": {
      "type": "string",
      "metadata": {
        "description": "Unique name of the virtual network"
      }
    },
    "vnetAddressPrefix": {
      "type": "string",
      "metadata": {
        "description": "Address blocks reserved for this virtual network in CDIR notation"
      }
    }
  },
  "variables": {
    "apiVersion": "2015-06-15"
  },
  "resources": [
    {
      "apiVersion": "[variables('apiVersion')]",
      "type": "Microsoft.Network/virtualNetworks",
      "name": "[parameters('vnetName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "addressSpace": {
          "addressPrefixes": [
            "[parameters('vnetAddressPrefix')]"
          ]  
        }
      }
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant